hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9cf13e1857d58c4f934f37774465503aa988077f | 172 | py | Python | exercicio95AprimorandoOsDicionarios.py | adrianomdantas/Exercicios-Python | ef5025a186615258aec0cf35ed839fe49577d983 | [
"MIT"
] | null | null | null | exercicio95AprimorandoOsDicionarios.py | adrianomdantas/Exercicios-Python | ef5025a186615258aec0cf35ed839fe49577d983 | [
"MIT"
] | null | null | null | exercicio95AprimorandoOsDicionarios.py | adrianomdantas/Exercicios-Python | ef5025a186615258aec0cf35ed839fe49577d983 | [
"MIT"
] | null | null | null | '''Aprimore o desafio 93 para que ele funcione com varios
jogadores, incluindo um sistema de visualizao de detalhes
do aproveitamento de cada jogador'''
| 13.230769 | 59 | 0.726744 | '''Aprimore o desafio 93 para que ele funcione com varios
jogadores, incluindo um sistema de visualização de detalhes
do aproveitamento de cada jogador'''
| 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3ec62af1643a0b0d23b360ab2f233eeb0d2255bf | 1,537 | py | Python | bonus_jnpr_xml/ex7_pyez_rpc_show_version.py | melshman/pynetauto | 3999d069e2043f3f15760a840e2faca5686fe331 | [
"Apache-2.0"
] | 1 | 2019-08-10T09:37:48.000Z | 2019-08-10T09:37:48.000Z | bonus_jnpr_xml/ex7_pyez_rpc_show_version.py | melshman/pynetauto | 3999d069e2043f3f15760a840e2faca5686fe331 | [
"Apache-2.0"
] | null | null | null | bonus_jnpr_xml/ex7_pyez_rpc_show_version.py | melshman/pynetauto | 3999d069e2043f3f15760a840e2faca5686fe331 | [
"Apache-2.0"
] | 1 | 2019-08-16T02:14:16.000Z | 2019-08-16T02:14:16.000Z | #!/usr/bin/env python
# import xmltodict
# from jnpr.junos.op.ethport import EthPortTable
# from jnpr.junos.op.arp import ArpTable
# from jnpr.junos.op.routes import RouteTable
# from jnpr.junos.op.phyport import PhyPortTable
# from jnpr.junos.op.phyport import PhyPortStatsTable
# from jnpr.junos.utils.config import Co... | 24.015625 | 77 | 0.733247 | #!/usr/bin/env python
from getpass import getpass
from pprint import pprint
from lxml import etree
# import xmltodict
from jnpr.junos import Device
# from jnpr.junos.op.ethport import EthPortTable
# from jnpr.junos.op.arp import ArpTable
# from jnpr.junos.op.routes import RouteTable
# from jnpr.junos.op.phyport impo... | 0 | 0 | 0 | 0 | 0 | 733 | 0 | 19 | 114 |
9828b45924c30d21484d0de726dd951478e26894 | 1,157 | py | Python | tests/queues_test.py | Cormen-Lib-Developers/Cormen-Lib | 7877f1180cb76b56c909b70a35d85af8a83e530a | [
"MIT"
] | 8 | 2022-01-24T00:34:59.000Z | 2022-03-15T01:34:51.000Z | tests/queues_test.py | Cormen-Lib-Developers/Cormen-Lib | 7877f1180cb76b56c909b70a35d85af8a83e530a | [
"MIT"
] | 8 | 2022-02-09T22:07:35.000Z | 2022-03-17T16:23:08.000Z | tests/queues_test.py | Cormen-Lib-Developers/Cormen-Lib | 7877f1180cb76b56c909b70a35d85af8a83e530a | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 26.295455 | 67 | 0.581677 | import unittest
from dalpy.queues import Queue, QueueUnderflowError
class QueueTest(unittest.TestCase):
def test_init(self):
q = Queue()
self.assertTrue(q.is_empty())
self.assertEqual(q.size(), 0)
def test_empty_ops(self):
q = Queue()
self.assertRaises(QueueUnderflowE... | 0 | 0 | 0 | 1,015 | 0 | 0 | 0 | 30 | 46 |
9682e010fa7682d3b3ca7f707c2a991a31191803 | 2,673 | py | Python | tests/apps/ad7091r.py | ktok07b6/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 83 | 2015-11-30T09:59:13.000Z | 2021-08-03T09:12:28.000Z | tests/apps/ad7091r.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 4 | 2017-02-10T01:43:11.000Z | 2020-07-14T03:52:25.000Z | tests/apps/ad7091r.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 11 | 2016-11-18T14:39:15.000Z | 2021-02-23T10:05:20.000Z |
CONVST_PULSE_CYCLE = 10
CONVERSION_CYCLE = 40
spic = AD7091R_SPIC()
test(spic)
| 29.054348 | 74 | 0.538721 | import polyphony
from polyphony.io import Port
from polyphony.typing import bit, uint3, uint12, uint16
from polyphony.timing import clksleep, clkfence, wait_rising, wait_falling
CONVST_PULSE_CYCLE = 10
CONVERSION_CYCLE = 40
@polyphony.module
class AD7091R_SPIC:
def __init__(self):
self.sclk = Port(bit, ... | 0 | 2,364 | 0 | 0 | 0 | 0 | 0 | 90 | 134 |
933746883a1fab6e5fd5ea0d6f96b9b83dd083fb | 625 | py | Python | run.py | mmmaaaggg/RESTPlus_MINA_Server_Prophets | 7ce08c5d7f9baa655313949231b99c01c5dc7987 | [
"MIT"
] | 1 | 2018-07-09T01:15:17.000Z | 2018-07-09T01:15:17.000Z | run.py | mmmaaaggg/RESTPlus_MINA_Server_Prophets | 7ce08c5d7f9baa655313949231b99c01c5dc7987 | [
"MIT"
] | null | null | null | run.py | mmmaaaggg/RESTPlus_MINA_Server_Prophets | 7ce08c5d7f9baa655313949231b99c01c5dc7987 | [
"MIT"
] | 3 | 2019-11-26T09:53:32.000Z | 2020-09-03T06:46:57.000Z | #! /usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author : MG
@Time : 2018/7/6 10:21
@File : run.py.py
@contact : mmmaaaggg@163.com
@desc :
"""
if __name__ == '__main__':
import logging
from app.config import config
from app.app import app
logger = logging.getLogger()
if config.APP_ENAB... | 26.041667 | 119 | 0.6496 | #! /usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author : MG
@Time : 2018/7/6 10:21
@File : run.py.py
@contact : mmmaaaggg@163.com
@desc :
"""
if __name__ == '__main__':
import logging
from app.config import config
from app.app import app
logger = logging.getLogger()
if config.APP_ENAB... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
536af7bd0f729f75543228eeef085d82e68902d5 | 612 | py | Python | tests/test_slider.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 5 | 2020-10-16T03:46:47.000Z | 2022-03-21T07:10:37.000Z | tests/test_slider.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | null | null | null | tests/test_slider.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 1 | 2022-02-16T14:18:43.000Z | 2022-02-16T14:18:43.000Z | """Test MSlider class"""
| 25.5 | 64 | 0.696078 | """Test MSlider class"""
import pytest
from dayu_widgets3.slider import MSlider
from dayu_widgets3.qt import Qt
@pytest.mark.parametrize('orient', (Qt.Horizontal, Qt.Vertical))
def test_slider_init(qtbot, orient):
"""Test MSlider init"""
slider = MSlider(orientation=orient)
slider.setValue(10)
qtbot.a... | 0 | 475 | 0 | 0 | 0 | 0 | 0 | 21 | 89 |
03c005aab99800df2ee6bde23902c69a1dea5c99 | 815 | py | Python | src/6-learn_json_str_to_python_data_struct.py | padmaparam/kids-py-learn | 0bc86c285d3398782ff529ff0a2105db77102245 | [
"MIT"
] | null | null | null | src/6-learn_json_str_to_python_data_struct.py | padmaparam/kids-py-learn | 0bc86c285d3398782ff529ff0a2105db77102245 | [
"MIT"
] | null | null | null | src/6-learn_json_str_to_python_data_struct.py | padmaparam/kids-py-learn | 0bc86c285d3398782ff529ff0a2105db77102245 | [
"MIT"
] | 1 | 2021-06-22T18:20:22.000Z | 2021-06-22T18:20:22.000Z | '''
Module is a file which contains various Python functions and global variables.
It is simply just .py extension file which has python executable code.
Package is a collection of modules. It must contain an init.py file as a
flag so that the python interpreter processes it as such. The init.py
could be an empty file... | 27.166667 | 78 | 0.741104 | '''
Module is a file which contains various Python functions and global variables.
It is simply just .py extension file which has python executable code.
Package is a collection of modules. It must contain an init.py file as a
flag so that the python interpreter processes it as such. The init.py
could be an empty file... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7583cb43b6f879a85898c5390fd789fe8bf8f4b9 | 7,125 | py | Python | src/newmain.py | Eliomar-Julian/SteamPromotion | d1f50cf4fc6d482e064685b6db6eae288d180be2 | [
"MIT"
] | 6 | 2020-10-04T19:20:05.000Z | 2020-11-10T20:45:57.000Z | src/newmain.py | Eliomar-Julian/SteamPromotion | d1f50cf4fc6d482e064685b6db6eae288d180be2 | [
"MIT"
] | 1 | 2020-11-11T04:34:18.000Z | 2020-11-11T04:34:18.000Z | src/newmain.py | Eliomar-Julian/SteamPromotion | d1f50cf4fc6d482e064685b6db6eae288d180be2 | [
"MIT"
] | 4 | 2020-10-04T18:03:31.000Z | 2020-11-11T20:04:26.000Z | import sqlite3
## DB
## SOCORRO!! lembra o tamnho dessas linhas?? kkk
con = sqlite3.connect("ourdata.db")
cur = con.cursor()
cur.execute(
"""
CREATE TABLE IF NOT EXISTS ourgames(
gamename TEXT,
gameurl TEXT,
gameactualprice TEXT,
gametrigger TEXT
)
"""
)
con.commit()
## Menu/Request... | 33.450704 | 92 | 0.579228 | import requests
from bs4 import BeautifulSoup
import sqlite3
import re
import threading
from os import system
from time import sleep
from PySide2.QtWidgets import (
QMessageBox, QDialog, QMessageBox,
QVBoxLayout, QLabel, QLineEdit
)
from PySide2 import QtGui, QtCore
## DB
## SOCORRO!! lembra o tamnho dessas ... | 56 | 0 | 0 | 0 | 0 | 6,410 | 0 | 84 | 249 |
d7dc92887186543052208c79bd2cc9f71b6452d0 | 10,646 | py | Python | tests/factories/factory.py | BoaVaga/boavaga_server | 7d25a68832d3b9f4f5666d0a3d55c99025498511 | [
"MIT"
] | null | null | null | tests/factories/factory.py | BoaVaga/boavaga_server | 7d25a68832d3b9f4f5666d0a3d55c99025498511 | [
"MIT"
] | null | null | null | tests/factories/factory.py | BoaVaga/boavaga_server | 7d25a68832d3b9f4f5666d0a3d55c99025498511 | [
"MIT"
] | null | null | null |
import factory
import factory.fuzzy
import faker.providers.phone_number.pt_BR
from src.services import Crypto
crypto = Crypto(True, 12)
factory.Faker.add_provider(SimplePhoneProvider, locale='pt_BR')
factory.Faker.add_provider(CustomTimeProvider)
_ALL_FACTORIES = (AdminSistemaFactory, AdminEst... | 34.904918 | 120 | 0.707778 | from datetime import datetime, time
from decimal import Decimal
from random import randint, choice
from uuid import uuid4
import factory
import factory.fuzzy
import faker.providers.phone_number.pt_BR
import faker.providers.date_time
from src.classes import ValorHoraInput
from src.enums import EstadosEnum, UploadStatu... | 0 | 845 | 0 | 7,584 | 0 | 647 | 0 | 268 | 750 |
dd33529f4ecdc0cc1ded21469ddb8afa6d88a7b8 | 795 | py | Python | testing/rho_visualize.py | mdmohsinali/SGCT-Based-Fault-Tolerant-2D-SFI | bc35188e1f9ade450dce75cfe934e9862e13059b | [
"BSD-3-Clause"
] | null | null | null | testing/rho_visualize.py | mdmohsinali/SGCT-Based-Fault-Tolerant-2D-SFI | bc35188e1f9ade450dce75cfe934e9862e13059b | [
"BSD-3-Clause"
] | null | null | null | testing/rho_visualize.py | mdmohsinali/SGCT-Based-Fault-Tolerant-2D-SFI | bc35188e1f9ade450dce75cfe934e9862e13059b | [
"BSD-3-Clause"
] | null | null | null | import sys
import solution_reader3
# load a solution reader object which parses the input spec
sr = solution_reader3.SolutionReader('input_data') # should properly set in "solution_reader3.py" if 32-bit or 64-bit
# load the density data at output step 20
rho = sr.loadVec('rho001.dat')
# the shape of the data is (NX,... | 37.857143 | 117 | 0.749686 | import sys
import solution_reader3
# load a solution reader object which parses the input spec
sr = solution_reader3.SolutionReader('input_data') # should properly set in "solution_reader3.py" if 32-bit or 64-bit
# load the density data at output step 20
rho = sr.loadVec('rho001.dat')
# the shape of the data is (NX,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59a536f8264ec53ac56a330375dec7b5ad15ed62 | 7,399 | py | Python | core/data_import.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 27 | 2019-10-31T15:16:13.000Z | 2022-03-29T03:56:57.000Z | core/data_import.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 4 | 2020-03-25T14:18:04.000Z | 2022-02-10T00:34:58.000Z | core/data_import.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 7 | 2020-02-23T22:12:37.000Z | 2021-12-08T20:14:41.000Z | """ Contains classes and methods to process the VRM data and convert it to the format as required by the 3D CNN model"""
#from numba import cuda
if (__name__=="__main__"):
#Importing Datafiles
print('Function for importing and preprocessing Cloud-of-Point Data')
| 31.892241 | 219 | 0.747263 | """ Contains classes and methods to process the VRM data and convert it to the format as required by the 3D CNN model"""
import pandas as pd
import numpy as np
from tqdm import tqdm
#from numba import cuda
class GetTrainData():
"""GetTrainData Class (No initialization parameter)
"""
def data_import(self,file_nam... | 0 | 0 | 0 | 7,046 | 0 | 0 | 0 | -5 | 90 |
da2fc8d3d795c85e1f6f6af22c1a20a44091e67b | 175 | py | Python | Informatik1/Finals Prep/HS20/6 solutions/1_warmup/07_recrusive_join/solution.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 8 | 2021-11-21T10:02:08.000Z | 2022-03-15T21:02:02.000Z | Informatik1/Finals Prep/HS20/6 solutions/1_warmup/07_recrusive_join/solution.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | null | null | null | Informatik1/Finals Prep/HS20/6 solutions/1_warmup/07_recrusive_join/solution.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 3 | 2021-11-19T18:52:56.000Z | 2022-02-27T15:45:59.000Z | #!/usr/bin/env python3
| 21.875 | 64 | 0.645714 | #!/usr/bin/env python3
def recursive_join(delim, values):
if len(values) == 1:
return values[0]
return values[0] + delim + recursive_join(delim, values[1:])
| 0 | 0 | 0 | 0 | 0 | 128 | 0 | 0 | 23 |
d01a8008bbc378f8154e0b0c334cbfd65e7e704a | 1,921 | py | Python | LogAnomaly/data/hdfs/gen_train_data.py | Nono17/AIOPS-Anomaly-Detection | 1bfc49ccf1c1c852a45a8e4606a9a73550184005 | [
"Apache-2.0"
] | 245 | 2020-03-27T08:29:17.000Z | 2022-03-31T07:52:58.000Z | LogAnomaly/data/hdfs/gen_train_data.py | Nono17/AIOPS-Anomaly-Detection | 1bfc49ccf1c1c852a45a8e4606a9a73550184005 | [
"Apache-2.0"
] | 32 | 2020-04-15T08:01:04.000Z | 2022-02-28T18:40:45.000Z | LogAnomaly/data/hdfs/gen_train_data.py | Nono17/AIOPS-Anomaly-Detection | 1bfc49ccf1c1c852a45a8e4606a9a73550184005 | [
"Apache-2.0"
] | 70 | 2020-04-12T04:51:53.000Z | 2022-02-24T08:09:40.000Z | import random
from random import shuffle
from pandas.core.frame import DataFrame
hdfs_train = data_read('data/hdfs_train')
hdfs_test_normal = data_read('data/hdfs_test_normal')
hdfs_test_abnormal = data_read('data/hdfs_test_abnormal')
hdfs_train.extend(hdfs_test_normal)
normal_all = hdfs_train
abnormal ... | 27.056338 | 73 | 0.687663 | import os
import random
from random import shuffle
import pandas as pd
from pandas.core.frame import DataFrame
def data_read(filepath):
fp = open(filepath, "r")
datas = [] # 存储处理后的数据
lines = fp.readlines() # 读取整个文件数据
i = 0 # 为一行数据
for line in lines:
row = line.strip()
... | 105 | 0 | 0 | 0 | 0 | 281 | 0 | -14 | 73 |
ae2ced1ca71d1a4d076511ee0ef80ad2a1b7dc41 | 1,048 | py | Python | dataworkspace/dataworkspace/apps/applications/urls.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 1 | 2019-06-10T08:22:56.000Z | 2019-06-10T08:22:56.000Z | dataworkspace/dataworkspace/apps/applications/urls.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 2 | 2019-05-17T13:10:42.000Z | 2019-06-17T10:48:46.000Z | dataworkspace/dataworkspace/apps/applications/urls.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | null | null | null | from django.urls import path
from dataworkspace.apps.accounts.utils import login_required
from dataworkspace.apps.applications.views import (application_spawning_html_view, application_running_html_view, tools_html_view, quicksight_start_polling_sync_and_redirect, UserToolSizeConfigurationView)
urlpatterns = [
pa... | 32.75 | 87 | 0.735687 | from django.urls import path
from dataworkspace.apps.accounts.utils import login_required
from dataworkspace.apps.applications.views import (
application_spawning_html_view,
application_running_html_view,
tools_html_view,
quicksight_start_polling_sync_and_redirect,
UserToolSizeConfigurationView,
)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0 |
b5f886cc791c647788e469a8ff54bb5968e79bf6 | 1,011 | py | Python | python/python-client-generated/test/test_user_api.py | littleflute/swagger-samples | 821ddd34ed9c7cfd088aa1e83c47d1e086851a81 | [
"Apache-2.0"
] | null | null | null | python/python-client-generated/test/test_user_api.py | littleflute/swagger-samples | 821ddd34ed9c7cfd088aa1e83c47d1e086851a81 | [
"Apache-2.0"
] | null | null | null | python/python-client-generated/test/test_user_api.py | littleflute/swagger-samples | 821ddd34ed9c7cfd088aa1e83c47d1e086851a81 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
cccc-praying-api
The API for CCCC Praying project # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
if __name__ == '__main__':
unittest.main()
| 18.722222 | 68 | 0.631058 | # coding: utf-8
"""
cccc-praying-api
The API for CCCC Praying project # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.api.user_api im... | 0 | 0 | 0 | 546 | 0 | 0 | 0 | 49 | 104 |
de5e3f8d8d85e116720c99944793fb044f982a18 | 3,501 | py | Python | lib/p5/sketch.py | croach/p5.py | edbaecd093a93d856221bc2ddad46a4165e2b277 | [
"MIT"
] | 2 | 2017-08-28T16:11:20.000Z | 2017-12-26T21:43:56.000Z | lib/p5/sketch.py | croach/p5.py | edbaecd093a93d856221bc2ddad46a4165e2b277 | [
"MIT"
] | null | null | null | lib/p5/sketch.py | croach/p5.py | edbaecd093a93d856221bc2ddad46a4165e2b277 | [
"MIT"
] | null | null | null |
from .utils import processing_func_name
def processing_function(func):
"""Decorator for turning Sketch methods into Processing functions.
Marks the function it's decorating as a processing function by camel
casing the name of the function (to follow Processing naming conventions)
and attaching the n... | 26.725191 | 78 | 0.620394 | from functools import wraps
from multiprocessing import Process
import webbrowser
from .utils import processing_func_name
def processing_function(func):
"""Decorator for turning Sketch methods into Processing functions.
Marks the function it's decorating as a processing function by camel
casing the name... | 0 | 1,271 | 0 | 1,124 | 0 | 0 | 0 | 16 | 115 |
b04e4aa54bdade7d154437062ba2149f23d26f82 | 980 | py | Python | app.py | sem-onyalo/dnn-training-monitoring-flask | 6a81e06a6871b0d6e890f9fd92f4ab79ac8ee639 | [
"MIT"
] | null | null | null | app.py | sem-onyalo/dnn-training-monitoring-flask | 6a81e06a6871b0d6e890f9fd92f4ab79ac8ee639 | [
"MIT"
] | null | null | null | app.py | sem-onyalo/dnn-training-monitoring-flask | 6a81e06a6871b0d6e890f9fd92f4ab79ac8ee639 | [
"MIT"
] | null | null | null |
from app import init_app
from common.config import Config
if __name__ == "__main__":
args = get_runtime_args()
config = Config(args)
app = init_app(config)
app.run(debug=config.debug, host=config.host, port=config.port)
| 46.666667 | 131 | 0.697959 | import argparse
from app import init_app
from common.config import Config
def get_runtime_args():
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--debug", type=bool, default=True, help="Is debug mode")
parser.add_argument("-i", "--host_ip", type=str, default="0.0.0.0", help="The host IP")
... | 0 | 0 | 0 | 0 | 0 | 703 | 0 | -6 | 45 |
ede88b48470bdfb48b0ca9b43dda0fa3d53f22f2 | 623 | py | Python | src/my_project/easy_problems/from201to250/reverse_only_letters.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null | src/my_project/easy_problems/from201to250/reverse_only_letters.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | 1 | 2021-09-22T12:26:14.000Z | 2021-09-22T12:26:14.000Z | src/my_project/easy_problems/from201to250/reverse_only_letters.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null |
solution = Solution()
print(solution.reverseOnlyLetters(s = "ab-cd"))
print(solution.reverseOnlyLetters(s = "a-bC-dEf-ghIj"))
print(solution.reverseOnlyLetters(s = "Test1ng-Leet=code-Q!"))
| 20.766667 | 69 | 0.540931 | from typing import List
class Solution:
def reverseOnlyLetters(self, s: str) -> str:
n = len(s)
temp = {i:s[i] for i in range(len(s)) if not s[i].isalpha()}
s = [s[i] for i in range(len(s)) if s[i].isalpha()]
s = list(reversed(s))
for i in range(0,n):
... | 0 | 0 | 0 | 373 | 0 | 0 | 0 | 2 | 46 |
60d2204142fce6c6e16cb461cb636097cafa160b | 5,578 | py | Python | tasks/worker_http.py | ankitdbst/staytuned-api | a045f47d3701cff0d0b4805ba5243697bda34f67 | [
"CC0-1.0"
] | null | null | null | tasks/worker_http.py | ankitdbst/staytuned-api | a045f47d3701cff0d0b4805ba5243697bda34f67 | [
"CC0-1.0"
] | null | null | null | tasks/worker_http.py | ankitdbst/staytuned-api | a045f47d3701cff0d0b4805ba5243697bda34f67 | [
"CC0-1.0"
] | null | null | null | from gevent import monkey
monkey.patch_all()
import copy_reg
import types
SLEEP_INTERVAL = 5
# We need to pickle instance methods of the Worker Class below so this snippet does that
# Refer: http://stackoverflow.com/questions/1816958/cant-pickle-type-instancemethod-
# when-using-pythons-multiprocessing-pool-ma
# S... | 29.670213 | 111 | 0.619398 | from gevent import monkey
monkey.patch_all()
import time
import logging
import copy_reg
import types
import grequests
import requests
from multiprocessing import JoinableQueue, Process
SLEEP_INTERVAL = 5
# We need to pickle instance methods of the Worker Class below so this snippet does that
# Refer: http://stack... | 0 | 0 | 0 | 4,611 | 0 | 359 | 0 | 1 | 204 |
6934d314d8dca51e2791617e709df90235758f61 | 8,904 | py | Python | pg_travel/deeprm/slow_down_cdf.py | Panlichen/pg_travel | 41ec6666a945e34dc974f1206c0e620704e75a06 | [
"MIT"
] | null | null | null | pg_travel/deeprm/slow_down_cdf.py | Panlichen/pg_travel | 41ec6666a945e34dc974f1206c0e620704e75a06 | [
"MIT"
] | null | null | null | pg_travel/deeprm/slow_down_cdf.py | Panlichen/pg_travel | 41ec6666a945e34dc974f1206c0e620704e75a06 | [
"MIT"
] | 1 | 2019-05-05T15:18:30.000Z | 2019-05-05T15:18:30.000Z | import torch.optim as optim
import numpy as np
import matplotlib
matplotlib.use('Agg')
import sys
sys.path.append('../..')
def discount(x, gamma):
"""
Given vector x, computes a vector y such that
y[i] = x[i] + gamma * x[i + 1] + gamma ^ 2 * x[i + 2] + ...
:param x:
:param gamma:
... | 36.342857 | 119 | 0.600292 | import torch
import torch.optim as optim
import argparse
import numpy as np
import time
from tensorboardX import SummaryWriter
from collections import deque
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
sys.path.append('../..')
from pg_travel.deeprm import model
fro... | 0 | 0 | 0 | 0 | 0 | 7,635 | 0 | 191 | 353 |
212ca646075e7c54abf11c259528a4a3b9538f2d | 8,833 | py | Python | score.py | paulo1er/PST-Toeic | 6ffe02bc3cea54aab2db2c8f3cde5a153417cf51 | [
"MIT"
] | null | null | null | score.py | paulo1er/PST-Toeic | 6ffe02bc3cea54aab2db2c8f3cde5a153417cf51 | [
"MIT"
] | 1 | 2018-12-18T16:59:35.000Z | 2018-12-18T17:03:25.000Z | score.py | paulo1er/PST-Toeic | 6ffe02bc3cea54aab2db2c8f3cde5a153417cf51 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 18 18:07:30 2019
@author: Guillaume
"""
"""
This file contains functions to calculate the score of the students and the statistics for the group
"""
# calculates the statistics for the class
# given the correction, marks every answer of ONE s... | 64.474453 | 1,015 | 0.422733 | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 18 18:07:30 2019
@author: Guillaume
"""
"""
This file contains functions to calculate the score of the students and the statistics for the group
"""
def average(lst):
return sum(lst) / len(lst)
# calculates the statistics for the class
def ... | 4 | 0 | 0 | 0 | 0 | 3,858 | 0 | 0 | 95 |
a84efaa4d645aa5ac7f703e4461b86fd89508d51 | 1,002 | py | Python | Day08/Ex03.py | king04aman/100daysofcode | 7b037de72809a19b5ac1e813626903e14d19f848 | [
"MIT"
] | null | null | null | Day08/Ex03.py | king04aman/100daysofcode | 7b037de72809a19b5ac1e813626903e14d19f848 | [
"MIT"
] | null | null | null | Day08/Ex03.py | king04aman/100daysofcode | 7b037de72809a19b5ac1e813626903e14d19f848 | [
"MIT"
] | null | null | null | alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
direction = input("Type 'encode' to encrypt, type 'decode' to decrypt : \n")
text = input("Ty... | 34.551724 | 221 | 0.536926 | alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
def encode(text,shift):
encoded_result = ""
for x in text:
temp = (alphabet... | 0 | 0 | 0 | 0 | 0 | 382 | 0 | 0 | 50 |
b8cd8942b4bcbae247d1bc13e1a51fe7df63b06a | 2,444 | py | Python | mi/35.py | 1005281342/learn | c9d1e2e256842d9b4846c4870ac72e83d172b20e | [
"Apache-2.0"
] | 1 | 2018-11-29T01:01:32.000Z | 2018-11-29T01:01:32.000Z | mi/35.py | 1005281342/learn | c9d1e2e256842d9b4846c4870ac72e83d172b20e | [
"Apache-2.0"
] | null | null | null | mi/35.py | 1005281342/learn | c9d1e2e256842d9b4846c4870ac72e83d172b20e | [
"Apache-2.0"
] | null | null | null | """
M N
7 3 8
1 1 5
1 2 4
1 3 3
2 2 3
2 5 0
3 4 0
6 1 0
7 0 0
7 0 00 7 0 0 0 7
M N(,)M N MN1 <= MN <= 100
K
7,3
8
"""
# import
"""
@param string line
@return string
"""
aa = solution("7 3")
print(aa)
| 20.032787 | 71 | 0.407938 | """
将 M 个同样的糖果放在 N 个同样的篮子里,允许有的篮子空着不放,共有多少种不同的分法?
比如,把 7 个糖果放在 3 个篮子里,共有 8 种分法(每个数表示篮子中放的糖果数,数的个数为篮子数):
1 1 5
1 2 4
1 3 3
2 2 3
2 5 0
3 4 0
6 1 0
7 0 0
注意:相同的分布,顺序不同也只算作一种分法,如 7 0 0、0 7 0 和 0 0 7 只算作一种。
输入包含二个正整数 M 和 N,以(,)分开,M 表示有几个同样的糖果,N 表... | 648 | 0 | 0 | 0 | 0 | 1,888 | 0 | 0 | 23 |
13a4b326a2db70513784918e5aed6686d41bfb04 | 4,547 | py | Python | MPI/MPI_Example/mpitest.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | 4 | 2020-09-16T10:45:15.000Z | 2021-05-06T04:34:32.000Z | MPI/MPI_Example/mpitest.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | null | null | null | MPI/MPI_Example/mpitest.py | petebunting/rsgis_scripts | b35b0403cdfad6c63824d4f8c038f190cdb5978d | [
"MIT"
] | 2 | 2020-07-06T18:03:40.000Z | 2022-02-15T12:45:34.000Z | from mpi4py import MPI
import numpy
from arcsilib.arcsiutils import ARCSIEnum
# Define MPI message tags
mpiTags = ARCSIEnum('READY', 'DONE', 'EXIT', 'START')
arcsiStages = ARCSIEnum('ARCSIPART1', 'ARCSIPART2', 'ARCSIPART3', 'ARCSIPART4')
# Initializations and preliminaries
mpiComm = MPI.COMM_WORLD # get MPI commu... | 36.669355 | 151 | 0.585441 | from mpi4py import MPI
import argparse
import numpy
from arcsilib.arcsiutils import ARCSIEnum
import sys
# Define MPI message tags
mpiTags = ARCSIEnum('READY', 'DONE', 'EXIT', 'START')
arcsiStages = ARCSIEnum('ARCSIPART1', 'ARCSIPART2', 'ARCSIPART3', 'ARCSIPART4')
# Initializations and preliminaries
mpiComm = MPI.CO... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -17 | 44 |
b33aaa6e9383980fec609a57b1c1e52161cdc5dd | 3,129 | py | Python | commands/util.py | tschoonj/jep | 639f6cbe512b5ce4b51412564dba8db5bbbf1e3b | [
"Zlib"
] | 698 | 2017-08-08T22:33:29.000Z | 2022-03-31T20:28:24.000Z | commands/util.py | tschoonj/jep | 639f6cbe512b5ce4b51412564dba8db5bbbf1e3b | [
"Zlib"
] | 305 | 2017-08-14T19:10:57.000Z | 2022-03-31T17:27:27.000Z | commands/util.py | tschoonj/jep | 639f6cbe512b5ce4b51412564dba8db5bbbf1e3b | [
"Zlib"
] | 117 | 2017-08-13T01:05:51.000Z | 2022-03-11T09:11:00.000Z | from __future__ import print_function
import subprocess
import sys
def shell(command, capture=True):
"""
Run a command on the local system.
This is borrowed from fabric.operations, with simplifications
`local` is simply a convenience wrapper around the use of the builtin
Python ``subproc... | 29.242991 | 80 | 0.674017 | from __future__ import print_function
from collections import namedtuple
from distutils.util import get_platform
import subprocess
import sys
def configure_error(*args, **kw):
print('Error: ', file=sys.stderr)
print(file=sys.stderr, *args, **kw)
sys.exit(1)
def warning(*args):
print(*args, file=sys.... | 0 | 0 | 0 | 338 | 0 | 226 | 0 | 31 | 228 |
2a6338b0b459ddac91b0f9a3e638e71a4b6f56de | 481 | py | Python | solutions/ccc/basketBallScore.py | mrparkonline/py_conditionals | d9420ec8c9a69689d8a87b4232db288d620b22bb | [
"MIT"
] | null | null | null | solutions/ccc/basketBallScore.py | mrparkonline/py_conditionals | d9420ec8c9a69689d8a87b4232db288d620b22bb | [
"MIT"
] | null | null | null | solutions/ccc/basketBallScore.py | mrparkonline/py_conditionals | d9420ec8c9a69689d8a87b4232db288d620b22bb | [
"MIT"
] | null | null | null | # Basketball Scores
# apple vs banana
# input - apples
apple_three = int(input())
apple_two = int(input())
apple_free = int(input())
# input - bananas
banana_three = int(input())
banana_two = int(input())
banana_free = int(input())
apple_total = (apple_three * 3) + (apple_two * 2) + apple_free
banana_total = (banana... | 21.863636 | 66 | 0.679834 | # Basketball Scores
# apple vs banana
# input - apples
apple_three = int(input())
apple_two = int(input())
apple_free = int(input())
# input - bananas
banana_three = int(input())
banana_two = int(input())
banana_free = int(input())
apple_total = (apple_three * 3) + (apple_two * 2) + apple_free
banana_total = (banana... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8762720c6151d6e947b6598ffe68be92042f4521 | 23,397 | py | Python | checkers_py/oneapi_gpu_checker.py | intel/diagnostics-utility | 380166619294e4292621855f7cfd4cc8e39c6123 | [
"BSD-3-Clause"
] | 5 | 2021-12-13T07:35:43.000Z | 2022-01-14T15:36:26.000Z | checkers_py/oneapi_gpu_checker.py | intel/diagnostics-utility | 380166619294e4292621855f7cfd4cc8e39c6123 | [
"BSD-3-Clause"
] | null | null | null | checkers_py/oneapi_gpu_checker.py | intel/diagnostics-utility | 380166619294e4292621855f7cfd4cc8e39c6123 | [
"BSD-3-Clause"
] | null | null | null | # /*******************************************************************************
# Copyright Intel Corporation.
# This software and the related documents are Intel copyrighted materials, and your use of them
# is governed by the express license under which they were provided to you (License).
# Unless the License pro... | 43.979323 | 110 | 0.636022 | # /*******************************************************************************
# Copyright Intel Corporation.
# This software and the related documents are Intel copyrighted materials, and your use of them
# is governed by the express license under which they were provided to you (License).
# Unless the License pro... | 84 | 0 | 0 | 0 | 0 | 21,410 | 0 | 156 | 570 |
c3b7932dfb1ec30577f8044317eefc283dfe1d3c | 10,884 | py | Python | tests/stepwise_function.py | mahitha-raj/stepwise-model-selection | c8efe8ef6ee2e2fda74c6087e4a216a4e29207ba | [
"MIT"
] | 1 | 2021-11-23T21:01:10.000Z | 2021-11-23T21:01:10.000Z | tests/stepwise_function.py | mahitha-raj/stepwise-model-selection | c8efe8ef6ee2e2fda74c6087e4a216a4e29207ba | [
"MIT"
] | null | null | null | tests/stepwise_function.py | mahitha-raj/stepwise-model-selection | c8efe8ef6ee2e2fda74c6087e4a216a4e29207ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)
# **************************************************************************
| 36.401338 | 87 | 0.450662 | #!/usr/bin/env python3
import sys
import warnings
import pandas as pd
import statsmodels.api as sm
from copy import deepcopy # Used to create sentiment word dictionary
warnings.simplefilter(action="ignore", category=FutureWarning)
class StepWise(object):
def __init__(
self,
df,
yname,... | 0 | 0 | 0 | 10,545 | 0 | 0 | 0 | -2 | 157 |
5e6f6c2d1178fce99b71b834e46ec4dfe9a76541 | 191 | py | Python | reeds/data/ene_ana_libs/__init__.py | candidechamp/reeds | 601e4327132f80d7e7fd90d47eecc85cecc0fdd8 | [
"MIT"
] | 3 | 2021-06-18T03:27:17.000Z | 2021-11-15T13:55:51.000Z | reeds/data/ene_ana_libs/__init__.py | candidechamp/reeds | 601e4327132f80d7e7fd90d47eecc85cecc0fdd8 | [
"MIT"
] | 11 | 2021-06-25T08:53:37.000Z | 2021-10-19T10:17:58.000Z | reeds/data/ene_ana_libs/__init__.py | candidechamp/reeds | 601e4327132f80d7e7fd90d47eecc85cecc0fdd8 | [
"MIT"
] | 1 | 2021-09-16T12:18:17.000Z | 2021-09-16T12:18:17.000Z | import os
template_dir = os.path.dirname(__file__)
ene_ana_old_path = template_dir + "/ene_ana_REEDS_7state.md++.lib"
ene_ana_lib_path = template_dir + "/new_ene_ana_REEDS_9state.md++.lib"
| 27.285714 | 70 | 0.790576 | import os
template_dir = os.path.dirname(__file__)
ene_ana_old_path = template_dir + "/ene_ana_REEDS_7state.md++.lib"
ene_ana_lib_path = template_dir + "/new_ene_ana_REEDS_9state.md++.lib"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4621fe85aaa1522d841667721a7829e1524b1024 | 519 | py | Python | chap6/demoDic.py | xhal/study-python | bd92c1a73090cbf7cfbcb252ee4f69c9a4acc7ef | [
"MIT"
] | null | null | null | chap6/demoDic.py | xhal/study-python | bd92c1a73090cbf7cfbcb252ee4f69c9a4acc7ef | [
"MIT"
] | null | null | null | chap6/demoDic.py | xhal/study-python | bd92c1a73090cbf7cfbcb252ee4f69c9a4acc7ef | [
"MIT"
] | null | null | null | # coding:utf-8
# : All rights Reserved, Designed By XHal.cc
# : Hal
# : 2021/2/4 22:08
# : V1.0.0
# : -
# 1{} javascript Object
#
dic = {}
print(dic)
# :
dic = {'a': 'aa', 'b': 3}
print(dic, id(dic), type(dic))
# 2
dic1 = dict({'a': 'aa', 'b': 3})
print(dic1, id(dic1), type(dic1))
print(dic == dic1)
print(dic... | 17.896552 | 48 | 0.612717 | # coding:utf-8
# 版权信息: All rights Reserved, Designed By XHal.cc
# 代码作者: Hal
# 创建时间: 2021/2/4 22:08
# 文件版本: V1.0.0
# 功能描述: 字典对象 - 基础使用
# 创建方式1:{} 花括号,与javascript Object 一样
# 空字典
dic = {}
print(dic)
# 键: 值
dic = {'a': 'aa', 'b': 3}
print(dic, id(dic), type(dic))
# 创建方式2: 内置函数
dic1 = dict({'a': 'aa', 'b': 3})
print(dic... | 243 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a72a3c16ecb5aec4dc943ee5c71870282a029fd | 1,074 | py | Python | handwritten digits/ann mnist v1.py | 1-ARIjitS/ANN-models | a19740ded74850065816719415c18c1812adda13 | [
"MIT"
] | 1 | 2020-09-30T13:20:04.000Z | 2020-09-30T13:20:04.000Z | handwritten digits/ann mnist v1.py | 1-ARIjitS/ANN-models | a19740ded74850065816719415c18c1812adda13 | [
"MIT"
] | 1 | 2020-09-30T13:14:02.000Z | 2020-09-30T17:58:23.000Z | handwritten digits/ann mnist v1.py | 1-ARIjitS/ANN-models | a19740ded74850065816719415c18c1812adda13 | [
"MIT"
] | 1 | 2020-09-30T20:24:09.000Z | 2020-09-30T20:24:09.000Z | # -*- coding: utf-8 -*-
"""ANN MNIST .ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1iKLukhHa0mOTG2BBrKnlJawBK1ZYaEC0
"""
from keras.datasets import mnist
(x_train,y_train),(x_test,y_test)=mnist.load_data()
x_train=x_train.reshape(60000,784)
x... | 23.866667 | 77 | 0.773743 | # -*- coding: utf-8 -*-
"""ANN MNIST .ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1iKLukhHa0mOTG2BBrKnlJawBK1ZYaEC0
"""
import keras
from keras.datasets import mnist
(x_train,y_train),(x_test,y_test)=mnist.load_data()
x_train=x_train.reshap... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 23 |
9a62f079ef3bd0b0f786e14aae65d918cd16b46e | 2,475 | py | Python | runner1c/commands/dump_epf.py | vakulenkoalex/runner-1c | 25b29f794085fb638808778dd0792fb98787543d | [
"BSD-2-Clause"
] | null | null | null | runner1c/commands/dump_epf.py | vakulenkoalex/runner-1c | 25b29f794085fb638808778dd0792fb98787543d | [
"BSD-2-Clause"
] | 6 | 2018-01-10T11:43:27.000Z | 2018-01-12T12:26:25.000Z | runner1c/commands/dump_epf.py | vakulenkoalex/runner-1c | 25b29f794085fb638808778dd0792fb98787543d | [
"BSD-2-Clause"
] | null | null | null | import runner1c.common as common
import runner1c.exit_code as exit_code
| 34.859155 | 112 | 0.645657 | import distutils.dir_util as copy_tree
import glob
import os
import shutil
import tempfile
import runner1c
import runner1c.common as common
import runner1c.exit_code as exit_code
class DumpEpfParser(runner1c.parser.Parser):
@property
def name(self):
return 'dump_epf'
@property
def descriptio... | 274 | 72 | 0 | 1,848 | 0 | 166 | 0 | -25 | 202 |
8fda8032e0b5243accc1e7f26502733451ec09bc | 1,575 | py | Python | stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py | stac-utils/stac-fastapi-nosql | 0f4cf9a91f9bfd78f215895b6b848efbb631db97 | [
"MIT"
] | 6 | 2022-01-26T14:34:52.000Z | 2022-02-22T00:09:23.000Z | stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py | stac-utils/stac-fastapi-elasticsearch | 0f4cf9a91f9bfd78f215895b6b848efbb631db97 | [
"MIT"
] | 46 | 2022-02-22T21:22:17.000Z | 2022-03-25T15:20:39.000Z | stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py | stac-utils/stac-fastapi-nosql | 0f4cf9a91f9bfd78f215895b6b848efbb631db97 | [
"MIT"
] | null | null | null | """API configuration."""
from typing import Set
_forbidden_fields: Set[str] = {"type"}
| 27.631579 | 87 | 0.644444 | """API configuration."""
import os
from typing import Any, Dict, Set
from elasticsearch import AsyncElasticsearch, Elasticsearch # type: ignore
from stac_fastapi.types.config import ApiSettings
def _es_config() -> Dict[str, Any]:
config = {
"hosts": [{"host": os.getenv("ES_HOST"), "port": os.getenv("ES_... | 0 | 210 | 0 | 407 | 0 | 649 | 0 | 65 | 152 |
45e35317858d5b5d13a4638d475764426c05c951 | 18,563 | py | Python | muffnn/fm/fm_classifier.py | civisanalytics/muffnn | 0ec92ddb5a0158a3e46e68974ff958101e3b874d | [
"BSD-3-Clause"
] | 53 | 2016-08-26T18:28:03.000Z | 2021-09-26T08:44:58.000Z | muffnn/fm/fm_classifier.py | civisanalytics/muffnn | 0ec92ddb5a0158a3e46e68974ff958101e3b874d | [
"BSD-3-Clause"
] | 80 | 2016-08-29T19:08:41.000Z | 2020-12-01T16:14:11.000Z | muffnn/fm/fm_classifier.py | civisanalytics/muffnn | 0ec92ddb5a0158a3e46e68974ff958101e3b874d | [
"BSD-3-Clause"
] | 25 | 2016-08-29T18:48:43.000Z | 2021-09-26T08:45:18.000Z | import logging
_LOGGER = logging.getLogger(__name__)
| 38.353306 | 78 | 0.571459 | import logging
import re
import scipy.sparse as sp
import numpy as np
import tensorflow as tf
from sklearn.base import ClassifierMixin, BaseEstimator
from sklearn.utils import check_X_y, check_array, check_random_state
from sklearn.utils.multiclass import type_of_target
from sklearn.exceptions import NotFittedError
f... | 0 | 0 | 0 | 18,093 | 0 | 0 | 0 | 168 | 246 |
11ae9044c094f2339fd9b184ab021204945c12f9 | 2,069 | bzl | Python | bazel/go_dependencies.bzl | loafoe/fhir | 513af7448762fc277ae0a8d7b12d18fc073b41d1 | [
"Apache-2.0"
] | null | null | null | bazel/go_dependencies.bzl | loafoe/fhir | 513af7448762fc277ae0a8d7b12d18fc073b41d1 | [
"Apache-2.0"
] | 2 | 2020-07-24T14:20:45.000Z | 2020-07-24T19:43:52.000Z | bazel/go_dependencies.bzl | loafoe/fhir | 513af7448762fc277ae0a8d7b12d18fc073b41d1 | [
"Apache-2.0"
] | 1 | 2020-07-10T15:03:45.000Z | 2020-07-10T15:03:45.000Z | """ Function for loading go dependencies for the go jsonformat library"""
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
def fhir_go_dependencies():
""" Loads dependencies of the Go FHIR library"... | 29.140845 | 90 | 0.649589 | """ Function for loading go dependencies for the go jsonformat library"""
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
def fhir_go_dependencies():
""" Loads dependencies of the Go FHIR library"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
574b9139caf0bbf3e8c634061691e659462237b4 | 3,677 | py | Python | site/_build/jupyter_execute/notebooks/02-intro-python/03-null-values.py | rpi-techfundamentals/website_fall_2020 | b85e5c297954bcaae565a8d25a18d2904d40f543 | [
"MIT"
] | 2 | 2020-10-18T23:05:09.000Z | 2021-11-14T08:09:11.000Z | site/_build/jupyter_execute/notebooks/02-intro-python/03-null-values.py | rpi-techfundamentals/website_fall_2020 | b85e5c297954bcaae565a8d25a18d2904d40f543 | [
"MIT"
] | 2 | 2020-12-31T14:33:02.000Z | 2020-12-31T14:38:26.000Z | site/_build/jupyter_execute/notebooks/02-intro-python/03-null-values.py | rpi-techfundamentals/website_fall_2020 | b85e5c297954bcaae565a8d25a18d2904d40f543 | [
"MIT"
] | 3 | 2020-08-31T21:58:58.000Z | 2020-09-30T02:55:08.000Z | [](http://introml.analyticsdojo.com)
<center><h1>Introduction to Python - Null Values</h1></center>
<center><h3><a href = 'http://introml.analyticsdojo.com'>introml.analyticsdojo.com</a></h3></center>
... | 34.364486 | 211 | 0.762578 | [](http://introml.analyticsdojo.com)
<center><h1>Introduction to Python - Null Values</h1></center>
<center><h3><a href = 'http://introml.analyticsdojo.com'>introml.analyticsdojo.com</a></h3></center>
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53eff4dbaed670e34c30a585fe6580f2312ac4a5 | 7,196 | py | Python | py_kit/misc.py | SystemLight/py-kit | 54d68fe66225341ef5f5e9b3c5b9e4a12d98cc1b | [
"MIT"
] | null | null | null | py_kit/misc.py | SystemLight/py-kit | 54d68fe66225341ef5f5e9b3c5b9e4a12d98cc1b | [
"MIT"
] | null | null | null | py_kit/misc.py | SystemLight/py-kit | 54d68fe66225341ef5f5e9b3c5b9e4a12d98cc1b | [
"MIT"
] | null | null | null | from typing import List, Dict, Union, Optional, Callable, TypeVar, Iterable, Tuple
def find_key(obj: Union[Dict, List], key: str):
"""
a.b.0
::
{'a':{'b':['val']}}
val
:param obj: key
:param key: key
:return:
"""
key_list = key.split('.')
for k in key_list:
... | 23.986667 | 96 | 0.575181 | import copy
import json
import threading
from collections import defaultdict
from typing import List, Dict, Union, Optional, Callable, TypeVar, Iterable, Tuple
def omit(obj, fields):
new_obj = copy.copy(obj)
for key in fields:
try:
del new_obj[key]
except KeyError:
cont... | 2,547 | 0 | 0 | 3,394 | 0 | 952 | 0 | -11 | 257 |
09fde9e7e525a3d0af056afd2a46aa0cfbb4119d | 18,500 | py | Python | wavelength/wavelength.py | simontorres/experimentos | 2bf5012dc9869f1e74eedae933a4ec46f47c1173 | [
"BSD-3-Clause"
] | null | null | null | wavelength/wavelength.py | simontorres/experimentos | 2bf5012dc9869f1e74eedae933a4ec46f47c1173 | [
"BSD-3-Clause"
] | null | null | null | wavelength/wavelength.py | simontorres/experimentos | 2bf5012dc9869f1e74eedae933a4ec46f47c1173 | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.append('/user/simon/development/soar/goodman')
if __name__ == '__main__':
# _file = 'data/fits/goodman_comp_400M2_GG455_HgArNe.fits'
_file = 'data/fits/goodman_comp_400M2_GG455_Ne.fits'
wav = WavelengthCalibration()
wav(spectrum=_file)
| 38.381743 | 129 | 0.581838 | from astropy import units as u
from astropy.modeling import models, fitting
from astropy.stats import sigma_clip
from ccdproc import CCDData
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import re
import sys
sys.path.append('/user/simon/development/soar/goo... | 0 | 2,995 | 0 | 14,911 | 0 | 0 | 0 | 48 | 267 |
36dfd15d3a55a85b8242be98fd3b7ff63f02cbf8 | 1,632 | py | Python | gpytorch/mlls/exact_marginal_log_likelihood.py | yushangdi/gpytorch | 3234046ecb672965af8765d47eb016f85b729bb0 | [
"MIT"
] | 2 | 2019-04-19T00:35:49.000Z | 2019-04-19T02:51:49.000Z | gpytorch/mlls/exact_marginal_log_likelihood.py | yushangdi/gpytorch | 3234046ecb672965af8765d47eb016f85b729bb0 | [
"MIT"
] | null | null | null | gpytorch/mlls/exact_marginal_log_likelihood.py | yushangdi/gpytorch | 3234046ecb672965af8765d47eb016f85b729bb0 | [
"MIT"
] | 1 | 2019-04-19T00:42:35.000Z | 2019-04-19T00:42:35.000Z | #!/usr/bin/env python3
| 37.090909 | 106 | 0.683211 | #!/usr/bin/env python3
import torch
from .marginal_log_likelihood import MarginalLogLikelihood
from ..likelihoods import _GaussianLikelihoodBase
from ..distributions import MultivariateNormal
class ExactMarginalLogLikelihood(MarginalLogLikelihood):
def __init__(self, likelihood, model):
"""
A spe... | 0 | 0 | 0 | 1,415 | 0 | 0 | 0 | 81 | 112 |
7febfe90bd6ff0ef95c6902fc959302c1c33f1ca | 1,962 | py | Python | blossom/tree.py | refraction-ray/blossom_alg | d1fc1cb724091a32e2a34ab02fac1d4c6f94d0b1 | [
"MIT"
] | null | null | null | blossom/tree.py | refraction-ray/blossom_alg | d1fc1cb724091a32e2a34ab02fac1d4c6f94d0b1 | [
"MIT"
] | null | null | null | blossom/tree.py | refraction-ray/blossom_alg | d1fc1cb724091a32e2a34ab02fac1d4c6f94d0b1 | [
"MIT"
] | 2 | 2019-11-16T01:40:12.000Z | 2020-07-15T18:10:31.000Z | import logging
logger = logging.getLogger('blossom') | 28.434783 | 66 | 0.536697 | import logging
logger = logging.getLogger('blossom')
class Tree():
def __init__(self, name='root', children=None):
self.name = name
self.parent = None
self.children = []
if children is not None:
for child in children:
self.add_child(child)
def __repr_... | 0 | 0 | 0 | 1,887 | 0 | 0 | 0 | 0 | 23 |
cf1b002f5d22d171900b16631b2d1b595dd4e080 | 8,389 | py | Python | pyccel/stdlib/internal/openmp.py | pyccel/pyccel | 68afff1c19535f19fea0ad714ad68ffe5cc4e3c9 | [
"MIT"
] | 206 | 2018-06-28T00:28:47.000Z | 2022-03-29T05:17:03.000Z | pyccel/stdlib/internal/openmp.py | pyccel/pyccel | 68afff1c19535f19fea0ad714ad68ffe5cc4e3c9 | [
"MIT"
] | 670 | 2018-07-23T11:02:24.000Z | 2022-03-30T07:28:05.000Z | pyccel/stdlib/internal/openmp.py | pyccel/pyccel | 68afff1c19535f19fea0ad714ad68ffe5cc4e3c9 | [
"MIT"
] | 19 | 2019-09-19T06:01:00.000Z | 2022-03-29T05:17:06.000Z | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#----------------... | 26.052795 | 92 | 0.669567 | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#----------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
740cc5945878a86cceca25446be7fdce8918f520 | 124 | py | Python | descriptors/__init__.py | xuzhiyi1998/fluentpython | 218311afb6b41d2668a1baa94dcee0ba7f4764a4 | [
"MIT"
] | null | null | null | descriptors/__init__.py | xuzhiyi1998/fluentpython | 218311afb6b41d2668a1baa94dcee0ba7f4764a4 | [
"MIT"
] | null | null | null | descriptors/__init__.py | xuzhiyi1998/fluentpython | 218311afb6b41d2668a1baa94dcee0ba7f4764a4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Project: fluentpython
# @Author: xuzhiyi
# @File name: __init__.py
# @Create time: 2021/8/1 20:20 | 24.8 | 30 | 0.645161 | # -*- coding: utf-8 -*-
# @Project: fluentpython
# @Author: xuzhiyi
# @File name: __init__.py
# @Create time: 2021/8/1 20:20 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
011deac3b859a22453e60f548fb3c50ae7fa2e4f | 58,206 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/vmware/plugins/modules/vmware_guest_disk.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 7 | 2021-11-16T04:05:42.000Z | 2022-02-19T21:14:29.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/vmware/plugins/modules/vmware_guest_disk.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/vmware/plugins/modules/vmware_guest_disk.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2022-03-01T05:43:07.000Z | 2022-03-01T05:43:07.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | 48.505 | 159 | 0.563258 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | 0 | 3,967 | 0 | 32,321 | 0 | 3,891 | 0 | 290 | 206 |
e2399a2eecaeb4248ac9ebba05a3cb28ae2aad76 | 1,729 | py | Python | src/tests/helpers.py | tipresias/augury | eaae2a7d27ee8c39796231ec55e0e2a82b59d60c | [
"MIT"
] | 4 | 2019-12-05T06:02:08.000Z | 2022-02-01T23:49:23.000Z | src/tests/helpers.py | tipresias/augury | eaae2a7d27ee8c39796231ec55e0e2a82b59d60c | [
"MIT"
] | 143 | 2019-07-30T11:06:56.000Z | 2022-03-14T19:02:39.000Z | src/tests/helpers.py | tipresias/augury | eaae2a7d27ee8c39796231ec55e0e2a82b59d60c | [
"MIT"
] | 3 | 2019-12-30T22:57:41.000Z | 2020-12-31T02:39:07.000Z | """Functions and classes to deduplicate and simplify test code."""
| 33.901961 | 87 | 0.626374 | """Functions and classes to deduplicate and simplify test code."""
class ColumnAssertionMixin:
"""Mixin class for making columns assertions in tests for Kedro nodes."""
def _assert_column_added(
self, column_names=[], valid_data_frame=None, feature_function=None, col_diff=1
):
for column... | 0 | 0 | 0 | 1,638 | 0 | 0 | 0 | 0 | 23 |
4cfe0a794f29fc15288f03da12bf854e26658753 | 3,212 | py | Python | apps/files/images.py | rmdes/tanzawa | d53baa10bd6c217cd18628437a88a43e3bd02b70 | [
"Apache-2.0"
] | 25 | 2021-06-13T03:38:44.000Z | 2022-03-15T15:53:31.000Z | apps/files/images.py | rmdes/tanzawa | d53baa10bd6c217cd18628437a88a43e3bd02b70 | [
"Apache-2.0"
] | 59 | 2021-06-12T23:35:06.000Z | 2022-03-24T21:40:24.000Z | apps/files/images.py | rmdes/tanzawa | d53baa10bd6c217cd18628437a88a43e3bd02b70 | [
"Apache-2.0"
] | null | null | null |
# TODO: Convert this into a class to handle image formatting
| 33.113402 | 86 | 0.657846 | import io
import mimetypes
from pathlib import Path
from typing import Optional, Tuple, Union
from django.core.files.uploadedfile import SimpleUploadedFile
from django.utils.timezone import now
from PIL import Image, ImageOps
from .models import TFile
def rotate_image(image_bytes: io.BytesIO, mime_type: str) -> io.... | 7 | 0 | 0 | 0 | 0 | 2,822 | 0 | 76 | 246 |
b4ad2e5e5b22b24d8fa2765b92a803a47b0f585f | 902 | py | Python | E10_KNMI.py | michielkauwatjoe/DataViz | c590a8c3148e35250a2179844adeb7a2534df585 | [
"MIT"
] | null | null | null | E10_KNMI.py | michielkauwatjoe/DataViz | c590a8c3148e35250a2179844adeb7a2534df585 | [
"MIT"
] | null | null | null | E10_KNMI.py | michielkauwatjoe/DataViz | c590a8c3148e35250a2179844adeb7a2534df585 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# https://knmi.nl/kennis-en-datacentrum/achtergrond/data-ophalen-vanuit-een-script
# https://github.com/EnergieID/KNMI-py
# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
# https://rethinkdb.com/
import knmi
from latlon import Latitude, Longitude
# Pandas Data... | 28.1875 | 82 | 0.702882 | #!/usr/bin/env python3
# https://knmi.nl/kennis-en-datacentrum/achtergrond/data-ophalen-vanuit-een-script
# https://github.com/EnergieID/KNMI-py
# https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html
# https://rethinkdb.com/
import knmi
from latlon import Latitude, Longitude
# Pandas Data... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db66c682d8c0efee24f783af18d113a894f6d75b | 5,507 | py | Python | Setup/Python/Youbot/youbot_3dpointcloud.py | nvecoven/INFO0948-2 | 60db1dcbdb6ef1be243778e2277d0ccfbb74fdbd | [
"CC-BY-4.0"
] | 2 | 2022-02-18T08:11:57.000Z | 2022-02-23T08:16:19.000Z | Setup/Python/Youbot/youbot_3dpointcloud.py | nvecoven/INFO0948-2 | 60db1dcbdb6ef1be243778e2277d0ccfbb74fdbd | [
"CC-BY-4.0"
] | null | null | null | Setup/Python/Youbot/youbot_3dpointcloud.py | nvecoven/INFO0948-2 | 60db1dcbdb6ef1be243778e2277d0ccfbb74fdbd | [
"CC-BY-4.0"
] | 2 | 2021-03-03T15:32:02.000Z | 2021-03-05T15:33:45.000Z | # -*- coding: utf-8 -*-
"""
# youbot Illustrates the V-REP MATLAB bindings, more specifically the way to take a 3D point cloud.
# (C) Copyright Renaud Detry 2013, Thibaut Cuvelier 2017.
# Distributed under the GNU General Public License.
# (See http://www.gnu.org/copyleft/gpl.html)
"""
# VREP
import sim as vrep
# Use... | 41.406015 | 114 | 0.727438 | # -*- coding: utf-8 -*-
"""
# youbot Illustrates the V-REP MATLAB bindings, more specifically the way to take a 3D point cloud.
# (C) Copyright Renaud Detry 2013, Thibaut Cuvelier 2017.
# Distributed under the GNU General Public License.
# (See http://www.gnu.org/copyleft/gpl.html)
"""
# VREP
import sim as vrep
# Use... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 66 |
68431956904694fad67f805a36fc5baa2395ccec | 33,787 | py | Python | crys3d/hklview/jsview_3d.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | crys3d/hklview/jsview_3d.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | crys3d/hklview/jsview_3d.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null |
# TODO:
# - cached scenes
from __future__ import division
"""
# python2 code
from websocket_server import WebsocketServer
import threading, math
from time import sleep
nc = {}
def new_client(client, server):
nc = client
print "got a new client:", nc
def on_message(client, server, message):
print me... | 34.617828 | 117 | 0.652499 |
# TODO:
# - cached scenes
from __future__ import division
from libtbx.math_utils import roundoff
from cctbx.miller import display2 as display
from cctbx.array_family import flex
from scitbx import graphics_utils
from cctbx import miller
from libtbx.utils import Sorry
from websocket_server import WebsocketServer
impo... | 0 | 0 | 0 | 31,663 | 0 | 0 | 0 | 102 | 332 |
cfd437ccf98b207195aece3da3aebed3f204c656 | 916 | py | Python | calendareshop/shopping/migrations/0004_customorder.py | Kaarhai/calendar-eshop | 4ba4141034fe0042f0b3eec6194efd4b5c815f66 | [
"BSD-3-Clause"
] | 1 | 2016-09-20T22:01:05.000Z | 2016-09-20T22:01:05.000Z | calendareshop/shopping/migrations/0004_customorder.py | Kaarhai/calendar-eshop | 4ba4141034fe0042f0b3eec6194efd4b5c815f66 | [
"BSD-3-Clause"
] | 6 | 2016-10-08T09:57:49.000Z | 2022-03-11T23:16:41.000Z | calendareshop/shopping/migrations/0004_customorder.py | Kaarhai/calendar-eshop | 4ba4141034fe0042f0b3eec6194efd4b5c815f66 | [
"BSD-3-Clause"
] | 2 | 2016-10-03T21:47:55.000Z | 2019-10-17T07:56:09.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 33.925926 | 274 | 0.592795 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '__first__'),
('shopping', '0003_auto_20150923_1016'),
]
operations = [
migrations.CreateModel(
n... | 0 | 0 | 0 | 786 | 0 | 0 | 0 | 19 | 46 |
1484f1883ecf2d917b75f65d49b4742884875fb8 | 1,223 | py | Python | cvismon.py | b10n1k/cvismon | d023570f61aa60b6cee4f680add2e09768171324 | [
"Apache-2.0"
] | null | null | null | cvismon.py | b10n1k/cvismon | d023570f61aa60b6cee4f680add2e09768171324 | [
"Apache-2.0"
] | null | null | null | cvismon.py | b10n1k/cvismon | d023570f61aa60b6cee4f680add2e09768171324 | [
"Apache-2.0"
] | null | null | null | import json
import re
import termplotlib as tpl
image_data = {}
# need permissions
ihash = ''
img_id = []
with open("/var/lib/docker/image/btrfs/repositories.json", "r") as f3:
data = f3.read()
js = json.loads(data)
for reponame in js['Repositories']:
for image in js['Repositories'][reponame]:
... | 29.119048 | 90 | 0.60507 | import json
from pprint import pprint
import re
import termplotlib as tpl
image_data = {}
# need permissions
ihash = ''
img_id = []
with open("/var/lib/docker/image/btrfs/repositories.json", "r") as f3:
data = f3.read()
js = json.loads(data)
for reponame in js['Repositories']:
for image in js['Rep... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
a147bee63dc602fee9883fa5a99b6ceb96497f89 | 5,205 | py | Python | digitick_client/models/show.py | frague59/digitick-client | b8787438cddc60720c60c8b23826185a7d0988d5 | [
"MIT"
] | null | null | null | digitick_client/models/show.py | frague59/digitick-client | b8787438cddc60720c60c8b23826185a7d0988d5 | [
"MIT"
] | null | null | null | digitick_client/models/show.py | frague59/digitick-client | b8787438cddc60720c60c8b23826185a7d0988d5 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Digitick REST API
The Digitick REST API is a set of methods giving access to catalog, user and cart management.
OpenAPI spec version: v1.0
Contact: contact@digitick.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
| 24.551887 | 105 | 0.538521 | # coding: utf-8
"""
Digitick REST API
The Digitick REST API is a set of methods giving access to catalog, user and cart management.
OpenAPI spec version: v1.0
Contact: contact@digitick.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six i... | 0 | 1,939 | 0 | 2,896 | 0 | 0 | 0 | -3 | 90 |
62ffeaee466458969ac58c7a83aedd98cd783112 | 193 | py | Python | helper/progressbar_filewalker.py | jgraber/PythonFriday | 879f10934dc6949785e5a799bfc3ca9a2a4434d4 | [
"MIT"
] | 5 | 2021-02-22T08:39:55.000Z | 2022-03-14T03:54:36.000Z | helper/progressbar_filewalker.py | jgraber/PythonFriday | 879f10934dc6949785e5a799bfc3ca9a2a4434d4 | [
"MIT"
] | null | null | null | helper/progressbar_filewalker.py | jgraber/PythonFriday | 879f10934dc6949785e5a799bfc3ca9a2a4434d4 | [
"MIT"
] | null | null | null | import progressbar
import os
files = os.listdir('D:\Python')
for i in progressbar.progressbar(files):
do_something(i)
| 14.846154 | 40 | 0.735751 | import time
import progressbar
import os
def do_something(file):
print(file)
time.sleep(0.02)
files = os.listdir('D:\Python')
for i in progressbar.progressbar(files):
do_something(i)
| 0 | 0 | 0 | 0 | 0 | 33 | 0 | -10 | 45 |
4d20b1d9572938ff4d9507dfe87029d69d55c90d | 13,373 | py | Python | yandex/cloud/ai/vision/v1/text_detection_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/ai/vision/v1/text_detection_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/ai/vision/v1/text_detection_pb2.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/ai/vision/v1/text_detection.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as ... | 39.332353 | 1,322 | 0.746355 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: yandex/cloud/ai/vision/v1/text_detection.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c1eabedf4921bbcba5aee451a6b65745380aee4 | 10,767 | py | Python | opencanary/test/module_test.py | amorrowbellarmine/opencanary | a25209888faa3fbaa15db09e419d03b42897a7d5 | [
"BSD-3-Clause"
] | 1,412 | 2015-08-06T03:54:37.000Z | 2022-03-29T07:30:54.000Z | opencanary/test/module_test.py | amorrowbellarmine/opencanary | a25209888faa3fbaa15db09e419d03b42897a7d5 | [
"BSD-3-Clause"
] | 170 | 2015-08-11T00:33:06.000Z | 2022-03-30T05:11:38.000Z | opencanary/test/module_test.py | amorrowbellarmine/opencanary | a25209888faa3fbaa15db09e419d03b42897a7d5 | [
"BSD-3-Clause"
] | 297 | 2015-08-17T09:25:41.000Z | 2022-03-31T08:25:41.000Z | """
This module assumes that OpenCanary has been installed and is running.
In particular it assumes that OpenCanary is logging to /var/tmp/opencanary.log
and that the services it's testing are enabled.
It would be much better to setup tests to start the services needed and provide
the configuration files so that test... | 38.045936 | 101 | 0.624594 | """
This module assumes that OpenCanary has been installed and is running.
In particular it assumes that OpenCanary is logging to /var/tmp/opencanary.log
and that the services it's testing are enabled.
It would be much better to setup tests to start the services needed and provide
the configuration files so that test... | 0 | 0 | 0 | 9,390 | 0 | 0 | 0 | -41 | 364 |
179184fc9666c2512b633fed036be6fba4cd566a | 3,081 | py | Python | flib/abstract.py | rldotai/flib | 695e875f708b0b71c9b005fdf85c066e4ffb7c0f | [
"BSD-3-Clause"
] | 1 | 2017-02-01T00:34:23.000Z | 2017-02-01T00:34:23.000Z | flib/abstract.py | rldotai/flib | 695e875f708b0b71c9b005fdf85c066e4ffb7c0f | [
"BSD-3-Clause"
] | null | null | null | flib/abstract.py | rldotai/flib | 695e875f708b0b71c9b005fdf85c066e4ffb7c0f | [
"BSD-3-Clause"
] | null | null | null | """
Abstract base classes for different kinds of feature.
"""
| 31.438776 | 80 | 0.646219 | """
Abstract base classes for different kinds of feature.
"""
import numpy as np
class Feature:
"""
Feature function base class.
Implements various methods common to feature functions, which are generally
the same across the various features in this library.
"""
def __init__(self, n_input, n... | 0 | 40 | 0 | 2,818 | 0 | 0 | 0 | -3 | 162 |
78f4476d4df1caa986d8953cb2eadff6102ccdc6 | 1,996 | py | Python | src/2Dvis.py | toicca/planetary-simulator-sc2 | f673eb0fbb49b72fdaf861782fa476b13d798aa0 | [
"MIT"
] | null | null | null | src/2Dvis.py | toicca/planetary-simulator-sc2 | f673eb0fbb49b72fdaf861782fa476b13d798aa0 | [
"MIT"
] | null | null | null | src/2Dvis.py | toicca/planetary-simulator-sc2 | f673eb0fbb49b72fdaf861782fa476b13d798aa0 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
#Reading the input instructions and names of the objects.
obj_names=[]
f = open("../run/input.dat","r")
obj_count=int(f.readline())
for obj in range(obj_count):
obj_names.append(f.readline().split()[0])
obj_names=sorted(ob... | 34.413793 | 147 | 0.743988 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import matplotlib.animation as animation
#Reading the input instructions and names of the objects.
obj_names=[]
f = open("../run/input.dat","r")
obj_count=int(f.readline())
for obj in range(obj_count):
o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 44 |
7fa33659a421046ddc243bc3c80abd2ab84720b6 | 792 | py | Python | 14_longestCommonPrefix/solution.py | NekoApocalypse/leetcode-collection | d7db13b34078eb3027f89a02eeb45066073a4a5c | [
"MIT"
] | null | null | null | 14_longestCommonPrefix/solution.py | NekoApocalypse/leetcode-collection | d7db13b34078eb3027f89a02eeb45066073a4a5c | [
"MIT"
] | null | null | null | 14_longestCommonPrefix/solution.py | NekoApocalypse/leetcode-collection | d7db13b34078eb3027f89a02eeb45066073a4a5c | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
test()
| 21.405405 | 57 | 0.411616 | class Solution:
def longestCommonPrefix(self, strs):
if not strs:
return ""
ans = 0
flag = True
while flag:
if ans < len(strs[0]):
target = strs[0][ans]
else:
break
for str in strs:
if ans... | 0 | 0 | 0 | 468 | 0 | 233 | 0 | 0 | 45 |
4d1d67b2a094f19834bbaaf69935f8a8759c6994 | 1,371 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/core/management/commands/fixturize.py | simonbru/django-template | c6faf55873e4c83be674197a89be3f5881a69528 | [
"MIT"
] | 22 | 2016-02-08T14:08:21.000Z | 2021-07-26T21:17:43.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/core/management/commands/fixturize.py | simonbru/django-template | c6faf55873e4c83be674197a89be3f5881a69528 | [
"MIT"
] | 64 | 2016-02-01T14:30:25.000Z | 2022-01-31T16:06:51.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/core/management/commands/fixturize.py | simonbru/django-template | c6faf55873e4c83be674197a89be3f5881a69528 | [
"MIT"
] | 16 | 2015-09-22T12:33:55.000Z | 2021-09-09T12:57:53.000Z | from io import StringIO
from django.core import management
from django.db import connection
def reset_db():
"""
Reset database to a blank state by removing all the tables and recreating them.
"""
with connection.cursor() as cursor:
cursor.execute("select tablename from pg_tables where scheman... | 31.159091 | 86 | 0.632385 | from io import StringIO
from django.core import management
from django.core.management.base import BaseCommand
from django.db import connection
def reset_db():
"""
Reset database to a blank state by removing all the tables and recreating them.
"""
with connection.cursor() as cursor:
cursor.ex... | 0 | 0 | 0 | 518 | 0 | 0 | 0 | 30 | 45 |
87b56d6c929c3ce3ce153dce7b3c210821d706a0 | 548 | py | Python | sympy/polys/domains/pythonrational.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T16:02:46.000Z | 2022-01-31T16:02:46.000Z | sympy/polys/domains/pythonrational.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 3 | 2022-02-04T14:45:16.000Z | 2022-02-04T14:45:45.000Z | sympy/polys/domains/pythonrational.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-02-04T13:50:29.000Z | 2022-02-04T13:50:29.000Z | """
Rational number type based on Python integers.
The PythonRational class from here has been moved to
sympy.external.pythonmpq
This module is just left here for backwards compatibility.
"""
from sympy.core.sympify import _sympy_converter
from sympy.utilities import public
from sympy.external.pythonmpq import Pytho... | 23.826087 | 58 | 0.821168 | """
Rational number type based on Python integers.
The PythonRational class from here has been moved to
sympy.external.pythonmpq
This module is just left here for backwards compatibility.
"""
from sympy.core.numbers import Rational
from sympy.core.sympify import _sympy_converter
from sympy.utilities import public
f... | 0 | 0 | 0 | 0 | 0 | 63 | 0 | 18 | 46 |
5d39bdcbff174082e5199143e653dd2c34282024 | 977 | py | Python | PythonCode/drawing_image.py | Spstolar/BMachine | 319e5efb72cd3ab07b8538b7c43bd93e75f2e38a | [
"MIT"
] | null | null | null | PythonCode/drawing_image.py | Spstolar/BMachine | 319e5efb72cd3ab07b8538b7c43bd93e75f2e38a | [
"MIT"
] | 3 | 2017-04-02T15:41:22.000Z | 2017-04-03T06:43:06.000Z | PythonCode/drawing_image.py | Spstolar/BMachine | 319e5efb72cd3ab07b8538b7c43bd93e75f2e38a | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
length = 28
dog = np.load('stabilization_small.npy')
num_plot = 0
if num_plot == 1:
for j in range(10):
img = dog[j,:].reshape((length, length)) # for printing numbers
# img = np.random.randint(0,2,size=(length, length))
imgplot = plt.i... | 28.735294 | 72 | 0.660184 | import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
length = 28
dog = np.load('stabilization_small.npy')
num_plot = 0
if num_plot == 1:
for j in range(10):
img = dog[j,:].reshape((length, length)) # for printing numbers
# img = np.random.randint(0,2,size=(length,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 22 |
f224cba2807c1bda25b178194830b1fe159bb6f9 | 806 | py | Python | manual-evaluation/anal.py | Tijana37/chimera | bd496e43ba4bb8949eb593ce412b5e91aaae7023 | [
"MIT"
] | 125 | 2019-04-09T10:29:48.000Z | 2022-02-24T07:57:09.000Z | manual-evaluation/anal.py | Tijana37/chimera | bd496e43ba4bb8949eb593ce412b5e91aaae7023 | [
"MIT"
] | 23 | 2019-04-10T08:38:40.000Z | 2022-03-10T13:33:30.000Z | manual-evaluation/anal.py | Tijana37/chimera | bd496e43ba4bb8949eb593ce412b5e91aaae7023 | [
"MIT"
] | 26 | 2019-04-09T11:02:19.000Z | 2022-03-06T06:37:30.000Z | from itertools import chain
from json import load
import numpy as np
if __name__ == "__main__":
samples = load(open("samples.json"))
rdfs = list(chain.from_iterable([s["rdf"] for s in samples]))
hal = np.sum([s["hal"] for s in samples])
total = len(rdfs)
exists = len([r for s, r, o, res in rdfs i... | 38.380952 | 128 | 0.58933 | from itertools import chain
from json import load
import numpy as np
if __name__ == "__main__":
samples = load(open("samples.json"))
rdfs = list(chain.from_iterable([s["rdf"] for s in samples]))
hal = np.sum([s["hal"] for s in samples])
total = len(rdfs)
exists = len([r for s, r, o, res in rdfs i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5edb306462b722ec70fd1df87b045be17a5272d4 | 1,106 | py | Python | app/migrations/0014_pickassociationrules.py | lucashanke/houseofdota | c83fbb15d58928599f47f9754e3c401d98db3c24 | [
"MIT"
] | 5 | 2016-08-18T03:50:57.000Z | 2018-11-20T21:02:59.000Z | app/migrations/0014_pickassociationrules.py | lucashanke/houseofdota | c83fbb15d58928599f47f9754e3c401d98db3c24 | [
"MIT"
] | null | null | null | app/migrations/0014_pickassociationrules.py | lucashanke/houseofdota | c83fbb15d58928599f47f9754e3c401d98db3c24 | [
"MIT"
] | 2 | 2016-08-05T11:04:24.000Z | 2018-11-20T21:03:04.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-07-05 22:01
from __future__ import unicode_literals
import django.core.validators
| 38.137931 | 224 | 0.643761 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-07-05 22:01
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import re
class Migration(migrations.Migration):
dependencies = [
('app', '0013_auto_2017... | 0 | 0 | 0 | 856 | 0 | 0 | 0 | 18 | 89 |
cad28a7345e2f20a52591ec569f9df1622cd825f | 3,257 | py | Python | print_model_info.py | eleanorplatt/ProtoPNet | 014ce4a95d07472f313f45a6a5af99023a054f1c | [
"MIT"
] | null | null | null | print_model_info.py | eleanorplatt/ProtoPNet | 014ce4a95d07472f313f45a6a5af99023a054f1c | [
"MIT"
] | null | null | null | print_model_info.py | eleanorplatt/ProtoPNet | 014ce4a95d07472f313f45a6a5af99023a054f1c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import torchvision.transforms as transforms
import torchvision.models as models
import re
from torchsummary import summary
# local imports
import model
from preprocess import mean, std
if __name__ == "__main__":
# book keeping namings a... | 47.897059 | 195 | 0.735646 | import torch
import torch.nn as nn
import torch.utils.model_zoo as model_zoo
import torch.nn.functional as F
import torchvision.transforms as transforms
import torchvision.models as models
import argparse
import re
import os
from torchsummary import summary
# local imports
import model
from preprocess import mean, std... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 582 | 180 |
fa428d289bf620d69dd7ff09de58371910717df8 | 1,707 | py | Python | tests/test_typehoon.py | BA7JCM/angr | 187a713c35759d998d93dfc5280630976d42d717 | [
"BSD-2-Clause"
] | null | null | null | tests/test_typehoon.py | BA7JCM/angr | 187a713c35759d998d93dfc5280630976d42d717 | [
"BSD-2-Clause"
] | null | null | null | tests/test_typehoon.py | BA7JCM/angr | 187a713c35759d998d93dfc5280630976d42d717 | [
"BSD-2-Clause"
] | null | null | null | # pylint:disable=missing-class-docstring,no-self-use
import os
import unittest
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
if __name__ == "__main__":
unittest.main()
| 32.207547 | 106 | 0.670767 | # pylint:disable=missing-class-docstring,no-self-use
import os
import unittest
import angr
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
class TestTypehoon(unittest.TestCase):
def test_smoketest(self):
p = angr.Project(os.path.join(test_loca... | 0 | 0 | 0 | 1,433 | 0 | 0 | 0 | -10 | 46 |
d4022225502430ca54e78eceb3da2a4dac4eb498 | 7,862 | py | Python | keras_unet_collection/losses.py | EunTaeJeon/keras-unet-collection | 50ab6c6b76e94447228035445efa32d7b0a19b33 | [
"MIT"
] | 1 | 2021-04-15T05:45:44.000Z | 2021-04-15T05:45:44.000Z | keras_unet_collection/losses.py | DARK-art108/keras-unet-collection | 50ab6c6b76e94447228035445efa32d7b0a19b33 | [
"MIT"
] | null | null | null | keras_unet_collection/losses.py | DARK-art108/keras-unet-collection | 50ab6c6b76e94447228035445efa32d7b0a19b33 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
def _crps_tf(y_true, y_pred, factor=0.05):
'''
core of (pseudo) CRPS loss
y_true: two-dimensional arrays
y_pred: two-dimensional arrays
factor: importance of std term
... | 29.118519 | 120 | 0.621216 |
from __future__ import absolute_import
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as K
def _crps_tf(y_true, y_pred, factor=0.05):
'''
core of (pseudo) CRPS loss
y_true: two-dimensional arrays
y_pred: two-dimensional arrays
factor: importance of std term
... | 15 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
06bc232e1db808dd9a2f96f163e890cdf0d7e5a9 | 878 | py | Python | scripts/explore_icentia11k_dataset.py | KISMED-TUDa/ECG_Classification | 7df7b6d28287f592536cdbf01b6aec73e7b045ef | [
"MIT"
] | 3 | 2021-12-07T17:08:00.000Z | 2021-12-08T23:16:57.000Z | scripts/explore_icentia11k_dataset.py | KISMED-TUDa/ECG_Classification | 7df7b6d28287f592536cdbf01b6aec73e7b045ef | [
"MIT"
] | 1 | 2021-12-09T00:33:41.000Z | 2021-12-09T15:59:48.000Z | scripts/explore_icentia11k_dataset.py | KISMED-TUDa/ECG_Classification | 7df7b6d28287f592536cdbf01b6aec73e7b045ef | [
"MIT"
] | 1 | 2021-07-30T14:53:48.000Z | 2021-07-30T14:53:48.000Z | import gzip
import pickle
import os
if __name__ == '__main__':
# Load sample
with gzip.open("E:\\ECG_Data\\icentia11k\\00000_batched.pkl.gz", "rb") as file:
data = pickle.load(file)
print(data.shape)
# Load label
with gzip.open("E:\\ECG_Data\\icentia11k\\00000_batched_lbls.pkl.gz", "rb") a... | 32.518519 | 89 | 0.559226 | import gzip
import pickle
import os
if __name__ == '__main__':
# Load sample
with gzip.open("E:\\ECG_Data\\icentia11k\\00000_batched.pkl.gz", "rb") as file:
data = pickle.load(file)
print(data.shape)
# Load label
with gzip.open("E:\\ECG_Data\\icentia11k\\00000_batched_lbls.pkl.gz", "rb") a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6485ee546c55b7a9b830d92a98876ee30a7dd654 | 1,317 | py | Python | tests.py | Unactived/python-tio | 8128dfafa376c35a87bad5da78361f00b759883b | [
"MIT"
] | 5 | 2020-11-06T17:40:03.000Z | 2021-09-01T04:45:07.000Z | tests.py | Unactived/python-tio | 8128dfafa376c35a87bad5da78361f00b759883b | [
"MIT"
] | 1 | 2021-01-26T22:05:57.000Z | 2021-05-17T01:46:12.000Z | tests.py | FrenchMasterSword/python-tio | 8128dfafa376c35a87bad5da78361f00b759883b | [
"MIT"
] | 1 | 2021-09-12T11:05:03.000Z | 2021-09-12T11:05:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tio
site = Tio.Tio()
| 31.357143 | 112 | 0.602126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tio
import asyncio
import unittest
site = Tio.Tio()
class TestOutput(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(None)
def test_hello(self):
async def go(self):
req ... | 0 | 0 | 242 | 945 | 0 | 0 | 0 | -13 | 67 |
4b8649a7f896860b98576d27ede3590288cba4c5 | 747 | py | Python | TextAugmentation/pndictionary_process.py | cdli-gh/Sumerian-NER | bbb77f0aa8ab6fac6e2969784998378c43408094 | [
"MIT"
] | 15 | 2020-07-11T18:18:24.000Z | 2021-08-25T09:06:15.000Z | TextAugmentation/pndictionary_process.py | cdli-gh/Sumerian-NER | bbb77f0aa8ab6fac6e2969784998378c43408094 | [
"MIT"
] | 3 | 2020-07-17T12:26:18.000Z | 2020-09-21T14:55:38.000Z | TextAugmentation/pndictionary_process.py | cdli-gh/Sumerian-Translation-Pipeline | bbb77f0aa8ab6fac6e2969784998378c43408094 | [
"MIT"
] | 2 | 2020-11-16T14:35:52.000Z | 2022-01-19T23:25:11.000Z | data2=pd.read_csv("Raw/pndictionary.csv",error_bad_lines=False,header=None)
data2=data2.drop([0,3,4,5],axis=1)
print(data2.head())
data2=data2.drop_duplicates(subset=[1],keep='first')
data2=data2.reset_index(drop=True)
l=[]
for i in range(len(data2)):
s=data2[2][i]
if s==' `value`' or s==" 'GN ara[times]'":
... | 25.758621 | 75 | 0.60241 | data2=pd.read_csv("Raw/pndictionary.csv",error_bad_lines=False,header=None)
data2=data2.drop([0,3,4,5],axis=1)
print(data2.head())
data2=data2.drop_duplicates(subset=[1],keep='first')
data2=data2.reset_index(drop=True)
l=[]
for i in range(len(data2)):
s=data2[2][i]
if s==' `value`' or s==" 'GN ara[times]'":
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
caaa6101a427d6787c264d4bfd4a1f4e0df16af7 | 2,665 | py | Python | bin/alf_condense.py | rherriman/Avara | eaa68133ac273796b60162673b8f240619cb35ed | [
"MIT"
] | 77 | 2016-10-30T18:37:14.000Z | 2022-02-13T05:02:55.000Z | bin/alf_condense.py | tra/Avara | 5a6b5a4f2cf29e8b2ddf7dd3f422579f37a14dab | [
"MIT"
] | 135 | 2018-09-09T06:46:04.000Z | 2022-01-29T19:33:12.000Z | bin/alf_condense.py | tra/Avara | 5a6b5a4f2cf29e8b2ddf7dd3f422579f37a14dab | [
"MIT"
] | 19 | 2018-09-09T02:02:46.000Z | 2022-03-16T08:21:08.000Z | #!/usr/bin/env python3
import argparse
import xml.etree.ElementTree as ET
from dumb_round import dumb_round
VESTIGIAL_ATTRS = {
'Walker': ['fill', 'frame', 'r'],
'Sphere': ['r'],
'Hologram': ['r'],
'Solid': ['r'],
'WallSolid': ['angle', 'cx', 'cz', 'r'],
'FreeSolid': ['r'],
'Dome': [],
... | 33.3125 | 82 | 0.500188 | #!/usr/bin/env python3
import argparse
import xml.etree.ElementTree as ET
from dumb_round import dumb_round
VESTIGIAL_ATTRS = {
'Walker': ['fill', 'frame', 'r'],
'Sphere': ['r'],
'Hologram': ['r'],
'Solid': ['r'],
'WallSolid': ['angle', 'cx', 'cz', 'r'],
'FreeSolid': ['r'],
'Dome': [],
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e2d8be7e8f536c4424ba5c343467407a8df550a7 | 707 | py | Python | var/spack/repos/builtin/packages/py-nibabel/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-03-05T10:54:32.000Z | 2021-03-05T14:14:52.000Z | var/spack/repos/builtin/packages/py-nibabel/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/py-nibabel/package.py | hainest/spack | c592e17d49118f253b552ef6165745ded8ac0ea5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 33.666667 | 95 | 0.701556 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyNibabel(PythonPackage):
"""Access a multitude of neuroimaging data formats"""
homep... | 0 | 0 | 0 | 465 | 0 | 0 | 0 | -2 | 46 |
2293b89434ad022fe2df44b50f3d9d6b72b21017 | 6,098 | py | Python | deepracer_follow_the_leader_ws/ftl_launcher/launch/ftl_launcher.py | jsspric/aws-deepracer-follow-the-leader-sample-project | d89f7b9c2810525b276543d7158d85ca6d473727 | [
"Apache-2.0"
] | null | null | null | deepracer_follow_the_leader_ws/ftl_launcher/launch/ftl_launcher.py | jsspric/aws-deepracer-follow-the-leader-sample-project | d89f7b9c2810525b276543d7158d85ca6d473727 | [
"Apache-2.0"
] | null | null | null | deepracer_follow_the_leader_ws/ftl_launcher/launch/ftl_launcher.py | jsspric/aws-deepracer-follow-the-leader-sample-project | d89f7b9c2810525b276543d7158d85ca6d473727 | [
"Apache-2.0"
] | null | null | null | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 34.845714 | 81 | 0.592161 | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 0 | 0 | 0 | 0 | 0 | 4,770 | 0 | 29 | 68 |
560802e4d84db4f55cdef12d3de3abb8181af3c2 | 1,538 | py | Python | write_token_counts.py | errantlinguist/storygenerator-preprocessing | 93967912a78589856169a806e8a71cb416dfea62 | [
"Apache-2.0"
] | null | null | null | write_token_counts.py | errantlinguist/storygenerator-preprocessing | 93967912a78589856169a806e8a71cb416dfea62 | [
"Apache-2.0"
] | null | null | null | write_token_counts.py | errantlinguist/storygenerator-preprocessing | 93967912a78589856169a806e8a71cb416dfea62 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Writes a lexicon to disk with the relevant counts of each word.
Use with e.g. "find . -type f -iname "*.txt" -exec ./write_token_counts.py {} +"
"""
__author__ = "Todd Shore <errantlinguist+github@gmail.com>"
__copyright__ = "Copyright (C) 2018 Todd Shore"
__license__ = "Apache License, Ve... | 26.982456 | 103 | 0.702861 | #!/usr/bin/env python3
"""
Writes a lexicon to disk with the relevant counts of each word.
Use with e.g. "find . -type f -iname "*.txt" -exec ./write_token_counts.py {} +"
"""
__author__ = "Todd Shore <errantlinguist+github@gmail.com>"
__copyright__ = "Copyright (C) 2018 Todd Shore"
__license__ = "Apache License, Ve... | 0 | 0 | 0 | 0 | 0 | 977 | 0 | -26 | 181 |
6f175a9aed19b63940cfe9deb8f1d7e2d536fa02 | 1,955 | py | Python | tools/sdk.py | xunice/libs-for-android | 3cd5a7cced337b843f2dbb6f74477f1ce58aacde | [
"Apache-2.0"
] | null | null | null | tools/sdk.py | xunice/libs-for-android | 3cd5a7cced337b843f2dbb6f74477f1ce58aacde | [
"Apache-2.0"
] | null | null | null | tools/sdk.py | xunice/libs-for-android | 3cd5a7cced337b843f2dbb6f74477f1ce58aacde | [
"Apache-2.0"
] | 1 | 2016-01-04T20:29:39.000Z | 2016-01-04T20:29:39.000Z | #!/usr/bin/env python
#
# Builds archives for SDK releases.
#
# Usage:
# python tools/sdk.py <version>
#
if __name__ == "__main__":
main()
| 28.333333 | 98 | 0.680307 | #!/usr/bin/env python
#
# Builds archives for SDK releases.
#
# Usage:
# python tools/sdk.py <version>
#
import os
import shutil
import sys
import tempfile
def execute(command):
status = os.system(command)
if status != 0:
raise Exception('unexpected result: %d' % status)
def sdk(version, output):
# Find th... | 0 | 0 | 0 | 0 | 0 | 1,689 | 0 | -37 | 158 |
4db9fd879ee2d1640193a796bf988646cbd55926 | 1,811 | py | Python | setup.py | LukasVik/symbolator | 9bb2dbfb1ea72e856e80327280aa54cea85faafa | [
"MIT"
] | 5 | 2020-11-20T16:45:27.000Z | 2020-11-27T17:06:35.000Z | setup.py | LukasVik/symbolator | 9bb2dbfb1ea72e856e80327280aa54cea85faafa | [
"MIT"
] | 5 | 2020-08-15T02:11:19.000Z | 2021-05-19T15:30:30.000Z | setup.py | nobodywasishere/symbolator | 9ff85e017e16d001107af4dff9fbac364d51cd49 | [
"MIT"
] | 4 | 2022-01-13T11:44:51.000Z | 2022-03-13T00:47:30.000Z |
import sys
try:
from setuptools import setup
except ImportError:
sys.exit('ERROR: setuptools is required.\nTry using "pip install setuptools".')
# Use README.rst for the long description
with open('README.rst') as fh:
long_description = fh.read()
def get_package_version(verfile):
'''Scan the script for the... | 29.688525 | 89 | 0.651574 |
import sys
try:
from setuptools import setup
except ImportError:
sys.exit('ERROR: setuptools is required.\nTry using "pip install setuptools".')
# Use README.rst for the long description
with open('README.rst') as fh:
long_description = fh.read()
def get_package_version(verfile):
'''Scan the script for the... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bd94ba1f5e3fd5b63ad65aba4fad53d8c6e4c886 | 15,916 | py | Python | sandbox/TSChristofides.py | AFRL-RY/Explore-Coarse-3D-Reconstruction-Path-Planning-Summer-2017 | 6c76e09f4fc2026d6b3efb421b7a56b480f5696b | [
"MIT"
] | null | null | null | sandbox/TSChristofides.py | AFRL-RY/Explore-Coarse-3D-Reconstruction-Path-Planning-Summer-2017 | 6c76e09f4fc2026d6b3efb421b7a56b480f5696b | [
"MIT"
] | null | null | null | sandbox/TSChristofides.py | AFRL-RY/Explore-Coarse-3D-Reconstruction-Path-Planning-Summer-2017 | 6c76e09f4fc2026d6b3efb421b7a56b480f5696b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 7 13:01:33 2016
this is a low-cost way to compute a decent solution to the traveling salesman
problem using the christofides algorythm. It guarentees approximately 1.5 the global minimum
@author: Landen Blackburn
"""
#from methods import distance3D
#this is for testin... | 51.176849 | 173 | 0.666939 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 7 13:01:33 2016
this is a low-cost way to compute a decent solution to the traveling salesman
problem using the christofides algorythm. It guarentees approximately 1.5 the global minimum
@author: Landen Blackburn
"""
import scipy.io as scipy
import numpy as np
from mun... | 0 | 0 | 0 | 14,715 | 0 | 0 | 0 | 34 | 251 |
4acfa6e08c91d6cf965af047f2b0bfd2e83e88a1 | 503 | py | Python | coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 3c870587465ff66c2c1871c8d3c4eea72463abda | [
"MIT"
] | 2 | 2020-12-07T16:07:07.000Z | 2020-12-07T16:08:53.000Z | coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 3c870587465ff66c2c1871c8d3c4eea72463abda | [
"MIT"
] | null | null | null | coding_intereview/1656. Design an Ordered Stream.py | Jahidul007/Python-Bootcamp | 3c870587465ff66c2c1871c8d3c4eea72463abda | [
"MIT"
] | 1 | 2020-10-03T16:38:02.000Z | 2020-10-03T16:38:02.000Z |
# Your OrderedStream object will be instantiated and called as such:
# obj = OrderedStream(n)
# param_1 = obj.insert(id,value)
| 26.473684 | 80 | 0.584493 | class OrderedStream:
def __init__(self, n: int):
self.data = [None]*n
self.ptr = 0
def insert(self, id: int, value: str) -> List[str]:
id -= 1
self.data[id] = value
if id > self.ptr: return []
while self.ptr < len(self.data) and self.data[self.ptr]: ... | 0 | 0 | 0 | 352 | 0 | 0 | 0 | 0 | 22 |
11bf7be8f2b3c566553756419a798a3b4b544760 | 5,272 | py | Python | scripts/fragment_free_space_tree.py | osandov/osandov-linux | 495a99eb77fd0fcb2f0a6a56d58e074fb31c5f9f | [
"MIT"
] | 35 | 2017-04-07T21:03:48.000Z | 2022-03-28T13:45:22.000Z | scripts/fragment_free_space_tree.py | osandov/osandov-linux | 495a99eb77fd0fcb2f0a6a56d58e074fb31c5f9f | [
"MIT"
] | 3 | 2020-05-01T17:49:48.000Z | 2021-01-05T00:55:54.000Z | scripts/fragment_free_space_tree.py | osandov/osandov-linux | 495a99eb77fd0fcb2f0a6a56d58e074fb31c5f9f | [
"MIT"
] | 27 | 2016-12-20T14:03:57.000Z | 2022-03-21T15:58:22.000Z | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Omar Sandoval <osandov@osandov.com>
# SPDX-License-Identifier: MIT
import os
CHUNK_SIZE = 1024 * 1024 * 1024 # 1 GB
if __name__ == '__main__':
main()
| 35.38255 | 93 | 0.599962 | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Omar Sandoval <osandov@osandov.com>
# SPDX-License-Identifier: MIT
import argparse
import os
import os.path
import shutil
import subprocess
import sys
CHUNK_SIZE = 1024 * 1024 * 1024 # 1 GB
def cycle_mount_btrfsck(dev, mnt):
subprocess.check_call(['umount', '--... | 0 | 0 | 0 | 0 | 0 | 4,869 | 0 | -36 | 226 |
69a14b2432872fa7ad5bc4643df5390cfb5e7c72 | 135,852 | py | Python | challenge_submissions/submit_766922/supplements/util.py | opendilab/GoBigger-Challenge-2021 | 794897e94caf15b69635dcb36eb64e1341131db9 | [
"Apache-2.0"
] | 121 | 2021-11-01T01:24:31.000Z | 2022-03-31T10:53:47.000Z | challenge_submissions/submit_766922/supplements/util.py | opendilab/GoBigger-Challenge-2021 | 794897e94caf15b69635dcb36eb64e1341131db9 | [
"Apache-2.0"
] | 2 | 2021-11-06T14:13:00.000Z | 2022-01-25T09:19:41.000Z | challenge_submissions/submit_766922/supplements/util.py | opendilab/GoBigger-Challenge-2021 | 794897e94caf15b69635dcb36eb64e1341131db9 | [
"Apache-2.0"
] | 39 | 2021-11-01T12:48:19.000Z | 2022-03-01T11:23:38.000Z | import copy
import math
import numpy as np
from pygame import Vector2
def match_clones(last_clones, cur_clones, avg_move_x, avg_move_y):
"""
clones
:param avg_move_y:
:param avg_move_x:
:param last_clones:
:param cur_clones:
... | 37.321978 | 142 | 0.52552 | import copy
import math
import os
import random
import time
from functools import wraps
import numpy as np
import torch
from gobigger.agents import BotAgent
from pygame import Vector2
def fn_timer(function):
@wraps(function)
def function_timer(*args, **kwargs):
t0 = time.time()
... | 1,389 | 17,495 | 0 | 72,753 | 0 | 27,283 | 0 | -18 | 1,412 |
c58e7ba548e389aba765514fc1b58d6e3007008a | 287 | py | Python | main.py | Otterpohl/sql-schema-graph | 307f7b2740c9f357d5bcd03c912e8480066e6ab6 | [
"MIT"
] | null | null | null | main.py | Otterpohl/sql-schema-graph | 307f7b2740c9f357d5bcd03c912e8480066e6ab6 | [
"MIT"
] | null | null | null | main.py | Otterpohl/sql-schema-graph | 307f7b2740c9f357d5bcd03c912e8480066e6ab6 | [
"MIT"
] | null | null | null | from loguru import logger
from pathlib import Path
import sql_functions
if __name__ == "__main__":
LogPath = str(Path(__file__).resolve().parent) + "\\log\\file_{time}.log"
logger.add(LogPath, level='DEBUG')
sql_functions.main()
logger.info("Completed Successfully")
| 22.076923 | 77 | 0.710801 | from loguru import logger
from pathlib import Path
import sql_functions
if __name__ == "__main__":
LogPath = str(Path(__file__).resolve().parent) + "\\log\\file_{time}.log"
logger.add(LogPath, level='DEBUG')
sql_functions.main()
logger.info("Completed Successfully")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
60caf4412b18d00cc57d0dad64a2c4ae116f9699 | 10,390 | py | Python | hhi_stmrftracking/mincut_model.py | bombardellif/hhi-stmrftracking | 10cc4dddab3841b7296468e378aa42da52e1ffd0 | [
"MIT"
] | 5 | 2018-10-18T13:35:04.000Z | 2021-12-23T05:06:23.000Z | hhi_stmrftracking/mincut_model.py | bombardellif/hhi-stmrftracking | 10cc4dddab3841b7296468e378aa42da52e1ffd0 | [
"MIT"
] | null | null | null | hhi_stmrftracking/mincut_model.py | bombardellif/hhi-stmrftracking | 10cc4dddab3841b7296468e378aa42da52e1ffd0 | [
"MIT"
] | 5 | 2018-12-13T14:34:27.000Z | 2022-02-21T15:34:35.000Z | """
Copyright:
2016 Fraunhofer Institute for Telecommunications, Heinrich-Hertz-Institut (HHI)
The copyright of this software source code is the property of HHI.
This software may be used and/or copied only with the written permission
of HHI and in accordance with the terms and conditions stipulated
in the ... | 49.009434 | 96 | 0.643118 | """
Copyright:
2016 Fraunhofer Institute for Telecommunications, Heinrich-Hertz-Institut (HHI)
The copyright of this software source code is the property of HHI.
This software may be used and/or copied only with the written permission
of HHI and in accordance with the terms and conditions stipulated
in the ... | 0 | 0 | 0 | 5,067 | 0 | 3,313 | 0 | 53 | 223 |
7c42bc7885ffb85c1f085e2972fbc14757067540 | 2,072 | py | Python | app/libs/swagger_filed.py | linrong/flask-server | 5f0896c6ccedb6b172b9af7e1018600e38a2df43 | [
"MIT"
] | null | null | null | app/libs/swagger_filed.py | linrong/flask-server | 5f0896c6ccedb6b172b9af7e1018600e38a2df43 | [
"MIT"
] | 1 | 2019-09-06T10:06:47.000Z | 2019-09-10T07:18:47.000Z | app/libs/swagger_filed.py | linrong/flask-server | 5f0896c6ccedb6b172b9af7e1018600e38a2df43 | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
Created by lr on 2019/08/29.
"""
__author__ = 'lr'
| 28 | 79 | 0.712355 | # _*_ coding: utf-8 _*_
"""
Created by lr on 2019/08/29.
"""
__author__ = 'lr'
class ParamFiled:
def __init__(self, name, description, enum, required, default):
self.name = name
self.description = description
self.enum = enum
self.required = required
self.default = default
@property
def data(s... | 0 | 199 | 0 | 1,601 | 0 | 0 | 0 | 0 | 184 |
d4cde83fd143699511433f1dfb0129c83bcf29ab | 8,066 | py | Python | Pi/Deploy/Database/PostgreSql/DeployPostgreSqlModule.py | abs/Pi.Deploy | 202b0677fefebe43bde7c2b7ea1f30f8c5a34470 | [
"BSD-3-Clause"
] | 2 | 2015-07-16T05:20:29.000Z | 2015-07-18T05:50:49.000Z | Pi/Deploy/Database/PostgreSql/DeployPostgreSqlModule.py | abs/Pi.Deploy | 202b0677fefebe43bde7c2b7ea1f30f8c5a34470 | [
"BSD-3-Clause"
] | null | null | null | Pi/Deploy/Database/PostgreSql/DeployPostgreSqlModule.py | abs/Pi.Deploy | 202b0677fefebe43bde7c2b7ea1f30f8c5a34470 | [
"BSD-3-Clause"
] | null | null | null | #
# (c) Peralta Informatics 2007
# $Id: DeployPostgreSqlModule.py 302 2008-01-21 09:36:01Z andrei $
#
import clr
import sys
clr.AddReference("System.Data")
clr.AddReference("System.Xml")
import System.Data
import System.Data.SqlClient
import System.Diagnostics
import System.Text
NpgsqlLocationAttributeName = 'Npgsq... | 30.209738 | 217 | 0.60786 | #
# (c) Peralta Informatics 2007
# $Id: DeployPostgreSqlModule.py 302 2008-01-21 09:36:01Z andrei $
#
import clr
import sys
import os
import shutil
clr.AddReference("System.Data")
clr.AddReference("System.Xml")
import System.Data
import System.Data.SqlClient
import System.Diagnostics
import System.Text
import System... | 0 | 0 | 0 | 7,399 | 0 | 3 | 0 | 102 | 180 |
46a031c1255bf237078387f5b765085108a60514 | 2,877 | py | Python | submit_cgap/auth.py | dbmi-bgm/SubmitCGAP | e35466c8d203b4f07ac98f2cc0574bf290ac5c5a | [
"MIT"
] | null | null | null | submit_cgap/auth.py | dbmi-bgm/SubmitCGAP | e35466c8d203b4f07ac98f2cc0574bf290ac5c5a | [
"MIT"
] | 2 | 2020-09-08T09:06:22.000Z | 2021-06-10T17:26:09.000Z | submit_cgap/auth.py | dbmi-bgm/SubmitCGAP | e35466c8d203b4f07ac98f2cc0574bf290ac5c5a | [
"MIT"
] | null | null | null |
from . import base as base_module
from .base import KeyManager
from .exceptions import CGAPEnvKeyMissing, CGAPServerKeyMissing
def get_keydict_for_env(env=None):
"""
Gets the appropriate auth info for talking to a given beanstalk environment.
Args:
env: the name of a beanstalk environment
... | 29.357143 | 105 | 0.659715 | import io
import json
import os
from . import base as base_module
from .base import KeyManager
from .exceptions import CGAPEnvKeyMissing, CGAPServerKeyMissing
def keypair_to_keydict(auth_tuple, server):
auth_dict = {
'key': auth_tuple[0],
'secret': auth_tuple[1],
'server': server,
}
... | 0 | 0 | 0 | 0 | 0 | 525 | 0 | -34 | 158 |
699b1074abf51a8673e613b4c8ea6d52b5ac4194 | 4,450 | py | Python | kaishi/image/ops.py | kungfuai/kaishi | e20360170ccac2111cab61fcd71b81be3c2a7468 | [
"MIT"
] | 10 | 2020-04-01T16:46:25.000Z | 2021-02-09T15:56:42.000Z | kaishi/image/ops.py | kungfuai/kaishi | e20360170ccac2111cab61fcd71b81be3c2a7468 | [
"MIT"
] | 14 | 2020-03-23T13:32:35.000Z | 2021-12-07T19:30:23.000Z | kaishi/image/ops.py | kungfuai/kaishi | e20360170ccac2111cab61fcd71b81be3c2a7468 | [
"MIT"
] | 2 | 2020-08-14T07:23:06.000Z | 2021-12-06T18:20:42.000Z | """Definitions for common operations on images."""
from io import BytesIO
import numpy as np
from PIL import Image
def extract_patch(im, patch_size):
"""Extract a center cropped patch of size 'patch_size' (2-element tuple).
:param im: input image
:type im: PIL image object
:param patch_size: size of ... | 34.765625 | 127 | 0.688539 | """Definitions for common operations on images."""
from io import BytesIO
import numpy as np
from PIL import Image
def extract_patch(im, patch_size):
"""Extract a center cropped patch of size 'patch_size' (2-element tuple).
:param im: input image
:type im: PIL image object
:param patch_size: size of ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f16ab8445018c0beab4577a452d8877ee9756f2 | 381 | py | Python | src/python/python-demo-app/flask_web/app.py | gregfullard/DevOpsDemo | bd183db601c1c48f7a2d4141869042c3da4ba4c9 | [
"Apache-2.0"
] | null | null | null | src/python/python-demo-app/flask_web/app.py | gregfullard/DevOpsDemo | bd183db601c1c48f7a2d4141869042c3da4ba4c9 | [
"Apache-2.0"
] | null | null | null | src/python/python-demo-app/flask_web/app.py | gregfullard/DevOpsDemo | bd183db601c1c48f7a2d4141869042c3da4ba4c9 | [
"Apache-2.0"
] | null | null | null | # flask_web/app.py
from flask import Flask
app = Flask(__name__)
#@app.route('/')
#def hello_world:
# return 'Hey, we have Flask in a Docker container!'
#if __name == '__main__':
# app.run(debug=True, host='0.0.0.0')
| 19.05 | 55 | 0.643045 | # flask_web/app.py
import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
local_ip = os.environ["LOCAL_IP"]
msg = "Hello, World! My Local IP is: " + local_ip
return msg
#@app.route('/')
#def hello_world:
# return 'Hey, we have Flask in a Docker container!'
#if __... | 0 | 121 | 0 | 0 | 0 | 0 | 0 | -12 | 45 |
bb1946076f473bae05fd996beec7b4c7ada7ea20 | 1,150 | py | Python | app/registries/permissions.py | cvarjao/gwells | cb47ec1d0c31b6f1586843e491f7cb5f1b98d61a | [
"Apache-2.0"
] | 1 | 2020-01-29T22:42:40.000Z | 2020-01-29T22:42:40.000Z | app/registries/permissions.py | matthewhall78/gwells | cb47ec1d0c31b6f1586843e491f7cb5f1b98d61a | [
"Apache-2.0"
] | 1 | 2018-05-02T05:28:33.000Z | 2018-05-09T15:58:07.000Z | app/registries/permissions.py | matthewhall78/gwells | cb47ec1d0c31b6f1586843e491f7cb5f1b98d61a | [
"Apache-2.0"
] | 1 | 2018-05-02T23:56:48.000Z | 2018-05-02T23:56:48.000Z | """
Registries view permission classes
"""
| 30.263158 | 105 | 0.681739 | """
Registries view permission classes
"""
from rest_framework.permissions import BasePermission, IsAdminUser, SAFE_METHODS
class IsAdminOrReadOnly(IsAdminUser):
"""
Allows read-only access to all users (including anonymous users) and write access to admin users only
"""
def has_permission(self, req... | 0 | 0 | 0 | 977 | 0 | 0 | 0 | 59 | 69 |
d71c7b3b9793719ec17d721210c0b5a30c5520e3 | 1,063 | py | Python | guamapa/towns/migrations/0002_surveyanswer_surveyquestion.py | brleinad/guamapa-api | 5872589891a00ca02a1fc6e45a349f7e9a45a78e | [
"MIT"
] | null | null | null | guamapa/towns/migrations/0002_surveyanswer_surveyquestion.py | brleinad/guamapa-api | 5872589891a00ca02a1fc6e45a349f7e9a45a78e | [
"MIT"
] | null | null | null | guamapa/towns/migrations/0002_surveyanswer_surveyquestion.py | brleinad/guamapa-api | 5872589891a00ca02a1fc6e45a349f7e9a45a78e | [
"MIT"
] | 1 | 2021-04-30T16:48:23.000Z | 2021-04-30T16:48:23.000Z | # Generated by Django 3.1.5 on 2021-02-11 02:59
| 33.21875 | 120 | 0.592662 | # Generated by Django 3.1.5 on 2021-02-11 02:59
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('towns', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='SurveyQuest... | 0 | 0 | 0 | 904 | 0 | 0 | 0 | 20 | 90 |
d4b9a8e71ce5205cd1a2e7c71f00b372ee032270 | 22,883 | py | Python | models/criterions/John.py | MorganeAyle/SNIP-it | df2bf44d6d3f7e4ea7733242a79c916735a7b49e | [
"MIT"
] | null | null | null | models/criterions/John.py | MorganeAyle/SNIP-it | df2bf44d6d3f7e4ea7733242a79c916735a7b49e | [
"MIT"
] | null | null | null | models/criterions/John.py | MorganeAyle/SNIP-it | df2bf44d6d3f7e4ea7733242a79c916735a7b49e | [
"MIT"
] | null | null | null | import torch.autograd as autograd
import torch.nn as nn
| 43.669847 | 122 | 0.51016 | import copy
import types
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
from models.networks.assisting_layers.GateDecoratorLayers import GatedBatchNorm
from models.criterions.SNIP import SNIP
from utils.constants import SNIP_BATCH_ITERATIONS
from utils.data_utils i... | 0 | 0 | 0 | 22,397 | 0 | 0 | 0 | 185 | 244 |
55c8553fd33c76be6a286e96ceebbe52d030587f | 1,156 | py | Python | examples/tiltcompensation.py | jckw/Adafruit_LSM9DS0 | 98ff135fbf1702160a9277df1fd637022f91e234 | [
"MIT"
] | 6 | 2017-11-14T07:21:58.000Z | 2018-08-24T03:47:58.000Z | examples/tiltcompensation.py | jckw/Adafruit_LSM9DS0 | 98ff135fbf1702160a9277df1fd637022f91e234 | [
"MIT"
] | null | null | null | examples/tiltcompensation.py | jckw/Adafruit_LSM9DS0 | 98ff135fbf1702160a9277df1fd637022f91e234 | [
"MIT"
] | 2 | 2017-09-26T16:57:16.000Z | 2018-12-06T12:33:11.000Z | from __future__ import print_function
import Adafruit_LSM9DS0
import math
import time
# Create new LSM9DS0 instance
imu = Adafruit_LSM9DS0.LSM9DS0()
table = []
while True:
(mag_x, mag_y, mag_z) = imu.readMag()
(acc_x, acc_y, acc_z) = imu.readAccel()
# Normalising the accelerometer data
# Dividing variable (don... | 23.591837 | 122 | 0.725779 | from __future__ import print_function
import Adafruit_LSM9DS0
import math
from itertools import permutations
import time
from tabulate import tabulate
# Create new LSM9DS0 instance
imu = Adafruit_LSM9DS0.LSM9DS0()
table = []
while True:
(mag_x, mag_y, mag_z) = imu.readMag()
(acc_x, acc_y, acc_z) = imu.readAccel()... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 44 |
f7ae975bc4d1bec40d52c9209dd174a9422b13a2 | 1,726 | py | Python | scripts/sprot_speclist_to_taxonomy.py | hyphaltip/uniprot_tools | df0a2194fa2935c59bd01f2e02ee267ba836860f | [
"MIT"
] | 1 | 2021-07-09T22:59:36.000Z | 2021-07-09T22:59:36.000Z | scripts/sprot_speclist_to_taxonomy.py | hyphaltip/uniprot_tools | df0a2194fa2935c59bd01f2e02ee267ba836860f | [
"MIT"
] | null | null | null | scripts/sprot_speclist_to_taxonomy.py | hyphaltip/uniprot_tools | df0a2194fa2935c59bd01f2e02ee267ba836860f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import urllib.request
import sys
import re
import csv
csv.register_dialect('tsv', delimiter='\t', quoting=csv.QUOTE_NONE)
lookup_taxonomy = { 'A': 'Archaea',
'B': 'Bacteria',
'E': 'Eukaryota',
'V': 'Virus',
... | 39.227273 | 122 | 0.607764 | #!/usr/bin/env python3
import argparse
import urllib.request
import sys
import re
import csv
csv.register_dialect('tsv', delimiter='\t', quoting=csv.QUOTE_NONE)
lookup_taxonomy = { 'A': 'Archaea',
'B': 'Bacteria',
'E': 'Eukaryota',
'V': 'Virus',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04579d2d8ec2c1738e44ef70bc8558f4c420a574 | 8,992 | py | Python | chainer_wing/subwindows/prediction.py | fukatani/ChainerWing | 37a1435635cbc610dc86d15c8baca67622355757 | [
"MIT",
"BSD-3-Clause"
] | 26 | 2017-07-03T13:50:28.000Z | 2021-02-06T08:43:42.000Z | chainer_wing/subwindows/prediction.py | fukatani/CW_gui | 37a1435635cbc610dc86d15c8baca67622355757 | [
"MIT",
"BSD-3-Clause"
] | 10 | 2017-07-03T14:30:00.000Z | 2017-12-21T13:26:43.000Z | chainer_wing/subwindows/prediction.py | fukatani/CW_gui | 37a1435635cbc610dc86d15c8baca67622355757 | [
"MIT",
"BSD-3-Clause"
] | 6 | 2017-03-15T13:48:09.000Z | 2019-04-15T19:28:02.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './prediction.ui'
#
# Created by: PyQt5 UI code generator 5.7.1
#
# WARNING! All changes made in this file will be lost!
| 59.157895 | 106 | 0.741882 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './prediction.ui'
#
# Created by: PyQt5 UI code generator 5.7.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_PredictionWindow(object):
def setupUi(self, PredictionWindow):
... | 0 | 0 | 0 | 8,725 | 0 | 0 | 0 | 21 | 46 |
a2fd8c3fc12bea32afd7c3d2d0e6fdef55a1e5fb | 323 | py | Python | 2015/08/puzzle2.py | jsvennevid/adventofcode | c6d5e3e3a166ffad5e8a7cc829599f49607a1efe | [
"MIT"
] | null | null | null | 2015/08/puzzle2.py | jsvennevid/adventofcode | c6d5e3e3a166ffad5e8a7cc829599f49607a1efe | [
"MIT"
] | null | null | null | 2015/08/puzzle2.py | jsvennevid/adventofcode | c6d5e3e3a166ffad5e8a7cc829599f49607a1efe | [
"MIT"
] | null | null | null | import re
chars = 0
mem = 0
for i in open('day8.txt'):
line = i.strip()
chars += len(line)
s = re.sub(r'(?:(\")|(\\))', repl, line, flags=re.I)
mem += len(s) + 2
print mem - chars
| 17.944444 | 66 | 0.510836 | import re
chars = 0
mem = 0
def repl(p):
return {
'"': lambda: '\\"',
'\\': lambda: '\\\\',
}[filter(lambda x: x is not None, [p.group(0), p.group(1)])[0]]()
for i in open('day8.txt'):
line = i.strip()
chars += len(line)
s = re.sub(r'(?:(\")|(\\))', repl, line, flags=re.I)
mem += len(s) + 2
print mem - cha... | 0 | 0 | 0 | 0 | 0 | 114 | 0 | 0 | 23 |
327df5cb7462df6aa0ca1f214b64443189f0f951 | 1,694 | py | Python | Layers/hog.py | michalnand/machine_vision | 66391b78bf1ccfc67bffdfbc6530c6b339334766 | [
"MIT"
] | null | null | null | Layers/hog.py | michalnand/machine_vision | 66391b78bf1ccfc67bffdfbc6530c6b339334766 | [
"MIT"
] | null | null | null | Layers/hog.py | michalnand/machine_vision | 66391b78bf1ccfc67bffdfbc6530c6b339334766 | [
"MIT"
] | null | null | null | import numpy
from PIL import Image
import torch
img = Image.open("../images/computer.jpg")
img_np = numpy.array(img)/255.0
img_t = torch.from_numpy(img_np).float()
img_t = torch.mean(img_t, dim=2).unsqueeze(0).unsqueeze(1)
hog = HOGLayer()
y = hog(img_t)
y_np = y.detach().to("cpu").numpy()[0]
print(img_t.sh... | 23.859155 | 91 | 0.572019 | import numpy
from PIL import Image
import torch
class HOGLayer(torch.nn.Module):
def __init__(self, nbins=10, pool=8):
super(HOGLayer, self).__init__()
self.nbins = nbins
self.conv = torch.nn.Conv2d(1, 2, kernel_size=3, stride=1, padding=1, bias=False)
kernel = [ [1, 0, -1],... | 0 | 0 | 0 | 1,244 | 0 | 0 | 0 | 0 | 23 |
469a60f02319fb45a69fc654932cbb7829344987 | 28,809 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/models/hr_holidays.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/models/hr_holidays.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/models/hr_holidays.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
import logging
_logger = logging.getLogger(__name__)
HOURS_PER_DAY = 8
| 50.365385 | 173 | 0.626436 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2005-2006 Axelor SARL. (http://www.axelor.com)
import logging
import math
from datetime import timedelta
from werkzeug import url_encode
from odoo import api, fields, models
from odoo.exceptions import ... | 0 | 18,190 | 0 | 10,077 | 0 | 0 | 0 | 101 | 201 |
bd5c05c822b1bf38e9e52d649d8c699c0a7c18fd | 13,659 | py | Python | examples/api/brunel.py | tclose/Pype9 | 23f96c0885fd9df12d9d11ff800f816520e4b17a | [
"MIT"
] | null | null | null | examples/api/brunel.py | tclose/Pype9 | 23f96c0885fd9df12d9d11ff800f816520e4b17a | [
"MIT"
] | null | null | null | examples/api/brunel.py | tclose/Pype9 | 23f96c0885fd9df12d9d11ff800f816520e4b17a | [
"MIT"
] | 1 | 2021-04-08T12:46:21.000Z | 2021-04-08T12:46:21.000Z | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import sys
argv = sys.argv[1:]
if __name__ == '__main__':
run(sys.argv[1:])
| 47.926316 | 83 | 0.540742 | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from builtins import zip
import os.path
from itertools import groupby
from operator import itemgetter
import ninemlcatalog
import nest
import numpy as np
from nineml import units as un, Property
from nineml.user import Initial
i... | 0 | 0 | 0 | 0 | 0 | 13,000 | 0 | 85 | 398 |
806a8cea703e8f9a44dade655cb7b3da30017e99 | 32,399 | py | Python | src/common/env.py | sarvi/wisk | b8de452c526508bd94d065b6ddf7f1ff47261631 | [
"BSD-3-Clause"
] | 2 | 2020-10-01T09:15:51.000Z | 2020-10-06T17:28:29.000Z | src/common/env.py | sarvi/wisk | b8de452c526508bd94d065b6ddf7f1ff47261631 | [
"BSD-3-Clause"
] | null | null | null | src/common/env.py | sarvi/wisk | b8de452c526508bd94d065b6ddf7f1ff47261631 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on Feb 20, 2017
@author: sarvi
@copyright: 2017 Cisco Inc. All rights reserved.
'''
# pylint: disable=locally-disabled, too-many-lines
from __future__ import print_function
import base64
import collections
import datetime
import hashlib
import logging.handlers
import os
import platform
import pprint
im... | 38.206368 | 146 | 0.629032 | '''
Created on Feb 20, 2017
@author: sarvi
@copyright: 2017 Cisco Inc. All rights reserved.
'''
# pylint: disable=locally-disabled, too-many-lines
from __future__ import print_function
import base64
import collections
import datetime
import hashlib
import logging.handlers
import os
import platform
import pprint
im... | 0 | 0 | 0 | 729 | 0 | 0 | 0 | 17 | 91 |
65080b34dfd4ab397afe54617064401c6cb1c30e | 548 | py | Python | bin/get_access_token.py | jmatsu/remocon | f086a15c66861694994f77b98850e145dc89244c | [
"MIT"
] | 31 | 2018-03-19T03:09:53.000Z | 2021-05-21T02:00:32.000Z | bin/get_access_token.py | jmatsu/remocon | f086a15c66861694994f77b98850e145dc89244c | [
"MIT"
] | 4 | 2018-03-18T15:36:17.000Z | 2018-10-09T17:21:47.000Z | bin/get_access_token.py | jmatsu/remocon | f086a15c66861694994f77b98850e145dc89244c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# python 2.x
print_access_token() | 30.444444 | 100 | 0.762774 | #!/usr/bin/env python
# python 2.x
import sys
from oauth2client.service_account import ServiceAccountCredentials
def print_access_token():
argv = sys.argv
if (len(argv) < 1):
print >> sys.stderr, 'a filepath to service-account.json must be specified as the 1st argument.'
quit()
credentials = ServiceAcc... | 0 | 0 | 0 | 0 | 0 | 389 | 0 | 34 | 68 |
8a909a4fb565f6e2d6f4c36f3c8f766ff4b4f8eb | 8,606 | py | Python | main.py | LewisErick/swic-arch | 81d742f70cfef728fb3572362e18f6019aee45cb | [
"MIT"
] | null | null | null | main.py | LewisErick/swic-arch | 81d742f70cfef728fb3572362e18f6019aee45cb | [
"MIT"
] | null | null | null | main.py | LewisErick/swic-arch | 81d742f70cfef728fb3572362e18f6019aee45cb | [
"MIT"
] | null | null | null | import sys
# Interfaces
# Derived classes
# Text
# Reader
# Tokenizer
# Permutator
# Sorter
# [["clouds", "are", "White"] , ["are", "White", "Clouds"], ["White", "clouds", "are"]]
# Presenter
if __name__ == '__main__':
if len(sys.argv) < 5:
raise Exception('Specify one more param, the text fi... | 28.782609 | 114 | 0.592377 | from copy import copy
import functools
import os
import sys
# Interfaces
class Filter:
def execute_filter():
raise Exception('interface method')
class Text:
def __init__(self, content: str):
self._content = content
class Reader(Filter):
def __init__(self):
self._children = []
... | 0 | 0 | 0 | 7,042 | 0 | 0 | 0 | -17 | 395 |
760eb38cd9104a572d95e79fdb3a9e728a753b83 | 1,206 | py | Python | crudapp/employees/views.py | GillesJnr/Django-Employee-Database-App | b1d26b829b0e0d031f738859bafaf3a1c2074da2 | [
"MIT"
] | null | null | null | crudapp/employees/views.py | GillesJnr/Django-Employee-Database-App | b1d26b829b0e0d031f738859bafaf3a1c2074da2 | [
"MIT"
] | null | null | null | crudapp/employees/views.py | GillesJnr/Django-Employee-Database-App | b1d26b829b0e0d031f738859bafaf3a1c2074da2 | [
"MIT"
] | null | null | null | from . forms import EmployeeForm
from . models import Employee
# Create your views here.
| 30.15 | 96 | 0.644279 | from django.shortcuts import render, redirect
from . forms import EmployeeForm
from . models import Employee
# Create your views here.
def employee_list(request):
employee_data = Employee.objects.all()
# list_xs = {employee_data}
list_result = [entry for entry in employee_data] # converts ValuesQuerySet... | 0 | 0 | 0 | 0 | 0 | 999 | 0 | 24 | 91 |
6fd50a3078580f4c2ae447e7d7aac7fe3f559c16 | 2,655 | py | Python | lib/rapidsms/templatetags/pagination_tags.py | dimagi/rapidsms-core-dev | aed753545ae01c279489f5a00e7f12ec432e11bf | [
"BSD-3-Clause"
] | 3 | 2015-04-17T04:47:31.000Z | 2018-04-02T17:44:19.000Z | lib/rapidsms/templatetags/pagination_tags.py | phillbaker/rapidsms-python2.5 | fc89ee49d0a7e1c52f9f0e699436c2241f00b116 | [
"BSD-3-Clause"
] | null | null | null | lib/rapidsms/templatetags/pagination_tags.py | phillbaker/rapidsms-python2.5 | fc89ee49d0a7e1c52f9f0e699436c2241f00b116 | [
"BSD-3-Clause"
] | 4 | 2015-01-30T02:53:13.000Z | 2019-11-08T11:08:20.000Z | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django import template
register = template.Library()
# when this module is imported via {% load pagination_tags %}, it is
# imported as django.templatetags.pagination_tags, which prevents a
# relative import (..conf) to rapidsms from working here. in fact, that
... | 32.777778 | 72 | 0.66968 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import math
from django import template
register = template.Library()
# when this module is imported via {% load pagination_tags %}, it is
# imported as django.templatetags.pagination_tags, which prevents a
# relative import (..conf) to rapidsms from working here. i... | 0 | 1,698 | 0 | 0 | 0 | 395 | 0 | 3 | 91 |