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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
623cc4a88cf805a2be9181a128ec45d41da45e39 | 746 | py | Python | camera/camera-test.py | Mejdi-Thabet/streo-measurment-vision | 8fa55dbcb40c24c0d80bc062fc88f5abca3afdd1 | [
"MIT"
] | null | null | null | camera/camera-test.py | Mejdi-Thabet/streo-measurment-vision | 8fa55dbcb40c24c0d80bc062fc88f5abca3afdd1 | [
"MIT"
] | null | null | null | camera/camera-test.py | Mejdi-Thabet/streo-measurment-vision | 8fa55dbcb40c24c0d80bc062fc88f5abca3afdd1 | [
"MIT"
] | null | null | null | import cv2 # import OpenCv lib
cap = cv2.VideoCapture(0) # create cap object
# set the format into MJPG in the FourCC format
# cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc('M','J','P','G'))
cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc('J','P','E','G'))
if not cap.isOp... | 39.263158 | 82 | 0.563003 | import cv2 # import OpenCv lib
cap = cv2.VideoCapture(0) # create cap object
# set the format into MJPG in the FourCC format
# cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc('M','J','P','G'))
cap.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc('J','P','E','G'))
if not cap.isOp... | 0 | 0 | 0 |
8daaf49581c6c124d1d1ca6059bbf42aec8dc61e | 760 | py | Python | final_project/machinetranslation/tests/tests.py | singhashwini12/xzceb-flask_eng_fr | ac5cac807078b4adfec65c4ff20287afe5658f81 | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/tests/tests.py | singhashwini12/xzceb-flask_eng_fr | ac5cac807078b4adfec65c4ff20287afe5658f81 | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/tests/tests.py | singhashwini12/xzceb-flask_eng_fr | ac5cac807078b4adfec65c4ff20287afe5658f81 | [
"Apache-2.0"
] | null | null | null | """
Module for unit tests for translations
"""
import unittest
from translator import french_to_english, english_to_french
class TranslationTest(unittest.TestCase):
"""This Class contains the unit tests for translations"""
def test_french_to_english(self):
"""This method tests the French to English ... | 29.230769 | 81 | 0.711842 | """
Module for unit tests for translations
"""
import unittest
from translator import french_to_english, english_to_french
class TranslationTest(unittest.TestCase):
"""This Class contains the unit tests for translations"""
def test_french_to_english(self):
"""This method tests the French to English ... | 0 | 0 | 0 |
acf3bb14a90d358bd06a4aeaf84395cbe98bf174 | 47 | py | Python | Parte1/Cap4/numbers.py | fabianoflorentino/python-CursoIntensivoDePython | 822288cc4b382936dde1bc647e3f8c2b925ced70 | [
"Apache-2.0"
] | null | null | null | Parte1/Cap4/numbers.py | fabianoflorentino/python-CursoIntensivoDePython | 822288cc4b382936dde1bc647e3f8c2b925ced70 | [
"Apache-2.0"
] | null | null | null | Parte1/Cap4/numbers.py | fabianoflorentino/python-CursoIntensivoDePython | 822288cc4b382936dde1bc647e3f8c2b925ced70 | [
"Apache-2.0"
] | 1 | 2020-02-05T13:07:08.000Z | 2020-02-05T13:07:08.000Z | for value in range(1,11):
print(str(value)) | 23.5 | 25 | 0.659574 | for value in range(1,11):
print(str(value)) | 0 | 0 | 0 |
76f27aff2a93ba3677a16d1134cdc05204043038 | 852 | py | Python | day21/part02.py | Berteun/adventofcode2019 | 39fdd90073491cd698b1a310c789b577b305d314 | [
"MIT"
] | null | null | null | day21/part02.py | Berteun/adventofcode2019 | 39fdd90073491cd698b1a310c789b577b305d314 | [
"MIT"
] | null | null | null | day21/part02.py | Berteun/adventofcode2019 | 39fdd90073491cd698b1a310c789b577b305d314 | [
"MIT"
] | null | null | null | import operator
import sys
sys.path.append("..")
from collections import defaultdict, namedtuple
from intcode import IntCodeMachine, open_file
# The logic is as follows.
# If we would fall into a gap otherwise, we jump (NOT A T // OR T J)
# We jump early, that is a gap at B or C if we have an out, that is we can move ... | 20.285714 | 105 | 0.664319 | import operator
import sys
sys.path.append("..")
from collections import defaultdict, namedtuple
from intcode import IntCodeMachine, open_file
# The logic is as follows.
# If we would fall into a gap otherwise, we jump (NOT A T // OR T J)
# We jump early, that is a gap at B or C if we have an out, that is we can move ... | 263 | 0 | 69 |
63a6a1b1ae7ec796ed219f0066ef0827b8930884 | 281 | py | Python | lambda/models/candidate.py | SujeethJinesh/presidential-sentiment-translator | 262724930f49714724f6bd0a8c833872fafccd09 | [
"MIT"
] | null | null | null | lambda/models/candidate.py | SujeethJinesh/presidential-sentiment-translator | 262724930f49714724f6bd0a8c833872fafccd09 | [
"MIT"
] | 4 | 2021-03-10T08:37:55.000Z | 2022-02-27T00:02:34.000Z | lambda/models/candidate.py | SujeethJinesh/presidential-sentiment-translator | 262724930f49714724f6bd0a8c833872fafccd09 | [
"MIT"
] | null | null | null | from .party_affiliation import PartyAffiliation
| 31.222222 | 92 | 0.75089 | from .party_affiliation import PartyAffiliation
class Candidate:
def __init__(self, name: str, twitter_handle: str, party_affiliation: PartyAffiliation):
self.name = name
self.twitter_handle = twitter_handle
self.party_affiliation = party_affiliation
| 188 | -5 | 49 |
197b93869990d0f3d97546f1dea1622b5635a527 | 448 | py | Python | Python Exercises/Mundo1/exercicio35.py | joaopblume/Curso-em-video-exercicios | d554c0c07c8d65b3a219d76fc487a78c11eaf874 | [
"MIT"
] | null | null | null | Python Exercises/Mundo1/exercicio35.py | joaopblume/Curso-em-video-exercicios | d554c0c07c8d65b3a219d76fc487a78c11eaf874 | [
"MIT"
] | null | null | null | Python Exercises/Mundo1/exercicio35.py | joaopblume/Curso-em-video-exercicios | d554c0c07c8d65b3a219d76fc487a78c11eaf874 | [
"MIT"
] | null | null | null | # Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem
# ou não formar um triângulo.
r1 = int(input('Valor do primeiro segmento: '))
r2 = int(input('Valor do segundo segmento: '))
r3 = int(input('Valor do terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
... | 37.333333 | 93 | 0.700893 | # Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem
# ou não formar um triângulo.
r1 = int(input('Valor do primeiro segmento: '))
r2 = int(input('Valor do segundo segmento: '))
r3 = int(input('Valor do terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
... | 0 | 0 | 0 |
61a4af5829698981e3b9c360f342edf02730b98a | 415 | py | Python | helper.py | devnoaman/GIZ-pass-python | 49bcf3af21053a934959ca89f360a12b2c967820 | [
"MIT"
] | null | null | null | helper.py | devnoaman/GIZ-pass-python | 49bcf3af21053a934959ca89f360a12b2c967820 | [
"MIT"
] | null | null | null | helper.py | devnoaman/GIZ-pass-python | 49bcf3af21053a934959ca89f360a12b2c967820 | [
"MIT"
] | 1 | 2021-09-28T19:44:24.000Z | 2021-09-28T19:44:24.000Z |
name='Noaman Monther Mahmood'
job='Full-Stack Mobile Developer'
header= 'This Job is Done By'
desc='And it is one of the requirements to be accepted in th Full-Stack Development Bootcamp \nthat is implemented by Computiq and and GIZ Interview' | 41.5 | 149 | 0.643373 |
def printConsoleFotter():
print("\n\n\n-------------------------------------")
print('Give this job a 🚀\n\n')
print(header+'\n'+name+'\n'+job+'\n'+desc+'\n')
name='Noaman Monther Mahmood'
job='Full-Stack Mobile Developer'
header= 'This Job is Done By'
desc='And it is one of the requirements to be accepte... | 151 | 0 | 23 |
8c42367d2e5da1623ac19d6395db113c71f802ca | 2,166 | py | Python | tortuga_kits/ganglia_3_7_2/kit.py | UnivaCorporation/tortuga-kit-ganglia | af8f6b76c7548687177be27f2aec32c7a96b9325 | [
"Apache-2.0"
] | 3 | 2018-03-03T15:44:50.000Z | 2019-03-14T17:42:21.000Z | tortuga_kits/ganglia_3_7_2/kit.py | UnivaCorporation/tortuga-kit-ganglia | af8f6b76c7548687177be27f2aec32c7a96b9325 | [
"Apache-2.0"
] | null | null | null | tortuga_kits/ganglia_3_7_2/kit.py | UnivaCorporation/tortuga-kit-ganglia | af8f6b76c7548687177be27f2aec32c7a96b9325 | [
"Apache-2.0"
] | 3 | 2018-03-03T14:24:59.000Z | 2018-12-12T17:57:03.000Z | #!/usr/bin/env python
# Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.380952 | 74 | 0.66205 | #!/usr/bin/env python
# Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1,240 | 125 | 23 |
3733083b91aea75ae2b9c0f4c328355efaeea6f4 | 5,569 | py | Python | JupyterNotebooks/DataLoading/preprocessing/images/convert_birdify_to_tfrecord.py | afarkasattila/Birdify2 | 3dcc373762a901f27cb9d5060785b75ff17b58a7 | [
"MIT"
] | null | null | null | JupyterNotebooks/DataLoading/preprocessing/images/convert_birdify_to_tfrecord.py | afarkasattila/Birdify2 | 3dcc373762a901f27cb9d5060785b75ff17b58a7 | [
"MIT"
] | null | null | null | JupyterNotebooks/DataLoading/preprocessing/images/convert_birdify_to_tfrecord.py | afarkasattila/Birdify2 | 3dcc373762a901f27cb9d5060785b75ff17b58a7 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .dataset_utils import image_to_tfexample
from json import dump
from numpy import arange, empty, array, empty_like
from numpy.random import shuffle
from os import walk
from PIL import Image
from six.moves im... | 38.406897 | 123 | 0.661519 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .dataset_utils import image_to_tfexample
from json import dump
from numpy import arange, empty, array, empty_like
from numpy.random import shuffle
from os import walk
from PIL import Image
from six.moves im... | 4,054 | 0 | 115 |
9c7100ba70e063698a89485b827c82e2a9d0ab07 | 1,710 | py | Python | notas_de_clase/img/metodos/esquema_newton.py | AppliedMechanics-EAFIT/Mod_Temporal | 6a0506d906ed42b143b773777e8dc0da5af763eb | [
"MIT"
] | 5 | 2019-02-20T18:14:01.000Z | 2020-07-19T22:44:44.000Z | notas_de_clase/img/metodos/esquema_newton.py | AppliedMechanics-EAFIT/Mod_Temporal | 6a0506d906ed42b143b773777e8dc0da5af763eb | [
"MIT"
] | 3 | 2020-04-15T00:22:58.000Z | 2020-07-04T17:03:54.000Z | notas_de_clase/img/metodos/esquema_newton.py | AppliedMechanics-EAFIT/Mod_Temporal | 6a0506d906ed42b143b773777e8dc0da5af763eb | [
"MIT"
] | 3 | 2020-05-14T18:17:09.000Z | 2020-10-27T06:37:05.000Z | # -*- coding: utf-8 -*-
"""
Ilustra el método de Newton-Raphson
@author: Nicolas Guarin-Zapata
"""
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["mathtext.fontset"] = "cm"
plt.rcParams["axes.spines.top"] = False
plt.rcParams["axes.spines.ri... | 30 | 79 | 0.605848 | # -*- coding: utf-8 -*-
"""
Ilustra el método de Newton-Raphson
@author: Nicolas Guarin-Zapata
"""
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["mathtext.fontset"] = "cm"
plt.rcParams["axes.spines.top"] = False
plt.rcParams["axes.spines.ri... | 0 | 0 | 0 |
d65c64f8dfacbef7a7b78ee233ba2f34a6a4c059 | 2,192 | py | Python | test/core/tests/card_extension_test.py | jinnovation/metaflow | 540f21133b08108f7129ce42b1c6a24fd9175b2f | [
"Apache-2.0"
] | null | null | null | test/core/tests/card_extension_test.py | jinnovation/metaflow | 540f21133b08108f7129ce42b1c6a24fd9175b2f | [
"Apache-2.0"
] | null | null | null | test/core/tests/card_extension_test.py | jinnovation/metaflow | 540f21133b08108f7129ce42b1c6a24fd9175b2f | [
"Apache-2.0"
] | null | null | null | from metaflow_test import MetaflowTest, ExpectationFailed, steps, tag
class CardExtensionsImportTest(MetaflowTest):
"""
- Requires on tests/extensions/packages to be installed.
"""
PRIORITY = 5
@tag('card(type="card_ext_init_b",save_errors=False)')
@tag('card(type="card_ext_init_a",save_erro... | 37.152542 | 74 | 0.522354 | from metaflow_test import MetaflowTest, ExpectationFailed, steps, tag
class CardExtensionsImportTest(MetaflowTest):
"""
- Requires on tests/extensions/packages to be installed.
"""
PRIORITY = 5
@tag('card(type="card_ext_init_b",save_errors=False)')
@tag('card(type="card_ext_init_a",save_erro... | 1,617 | 0 | 79 |
adf5e0106200486694e07b437ba6cce25229450b | 580 | py | Python | DisguiseGenerator/yapfLib/main.py | oscarkarnalim/csd | cd62ce5e8a2d86ce5a5f73838738d90b68c98439 | [
"Apache-2.0"
] | 2 | 2020-11-19T22:31:57.000Z | 2020-11-20T02:30:14.000Z | STRANGETool/yapfLib/main.py | ShivaShirsath/strange | 8ea04100c79c77654c37394dea349dd60aac92d9 | [
"Apache-2.0"
] | 2 | 2022-01-01T19:50:55.000Z | 2022-01-04T10:51:36.000Z | STRANGETool/yapfLib/main.py | ShivaShirsath/strange | 8ea04100c79c77654c37394dea349dd60aac92d9 | [
"Apache-2.0"
] | 2 | 2021-10-19T12:27:48.000Z | 2022-01-04T09:20:19.000Z | from yapf.yapflib.yapf_api import FormatFile
import sys
# using yapf library taken from https://github.com/google/yapf/
# version v0.28.0
# take the source path
sourcePath = sys.argv[1]
# take the first argument as the filepath
# then update the targeted code with their format corrected.
# this function returns an arr... | 38.666667 | 84 | 0.782759 | from yapf.yapflib.yapf_api import FormatFile
import sys
# using yapf library taken from https://github.com/google/yapf/
# version v0.28.0
# take the source path
sourcePath = sys.argv[1]
# take the first argument as the filepath
# then update the targeted code with their format corrected.
# this function returns an arr... | 0 | 0 | 0 |
0a3e1af84ab44a2a22acee03efc442791eaa6c38 | 9,044 | py | Python | src/opendr/perception/activity_recognition/cox3d/algorithm/pooling.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 217 | 2020-04-10T16:39:36.000Z | 2022-03-30T15:39:04.000Z | src/opendr/perception/activity_recognition/cox3d/algorithm/pooling.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 79 | 2021-06-23T10:40:10.000Z | 2021-12-16T07:59:42.000Z | src/opendr/perception/activity_recognition/cox3d/algorithm/pooling.py | makistsantekidis/opendr | 07dee3b59d3487b9c5a93d6946317178a02c9890 | [
"Apache-2.0"
] | 29 | 2021-12-16T09:26:13.000Z | 2022-03-29T15:19:18.000Z | """
Copyright (c) Lukas Hedegaard. All Rights Reserved.
Included in the OpenDR Toolit with permission from the author.
"""
from typing import Tuple, Union
import torch
from torch import Tensor
from torch.nn.modules.pooling import (
AdaptiveAvgPool1d,
AdaptiveAvgPool2d,
AdaptiveAvgPool3d,
AdaptiveMaxPo... | 32.532374 | 109 | 0.613777 | """
Copyright (c) Lukas Hedegaard. All Rights Reserved.
Included in the OpenDR Toolit with permission from the author.
"""
from typing import Tuple, Union
import torch
from torch import Tensor
from torch.nn.modules.pooling import (
AdaptiveAvgPool1d,
AdaptiveAvgPool2d,
AdaptiveAvgPool3d,
AdaptiveMaxPo... | 5,854 | 1,135 | 119 |
23ceb4be40ab14b96763eb535badca57463b0253 | 8,099 | py | Python | summarise_results.py | MDBAuth/EWR_tool | 5b05cf276822d97a38a32a5fc031209224a04fb3 | [
"CC0-1.0"
] | 5 | 2021-03-17T00:33:53.000Z | 2022-03-07T18:16:25.000Z | summarise_results.py | MDBAuth/EWR_tool | 5b05cf276822d97a38a32a5fc031209224a04fb3 | [
"CC0-1.0"
] | null | null | null | summarise_results.py | MDBAuth/EWR_tool | 5b05cf276822d97a38a32a5fc031209224a04fb3 | [
"CC0-1.0"
] | 2 | 2022-01-14T03:50:10.000Z | 2022-02-14T00:45:56.000Z | import pandas as pd
import numpy as np
import data_inputs, evaluate_EWRs
#--------------------------------------------------------------------------------------------------
def sum_events(events):
'''returns a sum of events'''
return int(round(events.sum(), 0))
def get_frequency(events):
'''Returns the f... | 47.087209 | 118 | 0.548463 | import pandas as pd
import numpy as np
import data_inputs, evaluate_EWRs
#--------------------------------------------------------------------------------------------------
def sum_events(events):
'''returns a sum of events'''
return int(round(events.sum(), 0))
def get_frequency(events):
'''Returns the f... | 570 | 0 | 46 |
f247545caa576995f4dbbcab2062f6ee8bbeab4d | 849 | py | Python | ex070.py | felipesch92/PythonExercicios | 73edcbde6beaabcfc86af3dd6e58473f1eecabd3 | [
"MIT"
] | null | null | null | ex070.py | felipesch92/PythonExercicios | 73edcbde6beaabcfc86af3dd6e58473f1eecabd3 | [
"MIT"
] | null | null | null | ex070.py | felipesch92/PythonExercicios | 73edcbde6beaabcfc86af3dd6e58473f1eecabd3 | [
"MIT"
] | null | null | null | # Crie um programa que leia o nome e o preço de vários produtos.
# O programa deverá perguntar se o usuário vai continuar ou não. No final, mostre:
# A) qual é o total gasto na compra.
# B) quantos produtos custam mais de R$1000.
# C) qual é o nome do produto mais barato.
n = ''
p = 0
t = 0
c = 0
b_p = 0 # preço produ... | 29.275862 | 82 | 0.59364 | # Crie um programa que leia o nome e o preço de vários produtos.
# O programa deverá perguntar se o usuário vai continuar ou não. No final, mostre:
# A) qual é o total gasto na compra.
# B) quantos produtos custam mais de R$1000.
# C) qual é o nome do produto mais barato.
n = ''
p = 0
t = 0
c = 0
b_p = 0 # preço produ... | 0 | 0 | 0 |
302b08f7c01bb97345c6e836aa5a2613fe0bec05 | 1,123 | py | Python | libs/sdc_etl_libs/database_helpers/DatabaseFactory.py | darknegma/docker-airflow | 44e3d02d7ac43c8876145ae47acfbbbde67230df | [
"Apache-2.0"
] | null | null | null | libs/sdc_etl_libs/database_helpers/DatabaseFactory.py | darknegma/docker-airflow | 44e3d02d7ac43c8876145ae47acfbbbde67230df | [
"Apache-2.0"
] | 3 | 2021-03-31T19:26:57.000Z | 2021-12-13T20:33:01.000Z | libs/sdc_etl_libs/database_helpers/DatabaseFactory.py | darknegma/docker-airflow | 44e3d02d7ac43c8876145ae47acfbbbde67230df | [
"Apache-2.0"
] | null | null | null |
import os
import sys
import logging
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from sdc_etl_libs.database_helpers.SnowflakeDatabase import SnowflakeDatabase
from sdc_etl_libs.database_helpers.NexusDatabase import NexusDatabase
from sdc_etl_libs.database_helpers.MySqlDatabase import MySqlDatabase
from... | 35.09375 | 81 | 0.722173 |
import os
import sys
import logging
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from sdc_etl_libs.database_helpers.SnowflakeDatabase import SnowflakeDatabase
from sdc_etl_libs.database_helpers.NexusDatabase import NexusDatabase
from sdc_etl_libs.database_helpers.MySqlDatabase import MySqlDatabase
from... | 476 | 54 | 23 |
9d2fd0de485396dcbbf68d054d38cd532366fff7 | 686 | py | Python | flow/delete_orphaned_datasets/code.py | dataiku/dss-code-samples | fceebfaf1c3fa0fefa5df4c5862b5befa386040f | [
"Apache-2.0"
] | 12 | 2018-05-21T18:05:55.000Z | 2021-10-29T23:40:28.000Z | flow/delete_orphaned_datasets/code.py | dataiku/dss-code-samples | fceebfaf1c3fa0fefa5df4c5862b5befa386040f | [
"Apache-2.0"
] | 12 | 2019-02-12T17:46:15.000Z | 2021-08-17T09:22:33.000Z | flow/delete_orphaned_datasets/code.py | dataiku/dss-code-samples | fceebfaf1c3fa0fefa5df4c5862b5befa386040f | [
"Apache-2.0"
] | 8 | 2018-09-06T17:40:18.000Z | 2022-02-28T02:28:34.000Z | import dataiku
def delete_orphaned_datasets(client=None, project_key=None, drop_data=False, dry_run=True):
"""Delete datasets that are not linked to any recipe.
"""
prj = client.get_project(project_key)
flow = prj.get_flow()
graph = flow.get_graph()
cpt = 0
for name, props in graph.nodes.it... | 34.3 | 91 | 0.593294 | import dataiku
def delete_orphaned_datasets(client=None, project_key=None, drop_data=False, dry_run=True):
"""Delete datasets that are not linked to any recipe.
"""
prj = client.get_project(project_key)
flow = prj.get_flow()
graph = flow.get_graph()
cpt = 0
for name, props in graph.nodes.it... | 0 | 0 | 0 |
02c495ae19bd0973705888f46d3438af6a3fbc59 | 598 | py | Python | macOS/ss_rss_decode.py | enihsyou/dotfiles | 7805f496405fe1b5795a11cc9c3b7ebfc21f5302 | [
"MIT"
] | null | null | null | macOS/ss_rss_decode.py | enihsyou/dotfiles | 7805f496405fe1b5795a11cc9c3b7ebfc21f5302 | [
"MIT"
] | null | null | null | macOS/ss_rss_decode.py | enihsyou/dotfiles | 7805f496405fe1b5795a11cc9c3b7ebfc21f5302 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from urllib.request import urlopen
from urllib.parse import unquote
import base64
import re
n3ro_rss_link = input("N3RO SIP002 URIs: ").strip()
data = urlopen(n3ro_rss_link).read()
links = base64.b64decode(data).decode()
for link in links.splitlines():
matcher = re.match(r"ss://(.+)@(.+)#(.... | 29.9 | 63 | 0.635452 | #!/usr/bin/env python3
from urllib.request import urlopen
from urllib.parse import unquote
import base64
import re
n3ro_rss_link = input("N3RO SIP002 URIs: ").strip()
data = urlopen(n3ro_rss_link).read()
links = base64.b64decode(data).decode()
for link in links.splitlines():
matcher = re.match(r"ss://(.+)@(.+)#(.... | 0 | 0 | 0 |
be5dba132045cad3c5008ecb5d5399651de45f89 | 5,482 | py | Python | Fib_It.py | TheScott463/NN_tools | 56fe08261827d6e28b4322ea464f4250bbfaac27 | [
"MIT"
] | null | null | null | Fib_It.py | TheScott463/NN_tools | 56fe08261827d6e28b4322ea464f4250bbfaac27 | [
"MIT"
] | null | null | null | Fib_It.py | TheScott463/NN_tools | 56fe08261827d6e28b4322ea464f4250bbfaac27 | [
"MIT"
] | null | null | null | import math
from itertools import islice
from time import ctime
print(ctime())
print(""
"fibonacci algorithms.py")
print("Iterative positive and negative")
print(ctime())
print(ctime())
print("expected Output:")
print(
"-832040 514229 -317811 196418 -121393 75025 -46368 28657 -17711 "
"10946 -6765... | 21.667984 | 114 | 0.579898 | import math
from itertools import islice
from time import ctime
print(ctime())
print(""
"fibonacci algorithms.py")
print("Iterative positive and negative")
print(ctime())
def fib(n, x=None):
if x is None:
x = [0, 1]
for i in range(abs(n) - 1):
x = [x[1], sum(x)]
return x[1] * ma... | 2,050 | 0 | 299 |
3c75fc14c1dbc3a08513e1f8a3cda194ef98c85d | 4,498 | py | Python | src/model_training/trainer.py | dishamehra/merlin-on-gcp | 6050b31689ecb585e2298a27300aa9bf9433e7cd | [
"Apache-2.0"
] | 2 | 2021-07-08T16:02:50.000Z | 2022-03-29T08:30:18.000Z | src/model_training/trainer.py | dishamehra/merlin-on-gcp | 6050b31689ecb585e2298a27300aa9bf9433e7cd | [
"Apache-2.0"
] | 1 | 2021-08-03T16:36:42.000Z | 2021-08-03T19:58:02.000Z | src/model_training/trainer.py | dishamehra/merlin-on-gcp | 6050b31689ecb585e2298a27300aa9bf9433e7cd | [
"Apache-2.0"
] | 7 | 2021-07-08T21:46:27.000Z | 2021-08-03T16:02:53.000Z | # Copyright 2021 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, ... | 33.819549 | 92 | 0.724322 | # Copyright 2021 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, ... | 3,374 | 0 | 92 |
2ee25cc12a87f3fa2f796eb4786dd982677dce46 | 797 | py | Python | ctf/Google-ctf/image-to-string.py | Sylhare/Flag | 8f056593466c8611fae0f5ed0d39c711f694f41b | [
"MIT"
] | null | null | null | ctf/Google-ctf/image-to-string.py | Sylhare/Flag | 8f056593466c8611fae0f5ed0d39c711f694f41b | [
"MIT"
] | 4 | 2019-02-06T16:08:56.000Z | 2019-03-17T20:12:50.000Z | ctf/Google-ctf/image-to-string.py | Sylhare/Flag | 8f056593466c8611fae0f5ed0d39c711f694f41b | [
"MIT"
] | null | null | null | import pytesseract
from PIL import Image
img = Image.open("flag.png")
text = pytesseract.image_to_string(img)
print(rot_encode(7)(text))
if __name__ == '__main__':
pass
| 24.151515 | 70 | 0.648683 | import pytesseract
from PIL import Image
img = Image.open("flag.png")
text = pytesseract.image_to_string(img)
def rot(*symbols):
def _rot(n):
encoded = ''.join(sy[n:] + sy[:n] for sy in symbols)
lookup = str.maketrans(''.join(symbols), encoded)
return lambda s: s.translate(lookup)
re... | 548 | 0 | 69 |
3e46954c165d1812f769952525be44965339574a | 5,180 | py | Python | script/compile_content.py | GameTechDev/gametechdev-site | 05a99f542a8ff57700e3df1f16afb16a6837ad75 | [
"MIT"
] | 1 | 2021-12-28T10:57:22.000Z | 2021-12-28T10:57:22.000Z | script/compile_content.py | GameTechDev/gametechdev-site | 05a99f542a8ff57700e3df1f16afb16a6837ad75 | [
"MIT"
] | null | null | null | script/compile_content.py | GameTechDev/gametechdev-site | 05a99f542a8ff57700e3df1f16afb16a6837ad75 | [
"MIT"
] | null | null | null | import json
import requests
import sys
import yaml
from bs4 import BeautifulSoup
from os.path import exists
from os import mkdir, environ
if __name__ == '__main__':
reposUrl = ''
authToken = ''
if len(sys.argv) > 1:
reposUrl = sys.argv[1]
authToken = sys.argv[2]
else:
# an o... | 37.810219 | 119 | 0.528185 | import json
import requests
import sys
import yaml
from bs4 import BeautifulSoup
from os.path import exists
from os import mkdir, environ
def dump_json(output, data_to_save):
save = open(output, 'w')
json.dump(data_to_save, save)
save.close()
print('Saved json to', output)
def dump_yaml(output, data... | 260 | 0 | 46 |
01c7d781c8bc2ec107e76b32652f3677ea1f3046 | 2,927 | py | Python | enaml/wx/wx_application.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | 11 | 2015-03-14T14:30:51.000Z | 2022-03-15T13:01:44.000Z | enaml/wx/wx_application.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | 3 | 2015-01-31T11:12:56.000Z | 2022-03-14T00:53:25.000Z | enaml/wx/wx_application.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | 4 | 2015-01-27T01:56:14.000Z | 2021-02-23T07:21:20.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | 28.980198 | 79 | 0.546293 | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | 0 | 0 | 0 |
0b1a0b850c9213734b43e7e8487946f434190431 | 1,206 | py | Python | test/testings/platform.py | HansBug/hbutils | 6872311c8a441c5955572e0093b10189a2b90708 | [
"Apache-2.0"
] | null | null | null | test/testings/platform.py | HansBug/hbutils | 6872311c8a441c5955572e0093b10189a2b90708 | [
"Apache-2.0"
] | 25 | 2021-10-03T06:19:05.000Z | 2022-03-27T12:48:57.000Z | test/testings/platform.py | HansBug/hbutils | 6872311c8a441c5955572e0093b10189a2b90708 | [
"Apache-2.0"
] | null | null | null | import os
import platform
import pytest
_is_win = bool(os.environ.get('IS_WIN', None))
_is_macos = bool(os.environ.get('IS_MAC', None))
_is_linux = not _is_macos and not _is_win
windows_mark = pytest.mark.unittest if _is_win else pytest.mark.ignore
macos_mark = pytest.mark.unittest if _is_macos else pytest.mark.igno... | 37.6875 | 74 | 0.759536 | import os
import platform
import pytest
_is_win = bool(os.environ.get('IS_WIN', None))
_is_macos = bool(os.environ.get('IS_MAC', None))
_is_linux = not _is_macos and not _is_win
windows_mark = pytest.mark.unittest if _is_win else pytest.mark.ignore
macos_mark = pytest.mark.unittest if _is_macos else pytest.mark.igno... | 0 | 0 | 0 |
0a97a4190c7e21d95b9fda88952299aa6a1aae1f | 1,813 | py | Python | adventofcode2020/12.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | 2 | 2016-12-28T09:40:07.000Z | 2020-12-08T13:58:15.000Z | adventofcode2020/12.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | null | null | null | adventofcode2020/12.py | matslindh/codingchallenges | b6792808b03ea07304fda7e74c874c2c4d200dac | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
print(navigation_schmavigation([l.strip() for l in open('input/12')]))
print(navigation_schmavigation_2([l.strip() for l in open('input/12')]))
| 22.949367 | 88 | 0.447876 | def rotate(current, dir, num):
seq = ['E', 'S', 'W', 'N']
if dir == 'L':
seq.reverse()
num //= 90
return seq[(seq.index(current) + num) % len(seq)]
def navigation_schmavigation(instructions):
dir = 'E'
x, y = 0, 0
for instr in instructions:
inp = instr[0... | 1,515 | 0 | 114 |
d247cd9a1a8e1b6e437b537d633be0d901ef036e | 170 | py | Python | 15. Chapter_/tasks.py | Mikma03/Python_Bill_Lubanovic_BookCodes | 8b5b228bb500a08af645a1db6f7c5f33ef5f0512 | [
"MIT"
] | null | null | null | 15. Chapter_/tasks.py | Mikma03/Python_Bill_Lubanovic_BookCodes | 8b5b228bb500a08af645a1db6f7c5f33ef5f0512 | [
"MIT"
] | null | null | null | 15. Chapter_/tasks.py | Mikma03/Python_Bill_Lubanovic_BookCodes | 8b5b228bb500a08af645a1db6f7c5f33ef5f0512 | [
"MIT"
] | null | null | null | from invoke import task
@task
| 21.25 | 48 | 0.676471 | from invoke import task
@task
def mytime(ctx):
import time
now = time.time()
time_str = time.asctime(time.localtime(now))
print("Bieżący czas:", timestr)
| 120 | 0 | 22 |
510784fb3b0fea6c94638a9a31c35e3c758d9b66 | 3,638 | py | Python | align/cell_fabric/gen_magic.py | thesourcerer8/ALIGN-public | 2e061c719e15f5e4ffafde6b3bfdc1f5dbb45654 | [
"BSD-3-Clause"
] | 2 | 2020-12-15T11:16:23.000Z | 2021-05-10T08:08:34.000Z | align/cell_fabric/gen_magic.py | thesourcerer8/ALIGN-public | 2e061c719e15f5e4ffafde6b3bfdc1f5dbb45654 | [
"BSD-3-Clause"
] | 1 | 2020-08-26T08:01:53.000Z | 2020-08-29T04:24:00.000Z | align/cell_fabric/gen_magic.py | thesourcerer8/ALIGN-public | 2e061c719e15f5e4ffafde6b3bfdc1f5dbb45654 | [
"BSD-3-Clause"
] | 2 | 2020-08-15T07:09:52.000Z | 2020-08-16T10:19:58.000Z | #!/usr/bin/python
import re
import json
import datetime
from . import pdk
import logging
logger = logging.getLogger(__name__)
| 38.294737 | 170 | 0.575316 | #!/usr/bin/python
import re
import json
import datetime
from . import pdk
import logging
logger = logging.getLogger(__name__)
def translate_data( macro_name, exclude_pattern, pdkfile, pinSwitch, data, via_gen_tbl, timestamp=None):
j = pdk.Pdk().load(pdkfile)
with open(pdkfile, "rt") as fp1:
j1 = json.load(fp1)... | 3,466 | 0 | 46 |
b9c787700d0831ebd09156e925743799a1f8c4a0 | 1,256 | py | Python | src/posts/templatetags/posts_tags.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | null | null | null | src/posts/templatetags/posts_tags.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | null | null | null | src/posts/templatetags/posts_tags.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | 1 | 2021-04-12T12:12:23.000Z | 2021-04-12T12:12:23.000Z | """ File defining custom template tags for our project """
# Core Django imports
from django import template
from django.utils.safestring import mark_safe
# app-imports
from posts.models import Post
# third-party imports
import markdown
register = template.Library()
@register.simple_tag
def total_posts():
"""... | 28.545455 | 75 | 0.735669 | """ File defining custom template tags for our project """
# Core Django imports
from django import template
from django.utils.safestring import mark_safe
# app-imports
from posts.models import Post
# third-party imports
import markdown
register = template.Library()
@register.simple_tag
def total_posts():
"""... | 0 | 0 | 0 |
9c684ca6bfbf0f62dc9afeed12f0225ec579b3a7 | 13,179 | py | Python | tests/models/test_gpu.py | djbyrne/pytorch-lightning | dab3b965cb9ceacc3f44aa2240b495d5996c6011 | [
"Apache-2.0"
] | null | null | null | tests/models/test_gpu.py | djbyrne/pytorch-lightning | dab3b965cb9ceacc3f44aa2240b495d5996c6011 | [
"Apache-2.0"
] | null | null | null | tests/models/test_gpu.py | djbyrne/pytorch-lightning | dab3b965cb9ceacc3f44aa2240b495d5996c6011 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import torch
import tests.base.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.core import memory
from pytorch_lightning.trainer.distrib_parts import (
parse_gpu_ids,
determine_root_gpu_device,
)
from ... | 32.9475 | 100 | 0.684574 | import os
import pytest
import torch
import tests.base.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.core import memory
from pytorch_lightning.trainer.distrib_parts import (
parse_gpu_ids,
determine_root_gpu_device,
)
from ... | 3,635 | 0 | 357 |
e6eae9d4ee68ccc71c708a9780a57c29e6399525 | 99 | py | Python | goodocityAPI/apps.py | juansjimenez/goodocity-backend | 77b2ab3f11047e2896e81358b8d8c63d7952b521 | [
"MIT"
] | 1 | 2020-09-26T02:27:05.000Z | 2020-09-26T02:27:05.000Z | goodocityAPI/apps.py | juansjimenez/goodocity-backend | 77b2ab3f11047e2896e81358b8d8c63d7952b521 | [
"MIT"
] | null | null | null | goodocityAPI/apps.py | juansjimenez/goodocity-backend | 77b2ab3f11047e2896e81358b8d8c63d7952b521 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 16.5 | 36 | 0.777778 | from django.apps import AppConfig
class GoodocityapiConfig(AppConfig):
name = 'goodocityAPI'
| 0 | 41 | 23 |
b975ce79701ed12694c8ee7194a12a5b3297a9db | 6,908 | py | Python | src/sage/tests/french_book/integration_doctest.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/tests/french_book/integration_doctest.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/tests/french_book/integration_doctest.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | ## -*- encoding: utf-8 -*-
"""
This file (./integration_doctest.sage) was *autogenerated* from ./integration.tex,
with sagetex.sty version 2011/05/27 v2.3.1.
It contains the contents of all the sageexample environments from this file.
You should be able to doctest this file with:
sage -t ./integration_doctest.sage
It i... | 31.257919 | 82 | 0.640562 | ## -*- encoding: utf-8 -*-
"""
This file (./integration_doctest.sage) was *autogenerated* from ./integration.tex,
with sagetex.sty version 2011/05/27 v2.3.1.
It contains the contents of all the sageexample environments from this file.
You should be able to doctest this file with:
sage -t ./integration_doctest.sage
It i... | 0 | 0 | 0 |
625ef7eed497f262e56e5bba6003fd8511f923b6 | 2,568 | py | Python | apps/bookstore/migrations/0001_initial.py | goutomroy/django_select_prefetch_related | 489d7e058c6283b52c8b2690aaff0dfed93cfc07 | [
"Apache-2.0"
] | 17 | 2019-12-11T11:02:01.000Z | 2021-10-06T11:58:23.000Z | apps/bookstore/migrations/0001_initial.py | goutomroy/django_select_prefetch_related | 489d7e058c6283b52c8b2690aaff0dfed93cfc07 | [
"Apache-2.0"
] | 8 | 2019-12-04T23:09:42.000Z | 2021-06-10T17:45:57.000Z | apps/bookstore/migrations/0001_initial.py | goutomroy/django_select_prefetch_related | 489d7e058c6283b52c8b2690aaff0dfed93cfc07 | [
"Apache-2.0"
] | 7 | 2019-12-11T11:02:06.000Z | 2021-10-06T09:55:25.000Z | # Generated by Django 3.0.2 on 2020-07-21 00:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 40.125 | 148 | 0.593458 | # Generated by Django 3.0.2 on 2020-07-21 00:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 2,388 | 23 |
0f091f16a19a47d5d8e327b5b69ae8e7dc948189 | 114 | py | Python | multimeter/__init__.py | wowace/multimeter | 24eed9cd59819a27c110b10c637e14735b29710f | [
"MIT"
] | null | null | null | multimeter/__init__.py | wowace/multimeter | 24eed9cd59819a27c110b10c637e14735b29710f | [
"MIT"
] | 48 | 2018-03-02T14:57:01.000Z | 2020-02-13T10:08:12.000Z | multimeter/__init__.py | kafitimi/multimeter | 24eed9cd59819a27c110b10c637e14735b29710f | [
"MIT"
] | null | null | null | """ Заголовок пакета """
default_app_config = 'multimeter.apps.MultimeterConfig' # pylint: disable=invalid-name
| 28.5 | 87 | 0.763158 | """ Заголовок пакета """
default_app_config = 'multimeter.apps.MultimeterConfig' # pylint: disable=invalid-name
| 0 | 0 | 0 |
1fa3a09416c6649076d6bef859c6fa35a7ef1972 | 2,256 | py | Python | C3CTF/2019 36C3/bacon/brute.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | 1 | 2021-08-24T22:16:41.000Z | 2021-08-24T22:16:41.000Z | C3CTF/2019 36C3/bacon/brute.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | C3CTF/2019 36C3/bacon/brute.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import itertools
import sys
MASK = 0xffffff
# did I implement this correctly?
assert forward(*map(bytes.fromhex, ('1211100a0908020100',
'20796c6c6172'))) == b'\xc0\x49\xa5\x38\x5a\xdc'
if len(sys.argv) < 2:
print(f"Usage: python3 {sys.argv[0]} <hex>... | 26.541176 | 84 | 0.51906 | #!/usr/bin/env python3
import itertools
import sys
MASK = 0xffffff
def forward(key, blk):
assert tuple(map(len, (key, blk))) == (9, 6)
def S(j, v): return (v << j | (v & MASK) >> 24-j) & MASK
ws = blk[:3], blk[3:], key[:3], key[3:6], key[6:]
x, y, l1, l0, k0 = (int.from_bytes(w, 'big') for w in ws)
... | 1,231 | 0 | 69 |
ae68e1d05aa2cc50e49cb492dc00efe34def4ab5 | 879 | py | Python | day-7-finding-the-percentage.py | roshansinghbisht/hello-python | 595418a47e66217ed8759c91cdb535e8fa88412b | [
"MIT"
] | null | null | null | day-7-finding-the-percentage.py | roshansinghbisht/hello-python | 595418a47e66217ed8759c91cdb535e8fa88412b | [
"MIT"
] | null | null | null | day-7-finding-the-percentage.py | roshansinghbisht/hello-python | 595418a47e66217ed8759c91cdb535e8fa88412b | [
"MIT"
] | null | null | null | if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
average = sum(student_marks[query_name])/ len(student_marks[query_name])
print... | 41.857143 | 76 | 0.701934 | if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
average = sum(student_marks[query_name])/ len(student_marks[query_name])
print... | 0 | 0 | 0 |
30ed6383084d2cfbd8d6b41733e49f997dcaedcb | 96 | py | Python | venv/lib/python3.8/site-packages/past/types/basestring.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/past/types/basestring.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/past/types/basestring.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/aa/b2/26/72bdb8c2f74308cbc5f71d13cb1f12d650ade8623046fcee026be0fd38 | 96 | 96 | 0.895833 | /home/runner/.cache/pip/pool/aa/b2/26/72bdb8c2f74308cbc5f71d13cb1f12d650ade8623046fcee026be0fd38 | 0 | 0 | 0 |
8f4929cdba696e92236ff3ff30c4593997b2dc01 | 9,400 | py | Python | scripts/nasqm.py | PotentialParadox/pynasqm | 1bd51299b6ca7f8229d8a15428515d53a358903c | [
"MIT"
] | 1 | 2020-03-13T22:34:03.000Z | 2020-03-13T22:34:03.000Z | scripts/nasqm.py | PotentialParadox/pynasqm | 1bd51299b6ca7f8229d8a15428515d53a358903c | [
"MIT"
] | null | null | null | scripts/nasqm.py | PotentialParadox/pynasqm | 1bd51299b6ca7f8229d8a15428515d53a358903c | [
"MIT"
] | null | null | null | '''
Run NASQM
created by Dustin Tracy (dtracy.uf@gmail.com)
This program is used to automate NASQM job creations.
You'll find the parameters to change in the file nasqm_user_input.py
'''
import argparse
import time
from pynasqm.initialize import initialize
from pynasqm.inputceon import InputCeon
from pynasqm.write impo... | 38.683128 | 98 | 0.738191 | '''
Run NASQM
created by Dustin Tracy (dtracy.uf@gmail.com)
This program is used to automate NASQM job creations.
You'll find the parameters to change in the file nasqm_user_input.py
'''
import argparse
import time
from pynasqm.initialize import initialize
from pynasqm.inputceon import InputCeon
from pynasqm.write impo... | 2,373 | 0 | 299 |
4a8b715fe771ab67480fb9b37145118295310381 | 224 | py | Python | run_gunicorn.py | SlideAtlas/SlideAtlas-Server | 3b9cbd56eaa29ae08ae521e75616ea230fe26397 | [
"Apache-2.0"
] | 3 | 2015-10-10T10:17:26.000Z | 2020-12-14T09:42:19.000Z | run_gunicorn.py | SlideAtlas/SlideAtlas-Server | 3b9cbd56eaa29ae08ae521e75616ea230fe26397 | [
"Apache-2.0"
] | 41 | 2015-02-03T19:47:28.000Z | 2017-02-06T23:24:26.000Z | run_gunicorn.py | SlideAtlas/SlideAtlas-Server | 3b9cbd56eaa29ae08ae521e75616ea230fe26397 | [
"Apache-2.0"
] | 2 | 2016-04-04T18:23:27.000Z | 2017-11-14T22:34:58.000Z | # coding=utf-8
# Development server
from slideatlas import create_app
app = create_app()
# app.run(host='0.0.0.0', port=8080)
if __name__ == "__main__":
print "To run:\ngunicorn run_gunicorn:app -b localhost:8080 -w 4" | 24.888889 | 69 | 0.714286 | # coding=utf-8
# Development server
from slideatlas import create_app
app = create_app()
# app.run(host='0.0.0.0', port=8080)
if __name__ == "__main__":
print "To run:\ngunicorn run_gunicorn:app -b localhost:8080 -w 4" | 0 | 0 | 0 |
a8bf0c58483a2e21ccdf3815d73bbf19efd309c2 | 990 | py | Python | examples/608_plan_pick_trajectory.py | djprohasky/workshop_swinburne_2021 | 596eb12595ef7c2522dc8e03163e917ca43d2a0a | [
"MIT"
] | 4 | 2021-12-13T09:57:06.000Z | 2022-01-04T15:04:58.000Z | examples/608_plan_pick_trajectory.py | djprohasky/workshop_swinburne_2021 | 596eb12595ef7c2522dc8e03163e917ca43d2a0a | [
"MIT"
] | 3 | 2021-06-16T10:27:09.000Z | 2021-06-17T02:37:04.000Z | examples/608_plan_pick_trajectory.py | djprohasky/workshop_swinburne_2021 | 596eb12595ef7c2522dc8e03163e917ca43d2a0a | [
"MIT"
] | 3 | 2021-06-15T12:43:22.000Z | 2021-06-16T11:01:38.000Z | import os
import helpers
from compas_fab.backends import RosClient
from compas_fab.robots import PlanningScene
import compas
HERE = os.path.dirname(__file__)
MAX_STEP = 0.01
# Load assembly
filename = os.path.join(HERE, 'assembly.json')
assembly = compas.json_load(filename)
with RosClient() as client:
robot = ... | 28.285714 | 100 | 0.70202 | import os
import helpers
from compas_fab.backends import RosClient
from compas_fab.robots import PlanningScene
import compas
HERE = os.path.dirname(__file__)
MAX_STEP = 0.01
# Load assembly
filename = os.path.join(HERE, 'assembly.json')
assembly = compas.json_load(filename)
with RosClient() as client:
robot = ... | 0 | 0 | 0 |
48f81270935a674567f3e6de615f1bc99760148d | 2,009 | py | Python | src/doit/sanitizedtable/sqlalchemy/sqlmodel.py | khusmann/doit | 305c04bda1ccfc38c86b97e4360481af654827e7 | [
"MIT"
] | null | null | null | src/doit/sanitizedtable/sqlalchemy/sqlmodel.py | khusmann/doit | 305c04bda1ccfc38c86b97e4360481af654827e7 | [
"MIT"
] | null | null | null | src/doit/sanitizedtable/sqlalchemy/sqlmodel.py | khusmann/doit | 305c04bda1ccfc38c86b97e4360481af654827e7 | [
"MIT"
] | null | null | null | from __future__ import annotations
import typing as t
import enum
from sqlalchemy import (
Column,
Integer,
String,
ForeignKey,
MetaData,
Table,
JSON,
)
from sqlalchemy.orm import (
relationship,
RelationshipProperty,
)
from ...common.sqlalchemy import (
declarative_base,
R... | 25.75641 | 75 | 0.683922 | from __future__ import annotations
import typing as t
import enum
from sqlalchemy import (
Column,
Integer,
String,
ForeignKey,
MetaData,
Table,
JSON,
)
from sqlalchemy.orm import (
relationship,
RelationshipProperty,
)
from ...common.sqlalchemy import (
declarative_base,
R... | 546 | 941 | 115 |
0edbcf145b35a1d7ce69dc123941f51b9137fada | 13,087 | py | Python | src/test/tinc/tincrepo/mpp/lib/gpdbSegmentConfig.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tincrepo/mpp/lib/gpdbSegmentConfig.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tincrepo/mpp/lib/gpdbSegmentConfig.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | #!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this ... | 40.896875 | 358 | 0.593184 | #!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this ... | 0 | 0 | 0 |
e8e874d1ba46c6302dbad010c653ee72b994c3aa | 1,851 | py | Python | main_PyBank.py | akshitarora19/Python | b097585bc075a693e159490bf1061f4efe36bc3f | [
"ADSL"
] | null | null | null | main_PyBank.py | akshitarora19/Python | b097585bc075a693e159490bf1061f4efe36bc3f | [
"ADSL"
] | null | null | null | main_PyBank.py | akshitarora19/Python | b097585bc075a693e159490bf1061f4efe36bc3f | [
"ADSL"
] | null | null | null | import os
import csv
total_months=0
total=0
last_pl=0
average_change=0
change_in_pl=0
total_change=0
ginc_profits=0
gdec_profits=0
prev_change_in_pl=0
ginc_profits_month=""
gdec_profits_month=""
csvpath=os.path.join("..", "Resources", "budget_data.csv")
with open (csvpath, newline="") as csvfile:
csvreader=... | 30.85 | 92 | 0.647218 | import os
import csv
total_months=0
total=0
last_pl=0
average_change=0
change_in_pl=0
total_change=0
ginc_profits=0
gdec_profits=0
prev_change_in_pl=0
ginc_profits_month=""
gdec_profits_month=""
csvpath=os.path.join("..", "Resources", "budget_data.csv")
with open (csvpath, newline="") as csvfile:
csvreader=... | 0 | 0 | 0 |
3c0c1510131fc8b90f5bc9b912db6614a61a3882 | 3,250 | py | Python | network/basher.py | voelkerb/pythonNetwork | 4483fb5ec6071aabaa65d81c6aa5a05aee5641b7 | [
"CC0-1.0"
] | null | null | null | network/basher.py | voelkerb/pythonNetwork | 4483fb5ec6071aabaa65d81c6aa5a05aee5641b7 | [
"CC0-1.0"
] | null | null | null | network/basher.py | voelkerb/pythonNetwork | 4483fb5ec6071aabaa65d81c6aa5a05aee5641b7 | [
"CC0-1.0"
] | null | null | null | import sys
import threading
import os
import subprocess
import time
import signal
class Basher():
"""
Class to execute any command given as a subprocess in a new thread.
You can wait for execution to finish or execute in the background and check
the output frequently.
"""
# Init function
... | 35.326087 | 137 | 0.602769 | import sys
import threading
import os
import subprocess
import time
import signal
class Basher():
"""
Class to execute any command given as a subprocess in a new thread.
You can wait for execution to finish or execute in the background and check
the output frequently.
"""
# Init function
... | 0 | 0 | 0 |
124e9b1791f943c162075aa54d54f6b877b4680c | 15,562 | py | Python | applications/ATOM/utils/gather_atom_metrics.py | jonesholger/lbann | 3214f189a1438565d695542e076c4fa8e7332d34 | [
"Apache-2.0"
] | 194 | 2016-07-19T15:40:21.000Z | 2022-03-19T08:06:10.000Z | applications/ATOM/utils/gather_atom_metrics.py | jonesholger/lbann | 3214f189a1438565d695542e076c4fa8e7332d34 | [
"Apache-2.0"
] | 1,021 | 2016-07-19T12:56:31.000Z | 2022-03-29T00:41:47.000Z | applications/ATOM/utils/gather_atom_metrics.py | jonesholger/lbann | 3214f189a1438565d695542e076c4fa8e7332d34 | [
"Apache-2.0"
] | 74 | 2016-07-28T18:24:00.000Z | 2022-01-24T19:41:04.000Z | import sys
import numpy as np
import re
#tag = sys.argv[len(sys.argv)-1]
#for each log file
for num in range(len(sys.argv)-1):
inp = sys.argv[num+1]
print('################################################################################')
print("File#", num , " ", inp)
print('################################... | 48.479751 | 133 | 0.569528 | import sys
import numpy as np
import re
#tag = sys.argv[len(sys.argv)-1]
def summarize_metrics(trainer_metrics):
total_time = 0
total_train_time = 0
results = {}
partial_results = {}
total_train_times = []
total_train_times_not_first_epoch = []
# For each epoch, gather data from all trainers
for e, da... | 8,844 | 0 | 46 |
988a098972dbe06fa08dd88ea86938c07dd60dfc | 1,167 | py | Python | scripts/compare_stemmers.py | tklovett/MaudeMiner | ba73f5dd99331c233fede9ccab1a2b1d5b430324 | [
"MIT"
] | 3 | 2015-09-10T09:07:36.000Z | 2020-12-01T22:17:06.000Z | scripts/compare_stemmers.py | tklovett/MaudeMiner | ba73f5dd99331c233fede9ccab1a2b1d5b430324 | [
"MIT"
] | null | null | null | scripts/compare_stemmers.py | tklovett/MaudeMiner | ba73f5dd99331c233fede9ccab1a2b1d5b430324 | [
"MIT"
] | null | null | null | import nltk
lines = []
with open("foitext.txt", 'r') as f:
for line in f:
lines.append(strip_non_ascii(line))
narratives = [x[x.rfind('|')+1:].strip() for x in lines]
tokens_list = [nltk.wordpunct_tokenize(x) for x in narratives]
# pos_list = [nltk.pos_tag(x) for x in tokens_list]
tokens = []
for x in tokens_list... | 23.34 | 67 | 0.700943 | import nltk
def strip_non_ascii(s):
return "".join(i for i in s if ord(i) < 128)
lines = []
with open("foitext.txt", 'r') as f:
for line in f:
lines.append(strip_non_ascii(line))
narratives = [x[x.rfind('|')+1:].strip() for x in lines]
tokens_list = [nltk.wordpunct_tokenize(x) for x in narratives]
# pos_list = [... | 48 | 0 | 23 |
b48daa89ced5699a98cab00df5229ec5b86c586c | 6,083 | py | Python | neuralnetworks/classifiers/las_model.py | v0lta/tfkaldi | 4772e881cc168439723c19f69a2425588f661060 | [
"MIT"
] | 57 | 2017-01-19T15:58:46.000Z | 2021-01-12T17:57:31.000Z | neuralnetworks/classifiers/las_model.py | v0lta/tfkaldi | 4772e881cc168439723c19f69a2425588f661060 | [
"MIT"
] | null | null | null | neuralnetworks/classifiers/las_model.py | v0lta/tfkaldi | 4772e881cc168439723c19f69a2425588f661060 | [
"MIT"
] | 15 | 2017-02-25T17:44:35.000Z | 2019-09-23T14:03:18.000Z | '''
This module implements a listen attend and spell classifier.
'''
from __future__ import absolute_import, division, print_function
import tensorflow as tf
from neuralnetworks.classifiers.classifier import Classifier
from neuralnetworks.las_elements import Listener
from neuralnetworks.beam_search_speller import Beam... | 41.380952 | 88 | 0.595594 | '''
This module implements a listen attend and spell classifier.
'''
from __future__ import absolute_import, division, print_function
import tensorflow as tf
from neuralnetworks.classifiers.classifier import Classifier
from neuralnetworks.las_elements import Listener
from neuralnetworks.beam_search_speller import Beam... | 1,985 | 0 | 27 |
997f596b808ddac161e32183631001799a8088e5 | 1,127 | py | Python | basketball_reference_web_scraper/parsers/players_season_totals.py | sheagk/basketball_reference_web_scraper | 820ff9760f91bffc3efd770d91547f3213f42ec8 | [
"MIT"
] | null | null | null | basketball_reference_web_scraper/parsers/players_season_totals.py | sheagk/basketball_reference_web_scraper | 820ff9760f91bffc3efd770d91547f3213f42ec8 | [
"MIT"
] | null | null | null | basketball_reference_web_scraper/parsers/players_season_totals.py | sheagk/basketball_reference_web_scraper | 820ff9760f91bffc3efd770d91547f3213f42ec8 | [
"MIT"
] | null | null | null | from basketball_reference_web_scraper.data import TEAM_ABBREVIATIONS_TO_TEAM, POSITION_ABBREVIATIONS_TO_POSITION
from basketball_reference_web_scraper.parsers.common import COLUMN_RENAMER, COLUMN_PARSER, \
find_team_column, parse_souped_row_given_header_columns, split_header_columns, get_all_tables_with_soup
__tot... | 53.666667 | 150 | 0.795918 | from basketball_reference_web_scraper.data import TEAM_ABBREVIATIONS_TO_TEAM, POSITION_ABBREVIATIONS_TO_POSITION
from basketball_reference_web_scraper.parsers.common import COLUMN_RENAMER, COLUMN_PARSER, \
find_team_column, parse_souped_row_given_header_columns, split_header_columns, get_all_tables_with_soup
__tot... | 540 | 0 | 23 |
1351df6d8950944565fc29066b395b8fc367a49c | 13,279 | py | Python | implementation/h2o-benchmarker/metaopt.py | kordikp/AutoMLprediction | 6f87bd0b95ce78103c9f4f83ee85d831ab60a0a6 | [
"Apache-2.0"
] | 1 | 2018-03-22T12:45:32.000Z | 2018-03-22T12:45:32.000Z | implementation/h2o-benchmarker/metaopt.py | kordikp/AutoMLprediction | 6f87bd0b95ce78103c9f4f83ee85d831ab60a0a6 | [
"Apache-2.0"
] | null | null | null | implementation/h2o-benchmarker/metaopt.py | kordikp/AutoMLprediction | 6f87bd0b95ce78103c9f4f83ee85d831ab60a0a6 | [
"Apache-2.0"
] | null | null | null | import h2o
from Benchmarker.experiment import Experiment
import Benchmarker.config as config
import Benchmarker.utils as utils
import warnings
from optparse import OptionParser
from Benchmarker.utils import init_journal, close_journal
import numbers
import Benchmarker.metaopt.fakegame as fg
import Benchmarker.... | 36.084239 | 150 | 0.590858 | import h2o
from Benchmarker.experiment import Experiment
import Benchmarker.config as config
import Benchmarker.utils as utils
import warnings
from optparse import OptionParser
from Benchmarker.utils import init_journal, close_journal
import numbers
import Benchmarker.metaopt.fakegame as fg
import Benchmarker.... | 9,301 | 0 | 375 |
56d63ba86ae10523e85c0d58aef43b02420340ec | 6,669 | py | Python | partymode.py | aruether/partymode | c16599c4d7ad4c3fcc76cf0ce4e8f332feba4c02 | [
"MIT"
] | 1 | 2022-03-09T15:52:42.000Z | 2022-03-09T15:52:42.000Z | partymode.py | aruether/partymode | c16599c4d7ad4c3fcc76cf0ce4e8f332feba4c02 | [
"MIT"
] | null | null | null | partymode.py | aruether/partymode | c16599c4d7ad4c3fcc76cf0ce4e8f332feba4c02 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import RPi.GPIO as gpio
import os
import time
import subprocess
import sys
import signal
import threading
import datetime
# Volume controls
day_volume = 70
night_volume = 100
# Control box IO
key_channel = 22
button_channel = 7
armed_indicator_channel = 18
activated_indicator_channel = 29
# ... | 25.65 | 114 | 0.708202 | #!/usr/bin/env python
import RPi.GPIO as gpio
import os
import time
import subprocess
import sys
import signal
import threading
import datetime
# Volume controls
day_volume = 70
night_volume = 100
# Control box IO
key_channel = 22
button_channel = 7
armed_indicator_channel = 18
activated_indicator_channel = 29
# ... | 4,265 | 0 | 319 |
345b571a44ba28aa19a909ee3ef31505cd612587 | 457 | py | Python | alpacka/agents/callbacks/__init__.py | shoot-tree-search/sts | 2d9f19a40c7fb1c637dd3bd230942c01f14927e1 | [
"MIT"
] | 2 | 2021-01-03T04:21:56.000Z | 2021-02-12T12:54:58.000Z | alpacka/agents/callbacks/__init__.py | shoot-tree-search/sts | 2d9f19a40c7fb1c637dd3bd230942c01f14927e1 | [
"MIT"
] | null | null | null | alpacka/agents/callbacks/__init__.py | shoot-tree-search/sts | 2d9f19a40c7fb1c637dd3bd230942c01f14927e1 | [
"MIT"
] | null | null | null | """Callbacks."""
import gin
from alpacka.agents.callbacks import graph_size_callback
# Configure callbacks in this module to ensure they're accessible via the
# alpacka.agents.callbacks.* namespace.
GraphSizeCallback = configure_callback(graph_size_callback.GraphSizeCallback) # pylint: disable=invalid-name
| 26.882353 | 109 | 0.792123 | """Callbacks."""
import gin
from alpacka.agents.callbacks import graph_size_callback
# Configure callbacks in this module to ensure they're accessible via the
# alpacka.agents.callbacks.* namespace.
def configure_callback(callback_class):
return gin.external_configurable(
callback_class, module='alpacka... | 120 | 0 | 22 |
4265a2a6ddbbcec2469a3d81b4e651385adf2254 | 10,653 | py | Python | distributed/dist_fleet/dist_fleet_ctr.py | zjjlivein/continuous_integration | c8825f32136fdd425389702c37ded08d6fd28a26 | [
"Apache-2.0"
] | 14 | 2020-03-04T07:52:07.000Z | 2022-02-14T01:39:14.000Z | distributed/dist_fleet/dist_fleet_ctr.py | zjjlivein/continuous_integration | c8825f32136fdd425389702c37ded08d6fd28a26 | [
"Apache-2.0"
] | 19 | 2020-03-04T03:52:10.000Z | 2021-12-23T07:02:07.000Z | distributed/dist_fleet/dist_fleet_ctr.py | zjjlivein/continuous_integration | c8825f32136fdd425389702c37ded08d6fd28a26 | [
"Apache-2.0"
] | 26 | 2020-03-04T05:39:09.000Z | 2022-02-14T01:43:28.000Z | #!/bin/env python
# -*- coding: utf-8 -*-
# encoding=utf-8 vi:ts=4:sw=4:expandtab:ft=python
#======================================================================
#
# Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
#
#======================================================================
"""
@Desc: dist_base_fl... | 37.776596 | 101 | 0.552708 | #!/bin/env python
# -*- coding: utf-8 -*-
# encoding=utf-8 vi:ts=4:sw=4:expandtab:ft=python
#======================================================================
#
# Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
#
#======================================================================
"""
@Desc: dist_base_fl... | 584 | 24 | 143 |
47044f1000f098378c2891a015792409afffcd37 | 2,235 | py | Python | azure-iot-common/tests/test_sastoken.py | olivakar/azure-iot-sdk-python-preview | 636855716a362bad1623983026666b5f91c22825 | [
"MIT"
] | null | null | null | azure-iot-common/tests/test_sastoken.py | olivakar/azure-iot-sdk-python-preview | 636855716a362bad1623983026666b5f91c22825 | [
"MIT"
] | null | null | null | azure-iot-common/tests/test_sastoken.py | olivakar/azure-iot-sdk-python-preview | 636855716a362bad1623983026666b5f91c22825 | [
"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.
# --------------------------------------------... | 31.041667 | 94 | 0.561969 | # -*- 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.
# --------------------------------------------... | 1,517 | 26 | 233 |
a93a345092e0fef48e929c091a6827fefb7df8be | 2,891 | py | Python | scripts/graphicslib.py | nash169/graphics-lib | a71dd2e27ac64ccccd8f55f1dd87863404789959 | [
"MIT"
] | null | null | null | scripts/graphicslib.py | nash169/graphics-lib | a71dd2e27ac64ccccd8f55f1dd87863404789959 | [
"MIT"
] | null | null | null | scripts/graphicslib.py | nash169/graphics-lib | a71dd2e27ac64ccccd8f55f1dd87863404789959 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of graphics-lib.
#
# Copyright (c) 2020, 2021, 2022 Bernardo Fichera <bernardo.fichera@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwar... | 34.831325 | 89 | 0.682463 | #!/usr/bin/env python
# encoding: utf-8
#
# This file is part of graphics-lib.
#
# Copyright (c) 2020, 2021, 2022 Bernardo Fichera <bernardo.fichera@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softwar... | 1,467 | 0 | 68 |
52aab517e0bb1695d7a351f3c996f23cfccf95ac | 4,387 | py | Python | stonesoup/models/measurement/tests/test_combined.py | Red-Portal/Stone-Soup-1 | 267621c86161a839da9b144c2745d28d9166d903 | [
"MIT"
] | 157 | 2019-04-14T20:43:11.000Z | 2022-03-30T08:30:33.000Z | stonesoup/models/measurement/tests/test_combined.py | Red-Portal/Stone-Soup-1 | 267621c86161a839da9b144c2745d28d9166d903 | [
"MIT"
] | 364 | 2019-04-18T15:54:49.000Z | 2022-03-31T09:50:02.000Z | stonesoup/models/measurement/tests/test_combined.py | Red-Portal/Stone-Soup-1 | 267621c86161a839da9b144c2745d28d9166d903 | [
"MIT"
] | 86 | 2019-04-20T02:01:18.000Z | 2022-03-28T01:03:11.000Z | # coding: utf-8
import pytest
from pytest import approx
import numpy as np
from ....types.angle import Bearing
from ....types.array import StateVector, CovarianceMatrix
from ....types.detection import Detection
from ....types.state import State
from ..linear import LinearGaussian
from ..nonlinear import (
Combined... | 35.379032 | 90 | 0.63483 | # coding: utf-8
import pytest
from pytest import approx
import numpy as np
from ....types.angle import Bearing
from ....types.array import StateVector, CovarianceMatrix
from ....types.detection import Detection
from ....types.state import State
from ..linear import LinearGaussian
from ..nonlinear import (
Combined... | 3,734 | 0 | 229 |
3a91273c8d7483c5d7b396705caa5c2cf20b08b5 | 824 | py | Python | ms_flask_app/app.py | royxss/Project_Risk_Assessment_Deploy | 931dc91caca120aa86eddfaf0c8fba49867c64fc | [
"Apache-2.0"
] | null | null | null | ms_flask_app/app.py | royxss/Project_Risk_Assessment_Deploy | 931dc91caca120aa86eddfaf0c8fba49867c64fc | [
"Apache-2.0"
] | null | null | null | ms_flask_app/app.py | royxss/Project_Risk_Assessment_Deploy | 931dc91caca120aa86eddfaf0c8fba49867c64fc | [
"Apache-2.0"
] | null | null | null | from flask import Flask,render_template,url_for,request
import pandas as pd
import pickle
import traceback
import ast
import sklearn
import xgboost
pickledModel = pickle.load(open('../app/public/latePaymentsModel.pkl','rb'))
app = Flask(__name__)
@app.route('/')
@app.route('/process',methods=["POST"])
if __name__ =... | 26.580645 | 96 | 0.743932 | from flask import Flask,render_template,url_for,request
import pandas as pd
import pickle
import traceback
import ast
import sklearn
import xgboost
pickledModel = pickle.load(open('../app/public/latePaymentsModel.pkl','rb'))
app = Flask(__name__)
@app.route('/')
def index():
return render_template("index.html")
@app... | 425 | 0 | 44 |
7a641e5f90766451959de7a519933e97339c5c6a | 6,814 | py | Python | app.py | snarfed/ownyourresponses | 52e2db2d1b7cae9bb2f9e0d320411627ea195f81 | [
"CC0-1.0"
] | 33 | 2015-02-12T22:19:23.000Z | 2022-01-19T11:02:43.000Z | app.py | snarfed/ownyourresponses | 52e2db2d1b7cae9bb2f9e0d320411627ea195f81 | [
"CC0-1.0"
] | 1 | 2015-10-07T05:53:57.000Z | 2016-02-16T15:21:04.000Z | app.py | snarfed/ownyourresponses | 52e2db2d1b7cae9bb2f9e0d320411627ea195f81 | [
"CC0-1.0"
] | 1 | 2015-10-04T17:32:59.000Z | 2015-10-04T17:32:59.000Z | """OwnYourResponses: turns likes, replies, etc. into posts on your web site.
Polls your social network activity and creates new posts on your web site (via
Micropub) for public Facebook comments and likes, Instagram likes, and Twitter
@-replies, retweets, and favorites.
"""
import logging
import json
import urllib.err... | 34.588832 | 87 | 0.695627 | """OwnYourResponses: turns likes, replies, etc. into posts on your web site.
Polls your social network activity and creates new posts on your web site (via
Micropub) for public Facebook comments and likes, Instagram likes, and Twitter
@-replies, retweets, and favorites.
"""
import logging
import json
import urllib.err... | 1,030 | 0 | 46 |
dbc24dbe997b9424f4f5edfed6b8616411c81386 | 7,267 | py | Python | ImageNet/train.py | mbodenham/Pytorch-XNOR-Net | aad9b68a522026a4a7ebbdf1b9ea82230e2edf24 | [
"BSD-3-Clause"
] | null | null | null | ImageNet/train.py | mbodenham/Pytorch-XNOR-Net | aad9b68a522026a4a7ebbdf1b9ea82230e2edf24 | [
"BSD-3-Clause"
] | null | null | null | ImageNet/train.py | mbodenham/Pytorch-XNOR-Net | aad9b68a522026a4a7ebbdf1b9ea82230e2edf24 | [
"BSD-3-Clause"
] | null | null | null | ## ssh -L 16006:127.0.0.1:16006 mb2775@ogg.cs.bath.ac.uk
import torch
from models import XNOR_VGG
import torchvision
from torchvision import transforms
import argparse
import binop
import torch.utils.tensorboard as tensorboard
import os
from datetime import datetime
import time
def accuracy(output, target, topk=(1,))... | 36.335 | 122 | 0.638916 | ## ssh -L 16006:127.0.0.1:16006 mb2775@ogg.cs.bath.ac.uk
import torch
from models import XNOR_VGG
import torchvision
from torchvision import transforms
import argparse
import binop
import torch.utils.tensorboard as tensorboard
import os
from datetime import datetime
import time
def accuracy(output, target, topk=(1,))... | 1,836 | 0 | 103 |
441f712583f6078e0ab5cdb4e58a31c9252a5c74 | 12,506 | py | Python | matsubara/heom.py | pyquantum/matsubara | c8f540a54fe3eadd2ceb8158b69d650f9cc93133 | [
"MIT"
] | 3 | 2020-04-02T09:28:44.000Z | 2021-01-28T12:19:29.000Z | matsubara/heom.py | Ydeh22/matsubara | c8f540a54fe3eadd2ceb8158b69d650f9cc93133 | [
"MIT"
] | 2 | 2019-07-04T10:09:14.000Z | 2019-07-12T15:04:02.000Z | matsubara/heom.py | Ydeh22/matsubara | c8f540a54fe3eadd2ceb8158b69d650f9cc93133 | [
"MIT"
] | 3 | 2019-04-02T07:59:54.000Z | 2022-03-23T23:49:27.000Z | """
This module provides a solver for the spin-boson model at zero temperature
using the hierarchy equations of motion (HEOM) method.
"""
# Authors: Shahnawaz Ahmed, Neill Lambert
# Contact: shahnawaz.ahmed95@gmail.com
import numpy as np
from copy import copy
from qutip import Qobj, qeye
from qutip.states import en... | 29.705463 | 88 | 0.574124 | """
This module provides a solver for the spin-boson model at zero temperature
using the hierarchy equations of motion (HEOM) method.
"""
# Authors: Shahnawaz Ahmed, Neill Lambert
# Contact: shahnawaz.ahmed95@gmail.com
import numpy as np
from copy import copy
from qutip import Qobj, qeye
from qutip.states import en... | 1,768 | 0 | 54 |
23d4b9e441abbd42ced42cd4096380d4ab596e69 | 3,225 | py | Python | tools/pycozmo_replay.py | gimait/pycozmo | 601d9c09903b9300e8990723cae95974212afb09 | [
"MIT"
] | 123 | 2019-08-25T21:28:23.000Z | 2022-03-12T13:54:59.000Z | tools/pycozmo_replay.py | solosito/pycozmo | 5d28118eb8f7a625ae4a66054dabf19b4fe27483 | [
"MIT"
] | 41 | 2019-08-25T21:21:37.000Z | 2022-02-09T14:20:54.000Z | tools/pycozmo_replay.py | solosito/pycozmo | 5d28118eb8f7a625ae4a66054dabf19b4fe27483 | [
"MIT"
] | 51 | 2019-09-04T13:30:02.000Z | 2022-01-09T01:20:24.000Z | #!/usr/bin/env python
from typing import Optional
import sys
import time
import dpkt
import pycozmo
if __name__ == '__main__':
main()
| 32.908163 | 100 | 0.537364 | #!/usr/bin/env python
from typing import Optional
import sys
import time
import dpkt
import pycozmo
class ReplayApp(object):
def __init__(self, log_messages: Optional[list] = None, replay_messages: Optional[list] = None):
self.log_messages = log_messages
self.frame_count = 0
self.pkts ... | 2,950 | 3 | 127 |
4724c3f8a6a2a060f1395a3f8e0e389b1091ba8a | 7,944 | py | Python | opfython/core/opf.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 26 | 2018-04-24T20:16:18.000Z | 2022-03-09T14:03:28.000Z | opfython/core/opf.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 4 | 2020-12-26T14:57:18.000Z | 2022-03-30T02:34:18.000Z | opfython/core/opf.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 16 | 2019-05-20T15:41:56.000Z | 2022-03-23T17:59:53.000Z | """Optimum-Path Forest standard definitions.
"""
import pickle
import numpy as np
import opfython.math.distance as d
import opfython.stream.loader as loader
import opfython.utils.exception as e
import opfython.utils.logging as l
from opfython.core import Subgraph
logger = l.get_logger(__name__)
class OPF:
"""... | 32.292683 | 124 | 0.601586 | """Optimum-Path Forest standard definitions.
"""
import pickle
import numpy as np
import opfython.math.distance as d
import opfython.stream.loader as loader
import opfython.utils.exception as e
import opfython.utils.logging as l
from opfython.core import Subgraph
logger = l.get_logger(__name__)
class OPF:
"""... | 2,822 | 0 | 130 |
8f421a457cb054f46d0d551c64aeebdaf5a52b6e | 2,093 | py | Python | record_shortcuts.py | elyssac02/grass-gis-on-hpc-henry2 | 68262c3687f967760b1c8cee0fff1a29e45a7698 | [
"CC0-1.0"
] | 1 | 2021-09-30T14:50:00.000Z | 2021-09-30T14:50:00.000Z | record_shortcuts.py | elyssac02/grass-gis-on-hpc-henry2 | 68262c3687f967760b1c8cee0fff1a29e45a7698 | [
"CC0-1.0"
] | 54 | 2020-05-12T01:58:04.000Z | 2022-03-11T15:39:49.000Z | record_shortcuts.py | elyssac02/grass-gis-on-hpc-henry2 | 68262c3687f967760b1c8cee0fff1a29e45a7698 | [
"CC0-1.0"
] | 3 | 2020-07-14T20:43:13.000Z | 2021-09-23T14:45:05.000Z | #!/usr/bin/env python
"""Record default module version and symlinks as shortcuts"""
import os
import re
import sys
from datetime import datetime
from pathlib import Path
def read_and_record_shortcuts(path, filename):
"""Read content of the directory, check validity, record to YAML file"""
path = Path(path)
... | 32.703125 | 88 | 0.580029 | #!/usr/bin/env python
"""Record default module version and symlinks as shortcuts"""
import os
import re
import sys
from datetime import datetime
from pathlib import Path
def read_and_record_shortcuts(path, filename):
"""Read content of the directory, check validity, record to YAML file"""
path = Path(path)
... | 0 | 0 | 0 |
2973f68aa295f821c1ca6e62f4b29b4927cb92eb | 1,926 | py | Python | country_named_entity_recognition/tests/test_georgia_country_vs_state.py | fastdatascience/countryfinder | 174bd34a658c8f01563494e51c1d285c3095f1ff | [
"MIT"
] | null | null | null | country_named_entity_recognition/tests/test_georgia_country_vs_state.py | fastdatascience/countryfinder | 174bd34a658c8f01563494e51c1d285c3095f1ff | [
"MIT"
] | null | null | null | country_named_entity_recognition/tests/test_georgia_country_vs_state.py | fastdatascience/countryfinder | 174bd34a658c8f01563494e51c1d285c3095f1ff | [
"MIT"
] | null | null | null | import unittest
from countryfinder.country_finder import find_countries
| 44.790698 | 159 | 0.695223 | import unittest
from countryfinder.country_finder import find_countries
class TestSynonymsForUSA(unittest.TestCase):
def test_american_address(self):
countries = find_countries("8757 Georgia Avenue, 12th Floor")
self.assertEqual(0, len(countries))
def test_other_eastern_european_countries(s... | 1,696 | 23 | 158 |
2e1292230597d1078b8609ca622f2f6e67696ad3 | 2,494 | py | Python | carver/ole/ole/ole.py | maydewd/stoq-plugins-public | 8b2877b5091ae731437ef35a95d4debdbf0a19f3 | [
"Apache-2.0"
] | null | null | null | carver/ole/ole/ole.py | maydewd/stoq-plugins-public | 8b2877b5091ae731437ef35a95d4debdbf0a19f3 | [
"Apache-2.0"
] | null | null | null | carver/ole/ole/ole.py | maydewd/stoq-plugins-public | 8b2877b5091ae731437ef35a95d4debdbf0a19f3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2015 PUNCH Cyber Analytics Group
#
# 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... | 29.341176 | 94 | 0.54571 | # Copyright 2014-2015 PUNCH Cyber Analytics Group
#
# 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... | 82 | 1,608 | 23 |
54ddfcbec622cddc0ff5caa8d2af77d5e8895d40 | 2,017 | py | Python | main.py | ArtDevRodrigues/game-basePython | e150e592a03c5b37aa20c1fdbb047e11aec2f56d | [
"MIT"
] | null | null | null | main.py | ArtDevRodrigues/game-basePython | e150e592a03c5b37aa20c1fdbb047e11aec2f56d | [
"MIT"
] | null | null | null | main.py | ArtDevRodrigues/game-basePython | e150e592a03c5b37aa20c1fdbb047e11aec2f56d | [
"MIT"
] | null | null | null | from game import *
from random import *
# elementos e seus ids
# 1-fogo
# 2-agua
# 3-terra
# 4-ar
p1 = Player("P1","Guerreiro","Masculino","Indiano")
ws1 = [
#Weapon(id ,element ,price ,rarity ,strength ,speed),
Weapon( 1 ,randint(1,4),randint(10,200),randint(1,5),randint(10,100),randint... | 37.351852 | 142 | 0.646009 | from game import *
from random import *
# elementos e seus ids
# 1-fogo
# 2-agua
# 3-terra
# 4-ar
p1 = Player("P1","Guerreiro","Masculino","Indiano")
ws1 = [
#Weapon(id ,element ,price ,rarity ,strength ,speed),
Weapon( 1 ,randint(1,4),randint(10,200),randint(1,5),randint(10,100),randint... | 0 | 0 | 0 |
fc1262d2e00618c8f06ef4ca02d3e3ab4748a18c | 4,997 | py | Python | Lib/site-packages/tensorboard/plugins/scalar/scalars_plugin.py | caiyongji/tf2.3.1-py3.7.9-full-built | ace4efcbf05b2b494388739718a18c13eab83c71 | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2020-09-02T16:13:51.000Z | 2021-06-05T08:45:59.000Z | Lib/site-packages/tensorboard/plugins/scalar/scalars_plugin.py | caiyongji/tf2.3.1-py3.7.9-full-built | ace4efcbf05b2b494388739718a18c13eab83c71 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/site-packages/tensorboard/plugins/scalar/scalars_plugin.py | caiyongji/tf2.3.1-py3.7.9-full-built | ace4efcbf05b2b494388739718a18c13eab83c71 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2020-09-17T13:16:30.000Z | 2020-09-17T13:16:30.000Z | # Copyright 2017 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.439716 | 80 | 0.64959 | # Copyright 2017 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... | 522 | 0 | 107 |
8788365c9cd1db6b69140f3e164a309b5cbc16ec | 929 | py | Python | backend/surveybackend/djangobasic/urls.py | huarngpa/huarngpa_norc_challenge | 58dc0d47b9149a8081f6ba81facb27bf5aefe8bb | [
"MIT"
] | null | null | null | backend/surveybackend/djangobasic/urls.py | huarngpa/huarngpa_norc_challenge | 58dc0d47b9149a8081f6ba81facb27bf5aefe8bb | [
"MIT"
] | 7 | 2020-02-11T23:07:58.000Z | 2022-02-10T16:34:54.000Z | backend/surveybackend/djangobasic/urls.py | huarngpa/huarngpa_norc_challenge | 58dc0d47b9149a8081f6ba81facb27bf5aefe8bb | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from django.urls import path
from . import views
from rest_framework.routers import DefaultRouter
app_name = 'djangobasic'
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.regist... | 29.967742 | 91 | 0.748116 | from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required
from django.urls import path
from . import views
from rest_framework.routers import DefaultRouter
app_name = 'djangobasic'
# Create a router and register our viewsets with it.
router = DefaultRouter()
router.regist... | 0 | 0 | 0 |
7d17b72b36a89362f6e2c9c098373876069e693b | 7,354 | py | Python | python/paddle/fluid/tests/unittests/test_beam_search_op.py | jinyuKING/Paddle | 1f4d46fa885448af4ce45827eae3c609280d4e34 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_beam_search_op.py | jinyuKING/Paddle | 1f4d46fa885448af4ce45827eae3c609280d4e34 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_beam_search_op.py | jinyuKING/Paddle | 1f4d46fa885448af4ce45827eae3c609280d4e34 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle 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 app... | 36.77 | 79 | 0.549905 | # Copyright (c) 2018 PaddlePaddle 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 app... | 6,080 | 26 | 234 |
94fe63f2bb4e1cc66bec275d7ad54bdb798933b1 | 45 | py | Python | apps/utils/images/__init__.py | jorgesaw/oclock | 2a78bd4d1ab40eaa65ea346cf8c37556fcbbeca5 | [
"MIT"
] | null | null | null | apps/utils/images/__init__.py | jorgesaw/oclock | 2a78bd4d1ab40eaa65ea346cf8c37556fcbbeca5 | [
"MIT"
] | 5 | 2021-03-19T10:16:00.000Z | 2022-02-10T09:16:32.000Z | apps/utils/images/__init__.py | jorgesaw/oclock | 2a78bd4d1ab40eaa65ea346cf8c37556fcbbeca5 | [
"MIT"
] | null | null | null | from .uploads_images import custom_upload_to
| 22.5 | 44 | 0.888889 | from .uploads_images import custom_upload_to
| 0 | 0 | 0 |
d8536b2cabc7f5bc241592886b848784c96f50cc | 1,019 | py | Python | results/baseline/parse_baseline.py | XiaoSanchez/autophase | 3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb | [
"BSD-3-Clause"
] | 14 | 2020-04-03T12:41:50.000Z | 2022-02-04T00:05:01.000Z | results/baseline/parse_baseline.py | XiaoSanchez/autophase | 3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb | [
"BSD-3-Clause"
] | 2 | 2020-03-02T04:32:58.000Z | 2021-09-15T20:02:25.000Z | results/baseline/parse_baseline.py | XiaoSanchez/autophase | 3d8d173ad27b9786e36efd22d0ceacbcf1cb1dfb | [
"BSD-3-Clause"
] | 8 | 2020-03-02T10:30:36.000Z | 2021-08-03T02:29:38.000Z | import pickle
get_random_pgm_groups()
| 25.475 | 84 | 0.584887 | import pickle
def get_random_pgm_groups():
interval = [0, 1000, 5000, 10000, 50000, 100000]
buckets = {}
for i in range(len(interval)-1):
buckets[i] = []
valid_count = 0
with open('baseline.txt') as f:
lines = f.readlines()
print("Ignore Header Line: {}".format(lines[0]))
lines = lines[1:]
... | 957 | 0 | 23 |
a0d5b28ad7f528382bfd88d685d4abe641a9bb60 | 395 | py | Python | hads_adad.py | rezasf/hads-adad | c6183c8a84ceb526242822c49ba7ad8bc71287a3 | [
"Unlicense"
] | null | null | null | hads_adad.py | rezasf/hads-adad | c6183c8a84ceb526242822c49ba7ad8bc71287a3 | [
"Unlicense"
] | null | null | null | hads_adad.py | rezasf/hads-adad | c6183c8a84ceb526242822c49ba7ad8bc71287a3 | [
"Unlicense"
] | null | null | null | # Copyright (C) 2021 rezasf - All Rights Reserved
import random
res = random.randint(0,40)
count = 1
while True:
daf =int(input("ye adad vared kon: "))
if daf == res :
print("bad az "+ str(count) +" bar talash"+" shoma bordid")
break
elif daf > res :
print("bro pain")
coun... | 23.235294 | 67 | 0.544304 | # Copyright (C) 2021 rezasf - All Rights Reserved
import random
res = random.randint(0,40)
count = 1
while True:
daf =int(input("ye adad vared kon: "))
if daf == res :
print("bad az "+ str(count) +" bar talash"+" shoma bordid")
break
elif daf > res :
print("bro pain")
coun... | 0 | 0 | 0 |
a8d084e6f1b2eaabb108d7dc5fb8eaa0ab99eec6 | 789 | py | Python | dipole_test.py | rweigel/magnetovis | 2f466df4e29c2bb71c3d92294efea7f9eb036cec | [
"BSD-2-Clause"
] | null | null | null | dipole_test.py | rweigel/magnetovis | 2f466df4e29c2bb71c3d92294efea7f9eb036cec | [
"BSD-2-Clause"
] | 2 | 2020-11-06T10:20:08.000Z | 2021-01-25T17:44:48.000Z | dipole_test.py | rweigel/magnetovis | 2f466df4e29c2bb71c3d92294efea7f9eb036cec | [
"BSD-2-Clause"
] | 1 | 2021-05-22T11:35:18.000Z | 2021-05-22T11:35:18.000Z | import magnetovis as mvs
import paraview.simple as pvs
time = [2015,3,20,0,0,0] # time not used if coord_sys = GSM
coord_sys = 'GSM'
M=7.788E22
dipoleFieldSourceDisplay, renderView, dipoleFieldSource = mvs.dipole_field(time, M, coord_sys)
# create a new 'Glyph'
glyph = pvs.Glyph(registrationName='-- Glyph', Input=di... | 30.346154 | 95 | 0.746515 | import magnetovis as mvs
import paraview.simple as pvs
time = [2015,3,20,0,0,0] # time not used if coord_sys = GSM
coord_sys = 'GSM'
M=7.788E22
dipoleFieldSourceDisplay, renderView, dipoleFieldSource = mvs.dipole_field(time, M, coord_sys)
# create a new 'Glyph'
glyph = pvs.Glyph(registrationName='-- Glyph', Input=di... | 0 | 0 | 0 |
fc3ec0b8abfc036829de0eac8883435ae2262c58 | 2,443 | py | Python | main.py | heylakshya/youtubeRabbitHole | c1a45479429cc68f36ac8586cc54755cc119141b | [
"MIT"
] | 1 | 2020-11-26T13:49:42.000Z | 2020-11-26T13:49:42.000Z | main.py | heylakshya/youtubeRabbitHole | c1a45479429cc68f36ac8586cc54755cc119141b | [
"MIT"
] | null | null | null | main.py | heylakshya/youtubeRabbitHole | c1a45479429cc68f36ac8586cc54755cc119141b | [
"MIT"
] | 1 | 2021-03-02T05:00:57.000Z | 2021-03-02T05:00:57.000Z | import functions as f
import random
import numpy as np
import matplotlib.pyplot as plt
import json
def crawl2(url, depth, first_call = 0, home_tags = None):
'''
Crawl the yt web graph and return relevance index
upto defined depth.
'''
print("---\tat depth = {}".format(depth))
if depth == 0:
return []
tags =... | 25.715789 | 61 | 0.6623 | import functions as f
import random
import numpy as np
import matplotlib.pyplot as plt
import json
def crawl2(url, depth, first_call = 0, home_tags = None):
'''
Crawl the yt web graph and return relevance index
upto defined depth.
'''
print("---\tat depth = {}".format(depth))
if depth == 0:
return []
tags =... | 372 | 0 | 23 |
3591c896cf2d3754b91b4056684ed9d3359d0500 | 765 | py | Python | lib/innvestigate/examples/utils_imagenet.py | vwesselkamp/deepfake-fingerprint-atacks | 0befc913b081913255399d4264f09bce0d39cbcb | [
"MIT"
] | null | null | null | lib/innvestigate/examples/utils_imagenet.py | vwesselkamp/deepfake-fingerprint-atacks | 0befc913b081913255399d4264f09bce0d39cbcb | [
"MIT"
] | null | null | null | lib/innvestigate/examples/utils_imagenet.py | vwesselkamp/deepfake-fingerprint-atacks | 0befc913b081913255399d4264f09bce0d39cbcb | [
"MIT"
] | null | null | null | import numpy as np
import innvestigate
import innvestigate.utils as iutils
import innvestigate.utils.visualizations as ivis
| 19.615385 | 71 | 0.688889 | import numpy as np
import innvestigate
import innvestigate.utils as iutils
import innvestigate.utils.visualizations as ivis
def preprocess(X, net):
X = X.copy()
X = net["preprocess_f"](X)
return X
def postprocess(X, color_conversion, channels_first):
X = X.copy()
X = iutils.postprocess_images(
... | 496 | 0 | 138 |
0db5529ac93de1b8d3df8ca691845c4c56323a28 | 2,844 | py | Python | oidc/models.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 4 | 2020-10-08T07:36:22.000Z | 2022-02-04T12:31:31.000Z | oidc/models.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 1 | 2021-04-10T08:32:42.000Z | 2021-04-10T08:32:42.000Z | oidc/models.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 7 | 2021-02-10T16:04:29.000Z | 2022-03-16T08:04:48.000Z | from django.db import models
import uuid
from model_utils.models import TimeStampedModel
from django.conf import settings
# Create your models here.
| 34.26506 | 84 | 0.678973 | from django.db import models
import uuid
from model_utils.models import TimeStampedModel
from django.conf import settings
def disambiguate_referent(referent: str) -> str:
ref_idx = 1
ref_split = referent.split("~")
if len(ref_split) > 1:
old_idx = int(ref_split[-1])
ref_idx += old_idx
... | 1,513 | 1,084 | 92 |
93d40edf5cdacd5bd4debc10d624462c580a5df1 | 613 | py | Python | tests/packages/PlatformDependentCode/plugin.py | Thom1729/st_package_reviewer | 71e4eaad60fe3391b0a4d39405b784ec84ea58bc | [
"MIT"
] | 8 | 2017-06-07T07:52:32.000Z | 2021-04-26T23:46:36.000Z | tests/packages/PlatformDependentCode/plugin.py | Thom1729/st_package_reviewer | 71e4eaad60fe3391b0a4d39405b784ec84ea58bc | [
"MIT"
] | 26 | 2017-05-29T21:11:10.000Z | 2021-05-16T20:58:23.000Z | tests/packages/PlatformDependentCode/plugin.py | Thom1729/st_package_reviewer | 71e4eaad60fe3391b0a4d39405b784ec84ea58bc | [
"MIT"
] | 8 | 2017-05-31T21:16:49.000Z | 2021-03-20T16:43:26.000Z | import platform, sublime, sublime_plugin
| 25.541667 | 59 | 0.575856 | import platform, sublime, sublime_plugin
class AwesomeFooCommand(sublime_plugin.ApplicationCommand):
def run(self):
if "Darwin" in platform.platform():
print("Darwin")
else:
print("not supported")
class AwesomeBarCommand(sublime_plugin.ApplicationCommand):
d... | 386 | 76 | 108 |
7b7dfdca5cb46e7b8e6460d7345da616a31b7001 | 9,426 | py | Python | scripts/automation/trex_control_plane/interactive/trex/astf/ignored_ips_macs.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/astf/ignored_ips_macs.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/astf/ignored_ips_macs.py | GabrielGanne/trex-core | 688a0fe0adb890964691473723d70ffa98e00dd3 | [
"Apache-2.0"
] | null | null | null | from ..common.trex_exceptions import *
from ..utils.common import *
from ..utils.text_tables import TRexTextTable, print_table_with_header
from ..utils import parsing_opts
| 33.30742 | 120 | 0.579355 | from ..common.trex_exceptions import *
from ..utils.common import *
from ..utils.text_tables import TRexTextTable, print_table_with_header
from ..utils import parsing_opts
class MacsIpsMngr(object):
def __init__(self, client, macs = None, ips = None):
self.client = client
self.black_list_macs = m... | 8,583 | 5 | 643 |
44d826263dd166b68c14221609b4bc0ae344851f | 3,578 | py | Python | Zero_to_Google_SDE/LeetCodeHelper.py | NihalAgarwal/My-coding-DSA-Template | db872f6f72609f1d6ce7fb8e388dcbeca8337ffb | [
"MIT"
] | null | null | null | Zero_to_Google_SDE/LeetCodeHelper.py | NihalAgarwal/My-coding-DSA-Template | db872f6f72609f1d6ce7fb8e388dcbeca8337ffb | [
"MIT"
] | null | null | null | Zero_to_Google_SDE/LeetCodeHelper.py | NihalAgarwal/My-coding-DSA-Template | db872f6f72609f1d6ce7fb8e388dcbeca8337ffb | [
"MIT"
] | null | null | null | import turtle
import pyperclip as pc
class TreeBuild:
""" Display how our tree looks like. """
@staticmethod
@staticmethod
class SquareBracketToCurlyBracket:
""" [[ ]] -> {{}} or [] -> {} or [[...[]...]] -> {{..{}..}} """
if __name__ == "__main__":
rep = "y"
while rep == "y" or rep == ... | 27.953125 | 84 | 0.439072 | import turtle
import pyperclip as pc
class TreeNode:
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
def __repr__(self):
return "TreeNode({})".format(self.val)
class TreeBuild:
""" Display how our tree looks like. """
... | 2,376 | -9 | 258 |
7c37e7c4e9abf74a7fe46b2d7f2c93f45ecdf0a0 | 2,089 | py | Python | pre_save_embedding.py | jstzwj/NatsuBot | ceb22a67f9c3779bea44a56209d7b3174c34d480 | [
"MIT"
] | 4 | 2020-08-07T10:28:04.000Z | 2020-08-09T04:12:28.000Z | pre_save_embedding.py | jstzwj/NatsuBot | ceb22a67f9c3779bea44a56209d7b3174c34d480 | [
"MIT"
] | null | null | null | pre_save_embedding.py | jstzwj/NatsuBot | ceb22a67f9c3779bea44a56209d7b3174c34d480 | [
"MIT"
] | null | null | null | import pickle
import os
import json
from sentence_transformers import SentenceTransformer
if __name__ == "__main__":
model = SentenceTransformer('distiluse-base-multilingual-cased', device='cuda')
# path = ['./chat_text/poetry.txt', './chat_text/chat_text.txt']
# path = ['./chat_text/chat_text.txt', './cha... | 41.78 | 89 | 0.549545 | import pickle
import os
import json
from sentence_transformers import SentenceTransformer
if __name__ == "__main__":
model = SentenceTransformer('distiluse-base-multilingual-cased', device='cuda')
# path = ['./chat_text/poetry.txt', './chat_text/chat_text.txt']
# path = ['./chat_text/chat_text.txt', './cha... | 0 | 0 | 0 |
714a8bdf932506bb3237e597634c7ccafc4f7c25 | 1,147 | py | Python | asym_rlpo/utils/debugging.py | abaisero/asym-porl | 8a76d920e51d783bbeeeea3cd2b02efffbb33c72 | [
"MIT"
] | 2 | 2021-08-24T22:41:36.000Z | 2021-10-31T01:55:37.000Z | asym_rlpo/utils/debugging.py | abaisero/asym-porl | 8a76d920e51d783bbeeeea3cd2b02efffbb33c72 | [
"MIT"
] | null | null | null | asym_rlpo/utils/debugging.py | abaisero/asym-porl | 8a76d920e51d783bbeeeea3cd2b02efffbb33c72 | [
"MIT"
] | 1 | 2021-10-13T12:27:40.000Z | 2021-10-13T12:27:40.000Z | from numbers import Number
from typing import Type
import numpy as np
import torch
# taken from https://stackoverflow.com/questions/18376935/best-practice-for-equality-in-python
def nested_equal(a, b):
"""
Compare two objects recursively by element, handling numpy objects.
Assumes hashable items are no... | 22.057692 | 94 | 0.625981 | from numbers import Number
from typing import Type
import numpy as np
import torch
def checkraise(
condition: bool,
error_type: Type[Exception],
error_message_fmt: str,
*args,
**kwargs
):
if not condition:
raise error_type(error_message_fmt.format(*args, **kwargs))
# taken from http... | 193 | 0 | 23 |
36b1e4beb8447b7b4673bba514a248d10b86f37c | 1,542 | py | Python | flask_vgavro_utils/config.py | vgavro/flask-vgavro-utils | 01b7caa0241a6b606c228081eea169e51a0d1337 | [
"BSD-2-Clause"
] | null | null | null | flask_vgavro_utils/config.py | vgavro/flask-vgavro-utils | 01b7caa0241a6b606c228081eea169e51a0d1337 | [
"BSD-2-Clause"
] | null | null | null | flask_vgavro_utils/config.py | vgavro/flask-vgavro-utils | 01b7caa0241a6b606c228081eea169e51a0d1337 | [
"BSD-2-Clause"
] | null | null | null | from werkzeug.utils import ImportStringError
from flask.config import Config
class LazyValue(object):
"""
This class may be used to lazy resolve config after importing local overrides.
For example:
REDIS_URL = "redis://localhost:6379/0"
CELERY_BROKER_URL = LazyValue(lambda conf: conf['REDIS_URL'])... | 33.521739 | 92 | 0.628405 | from werkzeug.utils import ImportStringError
from flask.config import Config
class LazyValue(object):
"""
This class may be used to lazy resolve config after importing local overrides.
For example:
REDIS_URL = "redis://localhost:6379/0"
CELERY_BROKER_URL = LazyValue(lambda conf: conf['REDIS_URL'])... | 897 | 0 | 157 |
968587f9776b6ebff30c84ba1c209150fc2ef151 | 2,827 | py | Python | reagent/optimizer/uninferrable_schedulers.py | alexnikulkov/ReAgent | e404c5772ea4118105c2eb136ca96ad5ca8e01db | [
"BSD-3-Clause"
] | 1 | 2021-01-15T01:55:47.000Z | 2021-01-15T01:55:47.000Z | reagent/optimizer/uninferrable_schedulers.py | alexnikulkov/ReAgent | e404c5772ea4118105c2eb136ca96ad5ca8e01db | [
"BSD-3-Clause"
] | null | null | null | reagent/optimizer/uninferrable_schedulers.py | alexnikulkov/ReAgent | e404c5772ea4118105c2eb136ca96ad5ca8e01db | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
This file contains configs that could not be inferred from the default values
provided by PyTorch. If PyTorch optimizers and lr_schedulers had type annotations
then we could infer everything.
default values that cannot be inferred:
- tuple
- None
- required parameters (no default value)
Som... | 27.182692 | 81 | 0.719844 | #!/usr/bin/env python3
"""
This file contains configs that could not be inferred from the default values
provided by PyTorch. If PyTorch optimizers and lr_schedulers had type annotations
then we could infer everything.
default values that cannot be inferred:
- tuple
- None
- required parameters (no default value)
Som... | 0 | 1,800 | 198 |
5d61cc68d241fb00cfc9760d6e7c86d5bee99a1f | 9,173 | py | Python | src/diffupath/utils.py | multipaths/DiffuPath | 80da8f23754169e1f670a2f93aa6e605d84ab7e8 | [
"Apache-2.0"
] | 5 | 2019-07-08T13:39:05.000Z | 2021-06-21T02:11:39.000Z | src/diffupath/utils.py | multipaths/DiffuPath | 80da8f23754169e1f670a2f93aa6e605d84ab7e8 | [
"Apache-2.0"
] | 5 | 2019-12-16T07:51:16.000Z | 2020-12-24T16:50:14.000Z | src/diffupath/utils.py | multipaths/DiffuPath | 80da8f23754169e1f670a2f93aa6e605d84ab7e8 | [
"Apache-2.0"
] | 1 | 2020-08-13T12:23:08.000Z | 2020-08-13T12:23:08.000Z | # -*- coding: utf-8 -*-
"""Miscellaneous utils of the package."""
import copy
import inspect
import itertools
import logging
import os
import pickle
import random
from collections import defaultdict
from glob import glob
from statistics import mean
from typing import List
import numpy as np
log = logging.getLogger(_... | 31.414384 | 128 | 0.631963 | # -*- coding: utf-8 -*-
"""Miscellaneous utils of the package."""
import copy
import inspect
import itertools
import logging
import os
import pickle
import random
from collections import defaultdict
from glob import glob
from statistics import mean
from typing import List
import numpy as np
log = logging.getLogger(_... | 0 | 0 | 0 |
774ef2745289a2cc5cdc3e604ab730eaef761c44 | 2,600 | py | Python | src/features/word_count_analysis.py | Nazdarovja/Python_Semester_Project | de830060553c51389c3940e022ae038b41021455 | [
"MIT"
] | null | null | null | src/features/word_count_analysis.py | Nazdarovja/Python_Semester_Project | de830060553c51389c3940e022ae038b41021455 | [
"MIT"
] | null | null | null | src/features/word_count_analysis.py | Nazdarovja/Python_Semester_Project | de830060553c51389c3940e022ae038b41021455 | [
"MIT"
] | null | null | null | import pandas as pd
import collections
import numpy as np
def count_top_words_in_genre(genre, lyrics_df):
"""
Detect the language of the text.
Parameters
----------
genre : str
genre like 'Hip-Hop' or 'Pop'
lyrics_df : pandas dataframe
clean dataframe
... | 37.142857 | 136 | 0.653462 | import pandas as pd
import collections
import numpy as np
def count_top_words_in_genre(genre, lyrics_df):
"""
Detect the language of the text.
Parameters
----------
genre : str
genre like 'Hip-Hop' or 'Pop'
lyrics_df : pandas dataframe
clean dataframe
... | 0 | 0 | 0 |
f96ed070a5f96ae75dfd7a99c5dd448c88eb2e4c | 9,423 | py | Python | common/trainloop/loops.py | alainjungo/reliability-challenges-uncertainty | 21e86f6e2a5d2520b5767dce48bbcf2b11773788 | [
"MIT"
] | 56 | 2019-07-10T06:02:11.000Z | 2021-12-21T08:11:22.000Z | common/trainloop/loops.py | alainjungo/reliability-challenges-uncertainty | 21e86f6e2a5d2520b5767dce48bbcf2b11773788 | [
"MIT"
] | 4 | 2019-09-26T08:51:58.000Z | 2021-06-08T20:27:53.000Z | common/trainloop/loops.py | alainjungo/reliability-challenges-uncertainty | 21e86f6e2a5d2520b5767dce48bbcf2b11773788 | [
"MIT"
] | 8 | 2019-10-21T12:43:08.000Z | 2021-12-02T08:14:38.000Z | import logging
import torch
import numpy as np
import common.utils.torchhelper as th
import common.trainloop.context as ctx
import common.trainloop.hooks as hooks
import common.trainloop.data as data
| 39.759494 | 119 | 0.665818 | import logging
import torch
import numpy as np
import common.utils.torchhelper as th
import common.trainloop.context as ctx
import common.trainloop.hooks as hooks
import common.trainloop.data as data
class Validate:
def __init__(self, steps: list) -> None:
self.steps = steps
self.score_aggregat... | 8,817 | -14 | 412 |
fb6e766a3aec86b5093d661ed727eae1c29acdee | 2,286 | py | Python | q2_types/per_sample_sequences/__init__.py | jakereps/q2-types | 9942237a3d44e159e3617b836e48435a12842e3c | [
"BSD-3-Clause"
] | 8 | 2016-06-26T20:35:52.000Z | 2021-08-08T07:45:56.000Z | q2_types/per_sample_sequences/__init__.py | jakereps/q2-types | 9942237a3d44e159e3617b836e48435a12842e3c | [
"BSD-3-Clause"
] | 170 | 2016-05-10T19:27:56.000Z | 2022-03-16T21:50:49.000Z | q2_types/per_sample_sequences/__init__.py | jakereps/q2-types | 9942237a3d44e159e3617b836e48435a12842e3c | [
"BSD-3-Clause"
] | 44 | 2016-05-09T20:56:06.000Z | 2021-08-17T17:09:39.000Z | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 49.695652 | 78 | 0.625984 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 0 | 0 | 0 |
fdb74a7ca6bafb012f1c478a67adb445d25c46e4 | 5,744 | py | Python | gpMgmt/bin/gpssh_modules/gppxssh_wrapper.py | wapache-org/greenplum-gpdb | 79e2bd251c1d27054846f630acd52e7903854829 | [
"PostgreSQL",
"Apache-2.0"
] | 5,535 | 2015-10-28T01:05:40.000Z | 2022-03-30T13:46:53.000Z | gpMgmt/bin/gpssh_modules/gppxssh_wrapper.py | wapache-org/greenplum-gpdb | 79e2bd251c1d27054846f630acd52e7903854829 | [
"PostgreSQL",
"Apache-2.0"
] | 9,369 | 2015-10-28T07:48:01.000Z | 2022-03-31T23:56:42.000Z | gpMgmt/bin/gpssh_modules/gppxssh_wrapper.py | wapache-org/greenplum-gpdb | 79e2bd251c1d27054846f630acd52e7903854829 | [
"PostgreSQL",
"Apache-2.0"
] | 1,800 | 2015-10-28T01:08:25.000Z | 2022-03-29T13:29:36.000Z | from datetime import datetime
import time
import sys
sys.path.insert(1, sys.path[0] + '/lib')
from pexpect import pxssh, TIMEOUT
CRNL = '\r\n'
DEBUG_VERBOSE_PRINTING = False
# experimentally derived that a sequence of tries with delays of
# 1, 5, 25, 125 secs worked to surmount a 1-second delay (via `tc` test)
RETRY... | 43.18797 | 116 | 0.621692 | from datetime import datetime
import time
import sys
sys.path.insert(1, sys.path[0] + '/lib')
from pexpect import pxssh, TIMEOUT
CRNL = '\r\n'
DEBUG_VERBOSE_PRINTING = False
# experimentally derived that a sequence of tries with delays of
# 1, 5, 25, 125 secs worked to surmount a 1-second delay (via `tc` test)
RETRY... | 1,780 | 3,605 | 23 |
b95a7481c95d69db4af9c074180e78b47074a31c | 4,486 | py | Python | gpMgmt/test/behave/mgmt_utils/steps/gpstart.py | zhongyibill/gpdb | 12cfded239d5da2ad102697c9d56efb5759807dd | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2021-01-03T17:55:43.000Z | 2021-01-03T17:55:43.000Z | gpMgmt/test/behave/mgmt_utils/steps/gpstart.py | zhongyibill/gpdb | 12cfded239d5da2ad102697c9d56efb5759807dd | [
"PostgreSQL",
"Apache-2.0"
] | 6 | 2019-11-04T17:12:13.000Z | 2020-06-04T21:18:41.000Z | gpMgmt/test/behave/mgmt_utils/steps/gpstart.py | zhongyibill/gpdb | 12cfded239d5da2ad102697c9d56efb5759807dd | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2020-03-26T02:47:22.000Z | 2020-03-26T02:47:22.000Z | import os
import signal
import subprocess
from behave import given, when, then
from test.behave_utils import utils
from gppylib.commands.base import Command
@when('the standby host goes down')
def _handle_sigpipe():
"""
Work around https://bugs.python.org/issue1615376, which is not fixed until
Python 3.2... | 34.507692 | 133 | 0.653143 | import os
import signal
import subprocess
from behave import given, when, then
from test.behave_utils import utils
from gppylib.commands.base import Command
def _run_sql(sql, opts=None):
env = None
if opts is not None:
env = os.environ.copy()
options = ''
for key, value in opts.items... | 3,209 | 0 | 202 |
caae85bacfe71629215a5620278cfc2abaed9bde | 17,277 | py | Python | groupon/extras/code.py | vikmeup/python-groupon | a7fc55c3b22d3031ac5abf3190ea2d8fcdcd4699 | [
"Apache-2.0"
] | null | null | null | groupon/extras/code.py | vikmeup/python-groupon | a7fc55c3b22d3031ac5abf3190ea2d8fcdcd4699 | [
"Apache-2.0"
] | null | null | null | groupon/extras/code.py | vikmeup/python-groupon | a7fc55c3b22d3031ac5abf3190ea2d8fcdcd4699 | [
"Apache-2.0"
] | null | null | null | from groupon import Version
__author__ = "Allan Bunch"
__copyright__ = "Copyright (C) 2010 Webframeworks LLC"
__license__ = """Copyright 2010 Webframeworks LLC Licensed under the Apache
License, Version 2.0 (the "License"); you may not use this
file except in compliance with the Licen... | 57.019802 | 179 | 0.472883 | from groupon import Version
__author__ = "Allan Bunch"
__copyright__ = "Copyright (C) 2010 Webframeworks LLC"
__license__ = """Copyright 2010 Webframeworks LLC Licensed under the Apache
License, Version 2.0 (the "License"); you may not use this
file except in compliance with the Licen... | 16,270 | 3 | 77 |
593e64885e5d572e4b146897a1f80d8ba96c976f | 11,552 | py | Python | app/utils/webstore.py | Timon0305/Auto_Checking | 8bb8e1e7e4a4817ff6769db25ea4fe0d8e5d65bf | [
"MIT"
] | null | null | null | app/utils/webstore.py | Timon0305/Auto_Checking | 8bb8e1e7e4a4817ff6769db25ea4fe0d8e5d65bf | [
"MIT"
] | 1 | 2022-02-09T16:45:14.000Z | 2022-02-09T16:45:14.000Z | app/utils/webstore.py | Timon0305/Auto_Checking | 8bb8e1e7e4a4817ff6769db25ea4fe0d8e5d65bf | [
"MIT"
] | null | null | null | import json
from time import sleep
import requests
from cloudaio import tlsexpert
import uuid
import random
s = requests.session()
stylecode = 'DB5074-101'
stop = False
storage = {}
sizes = ['9']
cookie = '_abck=42D4E2E416589130C76B07375A19C056~-1~YAAQwArGF1ovWzJ1AQAAFVlARAS+j6F2rlSe4zrahotRz7GSQSWK5sEIKBw84/F206ZvoZUy... | 35.435583 | 851 | 0.512119 | import json
from time import sleep
import requests
from cloudaio import tlsexpert
import uuid
import random
s = requests.session()
stylecode = 'DB5074-101'
stop = False
storage = {}
sizes = ['9']
cookie = '_abck=42D4E2E416589130C76B07375A19C056~-1~YAAQwArGF1ovWzJ1AQAAFVlARAS+j6F2rlSe4zrahotRz7GSQSWK5sEIKBw84/F206ZvoZUy... | 9,730 | 0 | 115 |
d0e3068f6158d62cc93b692a481748d81fc4828b | 8,344 | py | Python | apps/solar_savings_potential.py | annieco29/rooftop_solar_energy_app | 11314d80f1b714d86090c90df7a63f78966107e0 | [
"MIT"
] | null | null | null | apps/solar_savings_potential.py | annieco29/rooftop_solar_energy_app | 11314d80f1b714d86090c90df7a63f78966107e0 | [
"MIT"
] | null | null | null | apps/solar_savings_potential.py | annieco29/rooftop_solar_energy_app | 11314d80f1b714d86090c90df7a63f78966107e0 | [
"MIT"
] | null | null | null | import streamlit as st
import pandas as pd
import numpy as np
import datetime
import plotly.express as px
import base64 | 46.355556 | 188 | 0.680609 | import streamlit as st
import pandas as pd
import numpy as np
import datetime
import plotly.express as px
import base64
def app():
LOGO_IMAGE_IBM = "apps/ibm.png"
LOGO_IMAGE_U_OF_F = "apps/u_of_f.svg.png"
LOGO_IMAGE_BRIGHTER = "apps/brighter_potential_logo.png"
st.markdown(
"""
<style>... | 8,202 | 0 | 23 |
72ebbb47f00a1f3815d46bfb5a0e5a0fd768886b | 14,312 | py | Python | src/guesswhat/train/train_oracle.py | ibrahimSouleiman/GuessWhat | 60d140de1aae5ccda27e7d3eef2b9fb9548f0854 | [
"Apache-2.0"
] | null | null | null | src/guesswhat/train/train_oracle.py | ibrahimSouleiman/GuessWhat | 60d140de1aae5ccda27e7d3eef2b9fb9548f0854 | [
"Apache-2.0"
] | null | null | null | src/guesswhat/train/train_oracle.py | ibrahimSouleiman/GuessWhat | 60d140de1aae5ccda27e7d3eef2b9fb9548f0854 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
from multiprocessing import Pool
from distutils.util import strtobool
import tensorflow as tf
import numpy as np
import json
from pathlib import Path
from generic.data_provider.iterator import Iterator
from generic.tf_utils.evaluator import Evaluator
from generic.tf_utils.opt... | 38.891304 | 371 | 0.638276 | import argparse
import logging
import os
from multiprocessing import Pool
from distutils.util import strtobool
import tensorflow as tf
import numpy as np
import json
from pathlib import Path
from generic.data_provider.iterator import Iterator
from generic.tf_utils.evaluator import Evaluator
from generic.tf_utils.opt... | 0 | 0 | 0 |
b17c0e29efe0a6120c90012157d73cbf64908685 | 8,202 | py | Python | venv/lib/python2.7/site-packages/webassets/filter/compass.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/webassets/filter/compass.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | venv/lib/python2.7/site-packages/webassets/filter/compass.py | mutaihillary/mycalculator | 55685dd7c968861f18ae0701129f5af2bc682d67 | [
"MIT"
] | null | null | null | """
Generally speaking, compass provides a command line util that is used
a) as a management script (like django-admin.py) doing for example
setup work, adding plugins to a project etc), and
b) can compile the sass source files into CSS.
While generally project-based, starting with 0.10, compass supposedly
sup... | 42.942408 | 86 | 0.611558 | """
Generally speaking, compass provides a command line util that is used
a) as a management script (like django-admin.py) doing for example
setup work, adding plugins to a project etc), and
b) can compile the sass source files into CSS.
While generally project-based, starting with 0.10, compass supposedly
sup... | 0 | 0 | 0 |
eb1606b89995448b7b26ebd06607561f33f3d993 | 789 | py | Python | 05_ventanas.py | dlunna/gob.selenium | 9c663e78b880b3363731f6e6f5b6899a972ef7c0 | [
"MIT"
] | null | null | null | 05_ventanas.py | dlunna/gob.selenium | 9c663e78b880b3363731f6e6f5b6899a972ef7c0 | [
"MIT"
] | null | null | null | 05_ventanas.py | dlunna/gob.selenium | 9c663e78b880b3363731f6e6f5b6899a972ef7c0 | [
"MIT"
] | null | null | null | import time
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
if __name__ == '__main__':
unittest.main() | 26.3 | 97 | 0.669202 | import time
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class usando_unittest(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(executable_path='/var/www/pyfy/gob.selenium/chromedriver')
def test_cambiar_ventana(self):
drive... | 511 | 20 | 104 |
adaef4a84bf0412b7f77103cd7fd303ee40f3c2f | 7,367 | py | Python | app/crud/job.py | meddler-io/secoflex | 3a61b46ab03a25f6436d8e004a1d8ead46093272 | [
"MIT"
] | null | null | null | app/crud/job.py | meddler-io/secoflex | 3a61b46ab03a25f6436d8e004a1d8ead46093272 | [
"MIT"
] | null | null | null | app/crud/job.py | meddler-io/secoflex | 3a61b46ab03a25f6436d8e004a1d8ead46093272 | [
"MIT"
] | null | null | null |
from motor.frameworks.asyncio import pymongo_class_wrapper
from app.api.api_v2.endpoints import job
from typing import Any, List
from app.models.tool.job import JobCompositeInResponse, JobInDb, JobInRequest, JobInResponse, JobProgressResponse, JobUpdateModel
from app.models.mongo_id import ObjectIdInReq, ObjectIdInR... | 23.996743 | 188 | 0.467626 |
from motor.frameworks.asyncio import pymongo_class_wrapper
from app.api.api_v2.endpoints import job
from typing import Any, List
from app.models.tool.job import JobCompositeInResponse, JobInDb, JobInRequest, JobInResponse, JobProgressResponse, JobUpdateModel
from app.models.mongo_id import ObjectIdInReq, ObjectIdInR... | 6,221 | 0 | 135 |
cb99d70f985f446d177e9d7d3af216fc3f222dc4 | 942 | py | Python | article/migrations/0003_comments.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | article/migrations/0003_comments.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | article/migrations/0003_comments.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-08 11:06
from django.db import migrations, models
import django.db.models.deletion
| 37.68 | 163 | 0.638004 | # Generated by Django 3.1.5 on 2021-02-08 11:06
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('article', '0002_auto_20210207_1514'),
]
operations = [
migrations.CreateModel(
name='Comments',... | 0 | 795 | 23 |
74445ecadd16262701e1fb5d7152036f5118ee58 | 347 | py | Python | src/scenarios/shared/postcommands.py | BruceForstall/performance | 47524b9060aa7cb13205fa281a6be6e2d404995c | [
"MIT"
] | 547 | 2018-11-06T21:14:57.000Z | 2022-03-31T21:14:57.000Z | src/scenarios/shared/postcommands.py | BruceForstall/performance | 47524b9060aa7cb13205fa281a6be6e2d404995c | [
"MIT"
] | 1,572 | 2018-11-06T21:30:31.000Z | 2022-03-31T23:31:25.000Z | src/scenarios/shared/postcommands.py | BruceForstall/performance | 47524b9060aa7cb13205fa281a6be6e2d404995c | [
"MIT"
] | 196 | 2018-11-06T20:58:21.000Z | 2022-03-29T21:04:21.000Z | from shared.const import APPDIR, TMPDIR, TRACEDIR, PUBDIR, BINDIR, CROSSGENDIR
from performance.common import remove_directory | 43.375 | 80 | 0.731988 | from shared.const import APPDIR, TMPDIR, TRACEDIR, PUBDIR, BINDIR, CROSSGENDIR
from performance.common import remove_directory
def clean_directories():
to_remove = (APPDIR, TMPDIR, TRACEDIR, PUBDIR, BINDIR, CROSSGENDIR, "emsdk")
print(f"Removing {','.join(to_remove)} if exist ...")
for dir in to_remove:
... | 198 | 0 | 23 |
ebadf0352571b46b1488b0e97b824910cb2a4fe5 | 3,718 | py | Python | tests/chainer_tests/optimizer_hooks_tests/test_gradient_lars.py | dl4fugaku/chainer | 34655eff5986522eae56f47fc82a8cc2b78e1617 | [
"MIT"
] | 2 | 2019-08-12T21:48:04.000Z | 2020-08-27T18:04:20.000Z | tests/chainer_tests/optimizer_hooks_tests/test_gradient_lars.py | dl4fugaku/chainer | 34655eff5986522eae56f47fc82a8cc2b78e1617 | [
"MIT"
] | null | null | null | tests/chainer_tests/optimizer_hooks_tests/test_gradient_lars.py | dl4fugaku/chainer | 34655eff5986522eae56f47fc82a8cc2b78e1617 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
import chainer
from chainer import optimizer_hooks
from chainer import optimizers
from chainer import testing
_backend_params = [
# NumPy
{},
{'use_ideep': 'always'},
# CuPy
{'use_cuda': True, 'cuda_device': 0},
{'use_cuda': True, 'cuda_device': 1},
# C... | 33.495495 | 76 | 0.581495 | import unittest
import numpy as np
import chainer
from chainer import optimizer_hooks
from chainer import optimizers
from chainer import testing
_backend_params = [
# NumPy
{},
{'use_ideep': 'always'},
# CuPy
{'use_cuda': True, 'cuda_device': 0},
{'use_cuda': True, 'cuda_device': 1},
# C... | 2,804 | 31 | 153 |
1a152613f1c9b3bff272bfa88b986f63186e0426 | 680 | py | Python | backend/src/restaurants/api/urls.py | devmaturi/restaurant_finder | 31b737e705806080375d8ae7746ee294ecf7da26 | [
"MIT"
] | null | null | null | backend/src/restaurants/api/urls.py | devmaturi/restaurant_finder | 31b737e705806080375d8ae7746ee294ecf7da26 | [
"MIT"
] | null | null | null | backend/src/restaurants/api/urls.py | devmaturi/restaurant_finder | 31b737e705806080375d8ae7746ee294ecf7da26 | [
"MIT"
] | null | null | null | from restaurants.api.views import RestaurantViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'', RestaurantViewSet, basename='restaurants')
urlpatterns = router.urls
# from django.urls import path
# from .views import ( RestaurantListView, RestaurantDetailView,
# Re... | 35.789474 | 68 | 0.744118 | from restaurants.api.views import RestaurantViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'', RestaurantViewSet, basename='restaurants')
urlpatterns = router.urls
# from django.urls import path
# from .views import ( RestaurantListView, RestaurantDetailView,
# Re... | 0 | 0 | 0 |
d871051ace426998e7242e30f556f967efa26c23 | 1,090 | py | Python | Sockets/SocketServ/SocketServ.py | evoicefire/playground | 86d8fad5917757c356b8f54e57cdb315c5a1036d | [
"MIT"
] | null | null | null | Sockets/SocketServ/SocketServ.py | evoicefire/playground | 86d8fad5917757c356b8f54e57cdb315c5a1036d | [
"MIT"
] | null | null | null | Sockets/SocketServ/SocketServ.py | evoicefire/playground | 86d8fad5917757c356b8f54e57cdb315c5a1036d | [
"MIT"
] | null | null | null | import socket
import sys
__author__ = 'Gus'
HOST = ''
PORT = 8889
p = 0
e = 0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('--Socket created--')
try:
s.bind((HOST, PORT))
except socket.error as msg:
print('Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1])
sys.exit()
print(... | 20.961538 | 76 | 0.501835 | import socket
import sys
__author__ = 'Gus'
HOST = ''
PORT = 8889
p = 0
e = 0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('--Socket created--')
try:
s.bind((HOST, PORT))
except socket.error as msg:
print('Bind failed. Error Code : ' + str(msg[0]) + ' Message ' + msg[1])
sys.exit()
print(... | 0 | 0 | 0 |
86e7fa8f0d86380c6acc4c845c674a920302a313 | 5,417 | py | Python | kashgari/processors/base_processor.py | SunYanCN/Kashgari | f0892db08b2144fe93bb4de3914cd771e9a98d8e | [
"Apache-2.0"
] | 1 | 2020-04-15T11:41:29.000Z | 2020-04-15T11:41:29.000Z | kashgari/processors/base_processor.py | Amaz0ser/Kashgari | 9d72b7bc180336d3cfba94068e22af3dd56b8264 | [
"Apache-2.0"
] | null | null | null | kashgari/processors/base_processor.py | Amaz0ser/Kashgari | 9d72b7bc180336d3cfba94068e22af3dd56b8264 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# author: BrikerMan
# contact: eliyar917@gmail.com
# blog: https://eliyar.biz
# file: base_processor.py
# time: 2019-05-21 11:27
import collections
import logging
import operator
from typing import List, Optional, Union, Dict, Any
import numpy as np
from tensorflow.python.keras.preprocessing.seque... | 34.28481 | 95 | 0.572642 | # encoding: utf-8
# author: BrikerMan
# contact: eliyar917@gmail.com
# blog: https://eliyar.biz
# file: base_processor.py
# time: 2019-05-21 11:27
import collections
import logging
import operator
from typing import List, Optional, Union, Dict, Any
import numpy as np
from tensorflow.python.keras.preprocessing.seque... | 3,211 | 0 | 297 |