hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4270d790afa4624619214e25915fee27c2b4bfc1 | 2,032 | py | Python | graph.py | jnguyen1098/gryph-graph | adede75e594e34af7a3da62ee1177c177e7e527a | [
"0BSD"
] | null | null | null | graph.py | jnguyen1098/gryph-graph | adede75e594e34af7a3da62ee1177c177e7e527a | [
"0BSD"
] | 2 | 2020-06-10T02:28:55.000Z | 2021-04-15T19:50:52.000Z | graph.py | jnguyen1098/gryph-graph | adede75e594e34af7a3da62ee1177c177e7e527a | [
"0BSD"
] | 1 | 2020-10-02T14:32:58.000Z | 2020-10-02T14:32:58.000Z | #!/usr/bin/env python3
import pygraphviz
import wyvern
import random
import pydot
import sys
import csv
import re
prereq_reg = re.compile(r'[A-Z]{2,4}\*[0-9]{4}')
restrict_reg = re.compile(r'[A-Z]{2,4}\*[0-9]{4}')
if __name__ == "__main__":
sys.exit(main(sys.argv))
| 28.619718 | 105 | 0.619094 | #!/usr/bin/env python3
import pygraphviz
import wyvern
import random
import pydot
import sys
import csv
import re
prereq_reg = re.compile(r'[A-Z]{2,4}\*[0-9]{4}')
restrict_reg = re.compile(r'[A-Z]{2,4}\*[0-9]{4}')
class Course:
def __init__(self, name, prereqs, restricts):
self.name = name
self.p... | 1,623 | -8 | 144 |
66e56ce61a75cf31386ee63dde0e174382ec639d | 1,726 | py | Python | xsadmin_server.py | burningcx/shadowsocksr-p | 615f793edbdace4ab1001560054d4b2a6720e905 | [
"Apache-2.0"
] | null | null | null | xsadmin_server.py | burningcx/shadowsocksr-p | 615f793edbdace4ab1001560054d4b2a6720e905 | [
"Apache-2.0"
] | null | null | null | xsadmin_server.py | burningcx/shadowsocksr-p | 615f793edbdace4ab1001560054d4b2a6720e905 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
@author: alishtory
@site: https://github.com/alishtory
@file: xsadmin_server.py
@time: 2017/3/10 16:33
@description:
'''
import config_xsadmin as config
import requests, hashlib
import time, random, logging
from ServerManager import AbstractServerManager
if __name__ ... | 31.962963 | 102 | 0.681344 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
@author: alishtory
@site: https://github.com/alishtory
@file: xsadmin_server.py
@time: 2017/3/10 16:33
@description:
'''
import config_xsadmin as config
import requests, hashlib
import time, random, logging
from ServerManager import AbstractServerManager
class Xsadmi... | 1,030 | 29 | 118 |
dfb688b2d22b7a27719b37abd2123f2772bfb0a7 | 426 | py | Python | orders/urls.py | MrRezoo/django-online-shop | 2b0044ed41fe1b89c5fd2c2ea73822c6f43b5f6e | [
"MIT"
] | 1 | 2021-09-14T14:54:16.000Z | 2021-09-14T14:54:16.000Z | orders/urls.py | MrRezoo/django-online-shop | 2b0044ed41fe1b89c5fd2c2ea73822c6f43b5f6e | [
"MIT"
] | 1 | 2022-01-18T07:20:57.000Z | 2022-01-18T07:20:57.000Z | orders/urls.py | MrRezoo/django-online-shop | 2b0044ed41fe1b89c5fd2c2ea73822c6f43b5f6e | [
"MIT"
] | null | null | null | from django.urls import path
from orders import views
app_name = 'orders'
urlpatterns = [
path('create/', views.order_create, name='order_create'),
path('<int:order_id>/', views.detail, name='detail'),
path('payment/<int:order_id>/<int:price>', views.payment, name='payment'),
path('verify/', views.ve... | 30.428571 | 81 | 0.685446 | from django.urls import path
from orders import views
app_name = 'orders'
urlpatterns = [
path('create/', views.order_create, name='order_create'),
path('<int:order_id>/', views.detail, name='detail'),
path('payment/<int:order_id>/<int:price>', views.payment, name='payment'),
path('verify/', views.ve... | 0 | 0 | 0 |
d420e0659329ea1196870644b7417fb120f63575 | 614 | py | Python | main.py | nitoc-ict/slack-FileRemove | 8e9c96b0603fd8ee8056198b55ad0676a4229172 | [
"MIT"
] | 1 | 2020-02-15T12:04:00.000Z | 2020-02-15T12:04:00.000Z | main.py | nitoc-ict/slack-FileRemove | 8e9c96b0603fd8ee8056198b55ad0676a4229172 | [
"MIT"
] | null | null | null | main.py | nitoc-ict/slack-FileRemove | 8e9c96b0603fd8ee8056198b55ad0676a4229172 | [
"MIT"
] | null | null | null | import files_list
import files_delete
from datetime import datetime
import time
if __name__ == "__main__":
while True:
files = files_list.get_files_list()
if files == -1:
print("failed files get")
else:
now_time = datetime.now()
for file in files:
... | 32.315789 | 76 | 0.574919 | import files_list
import files_delete
from datetime import datetime
import time
if __name__ == "__main__":
while True:
files = files_list.get_files_list()
if files == -1:
print("failed files get")
else:
now_time = datetime.now()
for file in files:
... | 0 | 0 | 0 |
57dfb265080de79b9bbf7be66786483cf9b4fd2c | 5,803 | py | Python | cogs/depreciated/profiles.py | Greenfoot5/BattleBot | f4318124bb85786c3d0ff562132121c382445c36 | [
"MIT"
] | 2 | 2020-01-13T22:58:22.000Z | 2020-02-19T16:47:17.000Z | cogs/depreciated/profiles.py | Greenfoot5/BattleBot | f4318124bb85786c3d0ff562132121c382445c36 | [
"MIT"
] | 29 | 2020-01-13T23:30:03.000Z | 2020-06-26T18:08:01.000Z | cogs/depreciated/profiles.py | Greenfoot5/BattleBot | f4318124bb85786c3d0ff562132121c382445c36 | [
"MIT"
] | 2 | 2020-01-15T00:20:10.000Z | 2020-02-18T00:02:55.000Z | import discord
from discord.ext import commands
import asyncio
import pickle
import time
import datetime
import asyncio
ranksRP = [int(5*(i**1.5)+50*i+100) for i in range(50)]
class Profiles(commands.Cog):
"""
Info about yourself or other users. Will use Battle Legion API to check stats when added.
"""
... | 39.746575 | 345 | 0.580562 | import discord
from discord.ext import commands
import asyncio
import pickle
import time
import datetime
import asyncio
ranksRP = [int(5*(i**1.5)+50*i+100) for i in range(50)]
def get_rank_from(rp):
remRP = int(rp)
rank = 0
while remRP >= ranksRP[rank]:
remRP -= ranksRP[rank]
rank += 1
... | 287 | 0 | 72 |
050ef7288810f8353e5534adf5ba41a3c0bad564 | 1,776 | py | Python | vma_app/views.py | vishnujithtechversant/vma | 5948c89d0cc34ff15566040ae98a35da259e86ee | [
"MIT"
] | null | null | null | vma_app/views.py | vishnujithtechversant/vma | 5948c89d0cc34ff15566040ae98a35da259e86ee | [
"MIT"
] | null | null | null | vma_app/views.py | vishnujithtechversant/vma | 5948c89d0cc34ff15566040ae98a35da259e86ee | [
"MIT"
] | null | null | null | from flask import jsonify, render_template, redirect, current_app, request
import requests_oauthlib
from requests_oauthlib.compliance_fixes import facebook_compliance_fix
from config import FB_AUTHORIZATION_BASE_URL, FB_TOKEN_URL, BASE_URL
from serializer import serialize
from .db import get_schema
from .models impor... | 32.888889 | 88 | 0.664414 | from flask import jsonify, render_template, redirect, current_app, request
import requests_oauthlib
from requests_oauthlib.compliance_fixes import facebook_compliance_fix
from config import FB_AUTHORIZATION_BASE_URL, FB_TOKEN_URL, BASE_URL
from serializer import serialize
from .db import get_schema
from .models impor... | 1,404 | 0 | 23 |
96634d76e943187c818e40c45cd66c67b70cdce4 | 149 | py | Python | form.py | dharmeshdev19/Library-Management | a0e0b1c9157cb155228299fa35586c6c1182fafa | [
"Apache-2.0"
] | null | null | null | form.py | dharmeshdev19/Library-Management | a0e0b1c9157cb155228299fa35586c6c1182fafa | [
"Apache-2.0"
] | null | null | null | form.py | dharmeshdev19/Library-Management | a0e0b1c9157cb155228299fa35586c6c1182fafa | [
"Apache-2.0"
] | null | null | null | from wtforms_alchemy import ModelForm, ModelFormField
from models import * | 24.833333 | 53 | 0.765101 | from wtforms_alchemy import ModelForm, ModelFormField
from models import *
class BookEntryForm(ModelForm):
class Meta:
model = BookEntry | 0 | 52 | 23 |
4456e341bc297f786596507017dd94b4fa146a2f | 3,281 | py | Python | substitution_cipher/tests/test_encdec.py | onstop4/SubstitutionCipher | 21751d3e687fe770562266cbcbf885cc8923016e | [
"MIT"
] | null | null | null | substitution_cipher/tests/test_encdec.py | onstop4/SubstitutionCipher | 21751d3e687fe770562266cbcbf885cc8923016e | [
"MIT"
] | null | null | null | substitution_cipher/tests/test_encdec.py | onstop4/SubstitutionCipher | 21751d3e687fe770562266cbcbf885cc8923016e | [
"MIT"
] | null | null | null | from substitution_cipher.decrypt import decrypt_file, decrypt_text, reverse_dict
from substitution_cipher.encrypt import encrypt_file, encrypt_text
key = {
"a": "X",
"b": "B",
"c": "R",
"d": "Z",
"e": "A",
"f": "Y",
"g": "J",
"h": "M",
"i": "C",
"j": "D",
"k": "O",
"l": ... | 23.775362 | 80 | 0.538555 | from substitution_cipher.decrypt import decrypt_file, decrypt_text, reverse_dict
from substitution_cipher.encrypt import encrypt_file, encrypt_text
key = {
"a": "X",
"b": "B",
"c": "R",
"d": "Z",
"e": "A",
"f": "Y",
"g": "J",
"h": "M",
"i": "C",
"j": "D",
"k": "O",
"l": ... | 0 | 0 | 0 |
a89a8081129c506b7f7c3d57b7d30060d145ea78 | 19,474 | py | Python | env/lib/python3.5/site-packages/cartopy/io/img_tiles.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/cartopy/io/img_tiles.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | env/lib/python3.5/site-packages/cartopy/io/img_tiles.py | project-pantheon/pantheon_glob_planner | c0d50a53b36c4678192ec75ad7a4cd68c570daef | [
"BSD-3-Clause"
] | null | null | null | # (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | 35.151625 | 79 | 0.575126 | # (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | 5,505 | 1,590 | 570 |
439cf7fbcd727fbfcc01dd0a6b64de38c7c9d1e7 | 207 | py | Python | python/getLiveCovidData.py | tanvidaware17/hacktoberfest-2020 | 7c442d2c7471f248856801176e147c3a95173c4f | [
"MIT"
] | 1 | 2020-10-19T02:12:48.000Z | 2020-10-19T02:12:48.000Z | python/getLiveCovidData.py | tanvidaware17/hacktoberfest-2020 | 7c442d2c7471f248856801176e147c3a95173c4f | [
"MIT"
] | null | null | null | python/getLiveCovidData.py | tanvidaware17/hacktoberfest-2020 | 7c442d2c7471f248856801176e147c3a95173c4f | [
"MIT"
] | 1 | 2021-10-30T07:14:02.000Z | 2021-10-30T07:14:02.000Z | # importing the package covid
# can be installed with pip install covid
from covid import Covid
covid= Covid()
# setting a country, here India
india = covid.get_status_by_country_name("india")
print(india) | 23 | 49 | 0.782609 | # importing the package covid
# can be installed with pip install covid
from covid import Covid
covid= Covid()
# setting a country, here India
india = covid.get_status_by_country_name("india")
print(india) | 0 | 0 | 0 |
9121353aac22029780ce202eaf1a5b6813c9330a | 1,687 | py | Python | Python/VK/VK_bit.py | GeorgiyDemo/scrapheap | 1d298eb63e0e6a8fc92ab84a05372d2ed33beba1 | [
"MIT"
] | null | null | null | Python/VK/VK_bit.py | GeorgiyDemo/scrapheap | 1d298eb63e0e6a8fc92ab84a05372d2ed33beba1 | [
"MIT"
] | null | null | null | Python/VK/VK_bit.py | GeorgiyDemo/scrapheap | 1d298eb63e0e6a8fc92ab84a05372d2ed33beba1 | [
"MIT"
] | 1 | 2019-03-14T15:48:23.000Z | 2019-03-14T15:48:23.000Z | import datetime
import requests
import schedule
import time
import vk
session = vk.Session(access_token="token1")
admin = vk.Session(access_token="token2")
api = vk.API(session)
human = vk.API(admin)
maingroup = 128947927
maingroup_fix = -128947927
# Уведомления в личные сообщения
schedule.every(1).minutes.do(mes... | 25.179104 | 82 | 0.632484 | import datetime
import requests
import schedule
import time
import vk
session = vk.Session(access_token="token1")
admin = vk.Session(access_token="token2")
api = vk.API(session)
human = vk.API(admin)
maingroup = 128947927
maingroup_fix = -128947927
def get_users():
users = api.groups.getMembers(group_id=maingrou... | 683 | 0 | 69 |
bff11961cc103dada421a2d85d28dae8a7822fdf | 846 | py | Python | routes/app.py | barretobrock/bobrock.dev | 60b2d2d357bb9233027e876cc8197e71fe03e519 | [
"MIT"
] | null | null | null | routes/app.py | barretobrock/bobrock.dev | 60b2d2d357bb9233027e876cc8197e71fe03e519 | [
"MIT"
] | null | null | null | routes/app.py | barretobrock/bobrock.dev | 60b2d2d357bb9233027e876cc8197e71fe03e519 | [
"MIT"
] | null | null | null | from flask import Flask
# Internal packages
from configurations import BaseConfig
from flask_base import db, bcrypt, log_mgr
from .admin import admin
from .api import api
from .errors import errors
from .main import main
from .posts import posts
from .user import users
def create_app(*args, **kwargs) -> Flask:
""... | 29.172414 | 69 | 0.728132 | from flask import Flask
# Internal packages
from configurations import BaseConfig
from flask_base import db, bcrypt, log_mgr
from .admin import admin
from .api import api
from .errors import errors
from .main import main
from .posts import posts
from .user import users
def create_app(*args, **kwargs) -> Flask:
""... | 0 | 0 | 0 |
ea8cb6c91ffb3f93a9aa87923fb2123046e6f8ac | 209 | py | Python | testapp/plugin_t/test_with_plugins.py | majacQ/django-nose | 161ad932799a8b41c9bac624eaa552a11a653e4a | [
"BSD-3-Clause"
] | 318 | 2015-01-02T05:17:03.000Z | 2019-07-01T05:07:04.000Z | testapp/plugin_t/test_with_plugins.py | majacQ/django-nose | 161ad932799a8b41c9bac624eaa552a11a653e4a | [
"BSD-3-Clause"
] | 183 | 2015-01-05T18:09:34.000Z | 2019-07-03T06:41:21.000Z | testapp/plugin_t/test_with_plugins.py | majacQ/django-nose | 161ad932799a8b41c9bac624eaa552a11a653e4a | [
"BSD-3-Clause"
] | 120 | 2015-01-08T21:47:34.000Z | 2019-06-24T04:58:29.000Z | """Test loading of additional plugins."""
from nose.tools import eq_
def test_one():
"""Test that the test plugin was initialized."""
from testapp import plugins
eq_(plugins.plugin_began, True)
| 20.9 | 52 | 0.708134 | """Test loading of additional plugins."""
from nose.tools import eq_
def test_one():
"""Test that the test plugin was initialized."""
from testapp import plugins
eq_(plugins.plugin_began, True)
| 0 | 0 | 0 |
a158c434359106c74052a6281a48b7163da6480f | 1,041 | py | Python | notifications/providers/django_channels.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | null | null | null | notifications/providers/django_channels.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | null | null | null | notifications/providers/django_channels.py | gaybro8777/django-notifs | f349fdf2dc87f2b579055c4e2abd95832ad9df5b | [
"MIT"
] | null | null | null | """Notification channels for django-notifs."""
try:
from channels.layers import get_channel_layer
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEPENDENCIES = False
from asgiref.sync import async_to_sync
from pydantic import BaseModel
from .base import BaseNotificationProvider
class DjangoChannelsN... | 23.659091 | 79 | 0.741595 | """Notification channels for django-notifs."""
try:
from channels.layers import get_channel_layer
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEPENDENCIES = False
from asgiref.sync import async_to_sync
from pydantic import BaseModel
from .base import BaseNotificationProvider
class DjangoChannelsSc... | 248 | 126 | 129 |
0c0fa541e96bc999034f271c4efe4caf7360009d | 4,937 | py | Python | demo_infer.py | eddy4112/PSPNet-Full | ae51ad173900c4d466c1e57a084400071e0bd019 | [
"MIT"
] | 150 | 2018-04-22T18:24:54.000Z | 2022-03-02T05:02:03.000Z | demo_infer.py | eddy4112/PSPNet-Full | ae51ad173900c4d466c1e57a084400071e0bd019 | [
"MIT"
] | 32 | 2018-05-19T17:18:53.000Z | 2021-08-31T04:18:32.000Z | demo_infer.py | eddy4112/PSPNet-Full | ae51ad173900c4d466c1e57a084400071e0bd019 | [
"MIT"
] | 35 | 2018-05-09T09:42:24.000Z | 2020-12-09T13:26:05.000Z | import tensorflow as tf
import os
import numpy as np
import cv2
from args import FLAGS
from database import reader, helper, helper_cityscapes
from model import pspnet_mg
from experiment_manager.utils import sorted_str_dict
if __name__ == '__main__':
tf.app.run()
| 36.57037 | 120 | 0.655054 | import tensorflow as tf
import os
import numpy as np
import cv2
from args import FLAGS
from database import reader, helper, helper_cityscapes
from model import pspnet_mg
from experiment_manager.utils import sorted_str_dict
def gpu_num():
return len(FLAGS.visible_gpus.split(','))
def infer(image_filename, i_ckp... | 4,595 | 0 | 69 |
0701fd13fb17f2e14454754a226f448bc78698c0 | 2,835 | py | Python | tests/core/array/PythonTest.py | niklas2902/py4godot | bf50624d1fc94b55faf82a3a4d322e33fbba60ce | [
"MIT"
] | 2 | 2021-12-10T21:17:57.000Z | 2021-12-17T18:54:49.000Z | tests/core/array/PythonTest.py | niklas2902/py4godot | bf50624d1fc94b55faf82a3a4d322e33fbba60ce | [
"MIT"
] | 9 | 2021-12-21T18:35:28.000Z | 2022-03-27T20:03:50.000Z | tests/core/array/PythonTest.py | niklas2902/py4godot | bf50624d1fc94b55faf82a3a4d322e33fbba60ce | [
"MIT"
] | 1 | 2022-03-07T08:06:57.000Z | 2022-03-07T08:06:57.000Z | import unittest
from py4godot import Array, Variant
| 18.651316 | 42 | 0.653616 | import unittest
from py4godot import Array, Variant
class PythonTest(unittest.TestCase):
def test_append(self):
arr = Array()
arr.append(1)
print(type(arr[0]))
self.assertEqual(arr.get(0), 1)
self.assertEqual(arr[0], 1)
def test_set(self):
arr = Array()
arr.append(1)
arr.set(0,100)
print(arr.get(... | 2,242 | 15 | 520 |
5419c06b2466a67dec41806b75853918d1979b65 | 49,834 | py | Python | fonts/truetype/chango_32.py | slabua/st7789py_mpy | 31e6f94592563e2b5ad716c48486e605ca3911bb | [
"MIT"
] | 153 | 2020-02-02T11:03:14.000Z | 2022-03-30T05:47:07.000Z | examples/TWATCH-2020/prop_fonts/chango_32.py | skylin008/st7789_mpy | f304991fc5558be653df5f0de928494b85cbc60d | [
"MIT"
] | 58 | 2020-04-11T23:23:02.000Z | 2022-03-26T20:45:23.000Z | examples/TWATCH-2020/prop_fonts/chango_32.py | skylin008/st7789_mpy | f304991fc5558be653df5f0de928494b85cbc60d | [
"MIT"
] | 50 | 2020-02-02T11:05:23.000Z | 2022-03-22T15:24:42.000Z | # -*- coding: utf-8 -*-
# Converted from Chango-Regular.ttf using:
# ./font2bitmap.py Chango-Regular.ttf 32 -c 0x20-0x7f
MAP = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
BPP = 1
HEIGHT = 35
MAX_WIDTH = 49
_WIDTHS = \
b'\x0d\x10\x13\x1c\x1a\x30\x21\x0b\x... | 71.600575 | 106 | 0.671329 | # -*- coding: utf-8 -*-
# Converted from Chango-Regular.ttf using:
# ./font2bitmap.py Chango-Regular.ttf 32 -c 0x20-0x7f
MAP = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
BPP = 1
HEIGHT = 35
MAX_WIDTH = 49
_WIDTHS = \
b'\x0d\x10\x13\x1c\x1a\x30\x21\x0b\x... | 0 | 0 | 0 |
2941a56fa2c2f7eb394aca0cdacc3c0a1c07c5eb | 2,391 | py | Python | fdoc.py | jessekrubin/funk_docktor | 39ec026fe8edf272a79e8c0a74eac6860eaef768 | [
"MIT"
] | null | null | null | fdoc.py | jessekrubin/funk_docktor | 39ec026fe8edf272a79e8c0a74eac6860eaef768 | [
"MIT"
] | null | null | null | fdoc.py | jessekrubin/funk_docktor | 39ec026fe8edf272a79e8c0a74eac6860eaef768 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
from itertools import chain
from os import getcwd, path
import argparse
from pupy.decorations import tictoc
CD = getcwd()
def fmt_line(line, col, phillup=False):
"""
:param line:
:param col:
:return:
# >>> format_line([])
"""
if len(line) == 1:
code = line[... | 31.88 | 86 | 0.498954 | # -*- coding: utf-8 -*
from itertools import chain
from os import getcwd, path
import argparse
from pupy.decorations import tictoc
CD = getcwd()
def fmt_line(line, col, phillup=False):
"""
:param line:
:param col:
:return:
# >>> format_line([])
"""
if len(line) == 1:
code = line[... | 863 | 0 | 23 |
3d2cde815cce311a485e511efc147c4a6651bdf1 | 3,021 | py | Python | munininfluxdb/utils.py | mback2k/munin-influxdb | 08ecde755e649f6f71deb4e8d27247f69382b13c | [
"BSD-2-Clause"
] | 88 | 2015-01-14T13:33:34.000Z | 2021-12-14T13:51:56.000Z | munininfluxdb/utils.py | mback2k/munin-influxdb | 08ecde755e649f6f71deb4e8d27247f69382b13c | [
"BSD-2-Clause"
] | 17 | 2015-07-27T20:16:41.000Z | 2019-07-08T08:04:16.000Z | munininfluxdb/utils.py | mback2k/munin-influxdb | 08ecde755e649f6f71deb4e8d27247f69382b13c | [
"BSD-2-Clause"
] | 40 | 2015-01-30T20:23:16.000Z | 2021-12-14T13:52:03.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
def parse_handle(handle):
"""
Parses a connection handle to get it's subparts (user, password, host, port, dbname)
@return (user, passwd, host, port, dbname)
@example
127.0.0.1 -> (None, None, '127.0.0.1', None, None)... | 30.826531 | 140 | 0.54386 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
class Color:
GREEN = "\033[92m"
RED = "\033[91m"
BLUE = "\033[94m"
YELLOW = "\033[93m"
BOLD = "\033[1m"
CLEAR = "\033[0m"
class Symbol:
OK = "✓"
NOK = "✗"
WARN = "⚠"
OK_GREEN = "{0}{1}{2}"... | 667 | 979 | 150 |
8066c88d80723199425abc63c47807e5ee992971 | 561 | py | Python | tests/test_priority.py | StefanBRas/todoist-taskwarrior | 08dc877452d621a7c1ec3ed13de06d4c1fedb266 | [
"MIT"
] | null | null | null | tests/test_priority.py | StefanBRas/todoist-taskwarrior | 08dc877452d621a7c1ec3ed13de06d4c1fedb266 | [
"MIT"
] | 1 | 2021-03-11T04:56:02.000Z | 2021-03-11T21:42:33.000Z | tests/test_priority.py | StefanBRas/todoist-taskwarrior | 08dc877452d621a7c1ec3ed13de06d4c1fedb266 | [
"MIT"
] | null | null | null | """ Priority Tests
Test conversions between Todoist and Taskwarrior priorities.
"""
import pytest
from todoist_taskwarrior import utils
| 26.714286 | 60 | 0.709447 | """ Priority Tests
Test conversions between Todoist and Taskwarrior priorities.
"""
import pytest
from todoist_taskwarrior import utils
def test_priorities():
assert utils.ti_priority_to_tw(1) == None
assert utils.ti_priority_to_tw(2) == 'L'
assert utils.ti_priority_to_tw(3) == 'M'
assert utils.ti_pr... | 376 | 0 | 46 |
5d91d3e984e54a6abe0c50447e3205ca98d4fec6 | 389 | py | Python | python/ex022_string_meths.py | lucasdiogomartins/curso-em-video | 9da92b6255a11021f719a9e0ce994db639e1ac38 | [
"MIT"
] | null | null | null | python/ex022_string_meths.py | lucasdiogomartins/curso-em-video | 9da92b6255a11021f719a9e0ce994db639e1ac38 | [
"MIT"
] | null | null | null | python/ex022_string_meths.py | lucasdiogomartins/curso-em-video | 9da92b6255a11021f719a9e0ce994db639e1ac38 | [
"MIT"
] | null | null | null | nome = input('Digite seu nome: ').strip()
print('\n Nome em maiúsculas:', nome.upper())
print(' Nome em minúsculas:', nome.lower())
print(' Quantidade de letras:', len(nome.replace(' ', '')))
print(' Quantidade de letras:', len(nome)-nome.count(' ')) # 2° opção
print(' Q. de letras primeiro nome:', len(nome.split()[0]... | 48.625 | 70 | 0.640103 | nome = input('Digite seu nome: ').strip()
print('\n Nome em maiúsculas:', nome.upper())
print(' Nome em minúsculas:', nome.lower())
print(' Quantidade de letras:', len(nome.replace(' ', '')))
print(' Quantidade de letras:', len(nome)-nome.count(' ')) # 2° opção
print(' Q. de letras primeiro nome:', len(nome.split()[0]... | 0 | 0 | 0 |
b6ab9337b7ef728f089b9d25f36c451ed88425ad | 8,373 | py | Python | notebooks/python/utils/plotters.py | MindFoundry/optaas-tutorials | 9231a316554988da4fbcf9bd207cdb407adc5071 | [
"MIT"
] | 1 | 2021-05-17T14:30:07.000Z | 2021-05-17T14:30:07.000Z | notebooks/python/utils/plotters.py | MindFoundry/optaas-tutorials | 9231a316554988da4fbcf9bd207cdb407adc5071 | [
"MIT"
] | null | null | null | notebooks/python/utils/plotters.py | MindFoundry/optaas-tutorials | 9231a316554988da4fbcf9bd207cdb407adc5071 | [
"MIT"
] | 3 | 2019-06-18T14:26:31.000Z | 2020-03-06T15:10:11.000Z | from typing import Dict
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.display import display
from matplotlib.ticker import FormatStrFormatter, MaxNLocator
from mpl_toolkits.mplot3d import Axes3D
from plotly import offline as plotly, graph_objs as go, tools
PLOT_TYPES = {'random', 'grid', 'explo... | 37.048673 | 117 | 0.607668 | from typing import Dict
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.display import display
from matplotlib.ticker import FormatStrFormatter, MaxNLocator
from mpl_toolkits.mplot3d import Axes3D
from plotly import offline as plotly, graph_objs as go, tools
PLOT_TYPES = {'random', 'grid', 'explo... | 7,152 | 33 | 795 |
1bcde50ce43af8077dac6e8dfe503ac3aa0f10aa | 16,124 | py | Python | nox/src/nox/webapps/webserver/webauth.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 28 | 2015-02-04T13:59:25.000Z | 2021-12-29T03:44:47.000Z | nox/src/nox/webapps/webserver/webauth.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 552 | 2015-01-05T18:25:54.000Z | 2022-03-16T18:51:13.000Z | nox/src/nox/webapps/webserver/webauth.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 25 | 2015-02-04T18:48:20.000Z | 2020-06-18T15:51:05.000Z | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NOX is dist... | 34.675269 | 105 | 0.652382 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NOX is dist... | 8,233 | 1,156 | 1,188 |
4c41e63283fc018dba3147ad647705cc469d056e | 68,669 | py | Python | lib/GUI/Dialogs/__init__.py | Connor22/hydrus | d0ae4a8898742a0d13601e1167d5ba697b31c395 | [
"WTFPL"
] | null | null | null | lib/GUI/Dialogs/__init__.py | Connor22/hydrus | d0ae4a8898742a0d13601e1167d5ba697b31c395 | [
"WTFPL"
] | null | null | null | lib/GUI/Dialogs/__init__.py | Connor22/hydrus | d0ae4a8898742a0d13601e1167d5ba697b31c395 | [
"WTFPL"
] | null | null | null | from . import HydrusConstants as HC
from . import ClientConstants as CC
from . import ClientData
from . import ClientDefaults
from . import ClientDownloading
from . import ClientDragDrop
from . import ClientExporting
from . import ClientCaches
from . import ClientFiles
from . import ClientGUIACDropdown
from . import Cl... | 32.68396 | 246 | 0.540389 | from . import HydrusConstants as HC
from . import ClientConstants as CC
from . import ClientData
from . import ClientDefaults
from . import ClientDownloading
from . import ClientDragDrop
from . import ClientExporting
from . import ClientCaches
from . import ClientFiles
from . import ClientGUIACDropdown
from . import Cl... | 63,480 | 286 | 2,524 |
84ffc28bf041ee10ab164a930515ed2e59878b34 | 2,739 | py | Python | disvoice/phonation/phonation_functions.py | jcvasquezc/Disvoice | ed9dbd42c3f01f041f90848f96004be8ebb78d8d | [
"MIT"
] | null | null | null | disvoice/phonation/phonation_functions.py | jcvasquezc/Disvoice | ed9dbd42c3f01f041f90848f96004be8ebb78d8d | [
"MIT"
] | null | null | null | disvoice/phonation/phonation_functions.py | jcvasquezc/Disvoice | ed9dbd42c3f01f041f90848f96004be8ebb78d8d | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on Jul 21 2017
@author: J. C. Vasquez-Correa
"""
import numpy as np
import sys
def PQ(x,k):
"""
Perturbation Quotient in percentage of the signal x
:params x: input sequence: F0 values or Amplitude values per window
:params k: average factor (must be an odd n... | 22.45082 | 73 | 0.581599 |
# -*- coding: utf-8 -*-
"""
Created on Jul 21 2017
@author: J. C. Vasquez-Correa
"""
import numpy as np
import sys
def jitter_env(vPPS, iNumPuntos):
iLongSec=len(vPPS)
if (iLongSec < 2):
sys.warn('Pitch sequence is too short' )
vJitta=np.zeros(iNumPuntos)
return vJitta
vJitta... | 1,595 | 0 | 92 |
1c6094d1ada0aea2c39d2e18fc501d38ba63446d | 13,736 | py | Python | mlflow/utils/search_utils.py | xinmeigui-db/mlflow | a055e6a66ef02c3b23b49ef4001247fec01365a5 | [
"Apache-2.0"
] | 1,825 | 2018-06-05T17:30:39.000Z | 2022-03-24T13:39:46.000Z | mlflow/utils/search_utils.py | xinmeigui-db/mlflow | a055e6a66ef02c3b23b49ef4001247fec01365a5 | [
"Apache-2.0"
] | 200 | 2018-06-06T02:30:57.000Z | 2018-07-30T17:06:34.000Z | mlflow/utils/search_utils.py | xinmeigui-db/mlflow | a055e6a66ef02c3b23b49ef4001247fec01365a5 | [
"Apache-2.0"
] | 301 | 2018-06-05T17:47:48.000Z | 2022-03-17T12:09:17.000Z | import sqlparse
from sqlparse.sql import Identifier, Token, Comparison, Statement
from sqlparse.tokens import Token as TokenType
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
| 48.366197 | 99 | 0.578917 | import sqlparse
from sqlparse.sql import Identifier, Token, Comparison, Statement
from sqlparse.tokens import Token as TokenType
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
class SearchFilter(object):
VALID_METRIC_COMPARATORS = set(['>', '>=', '!... | 10,976 | 2,495 | 23 |
5b024c665d7b8d2d46dc13314fe85d1c41361fb4 | 23,864 | py | Python | test/test_read_preferences.py | detrack/mongo-python-driver | 42c5df83fbd30e6e8a188d48b2eb35659fbce861 | [
"Apache-2.0"
] | null | null | null | test/test_read_preferences.py | detrack/mongo-python-driver | 42c5df83fbd30e6e8a188d48b2eb35659fbce861 | [
"Apache-2.0"
] | null | null | null | test/test_read_preferences.py | detrack/mongo-python-driver | 42c5df83fbd30e6e8a188d48b2eb35659fbce861 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011-2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 36.713846 | 80 | 0.595835 | # Copyright 2011-2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 18,857 | 2,474 | 529 |
d52980e8aea5821b35988c68f49eebf5711892b0 | 1,247 | py | Python | metatests/cloudcafe/compute/hypervisors/client/responses.py | ProjectMeniscus/cloudcafe | fa8fd796b303f0c5f0d6e98b2b5d01f6ea8fefe9 | [
"Apache-2.0"
] | null | null | null | metatests/cloudcafe/compute/hypervisors/client/responses.py | ProjectMeniscus/cloudcafe | fa8fd796b303f0c5f0d6e98b2b5d01f6ea8fefe9 | [
"Apache-2.0"
] | null | null | null | metatests/cloudcafe/compute/hypervisors/client/responses.py | ProjectMeniscus/cloudcafe | fa8fd796b303f0c5f0d6e98b2b5d01f6ea8fefe9 | [
"Apache-2.0"
] | 1 | 2020-11-17T19:05:08.000Z | 2020-11-17T19:05:08.000Z | """
Copyright 2013 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 33.702703 | 72 | 0.623897 | """
Copyright 2013 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | 554 | 111 | 23 |
53061ba6cb93a24d52de7c0fd2bda627c28ad47c | 710 | py | Python | nvchecker_source/cran.py | pombredanne/nvchecker | 2067131848526b16d76d3e2392054e9250e85133 | [
"MIT"
] | null | null | null | nvchecker_source/cran.py | pombredanne/nvchecker | 2067131848526b16d76d3e2392054e9250e85133 | [
"MIT"
] | null | null | null | nvchecker_source/cran.py | pombredanne/nvchecker | 2067131848526b16d76d3e2392054e9250e85133 | [
"MIT"
] | null | null | null | # MIT licensed
# Copyright (c) 2022 Pekka Ristola <pekkarr [at] protonmail [dot] com>, et al.
from nvchecker.api import session, GetVersionError
CRAN_URL = 'https://cran.r-project.org/package=%s/DESCRIPTION'
VERSION_FIELD = 'Version: '
| 26.296296 | 78 | 0.702817 | # MIT licensed
# Copyright (c) 2022 Pekka Ristola <pekkarr [at] protonmail [dot] com>, et al.
from nvchecker.api import session, GetVersionError
CRAN_URL = 'https://cran.r-project.org/package=%s/DESCRIPTION'
VERSION_FIELD = 'Version: '
async def request(pkg):
url = CRAN_URL % pkg
res = await session.get(url)
r... | 426 | 0 | 46 |
a84f50a6a4e65cba238f5d34427633e72dcc2a43 | 468 | py | Python | gitkit/commands/point_here.py | akx/git-kit | 54948b57f201adecc810c4895b6712c1c8265cf3 | [
"MIT"
] | 3 | 2017-02-16T09:04:09.000Z | 2021-05-03T08:25:52.000Z | gitkit/commands/point_here.py | akx/git-kit | 54948b57f201adecc810c4895b6712c1c8265cf3 | [
"MIT"
] | 2 | 2017-02-16T08:54:15.000Z | 2017-02-16T09:09:41.000Z | gitkit/commands/point_here.py | akx/git-kit | 54948b57f201adecc810c4895b6712c1c8265cf3 | [
"MIT"
] | 1 | 2022-02-07T09:07:39.000Z | 2022-02-07T09:07:39.000Z | import click
from gitkit.util.shell import get_output, run
@click.command()
@click.argument("branches", nargs=-1)
def point_here(branches):
""" Set the given branch refs to point to the current HEAD. """
if not branches:
print("No branches passed.")
return
current = get_output("git rev-pa... | 27.529412 | 67 | 0.651709 | import click
from gitkit.util.shell import get_output, run
@click.command()
@click.argument("branches", nargs=-1)
def point_here(branches):
""" Set the given branch refs to point to the current HEAD. """
if not branches:
print("No branches passed.")
return
current = get_output("git rev-pa... | 0 | 0 | 0 |
23f1395154681da8f1ddd6ef9a310e4ecac19223 | 1,896 | py | Python | pylp/lib/stream.py | pylp/pylp | 7ebaa55fbaf61cb8175f211dd41ef2928c22d4d4 | [
"MIT"
] | 4 | 2018-05-19T09:10:32.000Z | 2020-10-25T02:54:06.000Z | pylp/lib/stream.py | pylp/pylp | 7ebaa55fbaf61cb8175f211dd41ef2928c22d4d4 | [
"MIT"
] | null | null | null | pylp/lib/stream.py | pylp/pylp | 7ebaa55fbaf61cb8175f211dd41ef2928c22d4d4 | [
"MIT"
] | null | null | null | """
Asynchronous stream with a piping system.
Copyright (C) 2017 The Pylp Authors.
This file is under the MIT License.
"""
import asyncio
class Stream():
"""An asynchronous stream containing a transformer with a piping system."""
def append_file(self, file):
"""Append a new file in the stream."""
self.fil... | 21.793103 | 76 | 0.716245 | """
Asynchronous stream with a piping system.
Copyright (C) 2017 The Pylp Authors.
This file is under the MIT License.
"""
import asyncio
class Stream():
"""An asynchronous stream containing a transformer with a piping system."""
def __init__(self, files = None):
# Files to transform and number of transforme... | 323 | 0 | 24 |
3fe160455f0db5ab15b4cabd404b9c7e12797cd6 | 78 | py | Python | uvloop/_noop.py | Psycojoker/uvloop | 03487c80a508ea92e66f976fa196e64514894205 | [
"Apache-2.0",
"MIT"
] | 10 | 2020-06-11T23:20:03.000Z | 2022-01-14T16:07:27.000Z | uvloop/_noop.py | Psycojoker/uvloop | 03487c80a508ea92e66f976fa196e64514894205 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-06-02T03:55:08.000Z | 2022-03-12T00:54:02.000Z | uvloop/_noop.py | Psycojoker/uvloop | 03487c80a508ea92e66f976fa196e64514894205 | [
"Apache-2.0",
"MIT"
] | 2 | 2020-06-22T09:46:57.000Z | 2021-04-25T21:32:04.000Z | def noop():
"""Empty function to invoke CPython ceval loop."""
return
| 19.5 | 54 | 0.641026 | def noop():
"""Empty function to invoke CPython ceval loop."""
return
| 0 | 0 | 0 |
f8fef7b295d087554ceed9257cf6b1d86b4a743f | 5,359 | py | Python | lbry/lbry/schema/result.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | null | null | null | lbry/lbry/schema/result.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/schema/result.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import base64
import struct
from typing import List
from binascii import hexlify
from itertools import chain
from lbry.schema.types.v2.result_pb2 import Outputs as OutputsMessage
| 43.92623 | 95 | 0.63482 | import base64
import struct
from typing import List
from binascii import hexlify
from itertools import chain
from lbry.schema.types.v2.result_pb2 import Outputs as OutputsMessage
class Outputs:
__slots__ = 'txos', 'extra_txos', 'txs', 'offset', 'total'
def __init__(self, txos: List, extra_txos: List, txs: ... | 4,797 | 358 | 23 |
b3192c2406886cb67eddb7e7e935e7708c5e3805 | 32,482 | py | Python | aiobungie/interfaces/factory.py | nxtlo/aiobungie | ca0a842bf5a7217662f0d8d63456ad277f313ef1 | [
"MIT"
] | 36 | 2021-07-09T19:26:18.000Z | 2022-03-26T09:12:43.000Z | aiobungie/interfaces/factory.py | nxtlo/aiobungie | ca0a842bf5a7217662f0d8d63456ad277f313ef1 | [
"MIT"
] | 149 | 2021-07-13T21:46:21.000Z | 2022-03-29T12:21:38.000Z | aiobungie/interfaces/factory.py | nxtlo/aiobungie | ca0a842bf5a7217662f0d8d63456ad277f313ef1 | [
"MIT"
] | 4 | 2021-07-21T05:33:11.000Z | 2022-02-19T11:15:31.000Z | # MIT License
# Copyright (c) 2020 - Present nxtlo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | 30.701323 | 147 | 0.623022 | # MIT License
# Copyright (c) 2020 - Present nxtlo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | 1,202 | 0 | 234 |
bc2cfd528415c4bbb23cf1d66a0344b381f02df4 | 1,753 | py | Python | android_appium_profiler/apps/etar.py | qiangxu1996/android-appium-profiler | 3f25bd023c113af35c4e7e6e3cec7c3c0abecc6a | [
"MIT"
] | null | null | null | android_appium_profiler/apps/etar.py | qiangxu1996/android-appium-profiler | 3f25bd023c113af35c4e7e6e3cec7c3c0abecc6a | [
"MIT"
] | null | null | null | android_appium_profiler/apps/etar.py | qiangxu1996/android-appium-profiler | 3f25bd023c113af35c4e7e6e3cec7c3c0abecc6a | [
"MIT"
] | null | null | null | import logging
import time
import adb
from .. import app_test
logger = logging.getLogger(__name__)
| 38.108696 | 116 | 0.641187 | import logging
import time
import adb
from .. import app_test
logger = logging.getLogger(__name__)
class App(app_test.AppTest):
def __init__(self, **kwargs):
extra_cap = kwargs.setdefault('extra_cap', {})
extra_cap.setdefault('noReset', False)
super().__init__('ws.xsoh.etar.debug', 'com.... | 1,568 | 7 | 76 |
6bea82f48a588df6984acd4336b01b9442d82f2c | 754 | py | Python | mmvae_hub/celeba/CelebaTrainer.py | Jimmy2027/MMVAE_mnist_svhn_text | e6e74059bd5feefc0af088f7b1abc31b0e9f2ab7 | [
"MIT"
] | null | null | null | mmvae_hub/celeba/CelebaTrainer.py | Jimmy2027/MMVAE_mnist_svhn_text | e6e74059bd5feefc0af088f7b1abc31b0e9f2ab7 | [
"MIT"
] | 24 | 2021-11-15T14:22:08.000Z | 2022-02-28T14:30:23.000Z | mmvae_hub/celeba/CelebaTrainer.py | Jimmy2027/MMVAE_mnist_svhn_text | e6e74059bd5feefc0af088f7b1abc31b0e9f2ab7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from mmvae_hub.utils.utils import save_and_log_flags
from torch.utils.tensorboard import SummaryWriter
from mmvae_hub.base.BaseCallback import BaseCallback
from mmvae_hub.base.BaseTrainer import BaseTrainer
from mmvae_hub.celeba.CelebaLogger import CelebALogger
| 32.782609 | 67 | 0.748011 | # -*- coding: utf-8 -*-
from mmvae_hub.utils.utils import save_and_log_flags
from torch.utils.tensorboard import SummaryWriter
from mmvae_hub.base.BaseCallback import BaseCallback
from mmvae_hub.base.BaseTrainer import BaseTrainer
from mmvae_hub.celeba.CelebaLogger import CelebALogger
class CelebaTrainer(BaseTrainer... | 351 | 12 | 103 |
3ce9adce92e632d0521ddee7340e76612f12cccb | 12,158 | py | Python | mysync.py | xuboying/mysync | 819d9bcc3d0addc2760f098b5eb2b1d5ae6d1e0b | [
"BSD-3-Clause"
] | 1 | 2018-05-15T12:46:21.000Z | 2018-05-15T12:46:21.000Z | mysync.py | xuboying/mysync | 819d9bcc3d0addc2760f098b5eb2b1d5ae6d1e0b | [
"BSD-3-Clause"
] | null | null | null | mysync.py | xuboying/mysync | 819d9bcc3d0addc2760f098b5eb2b1d5ae6d1e0b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
# -*- coding: utf-8 -*-
# BSD LICENSE
#
# Copyright (c) 2016, Boying Xu All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the fol... | 35.758824 | 142 | 0.610709 | #!/usr/bin/env python3
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
# -*- coding: utf-8 -*-
# BSD LICENSE
#
# Copyright (c) 2016, Boying Xu All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the fol... | 6,787 | 141 | 323 |
2edac396b427af9495c52fcb7456f968c19a660b | 1,448 | py | Python | rTPNN_layer.py | mertnakip/Recurrent-Trend-Predictive-Neural-Network | 3ce6878e51c5b4481b23625e8cc27d64da876bb1 | [
"MIT"
] | 4 | 2022-01-27T09:35:23.000Z | 2022-03-25T13:13:36.000Z | rTPNN_layer.py | mertnakip/Recurrent-Trend-Predictive-Neural-Network | 3ce6878e51c5b4481b23625e8cc27d64da876bb1 | [
"MIT"
] | null | null | null | rTPNN_layer.py | mertnakip/Recurrent-Trend-Predictive-Neural-Network | 3ce6878e51c5b4481b23625e8cc27d64da876bb1 | [
"MIT"
] | null | null | null | from keras.layers import Lambda, SimpleRNN, Concatenate, Subtract, Reshape
| 43.878788 | 132 | 0.605663 | from keras.layers import Lambda, SimpleRNN, Concatenate, Subtract, Reshape
class rTPNN:
def __call__(self, inputs):
"""
Inputs: 3D array with dimensions (Sample Size X 2 X Number of Features)
"""
num_features = inputs.shape[-1]
trend_predictor = []
level_pred... | 0 | 1,349 | 23 |
9b4d9e54705180942223e41e39982abe65ca94f0 | 149 | py | Python | Python/Alternating Characters/solution_test.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | Python/Alternating Characters/solution_test.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | Python/Alternating Characters/solution_test.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | # Import Pytest Package
import pytest
from solution import alternatingCharacters | 21.285714 | 47 | 0.791946 | # Import Pytest Package
import pytest
from solution import alternatingCharacters
def test_result():
assert alternatingCharacters("AABBAB") == 2 | 45 | 0 | 23 |
9b053f47b98ece9ca9e57a5bdc8c3dd63ff13111 | 812 | py | Python | zadanie/articles/urls.py | szymanskirafal/zadanie | 8668976955eeea45e4abec673ba5a6c4f3848e16 | [
"MIT"
] | null | null | null | zadanie/articles/urls.py | szymanskirafal/zadanie | 8668976955eeea45e4abec673ba5a6c4f3848e16 | [
"MIT"
] | null | null | null | zadanie/articles/urls.py | szymanskirafal/zadanie | 8668976955eeea45e4abec673ba5a6c4f3848e16 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'articles'
urlpatterns = [
path(
'',
views.ArticlesListView.as_view(),
name = 'list'),
path(
'create/',
views.ArticleCreateView.as_view(),
name = 'create'),
path(
'created/',
views.A... | 20.820513 | 51 | 0.530788 | from django.urls import path
from . import views
app_name = 'articles'
urlpatterns = [
path(
'',
views.ArticlesListView.as_view(),
name = 'list'),
path(
'create/',
views.ArticleCreateView.as_view(),
name = 'create'),
path(
'created/',
views.A... | 0 | 0 | 0 |
a68b55a31736cacbbb792f9aeb765afea58b9f7e | 377 | py | Python | browse/urls.py | machinalis/django-srd20 | 00c969cbe9353128e681c308bdc6810dfbd46b70 | [
"BSD-3-Clause"
] | 16 | 2015-04-12T00:57:49.000Z | 2018-07-24T16:06:55.000Z | browse/urls.py | machinalis/django-srd20 | 00c969cbe9353128e681c308bdc6810dfbd46b70 | [
"BSD-3-Clause"
] | null | null | null | browse/urls.py | machinalis/django-srd20 | 00c969cbe9353128e681c308bdc6810dfbd46b70 | [
"BSD-3-Clause"
] | 5 | 2015-07-04T14:39:00.000Z | 2018-07-24T16:06:57.000Z | from django.conf.urls.defaults import *
urlpatterns = patterns('browse.views',
url(r'^spell/(?P<slug>[\w-]+)/$', 'spell_detail', name='spell_detail'),
url(r'^feat/(?P<slug>[\w-]+)/$', 'feat_detail', name='feat_detail'),
url(r'^monster/(?P<slug>[\w-]+)/$', 'monster_detail', name='monster_detail'),
url(... | 34.272727 | 81 | 0.62069 | from django.conf.urls.defaults import *
urlpatterns = patterns('browse.views',
url(r'^spell/(?P<slug>[\w-]+)/$', 'spell_detail', name='spell_detail'),
url(r'^feat/(?P<slug>[\w-]+)/$', 'feat_detail', name='feat_detail'),
url(r'^monster/(?P<slug>[\w-]+)/$', 'monster_detail', name='monster_detail'),
url(... | 0 | 0 | 0 |
69f462a2dda688739d4ec758e6a31567c0d0a3a6 | 180 | py | Python | personal/views.py | ayan-b/Django_Blog | 68f5464a6b6732e405dda019d1f5202bb177747b | [
"MIT"
] | 1 | 2020-06-20T17:52:09.000Z | 2020-06-20T17:52:09.000Z | personal/views.py | ayan-b/Django_Blog | 68f5464a6b6732e405dda019d1f5202bb177747b | [
"MIT"
] | null | null | null | personal/views.py | ayan-b/Django_Blog | 68f5464a6b6732e405dda019d1f5202bb177747b | [
"MIT"
] | 1 | 2020-11-18T23:21:32.000Z | 2020-11-18T23:21:32.000Z | from django.shortcuts import render
| 22.5 | 50 | 0.744444 | from django.shortcuts import render
def index(request):
return render(request, 'personal/home.html')
def contact(request):
return render(request, 'personal/basic.html',)
| 98 | 0 | 46 |
74b6b1d58af00822913b7e71a4685f211d56d1dc | 439 | py | Python | globo/aplications/core/migrations/0005_sumasysaldos_cierre_anterior.py | orlandor55/globo | bb236e2b0a9c803794416478470e71081116bd56 | [
"MIT"
] | null | null | null | globo/aplications/core/migrations/0005_sumasysaldos_cierre_anterior.py | orlandor55/globo | bb236e2b0a9c803794416478470e71081116bd56 | [
"MIT"
] | null | null | null | globo/aplications/core/migrations/0005_sumasysaldos_cierre_anterior.py | orlandor55/globo | bb236e2b0a9c803794416478470e71081116bd56 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-03 17:25
from django.db import migrations, models
| 23.105263 | 93 | 0.626424 | # Generated by Django 3.2.9 on 2021-11-03 17:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20211103_1646'),
]
operations = [
migrations.AddField(
model_name='sumasysaldos',
name='cierre_ant... | 0 | 325 | 23 |
60fbacea377357c74a26eb60c0057dd00fba5f87 | 1,277 | py | Python | 3.py | elp2/advent_of_code_2015 | 7b16d175f3241c45e77ecbd1db98c484c75465e5 | [
"Apache-2.0"
] | 1 | 2021-12-02T15:19:36.000Z | 2021-12-02T15:19:36.000Z | 2015/3.py | elp2/advent_of_code | 600e2db9a7d5b576937c9b39c5c6805db406f57b | [
"Apache-2.0"
] | null | null | null | 2015/3.py | elp2/advent_of_code | 600e2db9a7d5b576937c9b39c5c6805db406f57b | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict, deque
import re
CHALLENGE_DAY = "3"
REAL = open(CHALLENGE_DAY + ".txt").read()
SAMPLE = open(CHALLENGE_DAY + ".sample.txt").read()
SAMPLE_EXPECTED = 2
sample = solve(SAMPLE)
if sample != SAMPLE_EXPECTED:
print("SAMPLE FAILED: ", sample, " != ", SAMPLE_EXPECTED)
assert sample =... | 26.061224 | 81 | 0.600626 | from collections import defaultdict, deque
import re
CHALLENGE_DAY = "3"
REAL = open(CHALLENGE_DAY + ".txt").read()
SAMPLE = open(CHALLENGE_DAY + ".sample.txt").read()
SAMPLE_EXPECTED = 2
def parse_lines(raw):
# Groups.
# groups = raw.split("\n\n")
# return list(map(lambda group: group.split("\n"), groups... | 686 | 0 | 46 |
c4b94f6c6f2254a6ed1a760dc968131c365f2563 | 3,440 | py | Python | forms.py | Anupam124jain/FaceRecognization | 1335c6907d3625a02cfb67c7fa0a9a4e1412a8e1 | [
"MIT"
] | null | null | null | forms.py | Anupam124jain/FaceRecognization | 1335c6907d3625a02cfb67c7fa0a9a4e1412a8e1 | [
"MIT"
] | null | null | null | forms.py | Anupam124jain/FaceRecognization | 1335c6907d3625a02cfb67c7fa0a9a4e1412a8e1 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
| 52.121212 | 134 | 0.638663 | from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
class RegistrationForm(forms.Form):
firstname = forms.RegexField(regex=r'^\w+$',... | 881 | 2,296 | 24 |
3650a55421623534d450c276628a6a93b031da5c | 5,408 | py | Python | tests/test_cursor_row.py | johnanthonyowens/ctds | 70621096e1c9cdabd152ed63c665d72cce3635b9 | [
"MIT"
] | 78 | 2016-03-14T18:02:05.000Z | 2021-11-26T23:23:06.000Z | tests/test_cursor_row.py | johnanthonyowens/ctds | 70621096e1c9cdabd152ed63c665d72cce3635b9 | [
"MIT"
] | 64 | 2016-10-18T17:54:08.000Z | 2021-09-30T11:01:02.000Z | tests/test_cursor_row.py | johnanthonyowens/ctds | 70621096e1c9cdabd152ed63c665d72cce3635b9 | [
"MIT"
] | 17 | 2016-07-21T20:22:12.000Z | 2020-11-07T01:25:26.000Z | from .base import TestExternalDatabase
from .compat import long_, unicode_
| 31.260116 | 104 | 0.419379 | from .base import TestExternalDatabase
from .compat import long_, unicode_
class TestCursorRow(TestExternalDatabase):
def test_subscript(self):
with self.connect() as connection:
with connection.cursor() as cursor:
args = (1, 'two', 'three', 4)
cursor.execute(
... | 5,154 | 21 | 158 |
500ecbcb33b44f6c1fe4788fb6d28a4afafba07a | 225 | py | Python | manager/director/apps/auth/apps.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 7 | 2020-08-23T23:08:34.000Z | 2021-12-02T04:17:37.000Z | manager/director/apps/auth/apps.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 43 | 2020-08-24T16:48:29.000Z | 2022-03-02T19:45:54.000Z | manager/director/apps/auth/apps.py | darius-kia/director4 | 1d2c2c4c3ec12cc9b7f846d5dc075ea3bbef36f9 | [
"MIT"
] | 10 | 2020-08-17T20:42:52.000Z | 2021-07-16T03:46:51.000Z | # SPDX-License-Identifier: MIT
# (c) 2019 The TJHSST Director 4.0 Development Team & Contributors
from django.apps import AppConfig
| 22.5 | 66 | 0.742222 | # SPDX-License-Identifier: MIT
# (c) 2019 The TJHSST Director 4.0 Development Team & Contributors
from django.apps import AppConfig
class AuthConfig(AppConfig):
name = "director.apps.auth"
label = "authentication"
| 0 | 68 | 23 |
5f7809164370fd963320e8879d32c1b996c6dff6 | 495 | py | Python | tg/admin.py | Kirillpt/clist | 1fae50266bda0e46fa7f3cd8a5b15bc921c9cc06 | [
"Apache-2.0"
] | null | null | null | tg/admin.py | Kirillpt/clist | 1fae50266bda0e46fa7f3cd8a5b15bc921c9cc06 | [
"Apache-2.0"
] | null | null | null | tg/admin.py | Kirillpt/clist | 1fae50266bda0e46fa7f3cd8a5b15bc921c9cc06 | [
"Apache-2.0"
] | null | null | null | from pyclist.admin import BaseModelAdmin, admin_register
from django.contrib import admin
from tg.models import Chat, History
@admin_register(Chat)
@admin_register(History)
| 30.9375 | 70 | 0.755556 | from pyclist.admin import BaseModelAdmin, admin_register
from django.contrib import admin
from tg.models import Chat, History
@admin_register(Chat)
class ChatAdmin(BaseModelAdmin):
search_fields = ['coder__user__username', 'title', 'last_command']
list_display = ['chat_id', 'coder', 'title', 'last_command']
... | 0 | 274 | 44 |
5e617b741acb066a7457b5e29fd528a290a1e809 | 2,105 | py | Python | protocolo/migrations/0001_initial.py | clowdcap/arq-django | 3feb313e940c3900dc7e60f80ef0afff15fa2461 | [
"MIT"
] | null | null | null | protocolo/migrations/0001_initial.py | clowdcap/arq-django | 3feb313e940c3900dc7e60f80ef0afff15fa2461 | [
"MIT"
] | null | null | null | protocolo/migrations/0001_initial.py | clowdcap/arq-django | 3feb313e940c3900dc7e60f80ef0afff15fa2461 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-11-09 14:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 39.716981 | 148 | 0.578147 | # Generated by Django 3.2.8 on 2021-11-09 14:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 1,925 | 23 |
ac2848fc8cb9e9d68102637eea1d7b896ca2e179 | 1,792 | py | Python | demo/alphaction/dataset/transforms/build.py | PANBOHE/Humanpose-fight | 36e6218db526d567922fa528fa7e11497c53ad60 | [
"Apache-2.0"
] | 1 | 2022-02-24T08:52:15.000Z | 2022-02-24T08:52:15.000Z | demo/alphaction/dataset/transforms/build.py | PANBOHE/Humanpose-fight | 36e6218db526d567922fa528fa7e11497c53ad60 | [
"Apache-2.0"
] | null | null | null | demo/alphaction/dataset/transforms/build.py | PANBOHE/Humanpose-fight | 36e6218db526d567922fa528fa7e11497c53ad60 | [
"Apache-2.0"
] | null | null | null | from . import video_transforms as T
from . import object_transforms as OT
| 27.569231 | 89 | 0.640067 | from . import video_transforms as T
from . import object_transforms as OT
def build_transforms(cfg, is_train=True):
# build transforms for training of testing
if is_train:
min_size = cfg.INPUT.MIN_SIZE_TRAIN
max_size = cfg.INPUT.MAX_SIZE_TRAIN
color_jitter = cfg.INPUT.COLOR_JITTER
... | 1,671 | 0 | 46 |
2023f71308325389c5fe248249252f7449321685 | 2,804 | py | Python | tests/test_pipeline.py | deep-voice/soundbay | eb19b9932fab0c909c8e9c0627d29dfcd752c18c | [
"Apache-2.0"
] | 7 | 2021-07-29T09:44:20.000Z | 2022-02-01T20:01:05.000Z | tests/test_pipeline.py | mosheman5/soundbay | eb19b9932fab0c909c8e9c0627d29dfcd752c18c | [
"Apache-2.0"
] | 13 | 2021-04-19T05:56:30.000Z | 2022-02-09T09:37:36.000Z | tests/test_pipeline.py | deep-voice/soundbay | eb19b9932fab0c909c8e9c0627d29dfcd752c18c | [
"Apache-2.0"
] | 2 | 2021-04-06T06:32:24.000Z | 2022-01-22T16:37:29.000Z | import copy
import os
import torch
import wandb
from soundbay.utils.logging import Logger
from soundbay.inference import predict
from soundbay.trainers import Trainer
from pathlib import Path
from soundbay.utils.app import App
from omegaconf import DictConfig
| 30.813187 | 99 | 0.659058 | import copy
import os
import torch
import wandb
from soundbay.utils.logging import Logger
from soundbay.inference import predict
from soundbay.trainers import Trainer
from pathlib import Path
from soundbay.utils.app import App
from omegaconf import DictConfig
class VariablesChangeException(Exception):
pass
def ... | 2,418 | 30 | 92 |
c1787fbdf6fd7e22388f94226ac3f8937c435d6d | 5,349 | py | Python | osm2rdf/updateUsageStats.py | CarlQLange/sophox | f5874d75e3a77874f5f27dd46193d1497bfa7a8f | [
"Apache-2.0"
] | 24 | 2018-11-16T20:57:17.000Z | 2022-03-17T21:37:19.000Z | osm2rdf/updateUsageStats.py | CarlQLange/sophox | f5874d75e3a77874f5f27dd46193d1497bfa7a8f | [
"Apache-2.0"
] | 21 | 2018-11-19T17:18:16.000Z | 2021-10-14T06:30:43.000Z | osm2rdf/updateUsageStats.py | UFOKN/sophox | c3b43bdc8cc00ab9b6f7776962afab2baa7f4b2f | [
"Apache-2.0"
] | 5 | 2020-09-07T18:32:01.000Z | 2021-06-01T19:52:04.000Z | #!/usr/bin/env python3
# Copyright Yuri Astrakhan <YuriAstrakhan@gmail.com>
import json
import logging
import time
from typing import Dict
import argparse
import requests
from datetime import datetime
from utils import stringify, chunks, query_status, set_status_query, parse_utc
from sparql import Sparql
info_keys ... | 35.66 | 114 | 0.575061 | #!/usr/bin/env python3
# Copyright Yuri Astrakhan <YuriAstrakhan@gmail.com>
import json
import logging
import time
from typing import Dict
import argparse
import requests
from datetime import datetime
from utils import stringify, chunks, query_status, set_status_query, parse_utc
from sparql import Sparql
info_keys ... | 4,553 | 196 | 23 |
cca9411b91416b1366ba5c8eb8274781c238ebb6 | 618 | py | Python | src/MyGL.py | hedlx/machuchu | 4926a931f81ccd892261a9b13c9d3cf78cc72c01 | [
"MIT"
] | null | null | null | src/MyGL.py | hedlx/machuchu | 4926a931f81ccd892261a9b13c9d3cf78cc72c01 | [
"MIT"
] | 3 | 2021-07-07T20:05:26.000Z | 2021-07-07T20:11:35.000Z | src/MyGL.py | hedlx/machuchu | 4926a931f81ccd892261a9b13c9d3cf78cc72c01 | [
"MIT"
] | null | null | null | from OpenGL import GL
# Pyopengl shader compilation errors are unreadable, so we'll define our own
# routine.
| 29.428571 | 76 | 0.723301 | from OpenGL import GL
# Pyopengl shader compilation errors are unreadable, so we'll define our own
# routine.
class ShaderCompilationError(Exception):
def __init__(self, text):
super().__init__("Shader compile failure:\n{}".format(text))
self.text = text
def compileShader(source, shaderType):
... | 414 | 19 | 72 |
a1385e4aefd67a6e8363bc3fce53670aa1ea871f | 6,861 | py | Python | covidaid/tools/read_data.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | covidaid/tools/read_data.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | covidaid/tools/read_data.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
Read images and corresponding labels.
"""
import torch
from torch.utils.data import Dataset
from PIL import Image
import os
import random
| 36.887097 | 153 | 0.594957 | # encoding: utf-8
"""
Read images and corresponding labels.
"""
import torch
from torch.utils.data import Dataset
from PIL import Image
import os
import random
class ChestXrayDataSetTest(Dataset):
def __init__(self, image_list_file, transform=None, combine_pneumonia=False):
"""
Create the Data Lo... | 234 | 6,418 | 46 |
6a5630d99e2816cc0a269463a2bc880ec28715f8 | 6,613 | py | Python | user/tests/test_user_api.py | fateme-zka/recipe-app-api | 269deb5ac964b32d90eb5a6f5a0d64552996f839 | [
"MIT"
] | null | null | null | user/tests/test_user_api.py | fateme-zka/recipe-app-api | 269deb5ac964b32d90eb5a6f5a0d64552996f839 | [
"MIT"
] | null | null | null | user/tests/test_user_api.py | fateme-zka/recipe-app-api | 269deb5ac964b32d90eb5a6f5a0d64552996f839 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
# constant values which we define at the first of the code.
# url to create user
CREATE_USER_URL = reverse('user:create')
# url to... | 39.598802 | 112 | 0.662332 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
# constant values which we define at the first of the code.
# url to create user
CREATE_USER_URL = reverse('user:create')
# url to... | 330 | 0 | 49 |
3fb7ad36b6a4561499e23b7103181d84a4b929cc | 62,934 | py | Python | cascada/bitvector/operation.py | ranea/CASSCA | d00770206fc91170d020c8224f81421ad220bce7 | [
"MIT"
] | null | null | null | cascada/bitvector/operation.py | ranea/CASSCA | d00770206fc91170d020c8224f81421ad220bce7 | [
"MIT"
] | null | null | null | cascada/bitvector/operation.py | ranea/CASSCA | d00770206fc91170d020c8224f81421ad220bce7 | [
"MIT"
] | null | null | null | """Provide the common bit-vector operators."""
import collections
import functools
import itertools
import math
from sympy.core import cache
from sympy.printing import precedence as sympy_precedence
from cascada.bitvector import context
from cascada.bitvector import core
zip = functools.partial(zip, strict=True)
... | 31.962417 | 113 | 0.580433 | """Provide the common bit-vector operators."""
import collections
import functools
import itertools
import math
from sympy.core import cache
from sympy.printing import precedence as sympy_precedence
from cascada.bitvector import context
from cascada.bitvector import core
zip = functools.partial(zip, strict=True)
... | 24,730 | 227 | 2,391 |
f1bb3a1de13a5215f33ff2284cef317137a79142 | 14,792 | py | Python | word_analysis/main.py | umitkoc/python_lesson | a127e5d81053c622b8f8d8dd9879167e17f8d6e8 | [
"MIT"
] | 3 | 2021-02-26T21:11:45.000Z | 2022-03-03T16:35:58.000Z | word_analysis/main.py | umitkoc/python_lesson | a127e5d81053c622b8f8d8dd9879167e17f8d6e8 | [
"MIT"
] | 1 | 2021-05-09T13:40:00.000Z | 2021-05-09T13:40:00.000Z | word_analysis/main.py | umitkoc/python_lesson | a127e5d81053c622b8f8d8dd9879167e17f8d6e8 | [
"MIT"
] | null | null | null | from json import dump
from operator import itemgetter
from os import listdir, mkdir, path, remove
from time import sleep
import fitz
from docx2pdf import convert
# from PDFNetPython3 import * ----> python version 3.5-3.8 with working
# from PDFNetPython3.PDFNetPython import Element, Image, PDFDoc, Point
from PyPDF2 i... | 32.725664 | 120 | 0.466604 | from json import dump
from operator import itemgetter
from os import listdir, mkdir, path, remove
from time import sleep
import fitz
from docx2pdf import convert
# from PDFNetPython3 import * ----> python version 3.5-3.8 with working
# from PDFNetPython3.PDFNetPython import Element, Image, PDFDoc, Point
from PyPDF2 i... | 10,545 | 0 | 322 |
c7dab99d9335ca65d8fad764be81284012109512 | 1,216 | py | Python | src/yamlfig/__init__.py | ktkalaru/yamlfig | a6ddb2c8346ae5695402c25921fdc0d2aaa9b3a1 | [
"MIT"
] | 1 | 2021-03-26T08:31:18.000Z | 2021-03-26T08:31:18.000Z | src/yamlfig/__init__.py | ktkalaru/yamlfig | a6ddb2c8346ae5695402c25921fdc0d2aaa9b3a1 | [
"MIT"
] | null | null | null | src/yamlfig/__init__.py | ktkalaru/yamlfig | a6ddb2c8346ae5695402c25921fdc0d2aaa9b3a1 | [
"MIT"
] | null | null | null | """Verify the structure of YAML-formatted configuration files.
The yamlfig package provides developers with a framework for defining
rules that test and verify a config file's structure. Those rules are
captured in a parser object which can be applied to YAML-based config
files to validate them.
In particular, this ... | 33.777778 | 70 | 0.778783 | """Verify the structure of YAML-formatted configuration files.
The yamlfig package provides developers with a framework for defining
rules that test and verify a config file's structure. Those rules are
captured in a parser object which can be applied to YAML-based config
files to validate them.
In particular, this ... | 0 | 0 | 0 |
013b5ffbce8389c2ccc782914a093247c85589c1 | 7,163 | py | Python | UserCode/jzhang/sbc_run6_mergeall.py | RunzZhang/SBCcode | e75b8e751cec5fb2c28950edef0c82f005caedcb | [
"MIT"
] | 4 | 2018-08-27T18:02:34.000Z | 2020-06-09T21:19:04.000Z | UserCode/jzhang/sbc_run6_mergeall.py | RunzZhang/SBCcode | e75b8e751cec5fb2c28950edef0c82f005caedcb | [
"MIT"
] | null | null | null | UserCode/jzhang/sbc_run6_mergeall.py | RunzZhang/SBCcode | e75b8e751cec5fb2c28950edef0c82f005caedcb | [
"MIT"
] | 4 | 2019-06-20T21:36:26.000Z | 2020-11-10T17:23:14.000Z | import numpy as np
import SBCcode as sbc
import os
import re
from SBCcode.DataHandling.WriteBinary import WriteBinaryNtupleFile as wb
# import ipdb
modules = [
'AcousticAnalysis_',
'DytranAnalysis_',
'EventAnalysis_',
'HistoryAnalysis_',
'ImageAnalysis_',
'TimingAnalysis_',
'PMTfastDAQalign... | 36.176768 | 468 | 0.50356 | import numpy as np
import SBCcode as sbc
import os
import re
from SBCcode.DataHandling.WriteBinary import WriteBinaryNtupleFile as wb
# import ipdb
modules = [
'AcousticAnalysis_',
'DytranAnalysis_',
'EventAnalysis_',
'HistoryAnalysis_',
'ImageAnalysis_',
'TimingAnalysis_',
'PMTfastDAQalign... | 0 | 0 | 0 |
bbc1a5d12e9554bcfb2d4d205210bffca54f0c00 | 372 | py | Python | HelloWorld/sequence_operators.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | HelloWorld/sequence_operators.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | HelloWorld/sequence_operators.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | """
Python3 has three sequence type
String
list
tuple
range
byte and byte array
"""
string1 = "he's "
string2 = "probably "
string3 = "pining "
string4 = "for the "
string5 = "fjords"
print(string1, string2, string3, string4, string5)
print(string1 * 5) # string multiplication
print(string1 * (5+4)) # operator pr... | 15.5 | 50 | 0.698925 | """
Python3 has three sequence type
String
list
tuple
range
byte and byte array
"""
string1 = "he's "
string2 = "probably "
string3 = "pining "
string4 = "for the "
string5 = "fjords"
print(string1, string2, string3, string4, string5)
print(string1 * 5) # string multiplication
print(string1 * (5+4)) # operator pr... | 0 | 0 | 0 |
8b58b23af84fc70a103b626ae7e1322ab1c82853 | 1,357 | py | Python | app/V1/views/officeview.py | Roychela/Politicalapp-APIs | 2f0a4b416470cffeac263111386b1a53c301feaa | [
"MIT"
] | null | null | null | app/V1/views/officeview.py | Roychela/Politicalapp-APIs | 2f0a4b416470cffeac263111386b1a53c301feaa | [
"MIT"
] | null | null | null | app/V1/views/officeview.py | Roychela/Politicalapp-APIs | 2f0a4b416470cffeac263111386b1a53c301feaa | [
"MIT"
] | null | null | null | from flask import jsonify, make_response, request
from app.V1.views import bluprint
from app.V1.models.appmodels import PoliticalOfficeModel
@bluprint.route("/offices", methods= ["GET"] )
@bluprint.route("/offices", methods= ["POST"])
@bluprint.route("/offices/<int:office_id>", methods=["GET"]) | 27.14 | 65 | 0.584377 | from flask import jsonify, make_response, request
from app.V1.views import bluprint
from app.V1.models.appmodels import PoliticalOfficeModel
@bluprint.route("/offices", methods= ["GET"] )
def get_all_offices():
return make_response(jsonify({
"status": 200,
"data": PoliticalOfficeModel.view_all_off... | 979 | 0 | 78 |
3becd57d8f0f84c471e090d235eb725279a99986 | 182 | py | Python | docs/examples/compute/rackspace/instantiate_next_gen.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | null | null | null | docs/examples/compute/rackspace/instantiate_next_gen.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T12:29:13.000Z | 2021-12-06T12:29:13.000Z | docs/examples/compute/rackspace/instantiate_next_gen.py | rgharris/libcloud | 90971e17bfd7b6bb97b2489986472c531cc8e140 | [
"Apache-2.0"
] | 1 | 2021-12-06T10:26:33.000Z | 2021-12-06T10:26:33.000Z | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.RACKSPACE)
driver = cls("username", "api key", region="iad")
| 30.333333 | 49 | 0.791209 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.RACKSPACE)
driver = cls("username", "api key", region="iad")
| 0 | 0 | 0 |
b42095240c69f586ff442cf47cdd820364bf6eb6 | 28,084 | py | Python | panqec/codes/base/_stabilizer_code.py | ehua7365/bn3d | b2ab7411c32c836fe5d0e48900461c1911408774 | [
"MIT"
] | null | null | null | panqec/codes/base/_stabilizer_code.py | ehua7365/bn3d | b2ab7411c32c836fe5d0e48900461c1911408774 | [
"MIT"
] | null | null | null | panqec/codes/base/_stabilizer_code.py | ehua7365/bn3d | b2ab7411c32c836fe5d0e48900461c1911408774 | [
"MIT"
] | null | null | null | from typing import Dict, Tuple, Optional, List
import os
from abc import ABCMeta, abstractmethod
import numpy as np
import json
from scipy.sparse import csr_matrix, dok_matrix
import panqec
from panqec.bpauli import bcommute, get_effective_error
from panqec import bsparse
os.environ['PANQEC_ROOT_DIR'] = os.path.dirna... | 33.836145 | 79 | 0.573067 | from typing import Dict, Tuple, Optional, List
import os
from abc import ABCMeta, abstractmethod
import numpy as np
import json
from scipy.sparse import csr_matrix, dok_matrix
import panqec
from panqec.bpauli import bcommute, get_effective_error
from panqec import bsparse
os.environ['PANQEC_ROOT_DIR'] = os.path.dirna... | 256 | 0 | 26 |
c498aaf0fde9570e6460accf87281b6d2ba2d1c0 | 337 | py | Python | arkbreeder/db.py | dgasmith/ARKBreeder | 7c1ad3a75d427dbf21b92e359a042030b3cfb6c8 | [
"MIT"
] | null | null | null | arkbreeder/db.py | dgasmith/ARKBreeder | 7c1ad3a75d427dbf21b92e359a042030b3cfb6c8 | [
"MIT"
] | null | null | null | arkbreeder/db.py | dgasmith/ARKBreeder | 7c1ad3a75d427dbf21b92e359a042030b3cfb6c8 | [
"MIT"
] | null | null | null | from typing import Any
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base: Any = declarative_base()
| 21.0625 | 55 | 0.735905 | from typing import Any
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base: Any = declarative_base()
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
name = Column(String)
fullname = Column(String)
nickname ... | 0 | 154 | 23 |
b61f9156fac150f760b016abece30bc74162db2a | 1,087 | py | Python | test/multi_prompt_minmax.py | temptitle/big-sleep | ac7e62a45829b3d8ab82aafb62db5475d7f644da | [
"MIT"
] | null | null | null | test/multi_prompt_minmax.py | temptitle/big-sleep | ac7e62a45829b3d8ab82aafb62db5475d7f644da | [
"MIT"
] | null | null | null | test/multi_prompt_minmax.py | temptitle/big-sleep | ac7e62a45829b3d8ab82aafb62db5475d7f644da | [
"MIT"
] | null | null | null | import time
import shutil
import torch
from big_sleep import Imagine
terminate = False
num_attempts = 4
for attempt in range(num_attempts):
dream = Imagine(
text = "an armchair in the form of pikachu\\an armchair imitating pikachu\\abstract",
text_min = "blur\\zoom",
lr = 7e-2,
ima... | 24.155556 | 93 | 0.599816 | import time
import shutil
import torch
from big_sleep import Imagine
terminate = False
def signal_handling(signum,frame):
global terminate
terminate = True
num_attempts = 4
for attempt in range(num_attempts):
dream = Imagine(
text = "an armchair in the form of pikachu\\an armchair imitating pikac... | 55 | 0 | 23 |
58445b4211c8de947653300404d77c29c83fe35f | 2,073 | py | Python | pystil/events.py | arthru/pystil | 60e02da290fa7e0596dc94ed0a0a3c6c293cee78 | [
"BSD-3-Clause"
] | null | null | null | pystil/events.py | arthru/pystil | 60e02da290fa7e0596dc94ed0a0a3c6c293cee78 | [
"BSD-3-Clause"
] | null | null | null | pystil/events.py | arthru/pystil | 60e02da290fa7e0596dc94ed0a0a3c6c293cee78 | [
"BSD-3-Clause"
] | null | null | null |
import pickle
import sys
import pika
import gevent
from gevent.event import Event
POLLS = {}
CACHE_SIZE = 20
| 28.013514 | 63 | 0.58466 |
import pickle
import sys
import pika
import gevent
from gevent.event import Event
POLLS = {}
CACHE_SIZE = 20
class Poll(object):
def __init__(self, site):
self.event = Event()
self.visits = []
self._offset = 0
def get(self, i):
if i == len(self.visits) + self._offset:
... | 1,811 | -2 | 150 |
e9dd9b72b49ba30d47740bbac04b144d52e958f6 | 2,567 | py | Python | getBert_embed.py | singaln/Chinese-BertWord-Embedding | 36e3ca33b356f0387bb490bc6bb968600c865a82 | [
"Apache-2.0"
] | 6 | 2021-02-23T02:04:42.000Z | 2022-01-19T11:24:21.000Z | getBert_embed.py | soul-an/Chinese-BertWord-Embedding | 93788abf701ede543bd890b0f6505c74bf089416 | [
"Apache-2.0"
] | null | null | null | getBert_embed.py | soul-an/Chinese-BertWord-Embedding | 93788abf701ede543bd890b0f6505c74bf089416 | [
"Apache-2.0"
] | 2 | 2021-01-07T12:21:46.000Z | 2022-02-03T01:54:29.000Z | # coding = utf-8
import jieba
import logging
import numpy as np
from transformers import BertModel, BertTokenizer
jieba.setLogLevel(logging.INFO)
bert_path = "../chinese_wwm_ext_pytorch"
bert = BertModel.from_pretrained(bert_path)
token = BertTokenizer.from_pretrained(bert_path)
# Bert 字向量生成
# c... | 36.671429 | 120 | 0.56603 | # coding = utf-8
import jieba
import logging
import numpy as np
from transformers import BertModel, BertTokenizer
jieba.setLogLevel(logging.INFO)
bert_path = "../chinese_wwm_ext_pytorch"
bert = BertModel.from_pretrained(bert_path)
token = BertTokenizer.from_pretrained(bert_path)
# Bert 字向量生成
def get_d... | 2,123 | 0 | 48 |
4d184df95c7ce4a81fcf99a4f14815b59c4e451b | 4,860 | py | Python | examples/training/avg_word_embeddings/training_stsbenchmark_bow.py | faezakamran/sentence-transformers | 2158fff3aa96651b10fe367c41fdd5008a33c5c6 | [
"Apache-2.0"
] | 7,566 | 2019-07-25T07:45:17.000Z | 2022-03-31T22:15:35.000Z | examples/training/avg_word_embeddings/training_stsbenchmark_bow.py | faezakamran/sentence-transformers | 2158fff3aa96651b10fe367c41fdd5008a33c5c6 | [
"Apache-2.0"
] | 1,444 | 2019-07-25T11:53:48.000Z | 2022-03-31T15:13:32.000Z | examples/training/avg_word_embeddings/training_stsbenchmark_bow.py | faezakamran/sentence-transformers | 2158fff3aa96651b10fe367c41fdd5008a33c5c6 | [
"Apache-2.0"
] | 1,567 | 2019-07-26T15:19:28.000Z | 2022-03-31T19:57:35.000Z | """
This example uses a simple bag-of-words (BoW) approach. A sentence is mapped
to a sparse vector with e.g. 25,000 dimensions. Optionally, you can also use tf-idf.
To make the model trainable, we add multiple dense layers to create a Deep Averaging Network (DAN).
"""
from torch.utils.data import DataLoader
import ma... | 37.384615 | 130 | 0.72037 | """
This example uses a simple bag-of-words (BoW) approach. A sentence is mapped
to a sparse vector with e.g. 25,000 dimensions. Optionally, you can also use tf-idf.
To make the model trainable, we add multiple dense layers to create a Deep Averaging Network (DAN).
"""
from torch.utils.data import DataLoader
import ma... | 0 | 0 | 0 |
43800dd1999f9cc6aaf991ed15e2934d7e8cd0e6 | 358 | py | Python | segmentfault/apps/users/migrations/0007_auto_20190730_2122.py | Yookyiss/segmentfault | 8fb7890c8b650ac34541a8fb14c3cd9bef98d120 | [
"MIT"
] | null | null | null | segmentfault/apps/users/migrations/0007_auto_20190730_2122.py | Yookyiss/segmentfault | 8fb7890c8b650ac34541a8fb14c3cd9bef98d120 | [
"MIT"
] | 12 | 2020-02-12T01:14:42.000Z | 2022-03-11T23:54:43.000Z | segmentfault/apps/users/migrations/0007_auto_20190730_2122.py | Yookyiss/segmentfault | 8fb7890c8b650ac34541a8fb14c3cd9bef98d120 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-30 13:22
from django.db import migrations
| 18.842105 | 47 | 0.578212 | # Generated by Django 2.2.2 on 2019-07-30 13:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0006_user_brithday'),
]
operations = [
migrations.RenameField(
model_name='user',
old_name='brithday',
... | 0 | 252 | 23 |
a7db98ab9c4ab713d267b5ea89a6cee4fc9645ad | 824 | py | Python | tests/test_requirements.py | siddhpant/pypi-mobans | 5219c14255c3c4350408ffea64af1ae6849f3e82 | [
"BSD-3-Clause"
] | null | null | null | tests/test_requirements.py | siddhpant/pypi-mobans | 5219c14255c3c4350408ffea64af1ae6849f3e82 | [
"BSD-3-Clause"
] | null | null | null | tests/test_requirements.py | siddhpant/pypi-mobans | 5219c14255c3c4350408ffea64af1ae6849f3e82 | [
"BSD-3-Clause"
] | null | null | null | import textwrap
from test_utils import get_rendered_file
| 29.428571 | 60 | 0.592233 | import textwrap
from test_utils import get_rendered_file
def test_requirements():
context = {
'dependencies': [
'dependency',
'dependency #with_comment',
'dependency#with_comment_no_space',
'dependency#egg=dependency',
'git+h... | 742 | 0 | 23 |
c16d9c990794024b8a225cb86f9dfca8def34ca2 | 82 | py | Python | src/graphnet/models/gnn/__init__.py | BozianuLeon/graphnet | 54c41a9486ba35fa3700c5ade3fddd69620bc721 | [
"Apache-2.0"
] | 1 | 2022-03-24T15:39:24.000Z | 2022-03-24T15:39:24.000Z | src/graphnet/models/gnn/__init__.py | BozianuLeon/graphnet | 54c41a9486ba35fa3700c5ade3fddd69620bc721 | [
"Apache-2.0"
] | 72 | 2021-12-07T13:19:16.000Z | 2022-03-31T13:16:58.000Z | src/graphnet/models/gnn/__init__.py | BozianuLeon/graphnet | 54c41a9486ba35fa3700c5ade3fddd69620bc721 | [
"Apache-2.0"
] | 3 | 2022-01-17T13:59:05.000Z | 2022-03-19T14:58:22.000Z | from .dynedge import DynEdge, DynEdge_V2, DynEdge_V3
from .convnet import ConvNet
| 27.333333 | 52 | 0.829268 | from .dynedge import DynEdge, DynEdge_V2, DynEdge_V3
from .convnet import ConvNet
| 0 | 0 | 0 |
5c99d355819ba57a67a8e1e71ccdfd63bdfe263b | 2,060 | py | Python | f_face_detector_occlusion.py | weariestDuet/face_recognition_occlusion | 1881361fb7563b84632d5e87477f8f9c9e9420e0 | [
"MIT"
] | null | null | null | f_face_detector_occlusion.py | weariestDuet/face_recognition_occlusion | 1881361fb7563b84632d5e87477f8f9c9e9420e0 | [
"MIT"
] | null | null | null | f_face_detector_occlusion.py | weariestDuet/face_recognition_occlusion | 1881361fb7563b84632d5e87477f8f9c9e9420e0 | [
"MIT"
] | null | null | null | from keras.models import load_model
import numpy as np
import cv2
"""
tensorflow_version --> '2.0.0'
keras_version -------> '2.3.1'
"""
'''
para usar:
1. instanciar modelo
face_detector = f_face_detector.detector_face_occlusion()
2. ingresar alguna imagen con un rostro y predecir
boxes_face = face_detector.de... | 32.698413 | 107 | 0.571359 | from keras.models import load_model
import numpy as np
import cv2
"""
tensorflow_version --> '2.0.0'
keras_version -------> '2.3.1'
"""
'''
para usar:
1. instanciar modelo
face_detector = f_face_detector.detector_face_occlusion()
2. ingresar alguna imagen con un rostro y predecir
boxes_face = face_detector.de... | 1,577 | 11 | 76 |
6d70d7c06174ffab0052204ecbf4ffb956642989 | 2,124 | py | Python | src/git_inspector/common.py | yaniksoeltzer/git_inspector | 628d2d7d407f789887649467c01d6cd5bfd87560 | [
"MIT"
] | 4 | 2021-12-06T15:35:19.000Z | 2022-01-23T23:17:38.000Z | src/git_inspector/common.py | yaniksoeltzer/git_inspector | 628d2d7d407f789887649467c01d6cd5bfd87560 | [
"MIT"
] | 12 | 2021-03-31T09:14:40.000Z | 2022-01-31T10:01:25.000Z | src/git_inspector/common.py | yaniksoeltzer/git_inspector | 628d2d7d407f789887649467c01d6cd5bfd87560 | [
"MIT"
] | 1 | 2022-01-22T11:37:08.000Z | 2022-01-22T11:37:08.000Z | import os
from git import Commit, Remote
import logging
| 26.55 | 106 | 0.660546 | import os
from git import Commit, Remote
import logging
class CommitResolveError(Exception):
pass
def get_tracked_heads(repo):
return list(filter(
lambda head: head.tracking_branch() is not None,
repo.heads
))
def get_untracked_heads(repo):
return list(filter(
lambda head:... | 1,826 | 24 | 207 |
53a5ba0992d505829f7140dd423574f69bf148c9 | 3,465 | py | Python | x_mushroom_rl/environments/dm_control_env.py | ml-research/X-mushroom-rl | ef5f131d3cfa9c229a614c044d8c001afe8812d2 | [
"MIT"
] | null | null | null | x_mushroom_rl/environments/dm_control_env.py | ml-research/X-mushroom-rl | ef5f131d3cfa9c229a614c044d8c001afe8812d2 | [
"MIT"
] | null | null | null | x_mushroom_rl/environments/dm_control_env.py | ml-research/X-mushroom-rl | ef5f131d3cfa9c229a614c044d8c001afe8812d2 | [
"MIT"
] | null | null | null | import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from dm_control import suite
from x_mushroom_rl.environments import Environment, MDPInfo
from x_mushroom_rl.utils.spaces import *
from x_mushroom_rl.utils.viewer import ImageViewer
class DMControl(... | 33 | 88 | 0.631169 | import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from dm_control import suite
from x_mushroom_rl.environments import Environment, MDPInfo
from x_mushroom_rl.utils.spaces import *
from x_mushroom_rl.utils.viewer import ImageViewer
class DMControl(... | 1,283 | 0 | 186 |
aee56e840cfeaf493a5b6492623d950bbdaebfda | 1,006 | py | Python | webapp/hoptimgui/home/urls.py | erwan-rouzel/hoptim | b7b8204073e1ed5b4fefa81ea74e8bd0b96c4411 | [
"Apache-2.0",
"MIT"
] | null | null | null | webapp/hoptimgui/home/urls.py | erwan-rouzel/hoptim | b7b8204073e1ed5b4fefa81ea74e8bd0b96c4411 | [
"Apache-2.0",
"MIT"
] | null | null | null | webapp/hoptimgui/home/urls.py | erwan-rouzel/hoptim | b7b8204073e1ed5b4fefa81ea74e8bd0b96c4411 | [
"Apache-2.0",
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = 'home'
urlpatterns = [
# ex: /home/
url(r'^$', views.hbase_region_servers, name='hbase_region_servers$'),
url(r'^opentsdb/split$', views.opentsdb_split, name='opentsdb_split'),
url(r'^opentsdb/regions/(?P<encoded_name>[a-f0-9]+)$... | 52.947368 | 122 | 0.701789 | from django.conf.urls import url
from . import views
app_name = 'home'
urlpatterns = [
# ex: /home/
url(r'^$', views.hbase_region_servers, name='hbase_region_servers$'),
url(r'^opentsdb/split$', views.opentsdb_split, name='opentsdb_split'),
url(r'^opentsdb/regions/(?P<encoded_name>[a-f0-9]+)$... | 0 | 0 | 0 |
193fe1aecdddc1bd5ac7e1b2ded1ffd52765a22b | 2,066 | py | Python | deluca/lung/utils/data/jax_data.py | google/deluca-lung | 8c665f3ac53f2251945f08c9990f2cfa099fdf06 | [
"Apache-2.0"
] | 1 | 2021-12-20T13:19:57.000Z | 2021-12-20T13:19:57.000Z | deluca/lung/utils/data/jax_data.py | google/deluca-lung | 8c665f3ac53f2251945f08c9990f2cfa099fdf06 | [
"Apache-2.0"
] | null | null | null | deluca/lung/utils/data/jax_data.py | google/deluca-lung | 8c665f3ac53f2251945f08c9990f2cfa099fdf06 | [
"Apache-2.0"
] | 3 | 2021-10-17T11:56:43.000Z | 2022-02-26T21:07:37.000Z | # https://pypi.org/project/jax-data/
import jax
import jax.numpy as jnp
import numpy as np | 27.918919 | 89 | 0.605518 | # https://pypi.org/project/jax-data/
import jax
import jax.numpy as jnp
import numpy as np
def default_collate_fn(samples):
X = jnp.array([sample[0] for sample in samples])
Y = jnp.array([sample[1] for sample in samples])
return X, Y
class Dataset(object):
def __init__(self):
pass
def _... | 915 | 809 | 250 |
fc7c4ff6f8bf69bd3579e184c4a2fbbfded6adcc | 10,655 | py | Python | test/test_app.py | gahoo/SNAP | 6595a8ab781830e557c75ebd1612c59fdc96114d | [
"MIT"
] | 1 | 2020-01-06T12:07:47.000Z | 2020-01-06T12:07:47.000Z | test/test_app.py | gahoo/SNAP | 6595a8ab781830e557c75ebd1612c59fdc96114d | [
"MIT"
] | null | null | null | test/test_app.py | gahoo/SNAP | 6595a8ab781830e557c75ebd1612c59fdc96114d | [
"MIT"
] | null | null | null | from core.app import App, AppParameter, AppFile
import unittest
import shutil
import pdb
class TestAppParameter(unittest.TestCase):
"""
test for App Parameters
"""
class TestAppFile(unittest.TestCase):
"""docstring for TestAppFile"""
class TestApp(unittest.TestCase):
"""docstring for TestApp"""
... | 42.114625 | 962 | 0.587236 | from core.app import App, AppParameter, AppFile
import unittest
import shutil
import pdb
class TestAppParameter(unittest.TestCase):
"""
test for App Parameters
"""
def test_check_error_parameter_type(self):
param = {'type': 'error type'}
self.assertRaises(TypeError, AppParameter, param)... | 9,535 | 0 | 753 |
97c1eb61027e713ba5851051084bca36413e1efd | 4,370 | py | Python | src/run.py | amiiiirrrr/Machine_learning_task | 2d066d06ea8622b06bd9e4e9f791074a44f80173 | [
"Apache-2.0"
] | null | null | null | src/run.py | amiiiirrrr/Machine_learning_task | 2d066d06ea8622b06bd9e4e9f791074a44f80173 | [
"Apache-2.0"
] | null | null | null | src/run.py | amiiiirrrr/Machine_learning_task | 2d066d06ea8622b06bd9e4e9f791074a44f80173 | [
"Apache-2.0"
] | null | null | null | """
run.py is written to train and evaluate the model
"""
import os
import logging
import glob
from Regression.configuration import BaseConfig
from Regression.methods import RegressionModel, save_model, load_trained
from Regression.dataloader import DataframeLoader
from Regression.train import TrainingEvaluati... | 38.333333 | 98 | 0.577803 | """
run.py is written to train and evaluate the model
"""
import os
import logging
import glob
from Regression.configuration import BaseConfig
from Regression.methods import RegressionModel, save_model, load_trained
from Regression.dataloader import DataframeLoader
from Regression.train import TrainingEvaluati... | 845 | 0 | 27 |
1eaefe466bdf55df8a9049202e7ab912858d4e2f | 78 | py | Python | tests/settings.py | Junzki/Essen | ef735a9229a3de3e07a7cf998b51c66809293dad | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | Junzki/Essen | ef735a9229a3de3e07a7cf998b51c66809293dad | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | Junzki/Essen | ef735a9229a3de3e07a7cf998b51c66809293dad | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from essen.settings import *
BROKER_TRANSPORT = 'sqs'
| 15.6 | 28 | 0.666667 | # -*- coding:utf-8 -*-
from essen.settings import *
BROKER_TRANSPORT = 'sqs'
| 0 | 0 | 0 |
657535408fc646e1595abcf0e21a86cde1360385 | 8,143 | py | Python | model/ner_model.py | bhuiyanmobasshir94/multiconer-baseline | a44705ca882d7844ba7c77d5afec0485ecfc448a | [
"Apache-2.0"
] | 1 | 2022-02-22T07:09:02.000Z | 2022-02-22T07:09:02.000Z | model/ner_model.py | rayalaupendar/multiconer-baseline | a44705ca882d7844ba7c77d5afec0485ecfc448a | [
"Apache-2.0"
] | null | null | null | model/ner_model.py | rayalaupendar/multiconer-baseline | a44705ca882d7844ba7c77d5afec0485ecfc448a | [
"Apache-2.0"
] | null | null | null | from typing import List, Any
import pytorch_lightning.core.lightning as pl
import torch
import torch.nn.functional as F
import numpy as np
from allennlp.modules import ConditionalRandomField
from allennlp.modules.conditional_random_field import allowed_transitions
from torch import nn
from torch.utils.data import Da... | 42.633508 | 155 | 0.67076 | from typing import List, Any
import pytorch_lightning.core.lightning as pl
import torch
import torch.nn.functional as F
import numpy as np
from allennlp.modules import ConditionalRandomField
from allennlp.modules.conditional_random_field import allowed_transitions
from torch import nn
from torch.utils.data import Da... | 7,158 | 22 | 454 |
1cfe5d222951f47251d81921718167419dc6f130 | 8,835 | py | Python | PAD3/config.py | yueyechen/cvpr20 | 69e6f9fd2393048bf48d7542a19ff0087b97d033 | [
"Apache-2.0"
] | 1 | 2020-12-18T06:02:29.000Z | 2020-12-18T06:02:29.000Z | PAD3/config.py | yueyechen/cvpr20 | 69e6f9fd2393048bf48d7542a19ff0087b97d033 | [
"Apache-2.0"
] | 4 | 2020-06-13T03:25:05.000Z | 2022-01-13T02:17:29.000Z | PAD3/config.py | yueyechen/cvpr20 | 69e6f9fd2393048bf48d7542a19ff0087b97d033 | [
"Apache-2.0"
] | 3 | 2020-03-02T10:10:48.000Z | 2020-05-11T08:27:40.000Z | from easydict import EasyDict as edict
from torchvision import transforms as trans
import torch.nn as nn
from label_smoothing import LabelSmoothing, LabelSmoothingLoss
| 64.963235 | 261 | 0.728014 | from easydict import EasyDict as edict
from torchvision import transforms as trans
import torch.nn as nn
from label_smoothing import LabelSmoothing, LabelSmoothingLoss
def get_config(training = True):
conf = edict()
conf.model = edict()
conf.train = edict()
conf.eval = edict()
conf.gpu = 3
co... | 8,644 | 0 | 23 |
df0afb38100643b24602d182444fbf379e417486 | 40,046 | py | Python | gprm/datasets/Reconstructions.py | siwill22/GPlatesReconstructionModel | 4306b8aa00eac35cd35a9f67e11f5bdf5106bb81 | [
"MIT"
] | 7 | 2020-05-04T03:05:09.000Z | 2022-01-28T13:52:53.000Z | gprm/datasets/Reconstructions.py | siwill22/GPlatesReconstructionModel | 4306b8aa00eac35cd35a9f67e11f5bdf5106bb81 | [
"MIT"
] | null | null | null | gprm/datasets/Reconstructions.py | siwill22/GPlatesReconstructionModel | 4306b8aa00eac35cd35a9f67e11f5bdf5106bb81 | [
"MIT"
] | 3 | 2021-05-23T01:53:52.000Z | 2021-09-14T12:21:53.000Z | from pooch import os_cache as _os_cache
from pooch import retrieve as _retrieve
from pooch import HTTPDownloader as _HTTPDownloader
from pooch import Unzip as _Unzip
import pandas as _pd
#import geopandas as _gpd
import os as _os
#from gprm import ReconstructionModel as _ReconstructionModel
# TODO
# Add: Domeier and ... | 65.865132 | 205 | 0.788293 | from pooch import os_cache as _os_cache
from pooch import retrieve as _retrieve
from pooch import HTTPDownloader as _HTTPDownloader
from pooch import Unzip as _Unzip
import pandas as _pd
#import geopandas as _gpd
import os as _os
#from gprm import ReconstructionModel as _ReconstructionModel
# TODO
# Add: Domeier and ... | 0 | 0 | 0 |
d16bf7608b2e1f0fa122bd80173d1bb78a8ef9a9 | 2,375 | py | Python | advent/day_2.py | rickdkk/advent-of-code-2021 | 49eed2d191d7b4a12f10ec8af9dc57408ba1b1fe | [
"MIT"
] | null | null | null | advent/day_2.py | rickdkk/advent-of-code-2021 | 49eed2d191d7b4a12f10ec8af9dc57408ba1b1fe | [
"MIT"
] | null | null | null | advent/day_2.py | rickdkk/advent-of-code-2021 | 49eed2d191d7b4a12f10ec8af9dc57408ba1b1fe | [
"MIT"
] | null | null | null | from pathlib import Path
def read_commands(path: Path) -> list[tuple[str, int]]:
"""Read sub commands from a file."""
commands = []
with open(path, "r") as file:
for line in file.readlines():
command, amount = line.split()
commands.append((command, int(amount)))
retur... | 29.320988 | 98 | 0.587368 | from pathlib import Path
class Sub:
def __init__(self, x: int = 0, y: int = 0):
self.x = x
self.y = y
@property
def depth(self) -> int:
return -self.y
@property
def total(self) -> int:
return self.x * self.depth
def process_command(self, command: str, amount:... | 583 | 1,351 | 69 |
840560aa85c2e903fda4564108dc18923bc1988a | 3,638 | py | Python | src/flowproc/flowprocd.py | shuntingyard/flowproc | 6d6f32b021f5f71d8fa177c9a891d2080364856e | [
"MIT"
] | null | null | null | src/flowproc/flowprocd.py | shuntingyard/flowproc | 6d6f32b021f5f71d8fa177c9a891d2080364856e | [
"MIT"
] | null | null | null | src/flowproc/flowprocd.py | shuntingyard/flowproc | 6d6f32b021f5f71d8fa177c9a891d2080364856e | [
"MIT"
] | 1 | 2020-05-19T14:36:23.000Z | 2020-05-19T14:36:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The flow collector daemon
"""
import argparse
import logging
import socketserver
import sys
from flowproc import process
from flowproc import __version__
__author__ = "Tobias Frei"
__copyright__ = "Tobias Frei"
__license__ = "mit"
logger = logging.getLogger(__name__... | 23.777778 | 72 | 0.603079 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The flow collector daemon
"""
import argparse
import logging
import socketserver
import sys
from flowproc import process
from flowproc import __version__
__author__ = "Tobias Frei"
__copyright__ = "Tobias Frei"
__license__ = "mit"
logger = logging.getLogger(__name__... | 201 | 41 | 49 |
49d5654d2989f6feb125b78d3a712f9bf8defdf8 | 2,622 | py | Python | nhlscrapi/games/repscrwrap.py | jcnavin/nhlscrapi | 2273683497ff27b0e92c8d1557ff0ce962dbf43b | [
"Apache-2.0"
] | 72 | 2015-01-16T04:44:34.000Z | 2021-12-04T15:07:11.000Z | nhlscrapi/games/repscrwrap.py | jcnavin/nhlscrapi | 2273683497ff27b0e92c8d1557ff0ce962dbf43b | [
"Apache-2.0"
] | 16 | 2015-10-29T02:51:18.000Z | 2021-03-21T05:24:49.000Z | nhlscrapi/games/repscrwrap.py | jcnavin/nhlscrapi | 2273683497ff27b0e92c8d1557ff0ce962dbf43b | [
"Apache-2.0"
] | 43 | 2015-04-18T23:12:58.000Z | 2021-12-18T20:45:04.000Z |
from functools import wraps
from abc import ABCMeta, abstractmethod
def dispatch_loader(scraper, loader_name):
"""
Decorator that enforces one time loading for scrapers. The one time loading is applied
to partial loaders, e.g. only parse and load the home team roster once. This is not
meant to be used... | 31.97561 | 116 | 0.575133 |
from functools import wraps
from abc import ABCMeta, abstractmethod
def dispatch_loader(scraper, loader_name):
"""
Decorator that enforces one time loading for scrapers. The one time loading is applied
to partial loaders, e.g. only parse and load the home team roster once. This is not
meant to be used... | 655 | 0 | 53 |
bbc37378d583057e324abfde45264ae1fa219795 | 3,007 | py | Python | pikka_bird_collector/collector.py | tiredpixel/pikka-bird-collector-py | 5273b9f1ee89831a84044e863db480bbf4730552 | [
"MIT"
] | 2 | 2015-06-12T19:55:16.000Z | 2019-04-05T22:33:05.000Z | pikka_bird_collector/collector.py | tiredpixel/pikka-bird-collector-py | 5273b9f1ee89831a84044e863db480bbf4730552 | [
"MIT"
] | 3 | 2015-06-06T20:56:03.000Z | 2020-01-29T14:41:54.000Z | pikka_bird_collector/collector.py | tiredpixel/pikka-bird-collector-py | 5273b9f1ee89831a84044e863db480bbf4730552 | [
"MIT"
] | null | null | null | import datetime
import importlib
import logging
import os
import platform
import socket
import sys
import pikka_bird_collector
from .config import Config
COLLECTORS = [
'system', # keep first; sort rest
'mongodb',
'mysql',
'postgresql',
'rabbitmq',
'redis']
COLLECTORS_MODULE_P = 'pikka_bird_... | 30.683673 | 85 | 0.555703 | import datetime
import importlib
import logging
import os
import platform
import socket
import sys
import pikka_bird_collector
from .config import Config
COLLECTORS = [
'system', # keep first; sort rest
'mongodb',
'mysql',
'postgresql',
'rabbitmq',
'redis']
COLLECTORS_MODULE_P = 'pikka_bird_... | 415 | 0 | 31 |
327c78ea41edf197dc20b356653ae754a30a9fc3 | 4,782 | py | Python | src/OTLMOW/OTLModel/Classes/Damwand.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/OTLModel/Classes/Damwand.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/OTLModel/Classes/Damwand.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.ConstructieElement import ConstructieElement
from OTLMOW.OTLModel.Datatypes.BooleanField import BooleanField
from OTLMOW.OTLModel.Datatypes.KlDamwandMateriaal import KlDamwandMateriaal
from OTLMOW.OTLModel.Data... | 47.346535 | 132 | 0.592012 | # coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.ConstructieElement import ConstructieElement
from OTLMOW.OTLModel.Datatypes.BooleanField import BooleanField
from OTLMOW.OTLModel.Datatypes.KlDamwandMateriaal import KlDamwandMateriaal
from OTLMOW.OTLModel.Data... | 2,821 | 0 | 157 |
236203ec0284a523da7e3d5e6f6fdd84cebe5792 | 8,116 | py | Python | mambo/cli.py | mardix/mambo | 36f856baf3a382ba4ea5ffd1454be5a0b935294f | [
"MIT"
] | 2 | 2016-09-27T04:34:59.000Z | 2019-06-04T00:47:48.000Z | mambo/cli.py | mardix/mambo | 36f856baf3a382ba4ea5ffd1454be5a0b935294f | [
"MIT"
] | null | null | null | mambo/cli.py | mardix/mambo | 36f856baf3a382ba4ea5ffd1454be5a0b935294f | [
"MIT"
] | null | null | null |
import os
import sys
import time
import click
import logging
import pkg_resources
from livereload import Server, shell
from . import Mambo
from .mambo import PAGE_FORMAT
from .__about__ import *
logging.basicConfig(filename='./error.log', level=logging.ERROR, format='%(asctime)s %(levelname)s %(name)s %(message)s')
... | 26.436482 | 121 | 0.581444 |
import os
import sys
import time
import click
import logging
import pkg_resources
from livereload import Server, shell
from . import Mambo
from .mambo import PAGE_FORMAT
from .__about__ import *
logging.basicConfig(filename='./error.log', level=logging.ERROR, format='%(asctime)s %(levelname)s %(name)s %(message)s')
... | 1,579 | 220 | 284 |
dc367736138891cba8ef5adecc58eb7bfe2a43af | 3,613 | py | Python | package/cloudshell/cm/ansible/domain/playbook_downloader.py | QualiSystemsLab/Ansible-Shell-Extended | c60c5c514c2d44c47a2329887a11ce7a949f9051 | [
"Apache-2.0"
] | null | null | null | package/cloudshell/cm/ansible/domain/playbook_downloader.py | QualiSystemsLab/Ansible-Shell-Extended | c60c5c514c2d44c47a2329887a11ce7a949f9051 | [
"Apache-2.0"
] | null | null | null | package/cloudshell/cm/ansible/domain/playbook_downloader.py | QualiSystemsLab/Ansible-Shell-Extended | c60c5c514c2d44c47a2329887a11ce7a949f9051 | [
"Apache-2.0"
] | null | null | null | import os
from cloudshell.cm.ansible.domain.cancellation_sampler import CancellationSampler
from cloudshell.cm.ansible.domain.http_request_service import HttpRequestService
from file_system_service import FileSystemService
from logging import Logger
from models import HttpAuth
| 39.703297 | 113 | 0.643786 | import os
from cloudshell.cm.ansible.domain.cancellation_sampler import CancellationSampler
from cloudshell.cm.ansible.domain.http_request_service import HttpRequestService
from file_system_service import FileSystemService
from logging import Logger
from models import HttpAuth
class PlaybookDownloader(object):
C... | 0 | 3,310 | 23 |
79c4753bc1e55ee32d6213d40a1236f4797c4880 | 17,743 | py | Python | pipecaster/cross_validation.py | ajcallegari/pipecaster | dc283db67662385a54179310e3dbede04ec3db84 | [
"MIT"
] | null | null | null | pipecaster/cross_validation.py | ajcallegari/pipecaster | dc283db67662385a54179310e3dbede04ec3db84 | [
"MIT"
] | 1 | 2021-03-26T21:06:06.000Z | 2021-03-26T21:06:06.000Z | pipecaster/cross_validation.py | ajcallegari/pipecaster | dc283db67662385a54179310e3dbede04ec3db84 | [
"MIT"
] | null | null | null | """
Cross validation functions supporting both MultichannelPipeline and
scikit-learn predictors.
"""
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import balanced_accuracy_score, explained_variance_score
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import LabelEncoder
from ... | 42.447368 | 79 | 0.598095 | """
Cross validation functions supporting both MultichannelPipeline and
scikit-learn predictors.
"""
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import balanced_accuracy_score, explained_variance_score
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import LabelEncoder
from ... | 307 | 0 | 23 |
2f772422b2b31056a6c104e32bc2ac789a69e657 | 1,649 | py | Python | src/rez/utils/json.py | maxnbk/rez | 762c5cfce17eabde67eb5582498406eb3544daf0 | [
"Apache-2.0"
] | null | null | null | src/rez/utils/json.py | maxnbk/rez | 762c5cfce17eabde67eb5582498406eb3544daf0 | [
"Apache-2.0"
] | null | null | null | src/rez/utils/json.py | maxnbk/rez | 762c5cfce17eabde67eb5582498406eb3544daf0 | [
"Apache-2.0"
] | 1 | 2020-09-24T08:33:43.000Z | 2020-09-24T08:33:43.000Z | # Copyright Contributors to the Rez project
#
# 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 ... | 31.711538 | 105 | 0.637356 | # Copyright Contributors to the Rez project
#
# 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 ... | 587 | 0 | 57 |
baab28c526f98ca7b609eaad29e08f67a7a58fc0 | 383 | py | Python | apps/cpq/utils/__init__.py | goztrk/django-htk | c56bf112e5d627780d2f4288460eae5cce80fa9e | [
"MIT"
] | 206 | 2015-10-15T07:05:08.000Z | 2021-02-19T11:48:36.000Z | apps/cpq/utils/__init__.py | goztrk/django-htk | c56bf112e5d627780d2f4288460eae5cce80fa9e | [
"MIT"
] | 8 | 2017-10-16T10:18:31.000Z | 2022-03-09T14:24:27.000Z | apps/cpq/utils/__init__.py | goztrk/django-htk | c56bf112e5d627780d2f4288460eae5cce80fa9e | [
"MIT"
] | 61 | 2015-10-15T08:12:44.000Z | 2022-03-10T12:25:06.000Z | # HTK Imports
from htk.apps.cpq.utils.accounting import get_invoice_years
from htk.apps.cpq.utils.accounting import get_receivables_by_year
from htk.apps.cpq.utils.crypto import compute_cpq_code
from htk.apps.cpq.utils.crypto import compute_cpq_code_check_hash
from htk.apps.cpq.utils.crypto import is_valid_cpq_code_che... | 47.875 | 66 | 0.86423 | # HTK Imports
from htk.apps.cpq.utils.accounting import get_invoice_years
from htk.apps.cpq.utils.accounting import get_receivables_by_year
from htk.apps.cpq.utils.crypto import compute_cpq_code
from htk.apps.cpq.utils.crypto import compute_cpq_code_check_hash
from htk.apps.cpq.utils.crypto import is_valid_cpq_code_che... | 0 | 0 | 0 |
578e63e25596bc80d5eda6aa4be6ccb5730ebf1e | 394 | py | Python | config/settings.py | buckyroberts/Discord-Python-Framework | 8731e9a01c2e2f83af9882838ad809696fe89e22 | [
"MIT"
] | 10 | 2021-10-04T01:21:51.000Z | 2021-11-17T09:26:17.000Z | config/settings.py | buckyroberts/Discord-Python-Framework | 8731e9a01c2e2f83af9882838ad809696fe89e22 | [
"MIT"
] | 1 | 2021-10-04T01:38:15.000Z | 2021-10-04T01:38:15.000Z | config/settings.py | buckyroberts/Discord-Python-Framework | 8731e9a01c2e2f83af9882838ad809696fe89e22 | [
"MIT"
] | 2 | 2021-11-20T14:41:56.000Z | 2022-02-09T18:49:29.000Z | import os
from dotenv import load_dotenv
load_dotenv()
# Application
MAXIMUM_CONFIRMATION_CHECKS = 20
# thenewboston
BANK_IP = '54.183.16.194'
BANK_PROTOCOL = 'http'
BOT_ACCOUNT_NUMBER = '598428d3a9df5423aab3e593b5d1b5f056b9fa353607fccb1aa76385cf233851'
# Discord
DISCORD_TOKEN = os.getenv('DISCORD_TOKEN')
# Mongo... | 17.909091 | 87 | 0.80203 | import os
from dotenv import load_dotenv
load_dotenv()
# Application
MAXIMUM_CONFIRMATION_CHECKS = 20
# thenewboston
BANK_IP = '54.183.16.194'
BANK_PROTOCOL = 'http'
BOT_ACCOUNT_NUMBER = '598428d3a9df5423aab3e593b5d1b5f056b9fa353607fccb1aa76385cf233851'
# Discord
DISCORD_TOKEN = os.getenv('DISCORD_TOKEN')
# Mongo... | 0 | 0 | 0 |
91dc00db8c954cb72689eac289edc05225abd6cf | 62 | py | Python | teamActivites/ta04-stretch/ta04.py | Zuzuni7/CS241 | d631483ce3fe9e6cd996f13ee33642a998226050 | [
"MIT"
] | 1 | 2021-10-13T01:50:27.000Z | 2021-10-13T01:50:27.000Z | teamActivites/ta04-stretch/ta04.py | Zuzuni7/CS241 | d631483ce3fe9e6cd996f13ee33642a998226050 | [
"MIT"
] | null | null | null | teamActivites/ta04-stretch/ta04.py | Zuzuni7/CS241 | d631483ce3fe9e6cd996f13ee33642a998226050 | [
"MIT"
] | 3 | 2020-05-13T04:28:49.000Z | 2021-05-14T23:13:30.000Z | """
CS241 Team Activity 4
Written by Chad Macbeth
"""
| 7.75 | 23 | 0.612903 | """
CS241 Team Activity 4
Written by Chad Macbeth
"""
| 0 | 0 | 0 |
a8fe0a6a0010c7b92b04559f0576c2bf6f49484a | 3,499 | py | Python | sopel/privileges.py | Exirel/sopel | 6305e40972cdda65c244d8779dfcdc303eb9884e | [
"EFL-2.0"
] | 555 | 2015-07-25T21:21:43.000Z | 2022-03-28T02:22:38.000Z | sopel/privileges.py | Exirel/sopel | 6305e40972cdda65c244d8779dfcdc303eb9884e | [
"EFL-2.0"
] | 1,177 | 2015-07-31T09:52:31.000Z | 2022-03-26T05:10:34.000Z | sopel/privileges.py | Exirel/sopel | 6305e40972cdda65c244d8779dfcdc303eb9884e | [
"EFL-2.0"
] | 406 | 2015-07-28T20:34:02.000Z | 2022-03-18T00:37:01.000Z | """Constants for user privileges in channels.
Privilege levels
================
Historically, there were two user privileges in channels:
* :data:`OP`: channel operator, or chanop, set and unset by ``+o`` and ``-o``
* :data:`VOICE`: the privilege to send messages to a channel with the
``+m`` mode, set and unset by... | 25.540146 | 79 | 0.673335 | """Constants for user privileges in channels.
Privilege levels
================
Historically, there were two user privileges in channels:
* :data:`OP`: channel operator, or chanop, set and unset by ``+o`` and ``-o``
* :data:`VOICE`: the privilege to send messages to a channel with the
``+m`` mode, set and unset by... | 0 | 0 | 0 |
2bb15dbea979a0e933e9bea4e07b8678513e67d5 | 4,500 | py | Python | optimizely.py | bmd/pyOptimizely | b47c88f0ab4eb10356692ae01391b3bc86595ac0 | [
"MIT"
] | null | null | null | optimizely.py | bmd/pyOptimizely | b47c88f0ab4eb10356692ae01391b3bc86595ac0 | [
"MIT"
] | null | null | null | optimizely.py | bmd/pyOptimizely | b47c88f0ab4eb10356692ae01391b3bc86595ac0 | [
"MIT"
] | null | null | null | import json
import requests
class Optimizely:
""" A Python wrapper around the Optimizely REST API
Attributes
_token (str): The Optimizely API token passe in the class constructor.
_api_base_url (str): The Base URL for the Optimizely API. Hardcoded as
it is unlikely to change, but ... | 35.714286 | 85 | 0.619333 | import json
import requests
class Optimizely:
""" A Python wrapper around the Optimizely REST API
Attributes
_token (str): The Optimizely API token passe in the class constructor.
_api_base_url (str): The Base URL for the Optimizely API. Hardcoded as
it is unlikely to change, but ... | 0 | 0 | 0 |
24d0a4f7df40f4f384d05e9615045c3965cb9cb3 | 2,080 | py | Python | application/controller/settings.py | hisahi/Nanibgal | 56d8741de0b6c5d10f55f7a5f225472d8c87b0b4 | [
"MIT"
] | null | null | null | application/controller/settings.py | hisahi/Nanibgal | 56d8741de0b6c5d10f55f7a5f225472d8c87b0b4 | [
"MIT"
] | 2 | 2018-10-07T10:51:17.000Z | 2018-10-18T09:38:21.000Z | application/controller/settings.py | hisahi/Nanibgal | 56d8741de0b6c5d10f55f7a5f225472d8c87b0b4 | [
"MIT"
] | 1 | 2018-10-18T07:55:21.000Z | 2018-10-18T07:55:21.000Z |
import application.models
from application.controller.auth import validate_username
from flask_login import logout_user
| 36.491228 | 71 | 0.649519 |
import application.models
from application.controller.auth import validate_username
from flask_login import logout_user
def handle_settings(id, request):
# find user by ID
user = application.models.User.query.filter_by(userid = id).first()
# if obj = None, something is really badly wrong
if user == No... | 1,913 | 0 | 46 |
0698c0ad871df5f4a4d46aab1d58212c27a0ddca | 12,758 | py | Python | plugins/point_cloud.py | chris-code/DaVis | c32054e4a32382717b7e2139b357b21846676801 | [
"MIT"
] | null | null | null | plugins/point_cloud.py | chris-code/DaVis | c32054e4a32382717b7e2139b357b21846676801 | [
"MIT"
] | 10 | 2015-08-18T12:50:50.000Z | 2015-08-30T17:12:29.000Z | plugins/point_cloud.py | chris-code/DaVis | c32054e4a32382717b7e2139b357b21846676801 | [
"MIT"
] | null | null | null | try:
import numpy as np
except ImportError:
raise Exception('This plugin requires the numpy library, which failed to import. \
Install the python3 version of numpy.')
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.colorchooser as tkcc
import plugin
| 40.501587 | 141 | 0.714532 | try:
import numpy as np
except ImportError:
raise Exception('This plugin requires the numpy library, which failed to import. \
Install the python3 version of numpy.')
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.colorchooser as tkcc
import plugin
class Distribution_Query_Window(tk.Toplevel):
def _... | 11,855 | 413 | 217 |
874a04acbcab2adc705ada1d394fec8af103a881 | 3,712 | py | Python | Bot/processors/BotLoan/Home.py | MasoudHeidary/django-telegram-bot-trade | 7032428e5e04cb02bb081dcc4d86a585a773ada0 | [
"MIT"
] | null | null | null | Bot/processors/BotLoan/Home.py | MasoudHeidary/django-telegram-bot-trade | 7032428e5e04cb02bb081dcc4d86a585a773ada0 | [
"MIT"
] | null | null | null | Bot/processors/BotLoan/Home.py | MasoudHeidary/django-telegram-bot-trade | 7032428e5e04cb02bb081dcc4d86a585a773ada0 | [
"MIT"
] | null | null | null | from django_tgbot.decorators import processor
from django_tgbot.state_manager import message_types, update_types
from django_tgbot.types.update import Update
from Bot.bot import state_manager, TelegramBot
from Bot.models import TelegramState
from Bot.BotSetting import ReportChannel
from Loan.models import Loan
from ..... | 34.37037 | 115 | 0.615032 | from django_tgbot.decorators import processor
from django_tgbot.state_manager import message_types, update_types
from django_tgbot.types.update import Update
from Bot.bot import state_manager, TelegramBot
from Bot.models import TelegramState
from Bot.BotSetting import ReportChannel
from Loan.models import Loan
from ..... | 3,219 | 0 | 44 |
3cbbe299bd73122586e1ab7c4277a704b494af84 | 832 | py | Python | gradplanner/planner/utils.py | ferenctorok/potential_field_planner | 7a9f7ae70a91523cc6d42029f869f9020cc1ea35 | [
"MIT"
] | null | null | null | gradplanner/planner/utils.py | ferenctorok/potential_field_planner | 7a9f7ae70a91523cc6d42029f869f9020cc1ea35 | [
"MIT"
] | null | null | null | gradplanner/planner/utils.py | ferenctorok/potential_field_planner | 7a9f7ae70a91523cc6d42029f869f9020cc1ea35 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def plot_grad_field(field, occupancy_grid):
"""Plots the gradient field of the np.array of pixels given by field"""
eps = 1e-6
N, M = field.shape
# matrix for the x and y coordinates in every point:
x, y = np.zeros((N, M)), np.zeros((N, M)) ... | 28.689655 | 75 | 0.56851 | import numpy as np
import matplotlib.pyplot as plt
def plot_grad_field(field, occupancy_grid):
"""Plots the gradient field of the np.array of pixels given by field"""
eps = 1e-6
N, M = field.shape
# matrix for the x and y coordinates in every point:
x, y = np.zeros((N, M)), np.zeros((N, M)) ... | 0 | 0 | 0 |