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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3cdcd455b3c8f3debe57480c3176ed5a442740e8 | 41 | py | Python | lib/handshake/const.py | Bitwise-01/Apex-2.0 | ba2bcad582c9e6cc3b9d0352ddb5c13998fdeded | [
"MIT"
] | 12 | 2021-07-26T22:03:08.000Z | 2022-03-06T16:43:50.000Z | lib/handshake/const.py | Bitwise-01/Apex-2.0 | ba2bcad582c9e6cc3b9d0352ddb5c13998fdeded | [
"MIT"
] | 1 | 2021-08-14T08:49:46.000Z | 2021-08-14T08:49:46.000Z | lib/handshake/const.py | Bitwise-01/Apex-2.0 | ba2bcad582c9e6cc3b9d0352ddb5c13998fdeded | [
"MIT"
] | 2 | 2022-01-01T16:55:16.000Z | 2022-01-16T01:09:24.000Z | '''All configs for handshake go here
'''
| 13.666667 | 36 | 0.682927 | '''All configs for handshake go here
'''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6d17fe30703e3ef776ea644bc0a1ac15db1e63c | 10,762 | py | Python | datasets/__init__.py | niloofarAzari/SFSegNets | ce97d2e7dfd7cf3f3d2af7b0c31e23e51df6b182 | [
"MIT"
] | 311 | 2020-07-06T04:31:33.000Z | 2022-03-30T07:22:04.000Z | datasets/__init__.py | zfxu/DecoupleSegNets | 26df59e0de4b5e610c7369b5bb8ba8c125e389bf | [
"MIT"
] | 56 | 2020-09-10T10:39:50.000Z | 2022-03-31T16:52:44.000Z | datasets/__init__.py | zfxu/DecoupleSegNets | 26df59e0de4b5e610c7369b5bb8ba8c125e389bf | [
"MIT"
] | 31 | 2020-08-13T01:57:26.000Z | 2022-03-14T03:30:48.000Z | """
Dataset setup and loaders
This file including the different datasets processing pipelines
"""
from datasets import cityscapes
from datasets import mapillary
from datasets import kitti
from datasets import camvid
from datasets import bdd
import torchvision.transforms as standard_transforms
import transforms.joint_... | 39.859259 | 133 | 0.630552 | """
Dataset setup and loaders
This file including the different datasets processing pipelines
"""
from datasets import cityscapes
from datasets import mapillary
from datasets import kitti
from datasets import camvid
from datasets import bdd
import torchvision.transforms as standard_transforms
import transforms.joint_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
96edfcb4a300d8e5f3e9f651c29468c23512f93f | 3,118 | py | Python | 17_mad_libs/test.py | frank-gear/tiny_python_projects | c72d0985f62ac7c2104b110aadc9e97cf38268e6 | [
"MIT"
] | null | null | null | 17_mad_libs/test.py | frank-gear/tiny_python_projects | c72d0985f62ac7c2104b110aadc9e97cf38268e6 | [
"MIT"
] | null | null | null | 17_mad_libs/test.py | frank-gear/tiny_python_projects | c72d0985f62ac7c2104b110aadc9e97cf38268e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""tests for mad_lib.py"""
import re
import os
import random
import string
from subprocess import getstatusoutput
prg = './mad.py'
no_blanks = 'inputs/no_blanks.txt'
fox = 'inputs/fox.txt'
hlp = 'inputs/help.txt'
verona = 'inputs/romeo_juliet.txt'
# ---------------------------... | 27.350877 | 78 | 0.541693 | #!/usr/bin/env python3
"""tests for mad_lib.py"""
import re
import os
import random
import string
from subprocess import getstatusoutput
prg = './mad.py'
no_blanks = 'inputs/no_blanks.txt'
fox = 'inputs/fox.txt'
hlp = 'inputs/help.txt'
verona = 'inputs/romeo_juliet.txt'
# ---------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
539a95d0b0041df826d7f66ea885e097a940ad7a | 451 | py | Python | examples/export_example.py | lucasqiu/ChatterBot | e9a490e8a9d67cd7b73f23878451e8b26371b351 | [
"BSD-3-Clause"
] | 2 | 2021-04-05T03:02:50.000Z | 2021-04-05T05:00:11.000Z | examples/export_example.py | mesadhan/ChatterBot | e9a490e8a9d67cd7b73f23878451e8b26371b351 | [
"BSD-3-Clause"
] | null | null | null | examples/export_example.py | mesadhan/ChatterBot | e9a490e8a9d67cd7b73f23878451e8b26371b351 | [
"BSD-3-Clause"
] | null | null | null | from chatterbot import ChatBot
'''
This is an example showing how to create an export file from
an existing chat bot that can then be used to train other bots.
'''
chatbot = ChatBot(
'Export Example Bot',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# First, lets train our bot with some data
chatb... | 25.055556 | 63 | 0.758315 | from chatterbot import ChatBot
'''
This is an example showing how to create an export file from
an existing chat bot that can then be used to train other bots.
'''
chatbot = ChatBot(
'Export Example Bot',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# First, lets train our bot with some data
chatb... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43c65235457651a836f5d0a28092612e02767fe5 | 309 | py | Python | products_list.py | aimarket/bestbuy-discord-monitor | 3841eced0e453928fd82ca42e06c938890e0e469 | [
"MIT"
] | 3 | 2020-05-20T07:13:14.000Z | 2021-11-21T10:38:26.000Z | products_list.py | aimarket/bestbuy-discord-monitor | 3841eced0e453928fd82ca42e06c938890e0e469 | [
"MIT"
] | null | null | null | products_list.py | aimarket/bestbuy-discord-monitor | 3841eced0e453928fd82ca42e06c938890e0e469 | [
"MIT"
] | 3 | 2020-05-20T07:06:34.000Z | 2020-09-27T04:45:16.000Z | """
=====================================================
Insert Best Buy website in list, seperated by a comma
=====================================================
"""
products_list =[#e.g."https://www.bestbuy.com/site/combo/nintendo-switch/",
"PASTE LINK HERE BETWEEN QUOTES",]
| 30.9 | 76 | 0.404531 | """
=====================================================
Insert Best Buy website in list, seperated by a comma
=====================================================
"""
products_list =[#e.g."https://www.bestbuy.com/site/combo/nintendo-switch/",
"PASTE LINK HERE BETWEEN QUOTES",]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7b04ea19f4a1d6c0393ca2fd7ab728bed74427d7 | 558 | py | Python | Task1C.py | otss2/1CW-Computing-Project | 6e19d04ec0ca1f8bcaf047424b74a9bcde96f85b | [
"MIT"
] | null | null | null | Task1C.py | otss2/1CW-Computing-Project | 6e19d04ec0ca1f8bcaf047424b74a9bcde96f85b | [
"MIT"
] | null | null | null | Task1C.py | otss2/1CW-Computing-Project | 6e19d04ec0ca1f8bcaf047424b74a9bcde96f85b | [
"MIT"
] | null | null | null | from floodsystem.stationdata import build_station_list
from floodsystem.geo import stations_within_radius
def run():
"""Requirements for Task 1C"""
# Build list of stations
stations = build_station_list()
# Build list of stations within certain radius of specified point
stations_in_radius = stati... | 29.368421 | 80 | 0.729391 | from floodsystem import geo
from floodsystem.stationdata import build_station_list
from floodsystem.geo import stations_within_radius
def run():
"""Requirements for Task 1C"""
# Build list of stations
stations = build_station_list()
# Build list of stations within certain radius of specified point
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 22 |
183083357080d888dc5a28adca9119fc03e4d328 | 2,137 | py | Python | fastinference/_nbdev.py | rsomani95/fastinference | 6c10722a4a153da7e2f38cbc1ac968f85215bf6c | [
"Apache-2.0"
] | null | null | null | fastinference/_nbdev.py | rsomani95/fastinference | 6c10722a4a153da7e2f38cbc1ac968f85215bf6c | [
"Apache-2.0"
] | null | null | null | fastinference/_nbdev.py | rsomani95/fastinference | 6c10722a4a153da7e2f38cbc1ac968f85215bf6c | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"Learner.get_preds": "00_inference.ipynb",
"Learner.predict": "00_inference.ipynb",
"TabularLearner.predict": "00_inference.ipynb",
"Interpret": "01_tabular.core.ipynb",
"s... | 42.74 | 80 | 0.641554 | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"Learner.get_preds": "00_inference.ipynb",
"Learner.predict": "00_inference.ipynb",
"TabularLearner.predict": "00_inference.ipynb",
"Interpret": "01_tabular.core.ipynb",
"s... | 0 | 0 | 0 | 0 | 0 | 18 | 0 | 0 | 23 |
f52b8eb489be3b8868644326835c81b7eb6a2e69 | 2,633 | py | Python | src/pte/plotting/clusterplot.py | richardkoehler/pynm-decode | 3120a410d79d3fce45d0f59025d68ba2d5e80d9e | [
"MIT"
] | 1 | 2022-01-08T09:33:09.000Z | 2022-01-08T09:33:09.000Z | src/pte/plotting/clusterplot.py | richardkoehler/pynm-decode | 3120a410d79d3fce45d0f59025d68ba2d5e80d9e | [
"MIT"
] | null | null | null | src/pte/plotting/clusterplot.py | richardkoehler/pynm-decode | 3120a410d79d3fce45d0f59025d68ba2d5e80d9e | [
"MIT"
] | null | null | null | """Module for plotting clusters."""
from pathlib import Path
from matplotlib import pyplot as plt
import matplotlib.figure
import numpy as np
import pte_stats
def clusterplot_combined(
power_a: np.ndarray,
power_b: np.ndarray | int | float,
extent: tuple | list,
alpha: float = 0.05,
n_perm: int =... | 25.813725 | 75 | 0.579567 | """Module for plotting clusters."""
from pathlib import Path
from matplotlib import pyplot as plt
import matplotlib.figure
import numpy as np
import pte_stats
def clusterplot_combined(
power_a: np.ndarray,
power_b: np.ndarray | int | float,
extent: tuple | list,
alpha: float = 0.05,
n_perm: int =... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c8a569bf86c0671d964909d7eb04612b84f39ca | 1,206 | py | Python | search/dictionary.py | makethemo/AskMe | cd2d006d500f4c79cd0465161e66c44e37635b76 | [
"Apache-2.0"
] | 2 | 2017-12-29T11:09:15.000Z | 2018-09-13T10:12:03.000Z | search/dictionary.py | makethemo/AskMe | cd2d006d500f4c79cd0465161e66c44e37635b76 | [
"Apache-2.0"
] | 6 | 2017-12-17T08:31:12.000Z | 2017-12-26T14:21:30.000Z | search/dictionary.py | makethemo/AskMe | cd2d006d500f4c79cd0465161e66c44e37635b76 | [
"Apache-2.0"
] | 6 | 2017-12-15T04:59:58.000Z | 2019-12-01T20:47:12.000Z | import json
import path
with open(path.KEY_PATH, 'r') as data_file:
data = json.load(data_file)
if __name__ == '__main__':
"""
"""
search_keyword_by_naver_dic('')
| 30.15 | 96 | 0.627695 | import urllib.request, json, re
import path
with open(path.KEY_PATH, 'r') as data_file:
data = json.load(data_file)
def search_keyword_by_naver_dic(input_text):
client_id = data['search_api-id']
client_secret = data['search_api-secret']
encText = urllib.parse.quote(input_text)
url = "https://ope... | 69 | 0 | 0 | 0 | 0 | 950 | 0 | 20 | 23 |
658e4870f57397d255ef18d90009a3b47dea1ef5 | 3,480 | py | Python | tests/trainers/test_segmentation.py | khlaifiabilel/torchgeo | 33efc2c0ca6ad7a5af9e29ddcedf67265fa8721f | [
"MIT"
] | null | null | null | tests/trainers/test_segmentation.py | khlaifiabilel/torchgeo | 33efc2c0ca6ad7a5af9e29ddcedf67265fa8721f | [
"MIT"
] | null | null | null | tests/trainers/test_segmentation.py | khlaifiabilel/torchgeo | 33efc2c0ca6ad7a5af9e29ddcedf67265fa8721f | [
"MIT"
] | 1 | 2021-09-18T22:31:53.000Z | 2021-09-18T22:31:53.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
| 35.876289 | 85 | 0.659483 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from typing import Any, Dict, Generator, cast
import pytest
from _pytest.fixtures import SubRequest
from _pytest.monkeypatch import MonkeyPatch
from omegaconf import OmegaConf
from torchgeo.datamodules import Ches... | 0 | 1,399 | 0 | 1,612 | 0 | 0 | 0 | 149 | 225 |
136666bf70ede41ff7b5d9a5cdfa5ec3cdbba499 | 313 | py | Python | web/anuncios/views.py | Hercita/EXAMEN_FINAL | 8c6b1bf1b3f12089c7fd9d5c6195cbfeb9574179 | [
"CC0-1.0"
] | null | null | null | web/anuncios/views.py | Hercita/EXAMEN_FINAL | 8c6b1bf1b3f12089c7fd9d5c6195cbfeb9574179 | [
"CC0-1.0"
] | null | null | null | web/anuncios/views.py | Hercita/EXAMEN_FINAL | 8c6b1bf1b3f12089c7fd9d5c6195cbfeb9574179 | [
"CC0-1.0"
] | null | null | null | # Create your views here. | 34.777778 | 70 | 0.763578 | from django.shortcuts import render
from anuncios.models import Anuncio
# Create your views here.
def anuncios(request):
anuncios = Anuncio.objects.filter(status='publicado')
return render(request,'anuncios/index.html',{'anuncios':anuncios})
def home(request):
return render(request,"web/index.html") | 0 | 0 | 0 | 0 | 0 | 171 | 0 | 28 | 89 |
7e2680efb1e402a1fbdb89ff5ab07917a1946ae4 | 1,296 | py | Python | docs/source/examples/ex_cross_section.py | ebisim/ebisim | 7197767a4d69fa1f7d5f0582eaf8f35c30f0b1f3 | [
"MIT"
] | 2 | 2021-03-11T11:01:18.000Z | 2021-03-12T11:58:20.000Z | docs/source/examples/ex_cross_section.py | ebisim/ebisim | 7197767a4d69fa1f7d5f0582eaf8f35c30f0b1f3 | [
"MIT"
] | 14 | 2019-06-03T14:56:55.000Z | 2021-07-21T20:01:27.000Z | docs/source/examples/ex_cross_section.py | HPLegion/EBISSimulation | 7197767a4d69fa1f7d5f0582eaf8f35c30f0b1f3 | [
"MIT"
] | 1 | 2019-03-13T13:13:05.000Z | 2019-03-13T13:13:05.000Z | """Example: Plotting cross sections"""
from matplotlib.pyplot import show
import ebisim as eb
# The cross section plot commands accept a number of formats for the element parameter
# This example shows the different possibilities
# The first option is to provide an instance of the Element class
potassium = eb.get_el... | 40.5 | 92 | 0.78858 | """Example: Plotting cross sections"""
from matplotlib.pyplot import show
import ebisim as eb
# The cross section plot commands accept a number of formats for the element parameter
# This example shows the different possibilities
# The first option is to provide an instance of the Element class
potassium = eb.get_el... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d34740d1ba2e1ded85568ef53f8761b641a9690e | 247 | py | Python | Desafios/Desafio13.py | Punkays/Phyton3-Estudos | 047ef62ddaf506fe3f653de3a1b2999874bbf12f | [
"Unlicense"
] | null | null | null | Desafios/Desafio13.py | Punkays/Phyton3-Estudos | 047ef62ddaf506fe3f653de3a1b2999874bbf12f | [
"Unlicense"
] | null | null | null | Desafios/Desafio13.py | Punkays/Phyton3-Estudos | 047ef62ddaf506fe3f653de3a1b2999874bbf12f | [
"Unlicense"
] | null | null | null |
# ! Desafio 13
# ! Faa um programa que leia o salario de um funcionario e mnostre seu novo salario com 15% de aumento
po = int(input('Digite seu salario '))
pa = (15/100) * po
x = po + pa
print('Seu salario com 15% de aumenta : {}'.format(x)) | 30.875 | 103 | 0.672065 |
# ! Desafio 13
# ! Faça um programa que leia o salario de um funcionario e mnostre seu novo salario com 15% de aumento
po = int(input('Digite seu salario '))
pa = (15/100) * po
x = po + pa
print('Seu salario com 15% de aumenta é: {}'.format(x)) | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6e821f70e3b489bcfb270e3a00e210f1328f924 | 99 | py | Python | src/utils.py | Zummation/IQNewsClip-Web-Scraper | cdc539196bc6340db2995b97201fac2a59897cb6 | [
"MIT"
] | 2 | 2020-03-14T18:17:09.000Z | 2020-03-15T17:26:52.000Z | src/utils.py | tongplw/IQNewsClip-Web-Scraper | cdc539196bc6340db2995b97201fac2a59897cb6 | [
"MIT"
] | 2 | 2021-03-31T20:27:48.000Z | 2021-12-13T20:32:05.000Z | src/utils.py | Zummation/IQNewsClip-Web-Scraper | cdc539196bc6340db2995b97201fac2a59897cb6 | [
"MIT"
] | null | null | null | SOURCES_CODE = {
'' : 'nAll',
'' : '01300000',
'' : '01600000',
} | 19.8 | 28 | 0.454545 | SOURCES_CODE = {
'ทุกสื่อ' : 'nAll',
'ข่าวหุ้น' : '01300000',
'ทันหุ้น' : '01600000',
} | 66 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb21933604971b818d553963d3bc1e8bbcafb0df | 6,992 | py | Python | pmdarima/arima/_context.py | tuomijal/pmdarima | 5bf84a2a5c42b81b949bd252ad3d4c6c311343f8 | [
"MIT"
] | 736 | 2019-12-02T01:33:31.000Z | 2022-03-31T21:45:29.000Z | pmdarima/arima/_context.py | tuomijal/pmdarima | 5bf84a2a5c42b81b949bd252ad3d4c6c311343f8 | [
"MIT"
] | 186 | 2019-12-01T18:01:33.000Z | 2022-03-31T18:27:56.000Z | pmdarima/arima/_context.py | tuomijal/pmdarima | 5bf84a2a5c42b81b949bd252ad3d4c6c311343f8 | [
"MIT"
] | 126 | 2019-12-07T04:03:19.000Z | 2022-03-31T17:40:14.000Z | # -*- coding: utf-8 -*-
#
# Author: Krishna Sunkara (kpsunkara)
#
# Re-entrant, reusable context manager to store execution context. Introduced
# in pmdarima 1.5.0 (see #221), redesigned not to use thread locals in #273
# (see #275 for context).
__all__ = ['AbstractContext', 'ContextStore', 'ContextType']
_ctx = _C... | 29.880342 | 79 | 0.626859 | # -*- coding: utf-8 -*-
#
# Author: Krishna Sunkara (kpsunkara)
#
# Re-entrant, reusable context manager to store execution context. Introduced
# in pmdarima 1.5.0 (see #221), redesigned not to use thread locals in #273
# (see #275 for context).
from abc import ABC, abstractmethod
from enum import Enum
import collecti... | 0 | 4,216 | 0 | 2,245 | 0 | 0 | 0 | 11 | 182 |
a8f4cf0b0938eb68c03bf8a5dd67d2d0b5030f80 | 2,781 | py | Python | Core.py | archwl/Cici | 1c1f8e51488e5c1ea9799829b325397380384beb | [
"MIT"
] | null | null | null | Core.py | archwl/Cici | 1c1f8e51488e5c1ea9799829b325397380384beb | [
"MIT"
] | null | null | null | Core.py | archwl/Cici | 1c1f8e51488e5c1ea9799829b325397380384beb | [
"MIT"
] | null | null | null | '''
The heart of Cici
'''
import discord
import os
enclosing_dir = os.path.dirname(os.path.realpath(__file__))
config = load_config()
db_path = f'{enclosing_dir}/data.db'
bot = Cici(
command_prefix=get_prefix,
description='Cici',
intents=discord.Intents.all()
)
if __name__ == '__main__':
... | 27 | 120 | 0.641855 | '''
The heart of Cici
'''
import discord
import os
import json
import aiosqlite
from functools import lru_cache
from aiohttp import ClientSession
from discord.ext.commands import Bot
enclosing_dir = os.path.dirname(os.path.realpath(__file__))
def dict_bool_eval(_dict, _key):
return _key in _dict and bool(_key)
... | 0 | 785 | 370 | 464 | 0 | 532 | 0 | 22 | 271 |
851f3532c64518c2990d8d5f15efc15aa0bb9a31 | 384 | py | Python | desafio/desafio020.py | henriquekirchheck/Curso-em-video-Python | 1a29f68515313af85c8683f626ba35f8fcdd10e7 | [
"MIT"
] | null | null | null | desafio/desafio020.py | henriquekirchheck/Curso-em-video-Python | 1a29f68515313af85c8683f626ba35f8fcdd10e7 | [
"MIT"
] | null | null | null | desafio/desafio020.py | henriquekirchheck/Curso-em-video-Python | 1a29f68515313af85c8683f626ba35f8fcdd10e7 | [
"MIT"
] | null | null | null | # O mesmo professor do desafio anterior quer sortear a ordem de apresentao dos alunos. Faa um programa que leia o nome dos quatro alunos e mostre a ordem sorteada
from random import shuffle
a1 = str(input('Aluno n1: '))
a2 = str(input('Aluno n2: '))
a3 = str(input('Aluno n3: '))
a4 = str(input('Aluno n4: '))
a = [a1... | 29.538462 | 165 | 0.682292 | # O mesmo professor do desafio anterior quer sortear a ordem de apresentação dos alunos. Faça um programa que leia o nome dos quatro alunos e mostre a ordem sorteada
from random import shuffle
a1 = str(input('Aluno n1: '))
a2 = str(input('Aluno n2: '))
a3 = str(input('Aluno n3: '))
a4 = str(input('Aluno n4: '))
a = ... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d9b7b39866f25631ff6a01f00fdb1f171abec72 | 185 | py | Python | importing_questions.py | mohamadaref/telegram_bot | 80eaa1da29c8c2f2990f26315b667d5a85e57d14 | [
"MIT"
] | 1 | 2019-09-19T07:05:05.000Z | 2019-09-19T07:05:05.000Z | importing_questions.py | mohamadaref/telegram_bot | 80eaa1da29c8c2f2990f26315b667d5a85e57d14 | [
"MIT"
] | null | null | null | importing_questions.py | mohamadaref/telegram_bot | 80eaa1da29c8c2f2990f26315b667d5a85e57d14 | [
"MIT"
] | null | null | null | from pandas import read_excel
data = read_excel('data/questions_and_choices.xlsx')
print(data.columns[2])
# print(data.head())
| 18.5 | 52 | 0.8 | import numpy
import xlsxwriter
from pandas import read_excel
import xlrd
import pandas
data = read_excel('data/questions_and_choices.xlsx')
print(data.columns[2])
# print(data.head())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -31 | 88 |
be77cd52b02ff2d6a2dc8fa807cacf01e47a6fc8 | 2,555 | py | Python | tweepy_setup.py | FeXd/saskvaccine | 9df8b25f262cf7666534da9735365e9a0a5c16b9 | [
"MIT"
] | 2 | 2021-07-15T23:19:20.000Z | 2021-07-19T04:52:08.000Z | tweepy_setup.py | FeXd/saskvaccine | 9df8b25f262cf7666534da9735365e9a0a5c16b9 | [
"MIT"
] | 7 | 2021-05-04T14:03:32.000Z | 2021-05-19T20:22:53.000Z | tweepy_setup.py | FeXd/saskwildfire | 06926a672a82a4d8bf9a1004d2d8d754c6ac3508 | [
"MIT"
] | 1 | 2021-04-29T19:01:05.000Z | 2021-04-29T19:01:05.000Z | # TWEEPY DOCUMENTATION - https://docs.tweepy.org/en/latest/
# AUTHENTICATION TUTORIAL - https://docs.tweepy.org/en/latest/auth_tutorial.html
import tweepy
# YOU MUST HAVE A TWITTER DEVELOPER ACCOUNT TO USE
# https://developer.twitter.com/en/apply-for-access
# All new developers must apply for a developer account to ac... | 35.985915 | 100 | 0.739726 | # TWEEPY DOCUMENTATION - https://docs.tweepy.org/en/latest/
# AUTHENTICATION TUTORIAL - https://docs.tweepy.org/en/latest/auth_tutorial.html
import tweepy
# YOU MUST HAVE A TWITTER DEVELOPER ACCOUNT TO USE
# https://developer.twitter.com/en/apply-for-access
# All new developers must apply for a developer account to ac... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a4e209109d8d5dd870aa66013b5052a6c51c4ad2 | 710 | py | Python | qutipy/channels/amplitude_damping_channel.py | sumeetkhatri/QuTIPy | ca2a3344c1caa818504425496ea37278d80b1c44 | [
"Apache-2.0"
] | 19 | 2020-11-11T13:00:22.000Z | 2022-03-14T11:18:04.000Z | qutipy/channels/amplitude_damping_channel.py | sumeetkhatri/QuTIPy | ca2a3344c1caa818504425496ea37278d80b1c44 | [
"Apache-2.0"
] | null | null | null | qutipy/channels/amplitude_damping_channel.py | sumeetkhatri/QuTIPy | ca2a3344c1caa818504425496ea37278d80b1c44 | [
"Apache-2.0"
] | 1 | 2022-03-03T15:20:15.000Z | 2022-03-03T15:20:15.000Z | '''
This code is part of QuTIpy.
(c) Copyright Sumeet Khatri, 2021
This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
Any modifications or derivative wor... | 24.482759 | 75 | 0.719718 | '''
This code is part of QuTIpy.
(c) Copyright Sumeet Khatri, 2021
This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
Any modifications or derivative wor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8b63b4e72522669569bfe16afef4e18f0b84f63c | 152 | py | Python | prod.py | paramsingh/socially-awkward | 176f74dcc8c5797ee1f6ea6267963392250287dd | [
"MIT"
] | 7 | 2019-03-11T05:45:42.000Z | 2019-12-06T07:31:37.000Z | prod.py | adarshrana205/socially-awkward | 176f74dcc8c5797ee1f6ea6267963392250287dd | [
"MIT"
] | null | null | null | prod.py | adarshrana205/socially-awkward | 176f74dcc8c5797ee1f6ea6267963392250287dd | [
"MIT"
] | 2 | 2019-05-08T15:30:36.000Z | 2019-11-30T20:28:53.000Z | from social.db import create_tables, drop_tables
from social.webserver import create_app
if True:
drop_tables()
create_tables()
app = create_app()
| 19 | 48 | 0.789474 | from social.db import create_tables, drop_tables
from social.webserver import create_app
if True:
drop_tables()
create_tables()
app = create_app()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a4ce58e7e0a7a1c8d846dc8d519ee3df18e70778 | 1,451 | py | Python | muted/system/cmd_move.py | ann884511/mule | ddc3da77188fe25f346ba0c341a83cd5ad94143e | [
"MIT"
] | 1 | 2019-06-06T07:21:09.000Z | 2019-06-06T07:21:09.000Z | muted/system/cmd_move.py | ann884511/mule | ddc3da77188fe25f346ba0c341a83cd5ad94143e | [
"MIT"
] | null | null | null | muted/system/cmd_move.py | ann884511/mule | ddc3da77188fe25f346ba0c341a83cd5ad94143e | [
"MIT"
] | null | null | null |
from __future__ import annotations
# cmd_move.py
| 28.45098 | 78 | 0.678153 |
from __future__ import annotations
from typing import List
from typing import Type
from component.exit import Exit
from component.role import Role
from component.room import Room
from event.event import Event
from message.message import Message
from system.channel import Channel
from logcat.logcat import LogCat
c... | 18 | 1,043 | 0 | -7 | 0 | 0 | 0 | 80 | 278 |
d244fa1afe08ae18b5f6d9733ac478ea0a0df46a | 11,670 | py | Python | cupcake2/ice2/IceUtils2.py | fanglu01/cDNA_Cupcake | 60f56dc291661a2b84e40b64d469fba658889c34 | [
"BSD-3-Clause-Clear"
] | 1 | 2018-09-21T06:20:50.000Z | 2018-09-21T06:20:50.000Z | cupcake2/ice2/IceUtils2.py | fanglu01/cDNA_Cupcake | 60f56dc291661a2b84e40b64d469fba658889c34 | [
"BSD-3-Clause-Clear"
] | null | null | null | cupcake2/ice2/IceUtils2.py | fanglu01/cDNA_Cupcake | 60f56dc291661a2b84e40b64d469fba658889c34 | [
"BSD-3-Clause-Clear"
] | null | null | null |
import numpy as np
from pbtranscript.Utils import execute
from pbtranscript.ice.IceUtils import alignment_has_large_nonmatch
gcon2_py = "ice_pbdagcon2.py"
def sanity_check_gcon2():
"""Sanity check gcon."""
cmd = gcon2_py + " --help"
errmsg = gcon2_py + " is not installed."
execute(cmd=cmd, errmsg=er... | 42.904412 | 176 | 0.587147 |
import numpy as np
from pbtranscript.Utils import execute
from pbtranscript.ice.IceUtils import alignment_has_large_nonmatch, HitItem, eval_blasr_alignment
from pbtranscript.io import LA4IceReader, BLASRM5Reader
gcon2_py = "ice_pbdagcon2.py"
def sanity_check_gcon2():
"""Sanity check gcon."""
cmd = gcon2_py +... | 0 | 0 | 0 | 0 | 7,399 | 0 | 0 | 65 | 68 |
9b54fcc5d7450ffdf85d29ea20f7756ca615e32d | 10,045 | py | Python | cvinspector/ml/plot.py | levanhieu-git/cv-inspector | d7e83732a688485587f795cc296a405639c5073d | [
"Apache-2.0"
] | 2 | 2021-02-20T23:45:38.000Z | 2021-03-07T01:47:45.000Z | cvinspector/ml/plot.py | UCI-Networking-Group/cv-inspector | 86334e1dce06b4530ebd22ef6d7a047fb728ed1a | [
"Apache-2.0"
] | null | null | null | cvinspector/ml/plot.py | UCI-Networking-Group/cv-inspector | 86334e1dce06b4530ebd22ef6d7a047fb728ed1a | [
"Apache-2.0"
] | 2 | 2021-02-20T23:28:06.000Z | 2021-11-29T12:33:29.000Z | # Copyright (c) 2021 Hieu Le and the UCI Networking Group
# <https://athinagroup.eng.uci.edu>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 38.049242 | 106 | 0.601294 | # Copyright (c) 2021 Hieu Le and the UCI Networking Group
# <https://athinagroup.eng.uci.edu>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 0 | 0 | 0 | 0 | 0 | 8,783 | 0 | 303 | 179 |
4aeaad0033430980c4e86745e3f3e093ed186f79 | 298 | py | Python | D2/frontend.py | slzjw26/learn_Pthon | 9c4053ec1ea4c32a01fa2658499d8e53a4a532f3 | [
"MIT"
] | null | null | null | D2/frontend.py | slzjw26/learn_Pthon | 9c4053ec1ea4c32a01fa2658499d8e53a4a532f3 | [
"MIT"
] | null | null | null | D2/frontend.py | slzjw26/learn_Pthon | 9c4053ec1ea4c32a01fa2658499d8e53a4a532f3 | [
"MIT"
] | null | null | null |
addr = ('127.0.0.1', 3001)
if __name__ == '__main__':
run() | 16.555556 | 60 | 0.54698 | import socket
def run():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(addr)
while True:
msg = input('>>> ')
if not msg:
break
sock.send(msg.encode()+b'\n')
addr = ('127.0.0.1', 3001)
if __name__ == '__main__':
run() | 0 | 0 | 0 | 0 | 0 | 193 | 0 | -8 | 45 |
b38a3e998daf6965786239516a3b3274009b5428 | 4,337 | py | Python | oom_lister.py | aebm/tools | 4c7f5acc857f34069c5fed855fbdb4f4fab421b5 | [
"BSD-2-Clause"
] | 1 | 2015-02-16T08:35:39.000Z | 2015-02-16T08:35:39.000Z | oom_lister.py | aebm/tools | 4c7f5acc857f34069c5fed855fbdb4f4fab421b5 | [
"BSD-2-Clause"
] | null | null | null | oom_lister.py | aebm/tools | 4c7f5acc857f34069c5fed855fbdb4f4fab421b5 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# List the process ordered by oom score
from __future__ import print_function
try:
from string import maketrans
except ImportError:
# we are using python3 so this is a str static method
maketrans = str.maketrans
PROC = '/proc'
SCORE = 'oom_score'
CMD = 'cmdline'
STATUS = 'status'
HEA... | 32.856061 | 78 | 0.613327 | #!/usr/bin/env python
# List the process ordered by oom score
from __future__ import print_function
import argparse
from codecs import decode
from operator import itemgetter
from os import listdir
from os.path import join
import sys
try:
from string import maketrans
except ImportError:
# we are using python3 s... | 0 | 0 | 0 | 0 | 0 | 3,615 | 0 | 1 | 293 |
a6da254ca4dedd3b588a47f333cdf7c050bbefa4 | 2,163 | py | Python | templet/__init__.py | a-sk/templet | 11d2232d90abd04b4fab8312a9dae47b7ebff2cc | [
"0BSD"
] | null | null | null | templet/__init__.py | a-sk/templet | 11d2232d90abd04b4fab8312a9dae47b7ebff2cc | [
"0BSD"
] | null | null | null | templet/__init__.py | a-sk/templet | 11d2232d90abd04b4fab8312a9dae47b7ebff2cc | [
"0BSD"
] | null | null | null | import os
import jinja2
import shutil
from . import utils
from codecs import open
__all__ = ['handle_project']
def copy(src, dst):
"""Copy file or directory from src to dst"""
if os.path.isfile(src):
shutil.copy(src, dst)
elif os.path.isdir(src):
shutil.copytree(src, dst)
return dst
... | 30.9 | 78 | 0.684697 | import os
import jinja2
import shutil
from . import utils
from codecs import open
__all__ = ['handle_project']
def copy(src, dst):
"""Copy file or directory from src to dst"""
if os.path.isfile(src):
shutil.copy(src, dst)
elif os.path.isdir(src):
shutil.copytree(src, dst)
return dst
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
35a00aa5d15733e03cb27d2e50c905e13d0a60ec | 3,496 | py | Python | ias/annotation/split_inputs_into_groups.py | olga-clarifai/clarifai-python-grpc | c1d45ea965f781de5ccf682b142049c7628d0480 | [
"Apache-2.0"
] | null | null | null | ias/annotation/split_inputs_into_groups.py | olga-clarifai/clarifai-python-grpc | c1d45ea965f781de5ccf682b142049c7628d0480 | [
"Apache-2.0"
] | null | null | null | ias/annotation/split_inputs_into_groups.py | olga-clarifai/clarifai-python-grpc | c1d45ea965f781de5ccf682b142049c7628d0480 | [
"Apache-2.0"
] | null | null | null | import argparse
# Import in the Clarifai gRPC based objects needed
from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
from clarifai_grpc.grpc.api import service_pb2_grpc
# Construct the communications channel and the object stub to call requests on.
channel = ClarifaiChannel.get_json_channel()
stub =... | 30.4 | 89 | 0.659611 | import argparse
from tqdm import tqdm
import numpy as np
# Import in the Clarifai gRPC based objects needed
from clarifai_grpc.channel.clarifai_channel import ClarifaiChannel
from clarifai_grpc.grpc.api import resources_pb2, service_pb2, service_pb2_grpc
from clarifai_grpc.grpc.api.status import status_code_pb2
from g... | 0 | 0 | 0 | 0 | 0 | 2,056 | 0 | 85 | 203 |
86f63653c9bbf365713034022c26402915ef2e28 | 268 | py | Python | 1 ano/estatisticas/tabela-corelacao-list.py | ThiagoPereira232/tecnico-informatica | 6b55ecf34501b38052943acf1b37074e3472ce6e | [
"MIT"
] | 1 | 2021-09-24T16:26:04.000Z | 2021-09-24T16:26:04.000Z | 1 ano/estatisticas/tabela-corelacao-list.py | ThiagoPereira232/tecnico-informatica | 6b55ecf34501b38052943acf1b37074e3472ce6e | [
"MIT"
] | null | null | null | 1 ano/estatisticas/tabela-corelacao-list.py | ThiagoPereira232/tecnico-informatica | 6b55ecf34501b38052943acf1b37074e3472ce6e | [
"MIT"
] | null | null | null | sx = sy =sxy = sx2 =sy2 = xy = c = 0
vx = [0,0,0]
vy = [0,0,0]
while(c<3):
vx[c] = int(input("Digite um valor de x: "))
c+=1
for x in vx:
sx += x
c=0
while(c<3):
vy[c] = int(input("Digite um valor de y: "))
c+=1
for y in vy:
sy += y
xy = x*y | 14.888889 | 48 | 0.473881 | sx = sy =sxy = sx2 =sy2 = xy = c = 0
vx = [0,0,0]
vy = [0,0,0]
while(c<3):
vx[c] = int(input("Digite um valor de x: "))
c+=1
for x in vx:
sx += x
c=0
while(c<3):
vy[c] = int(input("Digite um valor de y: "))
c+=1
for y in vy:
sy += y
xy = x*y | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f02bdc1535be765b32c70280f5165c80663629f2 | 160 | py | Python | dted/records/__init__.py | bbonenfant/dted | 5ae5055b6da65ce728bb282daa96bc0c58a65779 | [
"MIT"
] | 7 | 2021-07-02T00:06:33.000Z | 2021-12-22T17:32:14.000Z | dted/records/__init__.py | bbonenfant/dted | 5ae5055b6da65ce728bb282daa96bc0c58a65779 | [
"MIT"
] | 2 | 2021-11-04T16:57:52.000Z | 2022-02-21T20:58:39.000Z | dted/records/__init__.py | bbonenfant/dted | 5ae5055b6da65ce728bb282daa96bc0c58a65779 | [
"MIT"
] | null | null | null | """ Simplified imports for the records module. """
| 32 | 50 | 0.8125 | """ Simplified imports for the records module. """
from .acc import AccuracyDescription
from .dsi import DataSetIdentification
from .uhl import UserHeaderLabel
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 66 |
3e1a09246d8adbd4f02a1b19b24c26d39101c349 | 2,001 | py | Python | bigfastapi/subscription.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | 1 | 2022-03-20T21:46:05.000Z | 2022-03-20T21:46:05.000Z | bigfastapi/subscription.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | bigfastapi/subscription.py | danieliheonu/bigfastapi | 483554776195c9f38bb46ba719b613360eda1028 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from fastapi import APIRouter
app = APIRouter(tags=["Subscription"])
# ///
# SERVICE LAYER
| 35.732143 | 101 | 0.768616 | from typing import List
from bigfastapi import db
from uuid import uuid4
from bigfastapi.models import subscription_model
from bigfastapi.schemas import subscription_schema
from bigfastapi.db.database import get_db
import sqlalchemy.orm as _orm
import fastapi as _fastapi
from fastapi import APIRouter
from fastapi.respo... | 0 | 652 | 448 | 0 | 0 | 261 | 0 | 155 | 357 |
adafa7d9696042ee8c4a949ce2940d28ea46a07c | 28,305 | py | Python | app/views/user.py | viaict/viaduct | 1faec7e123c3fae7e8dbe1a354ad27b68f2a8cef | [
"MIT"
] | 11 | 2015-04-23T21:57:56.000Z | 2019-04-28T12:48:58.000Z | app/views/user.py | viaict/viaduct | 1faec7e123c3fae7e8dbe1a354ad27b68f2a8cef | [
"MIT"
] | 1 | 2016-10-05T14:10:58.000Z | 2016-10-05T14:12:23.000Z | app/views/user.py | viaict/viaduct | 1faec7e123c3fae7e8dbe1a354ad27b68f2a8cef | [
"MIT"
] | 3 | 2016-10-05T14:00:42.000Z | 2019-01-16T14:33:43.000Z | # -*- coding: utf-8 -*-
from datetime import datetime
from flask import Blueprint
from flask import flash, redirect, render_template, request, url_for
from flask_babel import _
from flask_login import current_user
from app import db
from app.forms import init_form
from app.models.activity import Activity
from app.mode... | 36.103316 | 79 | 0.634446 | # -*- coding: utf-8 -*-
import re
from csv import writer
from datetime import datetime
from flask import Blueprint
from flask import flash, redirect, render_template, request, url_for, abort, \
session
from flask_babel import _
from flask_login import current_user, login_user, logout_user, login_required
from io im... | 0 | 21,700 | 0 | 0 | 0 | 193 | 0 | 479 | 642 |
3c7cdbfcd83c35c91f14b26208ed5f97476086be | 186 | py | Python | apps.py | tobiasbartel/servicium-machine_manager | 1f4e88afd26ed31b1b4264cb0928fe9bd08033c5 | [
"MIT"
] | null | null | null | apps.py | tobiasbartel/servicium-machine_manager | 1f4e88afd26ed31b1b4264cb0928fe9bd08033c5 | [
"MIT"
] | null | null | null | apps.py | tobiasbartel/servicium-machine_manager | 1f4e88afd26ed31b1b4264cb0928fe9bd08033c5 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
| 20.666667 | 40 | 0.790323 | from __future__ import unicode_literals
from django.apps import AppConfig
class MachineManagerConfig(AppConfig):
name = 'machine_manager'
verbose_name = 'The Machine Manager'
| 0 | 0 | 0 | 87 | 0 | 0 | 0 | 12 | 46 |
527cdfc1040b4f82213159107c8b458fd0c8c948 | 7,280 | py | Python | perturbations/perturbations.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | perturbations/perturbations.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | perturbations/perturbations.py | pedersor/google-research | 6fa751dd261b3f6d918fd2cd35efef5d8bf3eea6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 39.351351 | 80 | 0.675275 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 0 | 2,922 | 0 | 0 | 0 | 0 | 0 | 3 | 47 |
017a6dbdee29e9ad4500fe1c410997633e58509c | 4,744 | py | Python | brainfuck.py | yvbbrjdr/brainfuck | eac66b19653bfd8d8172bd67dd95bc5b1c520358 | [
"BSD-3-Clause"
] | null | null | null | brainfuck.py | yvbbrjdr/brainfuck | eac66b19653bfd8d8172bd67dd95bc5b1c520358 | [
"BSD-3-Clause"
] | null | null | null | brainfuck.py | yvbbrjdr/brainfuck | eac66b19653bfd8d8172bd67dd95bc5b1c520358 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
main()
| 27.264368 | 73 | 0.493255 | #!/usr/bin/env python3
import readline
import sys
class LinkedList(object):
def __init__(self, value=0, left=None, right=None):
self.value, self._left, self._right = value, left, right
@property
def left(self):
if not self._left:
self._left = LinkedList(right=self)
ret... | 0 | 221 | 0 | 1,508 | 0 | 2,764 | 0 | -17 | 206 |
c619b957308a9704e7ea134f17078a37e3126ee2 | 1,278 | py | Python | cashews/utils/split_hash.py | AIGeneratedUsername/cashews | c4af2807053956f75662966a23e0af024c1a64a9 | [
"MIT"
] | null | null | null | cashews/utils/split_hash.py | AIGeneratedUsername/cashews | c4af2807053956f75662966a23e0af024c1a64a9 | [
"MIT"
] | null | null | null | cashews/utils/split_hash.py | AIGeneratedUsername/cashews | c4af2807053956f75662966a23e0af024c1a64a9 | [
"MIT"
] | null | null | null | import zlib
algorithms = [
zlib.crc32,
]
try:
import xxhash
except ImportError:
pass
else:
algorithms.extend(
[xxhash.xxh3_64_intdigest, xxhash.xxh64_intdigest, xxhash.xxh3_128_intdigest, xxhash.xxh32_intdigest]
)
def get_hashes(key: str, k: int, max_i: int):
"""
return array wit... | 24.576923 | 109 | 0.618936 | import hashlib
import zlib
algorithms = [
zlib.crc32,
]
try:
import xxhash
except ImportError:
pass
else:
algorithms.extend(
[xxhash.xxh3_64_intdigest, xxhash.xxh64_intdigest, xxhash.xxh3_128_intdigest, xxhash.xxh32_intdigest]
)
def get_hashes(key: str, k: int, max_i: int):
"""
r... | 0 | 0 | 0 | 0 | 0 | 238 | 0 | -7 | 68 |
f34719933d24ba37658714aac1ca06c1727c2e84 | 1,517 | py | Python | common/xrd-ui-tests-python/tests/xroad_local_group/XroadEditDescriptionLocalGroup.py | nordic-institute/X-Road-tests | e030661a0ad8ceab74dd8122b751e88025a3474a | [
"MIT"
] | 1 | 2019-02-09T00:16:54.000Z | 2019-02-09T00:16:54.000Z | common/xrd-ui-tests-python/tests/xroad_local_group/XroadEditDescriptionLocalGroup.py | nordic-institute/X-Road-tests | e030661a0ad8ceab74dd8122b751e88025a3474a | [
"MIT"
] | 1 | 2018-06-06T08:33:32.000Z | 2018-06-06T08:33:32.000Z | common/xrd-ui-tests-python/tests/xroad_local_group/XroadEditDescriptionLocalGroup.py | nordic-institute/X-Road-tests | e030661a0ad8ceab74dd8122b751e88025a3474a | [
"MIT"
] | 3 | 2018-07-09T08:51:00.000Z | 2020-07-23T18:40:24.000Z | from __future__ import absolute_import
| 33.711111 | 101 | 0.674357 | from __future__ import absolute_import
import unittest
from main.maincontroller import MainController
from tests.xroad_local_group import xroad_local_group
class XroadEditDescriptionLocalGroup(unittest.TestCase):
"""
UC SERVICE_28 Edit the Description of a Local Group
RIA URL: https://jira.ria.ee/browse... | 0 | 0 | 0 | 1,335 | 0 | 0 | 0 | 51 | 91 |
6505cbe7bfb95fe462ee263d231946f3e0a79924 | 1,053 | py | Python | horses/ex3.py | octonion/betting | d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb | [
"MIT"
] | 26 | 2017-04-03T01:45:27.000Z | 2021-09-22T12:11:31.000Z | horses/ex3.py | octonion/betting | d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb | [
"MIT"
] | null | null | null | horses/ex3.py | octonion/betting | d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb | [
"MIT"
] | 7 | 2017-04-07T17:42:23.000Z | 2021-12-21T21:58:22.000Z | #!/usr/bin/env python
import numpy as np
import pandas as pd
# First example
# Win probability vector
p = np.array([0.25,0.50,0.25])
# Decimal odds
d = np.array([5.0,1.5,2.0])
# Implied probabilities
i = np.array([])
for j in range(len(d)):
i = np.append(i,1/d[j])
race = pd.DataFrame()
race['p'] = p
race[... | 16.714286 | 75 | 0.508072 | #!/usr/bin/env python
import numpy as np
import pandas as pd
# First example
# Win probability vector
p = np.array([0.25,0.50,0.25])
# Decimal odds
d = np.array([5.0,1.5,2.0])
# Implied probabilities
i = np.array([])
for j in range(len(d)):
i = np.append(i,1/d[j])
race = pd.DataFrame()
race['p'] = p
race[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
23460522f672aa7690f5ad2b26797b3327b5e9d5 | 2,376 | py | Python | python/src/aoc/year2020/day22.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | 1 | 2021-02-16T21:30:04.000Z | 2021-02-16T21:30:04.000Z | python/src/aoc/year2020/day22.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | python/src/aoc/year2020/day22.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | from aoc.util import load_input
def part1(lines):
"""
>>> part1(load_example(__file__, '22'))
306
"""
cards1, cards2 = prepare_data(lines)
while True:
turn(cards1, cards2)
if len(cards1) == 0:
return calc_score(cards2)
if len(cards2) == 0:
ret... | 24.244898 | 84 | 0.547559 | from collections import deque
from aoc.util import load_example, load_input
def prepare_data(lines):
cards1 = deque()
cards2 = deque()
player = None
for line in lines:
if line.isspace():
continue
elif line.startswith("Player"):
player = int(line.split()[1].split... | 0 | 0 | 0 | 0 | 0 | 1,560 | 0 | 22 | 114 |
48dd705525e5cb03a8447d6256771c4073a6a921 | 5,160 | py | Python | bvc/admin/member_command.py | Vayel/GUCEM-BVC | e5645dec332756d3c9db083abf2c8f3625a10d4d | [
"WTFPL"
] | 2 | 2016-09-23T18:02:40.000Z | 2017-04-28T18:35:59.000Z | bvc/admin/member_command.py | Vayel/GUCEM-BVC | e5645dec332756d3c9db083abf2c8f3625a10d4d | [
"WTFPL"
] | 82 | 2016-09-26T14:38:31.000Z | 2018-02-12T18:47:12.000Z | bvc/admin/member_command.py | Vayel/GUCEM-BVC | e5645dec332756d3c9db083abf2c8f3625a10d4d | [
"WTFPL"
] | null | null | null |
from .site import admin_site
from .. import models, forms
admin_site.register(models.MemberCommand, MemberCommandAdmin)
| 36.083916 | 140 | 0.611822 | from smtplib import SMTPException
from django.contrib import admin, messages
from django.utils.timezone import now
from .site import admin_site
from .individual_command import IndividualCommandAdmin
from .. import models, forms
class MemberCommandAdmin(IndividualCommandAdmin):
list_display = ['id', 'member', 'd... | 46 | 0 | 0 | 4,819 | 0 | 0 | 0 | 82 | 112 |
f91ba4319af8d4d6061e2ed8acad51dfeee3c456 | 4,030 | py | Python | lc0001_two_sum.py | yiyinghsieh/python-algorithms-data-structures | 26879343d3d83ca431946f8a92def2bc8672f807 | [
"BSD-2-Clause"
] | null | null | null | lc0001_two_sum.py | yiyinghsieh/python-algorithms-data-structures | 26879343d3d83ca431946f8a92def2bc8672f807 | [
"BSD-2-Clause"
] | null | null | null | lc0001_two_sum.py | yiyinghsieh/python-algorithms-data-structures | 26879343d3d83ca431946f8a92def2bc8672f807 | [
"BSD-2-Clause"
] | null | null | null | """Leetcode 1. Two Sum
Easy
URL: https://leetcode.com/problems/two-sum/
Given an array of integers, return indices of the two numbers such that
they add up to a specific target.
You may assume that each input would have exactly one solution, and you
may not use the same element twice.
Example:
Given nums = [2, 7... | 31.24031 | 398 | 0.44268 | """Leetcode 1. Two Sum
Easy
URL: https://leetcode.com/problems/two-sum/
Given an array of integers, return indices of the two numbers such that
they add up to a specific target.
You may assume that each input would have exactly one solution, and you
may not use the same element twice.
Example:
Given nums = [2, 7... | 0 | 0 | 0 | 2,473 | 0 | 1,018 | 0 | 0 | 92 |
180588a9d2adcb91708df4f0c52060906cdde8cf | 5,811 | py | Python | DPGAnalysis/Skims/python/muonTagProbeFilters_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DPGAnalysis/Skims/python/muonTagProbeFilters_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DPGAnalysis/Skims/python/muonTagProbeFilters_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
#from HLTrigger.HLTfilters.hltHighLevel_cfi import *
#exoticaMuHLT = hltHighLevel
#Define the HLT path to be used.
#exoticaMuHLT.HLTPaths =['HLT_L1MuOpen']
#exoticaMuHLT.TriggerResultsTag = cms.InputTag("TriggerResults","","HLT8E29")
#Define the HLT quality cut
#exot... | 47.243902 | 102 | 0.514025 | import FWCore.ParameterSet.Config as cms
#from HLTrigger.HLTfilters.hltHighLevel_cfi import *
#exoticaMuHLT = hltHighLevel
#Define the HLT path to be used.
#exoticaMuHLT.HLTPaths =['HLT_L1MuOpen']
#exoticaMuHLT.TriggerResultsTag = cms.InputTag("TriggerResults","","HLT8E29")
#Define the HLT quality cut
#exot... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 23 |
4f780b26748d3d14409285105a1dc80ae0eaa03b | 2,315 | py | Python | mmnist/flags.py | thomassutter/MoPoE | 477a441ecb6c735a0b8af4d643fe3ac04c58171f | [
"MIT"
] | 3 | 2021-05-06T18:29:09.000Z | 2022-01-13T03:23:25.000Z | mmnist/flags.py | thomassutter/MoPoE | 477a441ecb6c735a0b8af4d643fe3ac04c58171f | [
"MIT"
] | 1 | 2022-02-02T07:49:59.000Z | 2022-02-16T08:16:20.000Z | mmnist/flags.py | thomassutter/MoPoE | 477a441ecb6c735a0b8af4d643fe3ac04c58171f | [
"MIT"
] | 2 | 2021-05-13T02:20:42.000Z | 2022-03-30T04:05:43.000Z | from utils.BaseFlags import parser as parser
parser.add_argument('--dataset', type=str, default='MMNIST', help="name of the dataset")
parser.add_argument('--style_dim', type=int, default=0, help="style dimensionality") # TODO: use modality-specific style dimensions?
parser.add_argument('--num_classes', type=int, def... | 72.34375 | 150 | 0.766739 | from utils.BaseFlags import parser as parser
parser.add_argument('--dataset', type=str, default='MMNIST', help="name of the dataset")
parser.add_argument('--style_dim', type=int, default=0, help="style dimensionality") # TODO: use modality-specific style dimensions?
parser.add_argument('--num_classes', type=int, def... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc6fc0ca9eaa7cd7fb08e399ba1a092687d4edbe | 127 | py | Python | src/model/__init__.py | JulienGrv/puremvc-python-demo-PySide-employeeadmin | b076493ac34254e665b485259b0a7122fa9cfde4 | [
"BSD-3-Clause"
] | 4 | 2017-08-26T10:18:10.000Z | 2020-07-28T19:50:54.000Z | src/model/__init__.py | JulienGrv/puremvc-python-demo-PySide-employeeadmin | b076493ac34254e665b485259b0a7122fa9cfde4 | [
"BSD-3-Clause"
] | null | null | null | src/model/__init__.py | JulienGrv/puremvc-python-demo-PySide-employeeadmin | b076493ac34254e665b485259b0a7122fa9cfde4 | [
"BSD-3-Clause"
] | 3 | 2020-09-22T12:17:14.000Z | 2021-07-16T12:28:18.000Z | # -*- coding: utf-8 -*-
| 18.142857 | 32 | 0.724409 | # -*- coding: utf-8 -*-
from . import enum
from . import vo
from .RoleProxy import RoleProxy
from .UserProxy import UserProxy
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 89 |
bb65a80afcb52dea901b2b0e0af77a55b90966d4 | 2,394 | py | Python | hyp3lib/file_subroutines.py | washreve/hyp3-lib | 5e7f11f1de9576a519b25fb56ccdb40e72ca9982 | [
"BSD-3-Clause"
] | null | null | null | hyp3lib/file_subroutines.py | washreve/hyp3-lib | 5e7f11f1de9576a519b25fb56ccdb40e72ca9982 | [
"BSD-3-Clause"
] | null | null | null | hyp3lib/file_subroutines.py | washreve/hyp3-lib | 5e7f11f1de9576a519b25fb56ccdb40e72ca9982 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division, unicode_literals
import errno
import os
import re
import zipfile
from hyp3lib.execute import execute
def prepare_files(csv_file):
"""Download granules and unzip granules
Given a CSV file of granule names, download the granules and unzip them... | 26.021739 | 86 | 0.587719 | from __future__ import print_function, absolute_import, division, unicode_literals
import errno
import glob
import os
import re
import zipfile
from hyp3lib.execute import execute
def prepare_files(csv_file):
"""Download granules and unzip granules
Given a CSV file of granule names, download the granules an... | 0 | 0 | 0 | 0 | 0 | 406 | 0 | -10 | 45 |
c2c9c13177f4b25d82b251702e09592343de443f | 2,229 | py | Python | blogs/models.py | AgnosticMe/phleeb | 48f85048d2db5d16d243feee2f84a961682a0f4d | [
"MIT"
] | null | null | null | blogs/models.py | AgnosticMe/phleeb | 48f85048d2db5d16d243feee2f84a961682a0f4d | [
"MIT"
] | null | null | null | blogs/models.py | AgnosticMe/phleeb | 48f85048d2db5d16d243feee2f84a961682a0f4d | [
"MIT"
] | null | null | null |
# Create your models here.
| 28.21519 | 102 | 0.680574 | from django.db import models
from django.conf import settings
from django.utils.text import slugify
import uuid
# Create your models here.
class Category(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField(editable=False)
def save(self, *args, **kwargs):
self.slug = f'... | 0 | 0 | 0 | 1,990 | 0 | 0 | 0 | 24 | 180 |
7ef705119c51114baa303c658e5e9a73bfa03b60 | 6,988 | py | Python | examples/precision_recall_at_k1.py | linksboy/Surprise | 0cad490b6009dcdb67776b90437df97d859fbc8e | [
"BSD-3-Clause"
] | null | null | null | examples/precision_recall_at_k1.py | linksboy/Surprise | 0cad490b6009dcdb67776b90437df97d859fbc8e | [
"BSD-3-Clause"
] | null | null | null | examples/precision_recall_at_k1.py | linksboy/Surprise | 0cad490b6009dcdb67776b90437df97d859fbc8e | [
"BSD-3-Clause"
] | null | null | null | """
This module illustrates how to compute Precision at k and Recall at k metrics.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import defaultdict
import time
from tabulate import tabulate
from surprise import Dataset
from... | 41.595238 | 130 | 0.576989 | """
This module illustrates how to compute Precision at k and Recall at k metrics.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import defaultdict
import time
import datetime
import random
import numpy as np
import six
f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 117 |
88938f5fc4d946d37ec35056f1accb58851cb47b | 268 | py | Python | tests/urls.py | emihir0/django-schema-graph | 0c8280c035f47a7c736b8feb05d4dd1084b27979 | [
"MIT"
] | 316 | 2020-02-17T13:47:47.000Z | 2022-03-29T20:25:36.000Z | tests/urls.py | emihir0/django-schema-graph | 0c8280c035f47a7c736b8feb05d4dd1084b27979 | [
"MIT"
] | 20 | 2020-02-23T07:59:36.000Z | 2021-05-11T03:39:17.000Z | tests/urls.py | emihir0/django-schema-graph | 0c8280c035f47a7c736b8feb05d4dd1084b27979 | [
"MIT"
] | 11 | 2020-03-02T17:31:31.000Z | 2022-03-17T05:55:50.000Z | from schema_graph.views import Schema
try:
# Django 2+:
from django.urls import path
urlpatterns = [path("", Schema.as_view())]
except ImportError:
# Django < 2:
from django.conf.urls import url
urlpatterns = [url(r"^$", Schema.as_view())]
| 19.142857 | 48 | 0.649254 | from schema_graph.views import Schema
try:
# Django 2+:
from django.urls import path
urlpatterns = [path("", Schema.as_view())]
except ImportError:
# Django < 2:
from django.conf.urls import url
urlpatterns = [url(r"^$", Schema.as_view())]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f1b3ce4c6aaa18904fc121599adf8339ace9dc4 | 919 | py | Python | src/greenery/greenery/v1_test.py | AdeebNqo/sublimegen | 1e25281b2d739c72fa501b67da6b271d0601fa2c | [
"Apache-2.0",
"MIT"
] | 1 | 2021-05-24T03:23:13.000Z | 2021-05-24T03:23:13.000Z | src/greenery/greenery/v1_test.py | AdeebNqo/sublimegen | 1e25281b2d739c72fa501b67da6b271d0601fa2c | [
"Apache-2.0",
"MIT"
] | 1 | 2015-04-15T09:02:38.000Z | 2015-04-15T09:02:38.000Z | src/greenery/greenery/v1_test.py | AdeebNqo/sublimegen | 1e25281b2d739c72fa501b67da6b271d0601fa2c | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == "__main__":
import os
import sys
# If you run tests in-place (instead of using py.test), ensure local version is tested!
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
if __name__ == "__main__":
test_v1()
| 28.71875 | 88 | 0.688792 | # -*- coding: utf-8 -*-
if __name__ == "__main__":
import os
import sys
# If you run tests in-place (instead of using py.test), ensure local version is tested!
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import greenery.v1 as greenery
def test_v1():
regex = greenery.parse( "a... | 0 | 0 | 0 | 0 | 0 | 580 | 0 | 9 | 46 |
498fdc7edf4475ef8f1309a0bf0b50a27af47861 | 485 | py | Python | PYTHON-CURSO EM VIDEO/Desafio 042.py | JaumVitor/HOMEWORK-PYTHON | aff564ac61802c7417d7280a73c1ed4a98978ed3 | [
"Apache-2.0"
] | null | null | null | PYTHON-CURSO EM VIDEO/Desafio 042.py | JaumVitor/HOMEWORK-PYTHON | aff564ac61802c7417d7280a73c1ed4a98978ed3 | [
"Apache-2.0"
] | null | null | null | PYTHON-CURSO EM VIDEO/Desafio 042.py | JaumVitor/HOMEWORK-PYTHON | aff564ac61802c7417d7280a73c1ed4a98978ed3 | [
"Apache-2.0"
] | null | null | null | l1 = int ( input ('Primeiro lado : '))
l2 = int ( input('Segundo lado : '))
l3 = int ( input ('Terceiro lado : '))
if l1 + l2 > l3 and l2 + l3 > l1 and l3 + l1 > l2:
print('Pode formar triangulo')
if l1 == l2 == l3:
print('Triangulo Equilatero')
elif (l1 == l2 and l2 != l3) or (l2 == l3 and l3 != ... | 30.3125 | 87 | 0.550515 | l1 = int ( input ('Primeiro lado : '))
l2 = int ( input('Segundo lado : '))
l3 = int ( input ('Terceiro lado : '))
if l1 + l2 > l3 and l2 + l3 > l1 and l3 + l1 > l2:
print('Pode formar triangulo')
if l1 == l2 == l3:
print('Triangulo Equilatero')
elif (l1 == l2 and l2 != l3) or (l2 == l3 and l3 != ... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
eab9e5108ae651e1fab0ae9b20fb7d94dba94f01 | 584 | py | Python | ibsng/handler/invoice/get_invoice_profile_by_group_name.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 6 | 2018-03-06T10:16:36.000Z | 2021-12-05T12:43:10.000Z | ibsng/handler/invoice/get_invoice_profile_by_group_name.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 3 | 2018-03-06T10:27:08.000Z | 2022-01-02T15:21:27.000Z | ibsng/handler/invoice/get_invoice_profile_by_group_name.py | ParspooyeshFanavar/pyibsng | d48bcf4f25e3f23461528bf0ff8870cc3d537444 | [
"MIT"
] | 3 | 2018-01-06T16:28:31.000Z | 2018-09-17T19:47:19.000Z | """Get invoice profile by group name API method."""
| 23.36 | 57 | 0.623288 | """Get invoice profile by group name API method."""
from ibsng.handler.handler import Handler
class getInvoiceProfileByGroupName(Handler):
"""Get invoice profile by group name method class."""
def control(self):
"""Validate inputs after setup method.
:return: None
:rtype: None
... | 0 | 0 | 0 | 466 | 0 | 0 | 0 | 20 | 45 |
1f6b559dea637c0d916447233f91601b295b9eac | 1,369 | py | Python | main.py | falseen/shadowsocks-kivy | c39ef797226221091ae95d67fa92605c45355c0e | [
"Apache-2.0"
] | null | null | null | main.py | falseen/shadowsocks-kivy | c39ef797226221091ae95d67fa92605c45355c0e | [
"Apache-2.0"
] | null | null | null | main.py | falseen/shadowsocks-kivy | c39ef797226221091ae95d67fa92605c45355c0e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, \
with_statement
from kivy.core.text import LabelBase
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
if __name__ == '__main__':
Window.clearcolor = get_color_from_hex('#458... | 26.326923 | 78 | 0.663988 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, \
with_statement
from kivy.app import App
from kivy.clock import Clock
from kivy.core.text import LabelBase
from kivy.core.window import Window
from kivy.utils import get_color_from_hex
from time import strft... | 0 | 0 | 0 | 537 | 0 | 0 | 0 | 15 | 222 |
71b43229ebca1d17c0b88b25e927ec69f9a632c9 | 2,567 | py | Python | cpu_load_generator/__main__.py | sirtyman/CPULoadGenerator | 9088ae1a9b1101f8ce7be6ed1df02bad16743bc9 | [
"MIT"
] | 4 | 2021-07-30T23:21:42.000Z | 2021-11-23T11:13:45.000Z | cpu_load_generator/__main__.py | sirtyman/CPULoadGenerator | 9088ae1a9b1101f8ce7be6ed1df02bad16743bc9 | [
"MIT"
] | null | null | null | cpu_load_generator/__main__.py | sirtyman/CPULoadGenerator | 9088ae1a9b1101f8ce7be6ed1df02bad16743bc9 | [
"MIT"
] | 1 | 2021-09-26T13:13:37.000Z | 2021-09-26T13:13:37.000Z | import sys
import argparse
import psutil
from cpu_load_generator import load_all_cores, load_single_core, from_profile
def parse_args(parser):
"""Parse input parameters.
param parser: ArgumentParser object
"""
parser.add_argument('-p', '--path_to_profile_json', type=str, default="",
... | 33.776316 | 119 | 0.64589 | import sys
import argparse
import psutil
from cpu_load_generator import load_all_cores, load_single_core, from_profile
def parse_args(parser):
"""Parse input parameters.
param parser: ArgumentParser object
"""
parser.add_argument('-p', '--path_to_profile_json', type=str, default="",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8879c47f6a35c0727c1560ed74ee6004f696c5b4 | 551 | py | Python | designs/GcdUnit/testbench/generate_test_vectors.py | jbrzozo24/mflowgen | fe168e1ea2311feb35588333aa5d7d7c6ba79625 | [
"BSD-3-Clause"
] | 53 | 2020-11-05T20:13:03.000Z | 2022-03-31T14:51:56.000Z | designs/GcdUnit/testbench/generate_test_vectors.py | jbrzozo24/mflowgen | fe168e1ea2311feb35588333aa5d7d7c6ba79625 | [
"BSD-3-Clause"
] | 27 | 2020-11-04T19:52:38.000Z | 2022-03-17T17:11:01.000Z | designs/GcdUnit/testbench/generate_test_vectors.py | jbrzozo24/mflowgen | fe168e1ea2311feb35588333aa5d7d7c6ba79625 | [
"BSD-3-Clause"
] | 26 | 2020-11-02T18:43:57.000Z | 2022-03-31T14:52:52.000Z | from random import random
import math
import numpy as np
num_vectors = 100
f = open("test_vectors.txt", "w")
i = 0
while (i < num_vectors):
a = np.uint16(math.floor(random() * (2**16 - 1)))
b = np.uint16(math.floor(random() * (2**16 - 1)))
if (a != 0) and (b != 0):
c = math.gcd(a, b)
f.write(str(get_h... | 22.958333 | 94 | 0.593466 | from random import random
import math
import numpy as np
import binascii
import struct
num_vectors = 100
f = open("test_vectors.txt", "w")
def get_hex (x):
return str(binascii.hexlify(struct.pack('>H', x)))[2:6] # H is for unsigned short -- 16 bits
i = 0
while (i < num_vectors):
a = np.uint16(math.floor(random... | 0 | 0 | 0 | 0 | 0 | 90 | 0 | -14 | 67 |
14a2c2afb9c59044a6c39bbd0a8f0ba276f110ad | 4,110 | py | Python | src/pyhf_benchmark/plot.py | pyhf/pyhf-benchmark | bc0f91253e8d6d4dbc7205cabf0ec7a9d5402dcf | [
"Apache-2.0"
] | 3 | 2020-05-22T22:50:22.000Z | 2020-06-02T16:28:37.000Z | src/pyhf_benchmark/plot.py | pyhf/pyhf-benchmark | bc0f91253e8d6d4dbc7205cabf0ec7a9d5402dcf | [
"Apache-2.0"
] | 30 | 2020-06-02T16:22:27.000Z | 2020-08-20T04:55:59.000Z | src/pyhf_benchmark/plot.py | pyhf/pyhf-benchmark | bc0f91253e8d6d4dbc7205cabf0ec7a9d5402dcf | [
"Apache-2.0"
] | 1 | 2020-07-28T02:32:58.000Z | 2020-07-28T02:32:58.000Z |
ylabels = [
"CPU Utilization (%)",
"Disk I/O Utilization (%)",
"Process CPU Threads In Use",
"Network Traffic (bytes)",
"System Memory Utilization (%)",
"Process Memory Available (non-swap) (MB)",
"Process Memory In Use (non-swap) (MB)",
"Process Memory \n In Use (non-swap) (%)",
"G... | 29.568345 | 84 | 0.605596 | import json
import pandas as pd
import time
import matplotlib.pyplot as plt
ylabels = [
"CPU Utilization (%)",
"Disk I/O Utilization (%)",
"Process CPU Threads In Use",
"Network Traffic (bytes)",
"System Memory Utilization (%)",
"Process Memory Available (non-swap) (MB)",
"Process Memory In... | 3 | 0 | 0 | 0 | 0 | 2,738 | 0 | -12 | 226 |
b853897f1d9e921de0b68dcf2f3f769919affd42 | 4,616 | py | Python | server.py | jseppanen/textpile | 0726961d4f841c664165f4ca9346b4e8029d3bff | [
"Unlicense"
] | null | null | null | server.py | jseppanen/textpile | 0726961d4f841c664165f4ca9346b4e8029d3bff | [
"Unlicense"
] | null | null | null | server.py | jseppanen/textpile | 0726961d4f841c664165f4ca9346b4e8029d3bff | [
"Unlicense"
] | null | null | null | from flask import Flask, request
from flask import Flask
app=Flask(__name__)
app.config.from_object(__name__)
app.config.update(DATABASE=app.root_path + '/data/textpile.db')
# log errors in production to uwsgi.log
app.config.update(PROPAGATE_EXCEPTIONS=True)
app.config.from_pyfile(app.root_path + '/config/flask-server... | 30.773333 | 75 | 0.595537 | from flask import Flask, request
from flask import Flask, request, session, g, jsonify, \
redirect, url_for, abort, render_template, flash
import sqlite3
import json
app=Flask(__name__)
app.config.from_object(__name__)
app.config.update(DATABASE=app.root_path + '/data/textpile.db')
# log errors in production to uw... | 0 | 3,740 | 0 | 0 | 0 | 151 | 0 | 69 | 274 |
9bf588687f45bf8bcc4b0da77a026b295a433874 | 7,253 | py | Python | src/Utils.py | borismus/lightning | e33173a1d9905004bbb789d36c8622cd577b6b40 | [
"Apache-2.0"
] | 14 | 2015-01-10T12:40:16.000Z | 2021-11-08T10:21:58.000Z | src/Utils.py | borismus/lightning | e33173a1d9905004bbb789d36c8622cd577b6b40 | [
"Apache-2.0"
] | null | null | null | src/Utils.py | borismus/lightning | e33173a1d9905004bbb789d36c8622cd577b6b40 | [
"Apache-2.0"
] | 3 | 2017-03-16T00:08:26.000Z | 2018-07-16T04:55:20.000Z | import datetime
from dateutil import parser
from itertools import tee
import os
import re
import shutil
import warnings
DEFAULT_TIME = datetime.time(9, 0)
MAX_SLUG_LENGTH = 30
def ComputePermalink(type_name, slug, created_date, permalink_template='{{slug}}'):
"""Returns the permalink for the given item."""
per... | 28.003861 | 83 | 0.653247 | import datetime
from dateutil import parser
from itertools import tee
from jinja2 import Template, Environment, FileSystemLoader
import os
import re
import shutil
import time
import warnings
import yaml
DEFAULT_TIME = datetime.time(9, 0)
MAX_SLUG_LENGTH = 30
class Date:
def __init__(self, datetime):
self.datet... | 0 | 46 | 0 | 913 | 0 | 1,445 | 0 | 17 | 277 |
cb74534e016f34167f118377909713df89e18936 | 775 | py | Python | phasespace/__init__.py | zfit/tfphasespace | 7131fbd687cb5dd1ce53fd4a590dcfd5d1af572f | [
"BSD-3-Clause"
] | null | null | null | phasespace/__init__.py | zfit/tfphasespace | 7131fbd687cb5dd1ce53fd4a590dcfd5d1af572f | [
"BSD-3-Clause"
] | 6 | 2019-02-27T20:06:27.000Z | 2019-03-12T14:02:51.000Z | phasespace/__init__.py | zfit/tfphasespace | 7131fbd687cb5dd1ce53fd4a590dcfd5d1af572f | [
"BSD-3-Clause"
] | null | null | null | """Top-level package for TensorFlow PhaseSpace."""
import sys
if sys.version_info < (3, 8):
from importlib_metadata import PackageNotFoundError, version
else:
from importlib.metadata import PackageNotFoundError, version
try:
__version__ = version("phasespace")
except PackageNotFoundError:
pass
__auth... | 21.527778 | 64 | 0.748387 | """Top-level package for TensorFlow PhaseSpace."""
import sys
if sys.version_info < (3, 8):
from importlib_metadata import PackageNotFoundError, version
else:
from importlib.metadata import PackageNotFoundError, version
try:
__version__ = version("phasespace")
except PackageNotFoundError:
pass
__auth... | 0 | 0 | 0 | 0 | 0 | 118 | 0 | 2 | 46 |
f4d3dcf126c0d1c97934fcc6149e7d3ce53b7189 | 369 | py | Python | src/format2csv.py | mutanthost/lnav | 55727284de202a9ebfde0f3f9861ef6af1d04c52 | [
"BSD-2-Clause"
] | 1 | 2020-12-16T08:55:30.000Z | 2020-12-16T08:55:30.000Z | src/format2csv.py | Sifor/lnav | 92f28f1174f1c26408d7b3dd548b80d54adad6f4 | [
"BSD-2-Clause"
] | 3 | 2015-09-30T22:25:05.000Z | 2015-10-01T00:05:46.000Z | src/format2csv.py | Sifor/lnav | 92f28f1174f1c26408d7b3dd548b80d54adad6f4 | [
"BSD-2-Clause"
] | null | null | null | import sys
if __name__ == "__main__":
sys.exit(main(sys.argv))
| 20.5 | 69 | 0.593496 |
import csv
import sys
import json
def main(args):
with open(args[1]) as fp:
out = csv.writer(open(args[2], 'w'))
format_dict = json.load(fp)
for key in sorted(format_dict):
value = format_dict[key]
out.writerow((value['title'], key, value['description']))
if __na... | 0 | 0 | 0 | 0 | 0 | 254 | 0 | -21 | 68 |
53031de8e25d045372bd5aab09f83ec7f6172d75 | 18,408 | py | Python | vel/rl/buffers/tests/test_circular_buffer_backend.py | galatolofederico/vel | 0473648cffb3f34fb784d12dbb25844ab58ffc3c | [
"MIT"
] | 273 | 2018-09-01T08:54:34.000Z | 2022-02-02T13:22:51.000Z | vel/rl/buffers/tests/test_circular_buffer_backend.py | braincorp/vel | bdf9d9eb6ed66278330e8cbece307f6e63ce53c6 | [
"MIT"
] | 47 | 2018-08-17T11:27:08.000Z | 2022-03-11T23:26:55.000Z | vel/rl/buffers/tests/test_circular_buffer_backend.py | braincorp/vel | bdf9d9eb6ed66278330e8cbece307f6e63ce53c6 | [
"MIT"
] | 37 | 2018-10-11T22:56:57.000Z | 2020-10-06T19:53:05.000Z | import gym
import gym.spaces
import numpy as np
import numpy.testing as nt
import pytest
from vel.exceptions import VelException
from vel.rl.buffers.backend.circular_buffer_backend import CircularBufferBackend
def get_half_filled_buffer():
""" Return simple preinitialized buffer """
observation_space = gym.s... | 34.929791 | 111 | 0.648848 | import gym
import gym.spaces
import numpy as np
import numpy.testing as nt
import pytest
from vel.exceptions import VelException
from vel.rl.buffers.backend.circular_buffer_backend import CircularBufferBackend
def get_half_filled_buffer():
""" Return simple preinitialized buffer """
observation_space = gym.s... | 0 | 0 | 0 | 0 | 0 | 2,422 | 0 | 0 | 46 |
8e2b0b06e771b67acac4db18531307d55d685e93 | 731 | py | Python | tests/ledsolid.py | eddiecarbin/riverapp | 4971ace1113021c3d4f3f0eee6db6de2c5f2f26f | [
"MIT"
] | null | null | null | tests/ledsolid.py | eddiecarbin/riverapp | 4971ace1113021c3d4f3f0eee6db6de2c5f2f26f | [
"MIT"
] | null | null | null | tests/ledsolid.py | eddiecarbin/riverapp | 4971ace1113021c3d4f3f0eee6db6de2c5f2f26f | [
"MIT"
] | null | null | null | import adafruit_fancyled.adafruit_fancyled as fancy
import board
import adafruit_dotstar
import time
num_leds = 1085
spread = 5
# Declare a NeoPixel object on pin D6 with num_leds pixels, no auto-write.
# Set brightness to max because we'll be using FancyLED's brightness control.
pixels = adafruit_dotstar.DotStar(bo... | 22.84375 | 82 | 0.682627 | import adafruit_fancyled.adafruit_fancyled as fancy
import board
import adafruit_dotstar
import time
num_leds = 1085
spread = 5
# Declare a NeoPixel object on pin D6 with num_leds pixels, no auto-write.
# Set brightness to max because we'll be using FancyLED's brightness control.
pixels = adafruit_dotstar.DotStar(bo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c9ecdb788d6aab8e3681809ec53711d47a2b508 | 696 | py | Python | Python3/2163.py | Di-Ca-N/URI-Online-Judge | 160797b534fe8c70e719b1ea41690157dbdbb52e | [
"MIT"
] | null | null | null | Python3/2163.py | Di-Ca-N/URI-Online-Judge | 160797b534fe8c70e719b1ea41690157dbdbb52e | [
"MIT"
] | null | null | null | Python3/2163.py | Di-Ca-N/URI-Online-Judge | 160797b534fe8c70e719b1ea41690157dbdbb52e | [
"MIT"
] | null | null | null | l, c = [int(x) for x in input().split()]
matriz = [[0 for _ in range(c)] for _ in range(l)]
possible_sabers = []
for i in range(l):
for j, v in enumerate(input().split()):
v = int(v)
matriz[i][j] = v
if v == 42:
possible_sabers.append((i, j))
final = (0, 0)
pattern = [
(-... | 19.333333 | 50 | 0.418103 | l, c = [int(x) for x in input().split()]
matriz = [[0 for _ in range(c)] for _ in range(l)]
possible_sabers = []
for i in range(l):
for j, v in enumerate(input().split()):
v = int(v)
matriz[i][j] = v
if v == 42:
possible_sabers.append((i, j))
final = (0, 0)
pattern = [
(-... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7a6de29b85379c597024e69a5ca7c498d689a942 | 112 | py | Python | src/Python/Utilities/VTKVersion.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 81 | 2020-08-10T01:44:30.000Z | 2022-03-23T06:46:36.000Z | src/Python/Utilities/VTKVersion.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 2 | 2020-09-12T17:33:52.000Z | 2021-04-15T17:33:09.000Z | src/Python/Utilities/VTKVersion.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 27 | 2020-08-17T07:09:30.000Z | 2022-02-15T03:44:58.000Z | #!/usr/bin/env python
from vtkmodules.vtkCommonCore import vtkVersion
print(vtkVersion.GetVTKSourceVersion())
| 18.666667 | 47 | 0.821429 | #!/usr/bin/env python
from vtkmodules.vtkCommonCore import vtkVersion
print(vtkVersion.GetVTKSourceVersion())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
425d34508bda8b701517672d8013d51c79b3ba4c | 348 | py | Python | pyswarms/backend/__init__.py | fluencer/pyswarms | 52d69e48b64055638e67297536cd2d654ba073d6 | [
"MIT"
] | 1 | 2019-03-07T06:41:43.000Z | 2019-03-07T06:41:43.000Z | pyswarms/backend/__init__.py | fluencer/pyswarms | 52d69e48b64055638e67297536cd2d654ba073d6 | [
"MIT"
] | null | null | null | pyswarms/backend/__init__.py | fluencer/pyswarms | 52d69e48b64055638e67297536cd2d654ba073d6 | [
"MIT"
] | null | null | null | """
The :code:`pyswarms.backend` module abstracts various operations
for swarm optimization: generating boundaries, updating positions, etc.
You can use the methods implemented here to build your own PSO implementations.
"""
__all__ = ["generators", "operators", "swarms"]
| 29 | 79 | 0.767241 | """
The :code:`pyswarms.backend` module abstracts various operations
for swarm optimization: generating boundaries, updating positions, etc.
You can use the methods implemented here to build your own PSO implementations.
"""
from .generators import *
from .operators import *
from .swarms import *
__all__ = ["generato... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 67 |
b43fb477ca4ff9ec7cdf6cf7cfad1e288cfc796b | 4,170 | py | Python | deeprobust/image/preprocessing/APE-GAN.py | shixiongjing/DeepRobust | 20328ffef0330726437c56a04514a7f8a5296e53 | [
"MIT"
] | 647 | 2020-02-08T02:13:21.000Z | 2022-03-31T07:44:00.000Z | deeprobust/image/preprocessing/APE-GAN.py | shixiongjing/DeepRobust | 20328ffef0330726437c56a04514a7f8a5296e53 | [
"MIT"
] | 77 | 2020-03-21T11:27:30.000Z | 2022-03-23T10:55:53.000Z | deeprobust/image/preprocessing/APE-GAN.py | shixiongjing/DeepRobust | 20328ffef0330726437c56a04514a7f8a5296e53 | [
"MIT"
] | 139 | 2020-03-04T00:25:12.000Z | 2022-03-21T15:45:29.000Z |
import torch
import torch.backends.cudnn as cudnn
if __name__ == "__main__":
get_args()
main(args)
| 32.578125 | 100 | 0.583453 | import os
import argparse
import torch
import torch.nn
from torch.utils.data import TensorDataset
import torch.backends.cudnn as cudnn
class Generator(nn.Module):
def __init__(self, in_ch):
super(Generator, self).__init__()
self.conv1 = nn.Conv2d(in_ch, 64, 4, stride=2, padding=1)
self.b... | 0 | 0 | 0 | 1,397 | 0 | 2,484 | 0 | -3 | 181 |
8bd28e53f6fd361bbb2c90baea93e5f56ae137e1 | 20,293 | py | Python | clickhouse_integration.py | millecodex/SEM | 39aedb8934fdf3c84d63d0cad444229979433a7a | [
"MIT"
] | 2 | 2022-01-06T01:53:14.000Z | 2022-01-06T06:29:35.000Z | clickhouse_integration.py | millecodex/SEM | 39aedb8934fdf3c84d63d0cad444229979433a7a | [
"MIT"
] | null | null | null | clickhouse_integration.py | millecodex/SEM | 39aedb8934fdf3c84d63d0cad444229979433a7a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
'''
# W O R K F L O W #
1. download github data in native clickhouse format (74.6 gb, ~10hours to download)
2. clickhouse server must be running
see: https://clickhouse.tech/docs/en/getting-started/install/
>sudo service clickhouse-server start (may need sudo -u jap... | 23.679113 | 117 | 0.662544 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
'''
# W O R K F L O W #
1. download github data in native clickhouse format (74.6 gb, ~10hours to download)
2. clickhouse server must be running
see: https://clickhouse.tech/docs/en/getting-started/install/
>sudo service clickhouse-server start (may need sudo -u jap... | 0 | 0 | 0 | 0 | 0 | 712 | 0 | 20 | 45 |
5a41a079fa01bdce1298f17000c10bcb99c2d05e | 650 | py | Python | projecteuler/35.py | diofeher/ctf-writeups | b82eaae064fe5339c69892dd084e0f1915ca8bb5 | [
"MIT"
] | 8 | 2018-12-30T06:49:29.000Z | 2021-06-30T22:37:54.000Z | projecteuler/35.py | diofeher/ctf-writeups | b82eaae064fe5339c69892dd084e0f1915ca8bb5 | [
"MIT"
] | null | null | null | projecteuler/35.py | diofeher/ctf-writeups | b82eaae064fe5339c69892dd084e0f1915ca8bb5 | [
"MIT"
] | 2 | 2020-03-10T11:04:54.000Z | 2020-10-13T12:34:16.000Z |
print len([i for i in range(1000000) if is_circular_prime(i)]) | 29.545455 | 70 | 0.589231 | def all_perms(string):
if len(string) <=1:
yield string
else:
for perm in all_perms(string[1:]):
for i in range(len(perm)+1):
yield perm[:i] + string[0:1] + perm[i:]
def is_prime(num):
if num==0 or num==1: return False
if num==2: return True
for i in rang... | 0 | 0 | 0 | 0 | 196 | 311 | 0 | 0 | 72 |
79d2bd4d366c5b184e4b92ef62f09bd3857a29c1 | 886 | py | Python | chap05/Filter.py | viekie/basic_deeplearning | 6c9e55cd621504da3d7ea1627e6783c9819a1916 | [
"Apache-2.0"
] | 3 | 2017-05-23T08:11:44.000Z | 2017-09-25T11:17:57.000Z | chap05/Filter.py | viekie/basic_deeplearning | 6c9e55cd621504da3d7ea1627e6783c9819a1916 | [
"Apache-2.0"
] | null | null | null | chap05/Filter.py | viekie/basic_deeplearning | 6c9e55cd621504da3d7ea1627e6783c9819a1916 | [
"Apache-2.0"
] | 1 | 2017-06-19T03:36:40.000Z | 2017-06-19T03:36:40.000Z | #!/usr/bin/env python
# -*- coding:utf8 -*-
# Power by viekie. 2017-05-27 09:23:04
| 26.848485 | 65 | 0.576749 | #!/usr/bin/env python
# -*- coding:utf8 -*-
# Power by viekie. 2017-05-27 09:23:04
import numpy as np
class Filter(object):
def __init__(self, width, height, depth):
'''
构造初始化
'''
self.width = width
self.height = height
self.depth = depth
self.weights = np.r... | 15 | 0 | 0 | 755 | 0 | 0 | 0 | -3 | 45 |
4124f814bb874e6d320bf5c4cc0c448b4e14dbff | 104 | py | Python | project/server/worker.py | ardikabs/flask-server-template | e1dfb33323cc89f6163d604007263b73ec5b6e12 | [
"MIT"
] | 1 | 2019-01-15T10:33:04.000Z | 2019-01-15T10:33:04.000Z | project/server/worker.py | ardikabs/flask-server-template | e1dfb33323cc89f6163d604007263b73ec5b6e12 | [
"MIT"
] | null | null | null | project/server/worker.py | ardikabs/flask-server-template | e1dfb33323cc89f6163d604007263b73ec5b6e12 | [
"MIT"
] | null | null | null |
import os
from server import make_worker
worker = make_worker(os.getenv("FLASK_CONFIG") or "default",) | 20.8 | 61 | 0.778846 |
import os
from server import make_worker
worker = make_worker(os.getenv("FLASK_CONFIG") or "default",) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d78b5d82b00d97040fcf7dda289d99db9079a7de | 2,192 | py | Python | unit_tests/test_files_check_ovn_db_connections.py | przemeklal/charm-ovn-central | ccb45c3d2ddfe089f299e8ebb79303dd0a705011 | [
"Apache-2.0"
] | null | null | null | unit_tests/test_files_check_ovn_db_connections.py | przemeklal/charm-ovn-central | ccb45c3d2ddfe089f299e8ebb79303dd0a705011 | [
"Apache-2.0"
] | null | null | null | unit_tests/test_files_check_ovn_db_connections.py | przemeklal/charm-ovn-central | ccb45c3d2ddfe089f299e8ebb79303dd0a705011 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 39.854545 | 74 | 0.708485 | # Copyright 2021 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 0 | 1,312 | 0 | 35 | 0 | 0 | 0 | 51 | 219 |
33f1868840dcae764bf333e380d375fb955c1acd | 201 | py | Python | Jupyter/AOBW.py | MooersLab/jupyterlabpymolpysnipsplus | b886750d63372434df53d4d6d7cdad6cb02ae4e7 | [
"MIT"
] | null | null | null | Jupyter/AOBW.py | MooersLab/jupyterlabpymolpysnipsplus | b886750d63372434df53d4d6d7cdad6cb02ae4e7 | [
"MIT"
] | null | null | null | Jupyter/AOBW.py | MooersLab/jupyterlabpymolpysnipsplus | b886750d63372434df53d4d6d7cdad6cb02ae4e7 | [
"MIT"
] | null | null | null | # Description: Run the AOBW function from the pymolshortcuts.py file to generate photorealistic effect in grayscale.
# Source: placeHolder
"""
cmd.do('cmd.do("AOBW")')
"""
cmd.do('cmd.do("AOBW")')
| 22.333333 | 117 | 0.706468 | # Description: Run the AOBW function from the pymolshortcuts.py file to generate photorealistic effect in grayscale.
# Source: placeHolder
"""
cmd.do('cmd.do("AOBW")')
"""
cmd.do('cmd.do("AOBW")')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58e2f18c29d37b8dcfd792252b792fe87df612cc | 348 | py | Python | year2021/python/day6/day6.py | 3schwartz/AdventOfCode | 32f259c4e20c3c4834718411f1053b6a11f71c86 | [
"MIT"
] | null | null | null | year2021/python/day6/day6.py | 3schwartz/AdventOfCode | 32f259c4e20c3c4834718411f1053b6a11f71c86 | [
"MIT"
] | null | null | null | year2021/python/day6/day6.py | 3schwartz/AdventOfCode | 32f259c4e20c3c4834718411f1053b6a11f71c86 | [
"MIT"
] | null | null | null |
inputStr = open('../../data/day6_data.txt').readline()
fishes = FishCreator.initFishes(inputStr)
spawn = FishSpawn()
numberOfFishes80Days = spawn.spawn(fishes, 80)
print(f"Part 1: {numberOfFishes80Days}")
numberOfFishes256Days = spawn.spawn(fishes, 256)
print(f"Part 2: {numberOfFishes256Days}") | 21.75 | 54 | 0.755747 | from year2021.python.day6.day6_func import *
inputStr = open('../../data/day6_data.txt').readline()
fishes = FishCreator.initFishes(inputStr)
spawn = FishSpawn()
numberOfFishes80Days = spawn.spawn(fishes, 80)
print(f"Part 1: {numberOfFishes80Days}")
numberOfFishes256Days = spawn.spawn(fishes, 256)
print(f"Part ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 22 |
07e263f9a23b2a011649cb1d854e7112ac894597 | 5,529 | py | Python | fastapi/encoders.py | includeamin/fastapi | 988d3c2a820f679bf88e2fc18f4e9614a2633212 | [
"MIT"
] | null | null | null | fastapi/encoders.py | includeamin/fastapi | 988d3c2a820f679bf88e2fc18f4e9614a2633212 | [
"MIT"
] | null | null | null | fastapi/encoders.py | includeamin/fastapi | 988d3c2a820f679bf88e2fc18f4e9614a2633212 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Set, Union
from pydantic.json import ENCODERS_BY_TYPE
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Dict[Union[int, str], Any]
encoders_by_class_tuples = generate_encoders_by_class_tuples(ENCODERS_BY_TYPE)
| 34.341615 | 85 | 0.58166 | from enum import Enum
from types import GeneratorType
from typing import Any, Callable, Dict, List, Set, Tuple, Union
from fastapi.logger import logger
from fastapi.utils import PYDANTIC_1
from pydantic import BaseModel
from pydantic.json import ENCODERS_BY_TYPE
SetIntStr = Set[Union[int, str]]
DictIntStrAny = Dict[U... | 0 | 0 | 0 | 0 | 0 | 5,059 | 0 | 69 | 157 |
ac16b5ae47ccf63f9b247a1c7165aa7cc95d25c3 | 5,116 | py | Python | cnstd/consts.py | breezedeus/cnstd | 57a8171ea706c9e8f665bffc640d90022d43ab8e | [
"Apache-2.0"
] | 266 | 2020-06-02T12:33:50.000Z | 2022-03-31T06:12:46.000Z | cnstd/consts.py | breezedeus/cnstd | 57a8171ea706c9e8f665bffc640d90022d43ab8e | [
"Apache-2.0"
] | 37 | 2020-06-04T13:34:35.000Z | 2022-03-25T07:43:21.000Z | cnstd/consts.py | breezedeus/cnstd | 57a8171ea706c9e8f665bffc640d90022d43ab8e | [
"Apache-2.0"
] | 66 | 2020-06-02T12:33:33.000Z | 2022-03-24T14:22:09.000Z | # coding: utf-8
# Copyright (C) 2021, [Breezedeus](https://github.com/breezedeus).
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this f... | 31.195122 | 86 | 0.581704 | # coding: utf-8
# Copyright (C) 2021, [Breezedeus](https://github.com/breezedeus).
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this f... | 153 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0 |
f46c961efad3e34687cc99723c14dc0969fb0567 | 3,055 | py | Python | Read and play bag files from realsense camera/read_bag.py | afiretony/UAV_utilities | 517b3eb9bb985dbf9ad334e96dbf8f1b4713bb14 | [
"MIT"
] | null | null | null | Read and play bag files from realsense camera/read_bag.py | afiretony/UAV_utilities | 517b3eb9bb985dbf9ad334e96dbf8f1b4713bb14 | [
"MIT"
] | null | null | null | Read and play bag files from realsense camera/read_bag.py | afiretony/UAV_utilities | 517b3eb9bb985dbf9ad334e96dbf8f1b4713bb14 | [
"MIT"
] | null | null | null | #####################################################
## Read bag from file ##
#####################################################
# First import library
import pyrealsense2 as rs
# Import Numpy for easy array manipulation
import numpy as np
import sys
np.set_printoptions(thre... | 32.849462 | 112 | 0.632733 | #####################################################
## Read bag from file ##
#####################################################
# First import library
import pyrealsense2 as rs
# Import Numpy for easy array manipulation
import numpy as np
import sys
np.set_printoptions(thre... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d7e531e587fcf22ca5052858a16906e530ac1ec | 186 | py | Python | tests/unit/test_mixin.py | matthewgdv/miscutils | f605ded914e355214533b06e7a768272409769c0 | [
"MIT"
] | null | null | null | tests/unit/test_mixin.py | matthewgdv/miscutils | f605ded914e355214533b06e7a768272409769c0 | [
"MIT"
] | null | null | null | tests/unit/test_mixin.py | matthewgdv/miscutils | f605ded914e355214533b06e7a768272409769c0 | [
"MIT"
] | null | null | null | # import pytest
| 13.285714 | 38 | 0.645161 | # import pytest
class TestReprMixin:
pass
class TestCopyMixin:
def test_copy(self): # synced
assert True
def test_deepcopy(self): # synced
assert True
| 0 | 0 | 0 | 122 | 0 | 0 | 0 | 0 | 46 |
4747776d908096882a8a9e84d7bd93098a2de6a8 | 1,399 | py | Python | DailyProgrammer/20120410B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/20120410B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/20120410B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
Reverse Polish Notation(RPN) is a mathematical notation where every operator follows all of its operands. For instance,
to add three and four, one would write "3 4 +" rather than "3 + 4". If there are multiple operations, the operator is
given immediately after its second operand; so the expression written "3 ? 4 +... | 31.088889 | 119 | 0.654753 | """
Reverse Polish Notation(RPN) is a mathematical notation where every operator follows all of its operands. For instance,
to add three and four, one would write "3 4 +" rather than "3 + 4". If there are multiple operations, the operator is
given immediately after its second operand; so the expression written "3 ? 4 +... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1d4c563ca6d7fbca06cb44be85b9076ebe241a61 | 5,083 | py | Python | origins/ontologies.py | cocoemily/paleocore2 | 34b9ba30358963a0a1c8ae7252ed7c5ef178a758 | [
"MIT"
] | null | null | null | origins/ontologies.py | cocoemily/paleocore2 | 34b9ba30358963a0a1c8ae7252ed7c5ef178a758 | [
"MIT"
] | null | null | null | origins/ontologies.py | cocoemily/paleocore2 | 34b9ba30358963a0a1c8ae7252ed7c5ef178a758 | [
"MIT"
] | null | null | null | # Origins Project Choice Lists, Vocabularies, Ontologies
# choice lists and vocabularies are defined with the following design template:
# variable_label1 = value # variable_labels are lowercase, values can be strings or numbers or codes
# variable_label2 = value
# CHOICES = (
# (variable_label1, 'string_represent... | 42.008264 | 119 | 0.744639 | # Origins Project Choice Lists, Vocabularies, Ontologies
# choice lists and vocabularies are defined with the following design template:
# variable_label1 = value # variable_labels are lowercase, values can be strings or numbers or codes
# variable_label2 = value
# CHOICES = (
# (variable_label1, 'string_represent... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17714782ac90fa3f8a593cd5ecfbcd309fdb7f2c | 133 | py | Python | templates/text_handlers.py | Tsitko/drawyourbot | 87ce611a6aaba0dbcd02332edecf1dfe79dcae03 | [
"MIT"
] | 22 | 2021-04-22T08:00:08.000Z | 2021-08-11T00:30:30.000Z | templates/text_handlers.py | Tsitko/drawyourbot | 87ce611a6aaba0dbcd02332edecf1dfe79dcae03 | [
"MIT"
] | null | null | null | templates/text_handlers.py | Tsitko/drawyourbot | 87ce611a6aaba0dbcd02332edecf1dfe79dcae03 | [
"MIT"
] | 4 | 2021-08-10T08:36:12.000Z | 2022-03-27T15:21:30.000Z | if last_question[bot.message.chat_id] == '%block_name%' and not got_answer:
%get_answer%
%next_blocks%
got_answer = True
| 26.6 | 79 | 0.699248 | if last_question[bot.message.chat_id] == '%block_name%' and not got_answer:
%get_answer%
%next_blocks%
got_answer = True
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5088bdcc2555dffb970cb2a2f2ba052473943cd3 | 11,536 | py | Python | core/utils.py | CAPTools/CAPCollector | 9d890b0f9a0d9a655e4042315ff94133621530e9 | [
"BSD-3-Clause"
] | 11 | 2015-01-24T03:04:31.000Z | 2022-01-12T23:33:49.000Z | core/utils.py | CAPTools/CAPCollector | 9d890b0f9a0d9a655e4042315ff94133621530e9 | [
"BSD-3-Clause"
] | null | null | null | core/utils.py | CAPTools/CAPCollector | 9d890b0f9a0d9a655e4042315ff94133621530e9 | [
"BSD-3-Clause"
] | 8 | 2015-04-19T18:22:53.000Z | 2021-12-15T11:21:02.000Z | # Copyright (c) 2013, Carnegie Mellon University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions... | 35.937695 | 80 | 0.692181 | # Copyright (c) 2013, Carnegie Mellon University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e2a9218dc15d719fba899fa20f53e298214c11a | 13,078 | py | Python | rain_api_core/urs_util.py | asfadmin/rain-api-core | 99985d4a346ab06449a42ed6b5b91f36d2bc760a | [
"Apache-2.0"
] | 1 | 2020-05-06T22:01:22.000Z | 2020-05-06T22:01:22.000Z | rain_api_core/urs_util.py | asfadmin/rain-api-core | 99985d4a346ab06449a42ed6b5b91f36d2bc760a | [
"Apache-2.0"
] | 87 | 2019-09-16T20:45:59.000Z | 2022-03-31T21:18:44.000Z | rain_api_core/urs_util.py | asfadmin/rain-api-core | 99985d4a346ab06449a42ed6b5b91f36d2bc760a | [
"Apache-2.0"
] | 2 | 2020-05-06T22:01:29.000Z | 2021-03-23T18:22:52.000Z |
import logging
import os
from rain_api_core.aws_util import retrieve_secret
log = logging.getLogger(__name__)
def get_urs_creds():
"""
Fetches URS creds from secrets manager.
:return: looks like:
{
"UrsId": "stringofseeminglyrandomcharacters",
"UrsAu... | 39.155689 | 156 | 0.658663 |
import logging
import os
import urllib
from time import time
from json import loads
from rain_api_core.general_util import log_context, return_timing_object, duration
from rain_api_core.view_util import make_set_cookie_headers_jwt, get_exp_time, JWT_COOKIE_NAME
from rain_api_core.aws_util import retrieve_secret
log ... | 0 | 0 | 0 | 0 | 0 | 11,746 | 0 | 127 | 362 |
6bc67b3877e6d543746b09d6c9a8ffaf05e2d6b6 | 979 | py | Python | source/lambda/solution_helper/lambda_function.py | aws-solutions/aws-devops-monitoring-dashboard | ce634d51c64118ba6716b1ffa19756d2e97ad4c8 | [
"Apache-2.0"
] | 9 | 2021-10-30T13:03:37.000Z | 2022-03-07T19:29:30.000Z | source/lambda/solution_helper/lambda_function.py | aws-solutions/aws-devops-monitoring-dashboard | ce634d51c64118ba6716b1ffa19756d2e97ad4c8 | [
"Apache-2.0"
] | 1 | 2022-01-03T20:18:32.000Z | 2022-01-13T00:44:51.000Z | source/lambda/solution_helper/lambda_function.py | aws-solutions/aws-devops-monitoring-dashboard | ce634d51c64118ba6716b1ffa19756d2e97ad4c8 | [
"Apache-2.0"
] | 5 | 2021-10-30T13:03:32.000Z | 2022-03-16T18:36:33.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
from crhelper import CfnResource
logger = logging.getLogger(__name__)
helper = CfnResource(json_logging=True, log_level="INFO")
| 26.459459 | 90 | 0.720123 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import uuid
import requests
import json
from copy import copy
from datetime import datetime
from crhelper import CfnResource
from util.solution_metrics import send_metrics
logger = loggi... | 0 | 353 | 0 | 0 | 0 | 177 | 0 | -5 | 200 |
6d148d29c415b6451fce5bdddc781fcb51b3a959 | 9,755 | py | Python | Test/Mock/Component.py | paul-ollis/cleversheep3 | 86e6ca76ea4e8524f16e2348d38484dcfafb07d0 | [
"Apache-2.0"
] | null | null | null | Test/Mock/Component.py | paul-ollis/cleversheep3 | 86e6ca76ea4e8524f16e2348d38484dcfafb07d0 | [
"Apache-2.0"
] | null | null | null | Test/Mock/Component.py | paul-ollis/cleversheep3 | 86e6ca76ea4e8524f16e2348d38484dcfafb07d0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Classes to mock components for use in system testing.
The main class is the `Component`, which is intended to be used as the base
class for an object that plays the part of a separately running process.
However, a component is actually executed under the control of the
`cleversheep3.Test.PollM... | 37.810078 | 79 | 0.634341 | #!/usr/bin/env python
"""Classes to mock components for use in system testing.
The main class is the `Component`, which is intended to be used as the base
class for an object that plays the part of a separately running process.
However, a component is actually executed under the control of the
`cleversheep3.Test.PollM... | 0 | 0 | 0 | 8,829 | 0 | 60 | 0 | 16 | 114 |
6f7b106f7638421b8fd55db0ebf2169f0c928b89 | 2,415 | py | Python | src/ralph/signals.py | DoNnMyTh/ralph | 97b91639fa68965ad3fd9d0d2652a6545a2a5b72 | [
"Apache-2.0"
] | 1,668 | 2015-01-01T12:51:20.000Z | 2022-03-29T09:05:35.000Z | src/ralph/signals.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 2,314 | 2015-01-02T13:26:26.000Z | 2022-03-29T04:06:03.000Z | src/ralph/signals.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 534 | 2015-01-05T12:40:28.000Z | 2022-03-29T21:10:12.000Z | from django.db.models.signals import post_save
# TODO(mkurek): make this working as a decorator, example:
# @post_commit(MyModel)
# def my_handler(instance):
# ...
def post_commit(func, model, signal=post_save, single_call=True):
"""
Post commit signal for specific model.
It's better than Django's pos... | 41.637931 | 80 | 0.681159 | from django.db import connection
from django.db.models.signals import post_save
from django.dispatch import receiver
# TODO(mkurek): make this working as a decorator, example:
# @post_commit(MyModel)
# def my_handler(instance):
# ...
def post_commit(func, model, signal=post_save, single_call=True):
"""
Pos... | 0 | 610 | 0 | 0 | 0 | 0 | 0 | 26 | 70 |
585404588be51bc49193fe8046ecb213a7dc11b7 | 3,743 | py | Python | ai_modules/kcwu_short2.py | sgpritam/2048-python | 1366db6a712b6808699d6b71166487d7cc01a88c | [
"BSD-3-Clause"
] | 79 | 2016-01-01T17:41:11.000Z | 2022-02-21T18:18:13.000Z | ai_modules/kcwu_short2.py | sgpritam/2048-python | 1366db6a712b6808699d6b71166487d7cc01a88c | [
"BSD-3-Clause"
] | 4 | 2017-04-08T15:14:08.000Z | 2021-12-25T00:51:34.000Z | ai_modules/kcwu_short2.py | sgpritam/2048-python | 1366db6a712b6808699d6b71166487d7cc01a88c | [
"BSD-3-Clause"
] | 63 | 2017-02-25T13:54:44.000Z | 2022-01-17T18:04:59.000Z | # Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
range4 = range(4)
job_table = {}
table = {}
# vim:sw=4:expandtab:softtabstop=4
| 26.174825 | 176 | 0.536468 | # Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from multiprocessing import *
import sys
range4 = range(4)
job_table = {}
def rotateRight(grid):
return [[grid[r][3-c] for r in range4] for c in range4]
def move_... | 0 | 0 | 0 | 739 | 0 | 2,401 | 0 | -3 | 363 |
51b3b5a2926120226b4c6ef9a3aa3313337a91df | 5,181 | py | Python | nengolib/networks/echo_state.py | ikajic/nengolib | bd30ec38ba656bedb94a267b5f86b51d1cec4954 | [
"MIT"
] | 27 | 2016-01-21T04:11:02.000Z | 2021-11-16T20:41:04.000Z | nengolib/networks/echo_state.py | ikajic/nengolib | bd30ec38ba656bedb94a267b5f86b51d1cec4954 | [
"MIT"
] | 178 | 2016-01-21T16:04:34.000Z | 2021-05-01T16:28:02.000Z | nengolib/networks/echo_state.py | ikajic/nengolib | bd30ec38ba656bedb94a267b5f86b51d1cec4954 | [
"MIT"
] | 4 | 2019-03-19T18:22:02.000Z | 2021-03-23T16:06:57.000Z |
__all__ = ['EchoState']
| 43.175 | 79 | 0.647365 | import numpy as np
from scipy.linalg import eig
from nengo.params import IntParam, NumberParam
from nengo.neurons import NeuronTypeParam
from nengo.synapses import SynapseParam
import nengo
from nengolib import Network
from nengolib.neurons import Tanh
from nengolib.networks.reservoir import Reservoir
__all__ = ['Ec... | 0 | 0 | 0 | 4,827 | 0 | 0 | 0 | 105 | 223 |
29f16302d911899d097a220dbe4d2244dad9298b | 427 | py | Python | tests/unit/test_k8s.py | lslebodn/conu | dee6fd958471f77d1c0511b031ea136dfaf8a77a | [
"MIT"
] | 95 | 2018-05-19T14:35:08.000Z | 2022-01-08T23:31:40.000Z | tests/unit/test_k8s.py | lslebodn/conu | dee6fd958471f77d1c0511b031ea136dfaf8a77a | [
"MIT"
] | 179 | 2017-09-12T11:14:30.000Z | 2018-04-26T05:36:13.000Z | tests/unit/test_k8s.py | lslebodn/conu | dee6fd958471f77d1c0511b031ea136dfaf8a77a | [
"MIT"
] | 16 | 2018-05-09T14:15:32.000Z | 2021-08-02T21:11:33.000Z | # -*- coding: utf-8 -*-
#
# Copyright Contributors to the Conu project.
# SPDX-License-Identifier: MIT
#
"""
Tests for Kubernetes backend
"""
| 21.35 | 91 | 0.754098 | # -*- coding: utf-8 -*-
#
# Copyright Contributors to the Conu project.
# SPDX-License-Identifier: MIT
#
"""
Tests for Kubernetes backend
"""
from conu.backend.k8s.utils import k8s_ports_to_metadata_ports, metadata_ports_to_k8s_ports
def test_port_conversion():
test_ports = ["8080/tcp", "12345"]
k8s_ports ... | 0 | 0 | 0 | 0 | 0 | 167 | 0 | 70 | 46 |
d7129155bec3bfc5f1ad8ebe45c9344c21663af1 | 7,468 | py | Python | research/rl/ppo.py | matwilso/boxLCD | 7505e27f47e6694026303aa6cf12477959fc9fba | [
"MIT"
] | 2 | 2021-05-17T14:33:54.000Z | 2021-09-09T07:14:03.000Z | research/rl/ppo.py | matwilso/boxLCD | 7505e27f47e6694026303aa6cf12477959fc9fba | [
"MIT"
] | null | null | null | research/rl/ppo.py | matwilso/boxLCD | 7505e27f47e6694026303aa6cf12477959fc9fba | [
"MIT"
] | null | null | null | import numpy as np
import torch as th
import torch.nn as nn
#from research.nets.flat_everything import FlatEverything | 38.297436 | 157 | 0.638324 | import matplotlib.pyplot as plt
import yaml
from datetime import datetime
from collections import defaultdict
from copy import deepcopy
import itertools
import numpy as np
import torch as th
from torch.optim import Adam
import time
import numpy as np
import scipy.signal
import torch as th
import torch.nn as nn
import t... | 0 | 0 | 0 | 6,672 | 0 | 0 | 0 | 172 | 507 |
b8bdbd0987c85f503a5658663124311935d26509 | 414 | py | Python | ABC/abc051-abc100/abc076/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc051-abc100/abc076/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc051-abc100/abc076/b.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | '''input
10
10
76
4
3
10
'''
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == '__main__':
operation_count = int(input())
incremental_value = int(input())
candidates = list()
for i in range(operation_count + 1):
result = 2 ** i + (operation_cou... | 16.56 | 68 | 0.586957 | '''input
10
10
76
4
3
10
'''
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == '__main__':
operation_count = int(input())
incremental_value = int(input())
candidates = list()
for i in range(operation_count + 1):
result = 2 ** i + (operation_cou... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
318c4aa7d390df96ab796a0470c35e596cc5b013 | 807 | py | Python | tests/test_parse_bytes_function.py | SethMMorton/natsor | 45c042ee849710fb45df6c3a9f980cdc0d7524f4 | [
"MIT"
] | null | null | null | tests/test_parse_bytes_function.py | SethMMorton/natsor | 45c042ee849710fb45df6c3a9f980cdc0d7524f4 | [
"MIT"
] | null | null | null | tests/test_parse_bytes_function.py | SethMMorton/natsor | 45c042ee849710fb45df6c3a9f980cdc0d7524f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""These test the utils.py functions."""
| 29.888889 | 64 | 0.677819 | # -*- coding: utf-8 -*-
"""These test the utils.py functions."""
import pytest
from hypothesis import given
from hypothesis.strategies import binary
from natsort.ns_enum import NSType, ns
from natsort.utils import BytesTransformer, parse_bytes_factory
@pytest.mark.parametrize(
"alg, example_func",
[
... | 0 | 530 | 0 | 0 | 0 | 0 | 0 | 77 | 134 |
952747f2c41b0d1614d5d77fab4a7fa08c5f3565 | 285 | py | Python | music/distance/aural/diatonic/seventh/minor.py | jedhsu/music | dea68c4a82296cd4910e786f533b2cbf861377c3 | [
"MIT"
] | null | null | null | music/distance/aural/diatonic/seventh/minor.py | jedhsu/music | dea68c4a82296cd4910e786f533b2cbf861377c3 | [
"MIT"
] | null | null | null | music/distance/aural/diatonic/seventh/minor.py | jedhsu/music | dea68c4a82296cd4910e786f533b2cbf861377c3 | [
"MIT"
] | null | null | null | """
*minor 7th*
The minor 7th diatonic interval.
"""
__all__ = ["MinorSeventh"]
| 11.875 | 41 | 0.708772 | """
*minor 7th*
The minor 7th diatonic interval.
"""
from dataclasses import dataclass
from fivear.musical.scale import Diatonic
from ...simple import SimpleInterval
__all__ = ["MinorSeventh"]
@dataclass
class MinorSeventh(
SimpleInterval,
Diatonic,
):
pass
| 0 | 55 | 0 | 0 | 0 | 0 | 0 | 47 | 92 |
4c2ac7fef64884be4cb9a8c8930be3a4e673d4f8 | 198 | py | Python | applications/baseapp/management/template_structures/application/__init__.py | ajitjasrotia/django-project-skeleton | 70e3e06384dfb018f59b1af8c7c3febf2bbcd47c | [
"MIT"
] | 48 | 2018-01-10T11:21:35.000Z | 2021-09-08T23:28:07.000Z | applications/baseapp/management/template_structures/application/__init__.py | ajitjasrotia/django-project-skeleton | 70e3e06384dfb018f59b1af8c7c3febf2bbcd47c | [
"MIT"
] | 26 | 2018-04-20T10:46:00.000Z | 2019-09-21T06:47:13.000Z | applications/baseapp/management/template_structures/application/__init__.py | ajitjasrotia/django-project-skeleton | 70e3e06384dfb018f59b1af8c7c3febf2bbcd47c | [
"MIT"
] | 20 | 2019-03-09T19:46:10.000Z | 2022-03-27T14:57:03.000Z | # isort:skip_file
# flake8: noqa
| 22 | 33 | 0.823232 | # isort:skip_file
# flake8: noqa
from .html import TEMPLATE_HTML
from .apps import TEMPLATE_APPS
from .urls import TEMPLATE_URLS
from .views import TEMPLATE_VIEWS
from .tests import TEMPLATE_TESTS
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 111 |
807e583cbe68257d26ee0f4d40e74fb8a9d64b95 | 1,203 | py | Python | unity.py | forever7410852/esvn | a8c5db2c46bf1dbaa30bc62f3cd7458f826e97b3 | [
"Apache-2.0"
] | 1 | 2017-04-16T14:19:28.000Z | 2017-04-16T14:19:28.000Z | unity.py | forever7410852/esvn | a8c5db2c46bf1dbaa30bc62f3cd7458f826e97b3 | [
"Apache-2.0"
] | null | null | null | unity.py | forever7410852/esvn | a8c5db2c46bf1dbaa30bc62f3cd7458f826e97b3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# run in python 3.5 and after
import fire
if __name__ == '__main__':
fire.Fire(unity)
| 30.075 | 124 | 0.588529 | #!/usr/bin/env python3
# run in python 3.5 and after
import fire
import subprocess
import os
import re
import signal
import time
import sys
class unity(object):
"""An enhanced unity cli."""
def open(self):
result = subprocess.run(
["defaults", "read", "/Users/HSH/Library/Preferences/com.un... | 0 | 0 | 0 | 912 | 0 | 55 | 0 | -57 | 178 |
0aa7901321d61c9a8020d316629398976cd486f9 | 11,827 | py | Python | texar/modules/embedders/position_embedders.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 25 | 2019-01-03T09:15:20.000Z | 2022-02-12T04:20:59.000Z | texar/modules/embedders/position_embedders.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 4 | 2019-03-28T11:02:20.000Z | 2022-02-15T04:57:33.000Z | texar/modules/embedders/position_embedders.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 9 | 2019-01-03T02:20:37.000Z | 2022-02-12T04:20:50.000Z | #
"""
Various position embedders.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=arguments-differ, invalid-name
__all__ = [
"PositionEmbedder",
"SinusoidsPositionEmbedder",
]
| 39.033003 | 87 | 0.603196 | #
"""
Various position embedders.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import tensorflow as tf
from texar.modules.embedders.embedder_base import EmbedderBase
from texar.modules.embedders import embedder_utils
from texar.utils.mo... | 0 | 1,492 | 0 | 9,753 | 0 | 0 | 0 | 107 | 204 |
94f957f34ddd100883c7635dde7686fb84a58a99 | 4,691 | py | Python | rules-conv.py | beorn7/promhacks | 042fdd4e7d50589e7957220684d5f29864d95e03 | [
"MIT"
] | 4 | 2018-12-13T14:16:44.000Z | 2019-01-04T11:13:47.000Z | rules-conv.py | beorn7/promhacks | 042fdd4e7d50589e7957220684d5f29864d95e03 | [
"MIT"
] | null | null | null | rules-conv.py | beorn7/promhacks | 042fdd4e7d50589e7957220684d5f29864d95e03 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Converts Prom1.x rule format into Prom2.x while keeping formatting
# and comments. This does not work in general. Some valid Prom1 rules
# files might not get converted properly.
import glob
import re
for rules_file in glob.iglob('*.rules'):
name = re.match(r'(.*)\.rules', rules_file)[1]
... | 36.084615 | 87 | 0.448305 | #!/usr/bin/python3
# Converts Prom1.x rule format into Prom2.x while keeping formatting
# and comments. This does not work in general. Some valid Prom1 rules
# files might not get converted properly.
import glob
import re
def convert(rules, yaml):
indent = 2
in_alert = False
in_record = False
in_expr... | 0 | 0 | 0 | 0 | 0 | 4,116 | 0 | 0 | 23 |
2d626d671dcd6abe298bfd3da9ff2103e85d3d2d | 4,182 | py | Python | pyt.py | ojhavijay/VIJAY-KUMAR-OJHA | d89224326cf89ac65da6b18aed71bbbb25c839d0 | [
"Unlicense"
] | null | null | null | pyt.py | ojhavijay/VIJAY-KUMAR-OJHA | d89224326cf89ac65da6b18aed71bbbb25c839d0 | [
"Unlicense"
] | null | null | null | pyt.py | ojhavijay/VIJAY-KUMAR-OJHA | d89224326cf89ac65da6b18aed71bbbb25c839d0 | [
"Unlicense"
] | null | null | null |
if __name__ == '__main__':
root=Tk()
obj=ChatBot(root)
root.mainloop()
| 34 | 365 | 0.549976 | from tkinter import*
from tkinter import ttk
class ChatBot:
def __init__(self,root):
self.root=root
self.root.title("UniBot")
self.root.geometry("730x620+0+0")
self.root.bind('<Return>',self.enter_func)
main_frame=Frame(self.root,bd=5,bg='orange',width=615)
... | 0 | 0 | 0 | 3,929 | 0 | 0 | 0 | 1 | 71 |
ec052e40881fff0e487807290780c7199d0dba38 | 33,017 | py | Python | tests/test_swiftclient.py | citrix-openstack-build/python-swiftclient | 68dde8dd514e4eef89aafa6c1c93e065045c3cbd | [
"Apache-2.0"
] | null | null | null | tests/test_swiftclient.py | citrix-openstack-build/python-swiftclient | 68dde8dd514e4eef89aafa6c1c93e065045c3cbd | [
"Apache-2.0"
] | null | null | null | tests/test_swiftclient.py | citrix-openstack-build/python-swiftclient | 68dde8dd514e4eef89aafa6c1c93e065045c3cbd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 37.181306 | 79 | 0.572856 | # Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 0 | 0 | 0 | 31,501 | 0 | 0 | 0 | 42 | 636 |
fbf53043effec4b990be99acf5f0238e010187d1 | 1,377 | py | Python | save_neutral_pose.py | johndpope/FacialRetargeting | 5fb0c1da6af6c3d59aef264f567bfa7a244d0764 | [
"MIT"
] | null | null | null | save_neutral_pose.py | johndpope/FacialRetargeting | 5fb0c1da6af6c3d59aef264f567bfa7a244d0764 | [
"MIT"
] | null | null | null | save_neutral_pose.py | johndpope/FacialRetargeting | 5fb0c1da6af6c3d59aef264f567bfa7a244d0764 | [
"MIT"
] | null | null | null | import numpy as np
import os
from utils.load_data import load_c3d_file
# declare variables
path = 'D:/MoCap_Data/David/NewSession_labeled/'
file = 'NeutralTrail14.c3d'
save_folder = 'data/'
save_name = 'David_neutral_pose'
neutral_frame = 900
template_labels = ['LeftBrow1', 'LeftBrow2', 'LeftBrow3', 'LeftBrow4', 'Righ... | 45.9 | 117 | 0.627451 | import numpy as np
import os
from utils.load_data import load_c3d_file
# declare variables
path = 'D:/MoCap_Data/David/NewSession_labeled/'
file = 'NeutralTrail14.c3d'
save_folder = 'data/'
save_name = 'David_neutral_pose'
neutral_frame = 900
template_labels = ['LeftBrow1', 'LeftBrow2', 'LeftBrow3', 'LeftBrow4', 'Righ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
727fed69bd7418960e671b30d7bed67924a69d3f | 825 | py | Python | schedule/migrations/0024_auto_20141116_1234.py | yourcelf/masterschedule | e585df0e9edcaff5fa4f04f77a9452e3073b5db7 | [
"Unlicense"
] | 1 | 2015-02-11T04:08:36.000Z | 2015-02-11T04:08:36.000Z | schedule/migrations/0024_auto_20141116_1234.py | yourcelf/masterschedule | e585df0e9edcaff5fa4f04f77a9452e3073b5db7 | [
"Unlicense"
] | null | null | null | schedule/migrations/0024_auto_20141116_1234.py | yourcelf/masterschedule | e585df0e9edcaff5fa4f04f77a9452e3073b5db7 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 27.5 | 79 | 0.603636 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('schedule', '0023_conference_venue_random_slugs'),
]
operations = [
migrations.AlterField(
model_name='conference... | 0 | 0 | 0 | 695 | 0 | 0 | 0 | 19 | 46 |
70270b2fa3b99e488be39abb00d56b72ca2b5297 | 3,039 | py | Python | dataviz/flagstriband.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | 119 | 2017-07-22T15:02:30.000Z | 2021-08-02T10:42:59.000Z | dataviz/flagstriband.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | null | null | null | dataviz/flagstriband.py | Udzu/pudzu | 5a0302830b052fc54feba891eb7bf634957a9d90 | [
"MIT"
] | 28 | 2017-08-04T14:28:41.000Z | 2019-11-27T23:46:14.000Z |
df = pd.read_csv("datasets/flagstriband.csv")
df = pd.concat([pd.DataFrame(df.colours.apply(list).tolist(), columns=list("TMB")), df], axis=1).set_index("colours")
FONT, SIZE = calibri, 24
fg, bg = "black", "#EEEEEE"
default_img = "https://s-media-cache-ak0.pinimg.com/736x/0d/36/e7/0d36e7a476b06333d9fe9960572b66b9.jp... | 55.254545 | 173 | 0.659756 | from pudzu.charts import *
df = pd.read_csv("datasets/flagstriband.csv")
df = pd.concat([pd.DataFrame(df.colours.apply(list).tolist(), columns=list("TMB")), df], axis=1).set_index("colours")
FONT, SIZE = calibri, 24
fg, bg = "black", "#EEEEEE"
default_img = "https://s-media-cache-ak0.pinimg.com/736x/0d/36/e7/0d36e7a4... | 0 | 0 | 0 | 0 | 0 | 1,730 | 0 | 5 | 95 |