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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aecfa8737eda8f66522d65be9eaa0ff115eeee4b | 364 | py | Python | ProblemSolving/mini_max_sum.py | Akasan/HackerRankResult | 71549236975cae5e8303570ae352c0e93d0e22b5 | [
"MIT"
] | null | null | null | ProblemSolving/mini_max_sum.py | Akasan/HackerRankResult | 71549236975cae5e8303570ae352c0e93d0e22b5 | [
"MIT"
] | null | null | null | ProblemSolving/mini_max_sum.py | Akasan/HackerRankResult | 71549236975cae5e8303570ae352c0e93d0e22b5 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the miniMaxSum function below.
def miniMaxSum(arr):
sorted_arr = sorted(arr)
min_sum = sum(sorted_arr[:-1])
max_sum = sum(sorted_arr[1:])
print(min_sum, max_sum)
if __name__ == '__main__':
arr = list(map(int, input... | 17.333333 | 50 | 0.678571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 65 | 0.178571 |
aecfc854993f2f476c1f4760e4745a5af412f1bd | 15,322 | py | Python | spiders/spiders/spiders/qunar.py | jiangxuewen16/hq-crawler | f03ec1e454513307e335943f224f4d927eaf2bbf | [
"MIT"
] | 1 | 2021-02-25T08:33:40.000Z | 2021-02-25T08:33:40.000Z | spiders/spiders/spiders/qunar.py | jiangxuewen16/hq-crawler | f03ec1e454513307e335943f224f4d927eaf2bbf | [
"MIT"
] | null | null | null | spiders/spiders/spiders/qunar.py | jiangxuewen16/hq-crawler | f03ec1e454513307e335943f224f4d927eaf2bbf | [
"MIT"
] | 2 | 2021-03-08T07:25:16.000Z | 2021-12-07T15:28:02.000Z | # -*- coding: utf-8 -*-
import json
import math
import random
import time
import requests
import scrapy
from scrapy.http import HtmlResponse
from scrapy import Request
from spiders.common import OTA
from spiders.items.spot import spot
from spiders.items.price import price
class QunarSpider(scrapy.Spider):
# 标签 ... | 48.487342 | 424 | 0.547513 | 15,493 | 0.979825 | 11,406 | 0.721351 | 0 | 0 | 0 | 0 | 4,659 | 0.29465 |
aed49e56a367c6273f6328e65eb9c26caf7bc5da | 5,941 | py | Python | stage_2_semantic/not_used/subsample.py | grtzsohalf/Audio-Phonetic-and-Semantic-Embedding | 1207cb61ec4587f38817b030a1e92cb315ebd178 | [
"MIT"
] | 2 | 2019-08-09T00:49:25.000Z | 2019-09-30T06:37:07.000Z | stage_2_semantic/not_used/subsample.py | grtzsohalf/Audio-Phonetic-and-Semantic-Embedding | 1207cb61ec4587f38817b030a1e92cb315ebd178 | [
"MIT"
] | null | null | null | stage_2_semantic/not_used/subsample.py | grtzsohalf/Audio-Phonetic-and-Semantic-Embedding | 1207cb61ec4587f38817b030a1e92cb315ebd178 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import sys
import random
import math
from tqdm import tqdm
from collections import Counter
import operator
import numpy as np
FLAGS = None
next_random = 1
def subsampling_bool(freq, sampling):
global next_random
next_random = (next_random * 25214903917 + 11)... | 35.57485 | 104 | 0.508669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 845 | 0.142232 |
aed4b5966f761ef3662819b99d5360ad4611d44f | 819 | py | Python | scripts/hofstede_csv_to_dict.py | tuejari/yoshi-2 | 2247e2c2820928c0e8ecd1b535a72ca74a5c5281 | [
"Apache-2.0"
] | 2 | 2021-12-02T14:05:40.000Z | 2021-12-27T08:49:48.000Z | scripts/hofstede_csv_to_dict.py | tuejari/yoshi-2 | 2247e2c2820928c0e8ecd1b535a72ca74a5c5281 | [
"Apache-2.0"
] | null | null | null | scripts/hofstede_csv_to_dict.py | tuejari/yoshi-2 | 2247e2c2820928c0e8ecd1b535a72ca74a5c5281 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
# Read the Hofstede indices into a pandas dataframe
data = pd.read_csv("..\\data\\Hofstede Insights - Manual 2021-05-13.csv", delimiter=",", index_col="country")
# Transform all data in the dataframe to strings
data["pdi"] = data["pdi"].astype(str)
data["idv"] = data["idv"].astype(str)
dat... | 40.95 | 132 | 0.62149 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 468 | 0.571429 |
aed61ba31c0649cb1a7854a5aa110c70142265a0 | 269 | py | Python | cmd_creator_b.py | azeznassar/JavaScriptToUML | 53cccc1bba635114f03d966fd2f0f2f2d2d74bae | [
"MIT"
] | 5 | 2020-08-16T09:25:42.000Z | 2022-01-19T21:00:48.000Z | cmd_creator_b.py | azeznassar/JavaScriptToUML | 53cccc1bba635114f03d966fd2f0f2f2d2d74bae | [
"MIT"
] | null | null | null | cmd_creator_b.py | azeznassar/JavaScriptToUML | 53cccc1bba635114f03d966fd2f0f2f2d2d74bae | [
"MIT"
] | 4 | 2020-08-19T09:05:13.000Z | 2021-08-03T17:25:53.000Z | # pylint: disable="import-error"
from command_line_creator import CommandLineCreator
from current_cmd_b import CurrentCMD_B
class CmdCreatorB(CommandLineCreator):
def create_cmd(self):
current_cmd = CurrentCMD_B(self.output)
return current_cmd | 29.888889 | 51 | 0.773234 | 144 | 0.535316 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 0.118959 |
aed70cd25520bf0f360431c3625a8328524dbc40 | 1,744 | py | Python | WideResNet2.py | styanddty/Wide-resnet-fashionMnist | f281f1e3e3c2b55be20620290d6e0535fcc70d98 | [
"MIT"
] | 4 | 2018-05-12T01:53:20.000Z | 2020-11-10T09:35:01.000Z | WideResNet2.py | styanddty/Wide-resnet-fashionMnist | f281f1e3e3c2b55be20620290d6e0535fcc70d98 | [
"MIT"
] | null | null | null | WideResNet2.py | styanddty/Wide-resnet-fashionMnist | f281f1e3e3c2b55be20620290d6e0535fcc70d98 | [
"MIT"
] | 1 | 2018-11-25T20:03:56.000Z | 2018-11-25T20:03:56.000Z | from utils import _conv2d, _bn, _block
import tensorflow as tf
def WideResNet(x, dropout, phase, layers, kval, scope, n_classes = 10): # Wide residual network
# 1 conv + 3 convblocks*(3 conv layers *1 group for each block + 2 conv layers*(N-1) groups for each block [total 1+N-1 = N groups]) = layers
# 3*2*(N... | 42.536585 | 145 | 0.612959 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 497 | 0.284977 |
aed73b39402bd942e4be1fdb0e1b2019a73a5408 | 21,700 | py | Python | src/pyadobemc/pyadobemc.py | andymaheshw/SiteCatalystPy | 3bb82b1c5cd6ee130e9a3c7b52a1c364913a9506 | [
"MIT"
] | null | null | null | src/pyadobemc/pyadobemc.py | andymaheshw/SiteCatalystPy | 3bb82b1c5cd6ee130e9a3c7b52a1c364913a9506 | [
"MIT"
] | null | null | null | src/pyadobemc/pyadobemc.py | andymaheshw/SiteCatalystPy | 3bb82b1c5cd6ee130e9a3c7b52a1c364913a9506 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 06 00:27:21 2016
@author: maheshwa
"""
from __future__ import print_function
import requests
import time
import binascii
import hashlib
import json
# Authentication
class AdobeAnalytics:
def __init__(self, user_name, shared_secret, endpoint='', debug=False):
... | 36.593592 | 118 | 0.6553 | 21,484 | 0.990046 | 0 | 0 | 0 | 0 | 0 | 0 | 13,039 | 0.600876 |
aed80772e26b65068e4088dd2031244a8b43228b | 2,750 | py | Python | tests/testingutils.py | dnephin/Tron | bd0f763421c6de50551e9a4b0e4a1c0c8ceb450a | [
"Apache-2.0"
] | null | null | null | tests/testingutils.py | dnephin/Tron | bd0f763421c6de50551e9a4b0e4a1c0c8ceb450a | [
"Apache-2.0"
] | null | null | null | tests/testingutils.py | dnephin/Tron | bd0f763421c6de50551e9a4b0e4a1c0c8ceb450a | [
"Apache-2.0"
] | null | null | null | import logging
import functools
import mock
from testify import TestCase, setup
from testify import class_setup, class_teardown
from testify import teardown
import time
from tron.utils import timeutils
log = logging.getLogger(__name__)
# TODO: remove when replaced with tron.eventloop
class MockReactorTestCase(Test... | 28.645833 | 77 | 0.661091 | 1,656 | 0.602182 | 0 | 0 | 1,194 | 0.434182 | 0 | 0 | 553 | 0.201091 |
aed8dca665c2fddde4b08f8f8f84ab30b49b9928 | 10,397 | py | Python | classes/App.py | JeanExtreme002/Aim-Coach | 25369e036073bc1fe95efdcad34b6648b1498672 | [
"BSD-3-Clause"
] | 1 | 2019-07-31T18:21:10.000Z | 2019-07-31T18:21:10.000Z | classes/App.py | JeanExtreme002/Aim-Training | 25369e036073bc1fe95efdcad34b6648b1498672 | [
"BSD-3-Clause"
] | null | null | null | classes/App.py | JeanExtreme002/Aim-Training | 25369e036073bc1fe95efdcad34b6648b1498672 | [
"BSD-3-Clause"
] | null | null | null | from classes.Display import Display
from classes.FinalScoreboard import FinalScoreboard
from classes.Sounds import Sounds
from classes.TargetArea import TargetArea
from classes.Target import Target
from classes.Text import Text
from classes.Timer import Timer
from time import time
import pygame
class App(object):
... | 33.756494 | 141 | 0.598346 | 10,162 | 0.971511 | 0 | 0 | 0 | 0 | 0 | 0 | 2,660 | 0.254302 |
aeda62809d73ce75af8f774735efd74dd45b137f | 3,501 | py | Python | tests/conftest.py | kown7/pymergevcd | b4716b5aff49c7c496cae4f70fda0e5d52231e1b | [
"MIT"
] | 1 | 2021-02-27T21:22:16.000Z | 2021-02-27T21:22:16.000Z | tests/conftest.py | kown7/pymergevcd | b4716b5aff49c7c496cae4f70fda0e5d52231e1b | [
"MIT"
] | 1 | 2021-10-21T18:44:59.000Z | 2021-10-21T18:44:59.000Z | tests/conftest.py | kown7/pymergevcd | b4716b5aff49c7c496cae4f70fda0e5d52231e1b | [
"MIT"
] | null | null | null | """Provide test fixtures"""
import logging
import os
import pytest
import vcd
@pytest.fixture
def dummy_vcd_file(tmpdir):
"""Create vcd file with random data"""
filename = os.path.sep.join([str(tmpdir), 'test.vcd'])
with open(filename, 'w+') as fptr:
with vcd.VCDWriter(fptr, timescale=(10, 'ns'),... | 46.065789 | 79 | 0.509854 | 0 | 0 | 0 | 0 | 3,382 | 0.96601 | 0 | 0 | 507 | 0.144816 |
aedc557dd8c720698321e37793a35e36a2e095e9 | 1,408 | py | Python | bot.py | tungr/CoeusBot | 90bdc869a1f8c077a1f88dcf1335d20a19d49fee | [
"MIT"
] | null | null | null | bot.py | tungr/CoeusBot | 90bdc869a1f8c077a1f88dcf1335d20a19d49fee | [
"MIT"
] | null | null | null | bot.py | tungr/CoeusBot | 90bdc869a1f8c077a1f88dcf1335d20a19d49fee | [
"MIT"
] | null | null | null | import discord, os
from discord.ext import commands
from discord.ext.commands import has_permissions, bot_has_permissions
from dotenv import load_dotenv
client = commands.Bot(command_prefix='-')
client.remove_command('help')
client.remove_command('reload')
# Loads a cog
@client.command()
@has_permissions(administrato... | 30.608696 | 69 | 0.736506 | 0 | 0 | 0 | 0 | 837 | 0.59446 | 591 | 0.419744 | 323 | 0.229403 |
aede0775f444057271755bf3520984120506d311 | 2,177 | py | Python | setup.py | llaurabat91/topic-modelling-tools | 9b53f52e5671005642faf065e993e19f0b249e5c | [
"MIT"
] | null | null | null | setup.py | llaurabat91/topic-modelling-tools | 9b53f52e5671005642faf065e993e19f0b249e5c | [
"MIT"
] | null | null | null | setup.py | llaurabat91/topic-modelling-tools | 9b53f52e5671005642faf065e993e19f0b249e5c | [
"MIT"
] | null | null | null | import sys
from setuptools import setup
from setuptools.extension import Extension
### unit tests for this package
import topicmodel_tests
### set include dirs for numpy
try:
import numpy
except ImportError:
numpy_already_installed = False
from distutils.sysconfig import get_python_lib
include_numpy_... | 28.272727 | 117 | 0.618741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 838 | 0.384933 |
aedff3138bbb43e485ad12558c8ec12fb523b030 | 3,311 | py | Python | game/tests/models/test_ownership.py | gafderks/monopoly-vue | 4d18938508412476b19d205258a6339ff1f5975a | [
"MIT"
] | null | null | null | game/tests/models/test_ownership.py | gafderks/monopoly-vue | 4d18938508412476b19d205258a6339ff1f5975a | [
"MIT"
] | 172 | 2020-10-01T18:38:15.000Z | 2022-03-28T19:20:11.000Z | game/tests/models/test_ownership.py | gafderks/monopoly-vue | 4d18938508412476b19d205258a6339ff1f5975a | [
"MIT"
] | null | null | null | import datetime
from unittest import mock
import pytz
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.test import TestCase
from game.models import Ownership, Game, Player, RealEstate
from game.tests.factories.ownership import OwnershipFactory
from game.tests.factori... | 39.416667 | 85 | 0.712776 | 2,895 | 0.874358 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0.008155 |
aee1d165304e92ca3a56f102fa49637d4eb2d084 | 4,637 | py | Python | anyHR/constraint/node/Node.py | figlerg/anyHR | 418742aa10634338c405de87b2ee1cbe08ae8a9e | [
"BSD-3-Clause"
] | 1 | 2021-08-14T17:59:51.000Z | 2021-08-14T17:59:51.000Z | anyHR/constraint/node/Node.py | figlerg/anyHR | 418742aa10634338c405de87b2ee1cbe08ae8a9e | [
"BSD-3-Clause"
] | 2 | 2022-03-27T13:38:19.000Z | 2022-03-31T15:20:26.000Z | anyHR/constraint/node/Node.py | figlerg/anyHR | 418742aa10634338c405de87b2ee1cbe08ae8a9e | [
"BSD-3-Clause"
] | 1 | 2022-03-27T08:31:23.000Z | 2022-03-27T08:31:23.000Z | # from constraint.node.SubstitutorVisitor import SubstitutorVisitor
from enum import Enum
class Node(object):
def __init__(self):
self.children = list()
self.node_type = NodeType.NODE
def get_vars(self, vars = set()):
# recursively crawls tree and writes down all the variables
... | 25.478022 | 128 | 0.587233 | 4,428 | 0.954928 | 0 | 0 | 0 | 0 | 0 | 0 | 358 | 0.077205 |
aee1d58bc63210b255b76deaef25027f91fb2561 | 464 | py | Python | shop/store/migrations/0004_auto_20210328_2032.py | Mykytenkovladislav/book_shop_and_warehouse | 60852e5ed3869291e73623b8b8d7901d39d66c9d | [
"MIT"
] | null | null | null | shop/store/migrations/0004_auto_20210328_2032.py | Mykytenkovladislav/book_shop_and_warehouse | 60852e5ed3869291e73623b8b8d7901d39d66c9d | [
"MIT"
] | null | null | null | shop/store/migrations/0004_auto_20210328_2032.py | Mykytenkovladislav/book_shop_and_warehouse | 60852e5ed3869291e73623b8b8d7901d39d66c9d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-28 20:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('store', '0003_auto_20210328_2029'),
]
operations = [
migrations.AlterField(
model_name='order',
name='shipped_date',... | 24.421053 | 125 | 0.62931 | 371 | 0.799569 | 0 | 0 | 0 | 0 | 0 | 0 | 152 | 0.327586 |
aee3b41530ad1d83d280d311e7b96dac16a5ac08 | 12,327 | py | Python | crop_rotator/core/classes.py | Bahusson/crop_rotator | c1d86d36ce1867a84b927708f92c62c7815250a4 | [
"MIT"
] | 1 | 2021-05-08T07:04:45.000Z | 2021-05-08T07:04:45.000Z | crop_rotator/core/classes.py | Bahusson/crop_rotator | c1d86d36ce1867a84b927708f92c62c7815250a4 | [
"MIT"
] | 80 | 2020-11-18T20:35:12.000Z | 2021-06-13T08:08:36.000Z | crop_rotator/core/classes.py | Bahusson/crop_rotator | c1d86d36ce1867a84b927708f92c62c7815250a4 | [
"MIT"
] | null | null | null | from .snippets import (
remove_repeating,
flare,
list_appending_long,
level_off,
)
import itertools
import copy
from core.models import RotatorAdminPanel
class PageLoad(object):
"""Zwraca tyle języków ile mamy zainstalowane
w ustawieniach w zakładce LANGUAGES w formacie naprzemiennym
p... | 35.834302 | 101 | 0.564695 | 10,309 | 0.832849 | 0 | 0 | 0 | 0 | 0 | 0 | 1,749 | 0.141299 |
aee4f9bbfdac79e9118eae4558fc269abff34caa | 11,972 | py | Python | ai/RLPlayer.py | Unn20/achtung_die_kurve | e2dbb1752c070cfc398e415d5a427384c0230f3c | [
"MIT"
] | null | null | null | ai/RLPlayer.py | Unn20/achtung_die_kurve | e2dbb1752c070cfc398e415d5a427384c0230f3c | [
"MIT"
] | null | null | null | ai/RLPlayer.py | Unn20/achtung_die_kurve | e2dbb1752c070cfc398e415d5a427384c0230f3c | [
"MIT"
] | null | null | null | import copy
import math
import random
import numpy as np
import torch
from game.Player import Player
class RLPlayer(Player):
def __init__(self, name, game_state, action_space, parameters={}):
super().__init__(name)
print(f"Player {name} parameters: {parameters}")
self.action_space = acti... | 43.064748 | 157 | 0.628383 | 11,854 | 0.990144 | 0 | 0 | 0 | 0 | 0 | 0 | 1,448 | 0.120949 |
aee5927bf583c22f6d9d0f89495d9cdad0d60cd0 | 4,761 | py | Python | Intervention_Scenarios/helpers/what_if_helpers.py | tomtuamnuq/covasim-dds | 1e3ce8f9dda6908ca20040a3b532495de3bdc4c1 | [
"Apache-2.0"
] | 2 | 2022-03-11T09:48:19.000Z | 2022-03-20T09:06:31.000Z | Intervention_Scenarios/helpers/what_if_helpers.py | AzadehKSH/covasim-dds | 8bbaf4ffbebb4904ea56142d40043d2259ec7f25 | [
"Apache-2.0"
] | null | null | null | Intervention_Scenarios/helpers/what_if_helpers.py | AzadehKSH/covasim-dds | 8bbaf4ffbebb4904ea56142d40043d2259ec7f25 | [
"Apache-2.0"
] | null | null | null | from functools import partial
from typing import Tuple
import covasim as cv
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as st
def get_current_infected_ratio():
# Returns the current ratio of infected people in germany
number_infected = 651500 # https://www.deutschland.de/de/topic/p... | 38.707317 | 129 | 0.692502 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 978 | 0.205419 |
aee5c643860aef69edc1c551fc556f5c1921368e | 25,812 | py | Python | src/nba_history/player_data.py | odonnell31/nba_history | bfcaffa265ee193f1faf4e6786ddc7d2cbfc9142 | [
"MIT"
] | null | null | null | src/nba_history/player_data.py | odonnell31/nba_history | bfcaffa265ee193f1faf4e6786ddc7d2cbfc9142 | [
"MIT"
] | null | null | null | src/nba_history/player_data.py | odonnell31/nba_history | bfcaffa265ee193f1faf4e6786ddc7d2cbfc9142 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 16 11:45:09 2021
@author: Michael ODonnell
@purpose: scrape NBA draft picks by year
"""
# import needed libraries
import requests
from bs4 import BeautifulSoup
import pandas as pd
import time
# function to scrape a list of years of NBA Drafts
def scrape_draft_data(star... | 43.675127 | 200 | 0.535371 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8,238 | 0.319104 |
aee70f5de0ae2c6851fc83893a601e60e16a4182 | 19,651 | py | Python | aristotle/apps/marc/bots/aspbots.py | jermnelson/Discover-Aristotle | cc1ff79915d715801890a3a8642099304916adfa | [
"Apache-2.0"
] | 7 | 2015-03-13T09:56:16.000Z | 2021-05-03T13:39:05.000Z | aristotle/apps/marc/bots/aspbots.py | jermnelson/Discover-Aristotle | cc1ff79915d715801890a3a8642099304916adfa | [
"Apache-2.0"
] | 1 | 2021-04-06T16:30:00.000Z | 2021-04-06T16:43:57.000Z | aristotle/apps/marc/bots/aspbots.py | jermnelson/Discover-Aristotle | cc1ff79915d715801890a3a8642099304916adfa | [
"Apache-2.0"
] | 2 | 2015-12-18T16:51:07.000Z | 2016-02-26T09:56:42.000Z | import urlparse,urllib2,re
import datetime,logging
from marcbots import MARCImportBot
from pymarc import Field
class AlexanderStreetPressBaseBot(MARCImportBot):
"""
`AlexanderStreetPressBaseBot` encapsulates the basic
MARC record changes used by child classes.
"""
def __init__(self,ma... | 38.009671 | 125 | 0.558292 | 19,493 | 0.99196 | 0 | 0 | 0 | 0 | 0 | 0 | 7,312 | 0.372093 |
aee85d757db25a014d88c52b4b892e6e8e5b9803 | 335 | py | Python | TestGetter.py | okiyama/Chess-EEA-Opponent-Modelling | c81f2b5226e3441ed236b3b20c3811e721d412d8 | [
"MIT"
] | null | null | null | TestGetter.py | okiyama/Chess-EEA-Opponent-Modelling | c81f2b5226e3441ed236b3b20c3811e721d412d8 | [
"MIT"
] | null | null | null | TestGetter.py | okiyama/Chess-EEA-Opponent-Modelling | c81f2b5226e3441ed236b3b20c3811e721d412d8 | [
"MIT"
] | null | null | null | class TestGetter:
""" Interface for getting tests. Useful because I'd like to both be able to evolve a next test as well as play a normal game of chess with the user """
#I thought about using abstract base class for this but it feels like overkill
def getNextTest(self, opponents, previousTest): raise NotI... | 67 | 155 | 0.761194 | 335 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 229 | 0.683582 |
aee96f06eaeca2b9830d780ade1fc0b516e69f02 | 1,915 | py | Python | sqlalchemy/sqlalchemy-0.3.6+codebay/sqlalchemy/ext/assignmapper.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | 5 | 2015-04-16T08:36:17.000Z | 2017-05-12T17:20:12.000Z | sqlalchemy/sqlalchemy-0.3.6+codebay/sqlalchemy/ext/assignmapper.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | null | null | null | sqlalchemy/sqlalchemy-0.3.6+codebay/sqlalchemy/ext/assignmapper.py | nakedible/vpnease-l2tp | 0fcda6a757f2bc5c37f4753b3cd8b1c6d282db5c | [
"WTFPL"
] | 4 | 2015-03-19T14:39:51.000Z | 2019-01-23T08:22:55.000Z | from sqlalchemy import mapper, util, Query, exceptions
import types
def monkeypatch_query_method(ctx, class_, name):
def do(self, *args, **kwargs):
query = Query(class_, session=ctx.current)
return getattr(query, name)(*args, **kwargs)
setattr(class_, name, classmethod(do))
def monkeypatch_obj... | 43.522727 | 171 | 0.632898 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 310 | 0.16188 |
aee9791412aca3b9a70fc201a6a8bbfc83e5a9e9 | 210 | py | Python | SmartTE/Signals/UndoSignals.py | smartboyathome/SmartTE | 373a721f17e9a1f3d1bbe5c9c101c638de3fa96d | [
"BSD-3-Clause"
] | 1 | 2020-07-15T19:53:27.000Z | 2020-07-15T19:53:27.000Z | SmartTE/Signals/UndoSignals.py | smartboyathome/SmartTE | 373a721f17e9a1f3d1bbe5c9c101c638de3fa96d | [
"BSD-3-Clause"
] | null | null | null | SmartTE/Signals/UndoSignals.py | smartboyathome/SmartTE | 373a721f17e9a1f3d1bbe5c9c101c638de3fa96d | [
"BSD-3-Clause"
] | null | null | null | UNDO_EMPTY = 'undostack-empty'
UNDO_NOT_EMPTY = 'undostack-not-empty'
REDO_EMPTY = 'redostack-empty'
REDO_NOT_EMPTY = 'redostack-not-empty'
UNDO_CHANGED = 'undostack-changed'
REDO_CHANGED = 'redostack-changed'
| 30 | 38 | 0.790476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 114 | 0.542857 |
aeebb225c84833a15d25e565e8ec5e80d876a03e | 3,564 | py | Python | Mod.py | christoffaloffagus/Clint-Bot-3000 | e2da367ceb7459d9c081a17c9e24ef08d76f3e53 | [
"MIT"
] | null | null | null | Mod.py | christoffaloffagus/Clint-Bot-3000 | e2da367ceb7459d9c081a17c9e24ef08d76f3e53 | [
"MIT"
] | null | null | null | Mod.py | christoffaloffagus/Clint-Bot-3000 | e2da367ceb7459d9c081a17c9e24ef08d76f3e53 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from os import system
class Mod:
def __init__(self, client):
self.client = client
# ------------------------------- COMMANDS ------------------------------- #
# Commands need to have the @commands.command decorator
@commands.command(hidden=True, pass_co... | 26.796992 | 89 | 0.564534 | 1,806 | 0.506734 | 0 | 0 | 1,260 | 0.353535 | 1,273 | 0.357183 | 2,062 | 0.578563 |
aeed0b8abb2aadc143c55c6677cfe9445bb8a6a9 | 1,316 | py | Python | examples/dictation grammar example.py | onchiptech/pyjsgf | f7ff26323e5e602ea10e7d302610c2fcb46234d6 | [
"MIT"
] | 40 | 2018-01-24T23:01:27.000Z | 2022-01-19T03:33:37.000Z | examples/dictation grammar example.py | onchiptech/pyjsgf | f7ff26323e5e602ea10e7d302610c2fcb46234d6 | [
"MIT"
] | 31 | 2018-03-01T07:58:27.000Z | 2022-01-13T12:07:45.000Z | examples/dictation grammar example.py | onchiptech/pyjsgf | f7ff26323e5e602ea10e7d302610c2fcb46234d6 | [
"MIT"
] | 21 | 2017-11-14T09:11:17.000Z | 2022-02-02T15:32:57.000Z | """
Example showing use of the jsgf.ext DictationGrammar class for matching and
compiling rules that use regular JSGF expansions like Literal and Sequence as
well as Dictation expansions.
"""
from jsgf import PublicRule, Sequence
from jsgf.ext import Dictation, DictationGrammar
def main():
# Create a simple rule... | 31.333333 | 79 | 0.718085 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 756 | 0.574468 |
aeeff92da6880272b842617fa1cd1119d5a74e02 | 2,534 | py | Python | pyclustering/cluster/tests/integration/it_hsyncnet.py | JosephChataignon/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 1,013 | 2015-01-26T19:50:14.000Z | 2022-03-31T07:38:48.000Z | pyclustering/cluster/tests/integration/it_hsyncnet.py | peterlau0626/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 542 | 2015-01-20T16:44:32.000Z | 2022-01-29T14:57:20.000Z | pyclustering/cluster/tests/integration/it_hsyncnet.py | peterlau0626/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 262 | 2015-03-19T07:28:12.000Z | 2022-03-30T07:28:24.000Z | """!
@brief Integration-tests for Hierarchical Sync (HSyncNet) algorithm.
@authors Andrei Novikov ([email protected])
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest;
import matplotlib;
matplotlib.use('Agg');
from pyclustering.cluster.tests.hsyncnet_templates import HsyncnetTestT... | 41.540984 | 133 | 0.753749 | 2,033 | 0.802289 | 0 | 0 | 187 | 0.073796 | 0 | 0 | 182 | 0.071823 |
aef1f46a6f4fb6e4545b68a9cb41e8f97c07f8ea | 92 | py | Python | custom/plugins/setup_oer_reports_pre.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-07-09T20:02:48.000Z | 2021-11-21T20:00:37.000Z | custom/plugins/setup_oer_reports_pre.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | custom/plugins/setup_oer_reports_pre.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | import common.assertions as assertions
def run(cfg):
assertions.validateAdminPassword(cfg) | 23 | 38 | 0.836957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aef2d0ce8b0f340445dbcd09415dd30f5aa7f265 | 758 | py | Python | material/curso_em_video/ex085.py | sergiodealencar/courses | c9d86b27b0185cc82624b01ed76653dbc12554a3 | [
"MIT"
] | null | null | null | material/curso_em_video/ex085.py | sergiodealencar/courses | c9d86b27b0185cc82624b01ed76653dbc12554a3 | [
"MIT"
] | null | null | null | material/curso_em_video/ex085.py | sergiodealencar/courses | c9d86b27b0185cc82624b01ed76653dbc12554a3 | [
"MIT"
] | null | null | null | lista = [[], []]
valor = 0
for c in range(1, 8):
valor = int(input(f'Digite o {c}o. valor: '))
if valor % 2 == 0:
lista[0].append(valor)
else:
lista[1].append(valor)
print('-=' * 30)
print(f'Os valores pares digitados foram: {sorted(lista[0])}')
print(f'Os valores ímpres digitados foram: {so... | 29.153846 | 65 | 0.575198 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 550 | 0.721785 |
aef488759816cabfb40bd3b6063dcdfb1b53455d | 3,216 | py | Python | ane_research/utils/kendall_top_k.py | michaeljneely/sparse-attention-explanation | 658b181f67963fe22dd0489bd9b37bdbd05110c1 | [
"MIT"
] | 2 | 2020-03-25T22:13:09.000Z | 2021-01-06T04:28:03.000Z | ane_research/utils/kendall_top_k.py | michaeljneely/sparse-attention-explanation | 658b181f67963fe22dd0489bd9b37bdbd05110c1 | [
"MIT"
] | null | null | null | ane_research/utils/kendall_top_k.py | michaeljneely/sparse-attention-explanation | 658b181f67963fe22dd0489bd9b37bdbd05110c1 | [
"MIT"
] | null | null | null | '''Top-k kendall-tau distance.
This module generalise kendall-tau as defined in [1].
It returns a distance: 0 for identical (in the sense of top-k) lists and 1 if completely different.
Example:
Simply call kendall_top_k with two same-length arrays of ratings (or also rankings), length of the top elements k (defau... | 34.212766 | 204 | 0.634639 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,907 | 0.592973 |
aef7c4bd6270658e2d5f6a301a21f1fd8ae19292 | 619 | py | Python | test/math/test_matmul.py | ctgk/bayes | 96eab9305eaeecc5a5b032cdf92a8285de4f60bf | [
"MIT"
] | 21 | 2019-01-08T05:58:41.000Z | 2021-11-26T14:24:11.000Z | test/math/test_matmul.py | ctgk/bayes | 96eab9305eaeecc5a5b032cdf92a8285de4f60bf | [
"MIT"
] | null | null | null | test/math/test_matmul.py | ctgk/bayes | 96eab9305eaeecc5a5b032cdf92a8285de4f60bf | [
"MIT"
] | 11 | 2019-05-04T13:44:19.000Z | 2021-08-05T04:26:19.000Z | import unittest
import numpy as np
import bayesnet as bn
class TestMatMul(unittest.TestCase):
def test_matmul(self):
x = np.random.rand(10, 3)
y = np.random.rand(3, 5)
g = np.random.rand(10, 5)
xp = bn.Parameter(x)
z = xp @ y
self.assertTrue((z.value == x @ y).all(... | 22.925926 | 51 | 0.534733 | 510 | 0.82391 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.016155 |
aef90fca9fea526b2891e7df58b0f264aee383cd | 2,387 | py | Python | test.py | VegaSera/SWNDiscordBot2 | cb73b9d51591b6af9f2a1a603ea0dd8a7161020c | [
"MIT"
] | 2 | 2020-09-08T18:08:55.000Z | 2021-06-22T17:13:32.000Z | test.py | VegaSera/SWNDiscordBot2 | cb73b9d51591b6af9f2a1a603ea0dd8a7161020c | [
"MIT"
] | null | null | null | test.py | VegaSera/SWNDiscordBot2 | cb73b9d51591b6af9f2a1a603ea0dd8a7161020c | [
"MIT"
] | 1 | 2020-06-30T19:12:27.000Z | 2020-06-30T19:12:27.000Z |
class char:
def __init__(self):
self.str = 15
self.dex = 15
self.con = 14
self.wis = 15
self.int = 15
self.cha = 15
def raise_stat(self):
stats = [self.str, self.dex, self.con, self.int, self.wis, self.cha]
min_stat = min(stats)
for ind... | 27.436782 | 105 | 0.492669 | 1,592 | 0.666946 | 0 | 0 | 0 | 0 | 0 | 0 | 1,053 | 0.44114 |
aef99003b57d71ccb53d2879735f4b65ddc02caf | 4,519 | py | Python | modules/friday/loginator.py | roshanmaind/Nico | 5495cf88111403f22e34e3b13badf7535ddd0b4d | [
"MIT"
] | 2 | 2019-03-14T01:06:37.000Z | 2020-06-04T04:35:36.000Z | modules/friday/loginator.py | roshanmaind/Nico | 5495cf88111403f22e34e3b13badf7535ddd0b4d | [
"MIT"
] | null | null | null | modules/friday/loginator.py | roshanmaind/Nico | 5495cf88111403f22e34e3b13badf7535ddd0b4d | [
"MIT"
] | 1 | 2020-02-11T09:54:12.000Z | 2020-02-11T09:54:12.000Z | from kivy.app import App
from kivy.config import Config
Config.set('graphics', 'width', '500')
Config.set('graphics', 'height', '640')
Config.set('graphics', 'resizable', False)
Config.set('kivy','window_icon','data/friday/res/icon.ico')
#from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenMana... | 24.82967 | 106 | 0.652578 | 3,522 | 0.779376 | 0 | 0 | 0 | 0 | 0 | 0 | 789 | 0.174596 |
aefcef00d9aee8a184d745a314bbf87059c90545 | 380 | py | Python | 13-Introduction to Data Visualization with Matplotlib/Chapter_3/05-Adding error-bars to a bar chart.py | Pegasus-01/Data-manipulation-and-merging-with-pandas | 5346678d25820d9fe352bd70294484ecd96fccf7 | [
"Apache-2.0"
] | 1 | 2021-05-08T11:09:27.000Z | 2021-05-08T11:09:27.000Z | 13-Introduction to Data Visualization with Matplotlib/Chapter_3/05-Adding error-bars to a bar chart.py | Pegasus-01/Data-manipulation-and-merging-with-pandas | 5346678d25820d9fe352bd70294484ecd96fccf7 | [
"Apache-2.0"
] | 1 | 2022-03-12T15:42:14.000Z | 2022-03-12T15:42:14.000Z | 13-Introduction to Data Visualization with Matplotlib/Chapter_3/05-Adding error-bars to a bar chart.py | Pegasus-01/Data-manipulation-and-merging-with-pandas | 5346678d25820d9fe352bd70294484ecd96fccf7 | [
"Apache-2.0"
] | 1 | 2021-04-30T18:24:19.000Z | 2021-04-30T18:24:19.000Z | fig, ax = plt.subplots()
# Add a bar for the rowing "Height" column mean/std
ax.bar("Rowing", mens_rowing["Height"].mean(), yerr=mens_rowing["Height"].std())
# Add a bar for the gymnastics "Height" column mean/std
ax.bar("Gymnastics", mens_gymnastics["Height"].mean(), yerr=mens_gymnastics["Height"].std())
# ... | 31.666667 | 93 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 192 | 0.505263 |
aefede202bad9f729cfa7d6d686317776413a990 | 503 | py | Python | itests/pages/role_users.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 58 | 2017-05-26T06:46:24.000Z | 2022-03-25T20:55:51.000Z | itests/pages/role_users.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 74 | 2017-06-16T17:48:37.000Z | 2022-03-28T23:09:54.000Z | itests/pages/role_users.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 43 | 2017-05-20T22:11:51.000Z | 2022-03-25T00:24:56.000Z | from __future__ import annotations
from itests.pages.base import BaseModal, BasePage
class RoleUserViewPage(BasePage):
def click_disable_button(self) -> None:
button = self.find_element_by_id("disable-role-user")
button.click()
def get_disable_modal(self) -> DisableRoleUserModal:
ele... | 26.473684 | 61 | 0.739563 | 411 | 0.817097 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 0.065606 |
aefeff0d7e3ecd3fdcf33e006a4f377fb496e7f7 | 6,141 | py | Python | hybrid/GAN-Sentence/model.py | vishalbelsare/Deep-Learning-Tensorflow | 1590bfc7007aa53aaab72493e7d6f8154f3ec99b | [
"MIT"
] | 51 | 2017-08-04T12:54:49.000Z | 2022-03-04T08:23:46.000Z | hybrid/GAN-Sentence/model.py | Jeansding/Deep-Learning-Tensorflow | 1590bfc7007aa53aaab72493e7d6f8154f3ec99b | [
"MIT"
] | 3 | 2017-09-24T13:44:30.000Z | 2018-12-23T11:43:34.000Z | hybrid/GAN-Sentence/model.py | vishalbelsare/Deep-Learning-Tensorflow | 1590bfc7007aa53aaab72493e7d6f8154f3ec99b | [
"MIT"
] | 45 | 2017-08-04T02:36:32.000Z | 2022-03-04T08:23:50.000Z | import tensorflow as tf
import numpy as np
import parse
def lstm_cell(size_layer, state_is_tuple = True):
return tf.nn.rnn_cell.LSTMCell(size_layer, state_is_tuple = state_is_tuple)
def generate(sess, sequence, noise, model, tag, length_sentence, text_vocab):
sentence_generated = []
onehot = parse.embed_to_onehot(... | 63.309278 | 205 | 0.765511 | 2,284 | 0.371926 | 0 | 0 | 0 | 0 | 0 | 0 | 146 | 0.023775 |
aeffe251e30362d499c33484220e03c6b09531a5 | 987 | py | Python | extracting_information/extract_payments.py | ErikOSorensen/mmrisk_instrument | 3a1bf587ec08362a4c24f8a40064142a5307c94c | [
"BSD-3-Clause"
] | null | null | null | extracting_information/extract_payments.py | ErikOSorensen/mmrisk_instrument | 3a1bf587ec08362a4c24f8a40064142a5307c94c | [
"BSD-3-Clause"
] | null | null | null | extracting_information/extract_payments.py | ErikOSorensen/mmrisk_instrument | 3a1bf587ec08362a4c24f8a40064142a5307c94c | [
"BSD-3-Clause"
] | null | null | null | from mmr2web.models import *
import datetime
def get_payments_file(nok_per_usd=9.1412):
"""Default exchange rate taken from Norges Bank, Nov 22, 2019."""
payments_out = open("payments_mmrisk.csv", "w")
payments_out.write("amount,message\n")
total_payment = 0
for s in Situation.objects.filter(selec... | 37.961538 | 105 | 0.637285 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 326 | 0.330294 |
4e002a3d2a0b17bea2d95b12a32b8e97ea924162 | 1,488 | py | Python | tests/extmod/uasyncio_threadsafeflag.py | ProofDx/micropython | 321d1897c34f16243edf2c94913d7cf877a013d1 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/extmod/uasyncio_threadsafeflag.py | ProofDx/micropython | 321d1897c34f16243edf2c94913d7cf877a013d1 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/extmod/uasyncio_threadsafeflag.py | ProofDx/micropython | 321d1897c34f16243edf2c94913d7cf877a013d1 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | # Test Event class
try:
import uasyncio as asyncio
except ImportError:
print("SKIP")
raise SystemExit
import micropython
try:
micropython.schedule
except AttributeError:
print("SKIP")
raise SystemExit
try:
# Unix port can't select/poll on user-defined types.
import uselect as selec... | 18.6 | 56 | 0.633065 | 0 | 0 | 0 | 0 | 0 | 0 | 912 | 0.612903 | 337 | 0.226478 |
4e00da2e34037c4502cad55e6ab548d6d329f370 | 2,861 | py | Python | tests/TestItemkind.py | ORTECScientificBenchmarks/ortec-scientific-benchmarks-loadbuilding | 8b1f5c58d930448a29195355d28fda856f4705b2 | [
"MIT"
] | 4 | 2018-05-23T22:48:42.000Z | 2020-04-21T10:21:30.000Z | tests/TestItemkind.py | ORTECScientificBenchmarks/ortec-scientific-benchmarks-loadbuilding | 8b1f5c58d930448a29195355d28fda856f4705b2 | [
"MIT"
] | null | null | null | tests/TestItemkind.py | ORTECScientificBenchmarks/ortec-scientific-benchmarks-loadbuilding | 8b1f5c58d930448a29195355d28fda856f4705b2 | [
"MIT"
] | null | null | null | import unittest
from ortec.scientific.benchmarks.loadbuilding.instance.ThreeDitemkind import ThreeDitemkind
class TestItemkind(unittest.TestCase):
def setUp(self):
self.item_kind = ThreeDitemkind()
self.item_kind.id = 1
self.item_kind.quantity = 10
self.item_kind.boundingBox... | 42.073529 | 92 | 0.688221 | 2,637 | 0.921706 | 0 | 0 | 0 | 0 | 0 | 0 | 59 | 0.020622 |
4e02feb6bd33bf7b2f8ebc85d438cb20d237fd9e | 30 | py | Python | blind_blizzards/data/game.py | Starwort/code-jam-5 | c11ab7508ca8c68fe64f33118a3a44956c0a8292 | [
"MIT"
] | null | null | null | blind_blizzards/data/game.py | Starwort/code-jam-5 | c11ab7508ca8c68fe64f33118a3a44956c0a8292 | [
"MIT"
] | null | null | null | blind_blizzards/data/game.py | Starwort/code-jam-5 | c11ab7508ca8c68fe64f33118a3a44956c0a8292 | [
"MIT"
] | 1 | 2019-06-28T21:59:41.000Z | 2019-06-28T21:59:41.000Z | from .structs import GameNode
| 15 | 29 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e031c5ec8a60556bf8f5a17d8935996db1b3e9d | 292 | py | Python | netpen/utils.py | defcronyke/netpen | 66bf5c4401752a6ad9f411f04d88c0189281f8fb | [
"MIT"
] | 27 | 2021-07-13T14:41:59.000Z | 2022-03-19T09:48:50.000Z | netpen/utils.py | defcronyke/netpen | 66bf5c4401752a6ad9f411f04d88c0189281f8fb | [
"MIT"
] | 7 | 2021-07-13T20:12:04.000Z | 2022-02-23T18:16:47.000Z | netpen/utils.py | defcronyke/netpen | 66bf5c4401752a6ad9f411f04d88c0189281f8fb | [
"MIT"
] | 3 | 2021-07-13T15:25:01.000Z | 2021-11-18T09:57:09.000Z | import socket
import ipaddress
def net_family(net):
if isinstance(ipaddress.ip_network(net, strict=False),
ipaddress.IPv6Network):
return socket.AF_INET6
return socket.AF_INET
def flag6(net):
return '-6' if net_family(net) == socket.AF_INET6 else ''
| 20.857143 | 61 | 0.678082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.020548 |
4e039a12924bbf9ee1073f9918fa1b333ccf4193 | 4,370 | py | Python | Python/biopsy/binding_hit.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | Python/biopsy/binding_hit.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | Python/biopsy/binding_hit.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | #
# Copyright John Reid 2006
#
from _biopsy import *
def _hit_str( hit ):
return ",".join( [
hit.binder,
str( hit.location.position ),
str( hit.location.positive_strand ),
str( hit.p_binding )
] )
Hit.__str__ = _hit_str
def _location_start( location ):
re... | 30.774648 | 113 | 0.643936 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,141 | 0.261098 |
4e0443002a9f7388df8a4ecc7a67f5770910ff51 | 8,384 | py | Python | epithet/epithet.py | mitodl/epithet | 4f95054fbdfbae0e9d6db2e3309993d00a8a6867 | [
"MIT"
] | null | null | null | epithet/epithet.py | mitodl/epithet | 4f95054fbdfbae0e9d6db2e3309993d00a8a6867 | [
"MIT"
] | null | null | null | epithet/epithet.py | mitodl/epithet | 4f95054fbdfbae0e9d6db2e3309993d00a8a6867 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
from github import Github
from github.GithubException import RateLimitExceededException
def main():
cli(obj={})
def get_repos(key, org, repo, url):
if url:
g = Github(key, base_url=url)
else:
g = Github(key)
if org:
g_org = g.get_organizat... | 40.699029 | 89 | 0.532085 | 0 | 0 | 0 | 0 | 7,836 | 0.934637 | 0 | 0 | 1,879 | 0.224117 |
4e04cfd6696b1d79b63702e52778fdde33cbdd79 | 1,876 | py | Python | Tarea1/utilities.py | aleluman/CC5114 | aae4ea9faf0a7cb3eb3bf53f8eecaf209aebf4d6 | [
"MIT"
] | null | null | null | Tarea1/utilities.py | aleluman/CC5114 | aae4ea9faf0a7cb3eb3bf53f8eecaf209aebf4d6 | [
"MIT"
] | null | null | null | Tarea1/utilities.py | aleluman/CC5114 | aae4ea9faf0a7cb3eb3bf53f8eecaf209aebf4d6 | [
"MIT"
] | null | null | null | import numpy as np
def normalize(matrix, nh=1, nl=0):
"""Normalizes each column in a matrix by calculating its maximum
and minimum values, the parameters nh and nl specify the final range
of the normalized values"""
return (matrix - matrix.min(0)) * ((nh - nl) / matrix.ptp(0)) + nl
def one_hot_encod... | 39.083333 | 99 | 0.695096 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 774 | 0.41258 |
4e051ec8fbfa4fdbb801b562f9028e2cec2f9219 | 1,304 | py | Python | tests/test_searcher.py | jrdelmar/cbis | 6cce46680555d622ecea88f2ee2721209810abbe | [
"MIT"
] | 1 | 2019-03-19T14:10:19.000Z | 2019-03-19T14:10:19.000Z | tests/test_searcher.py | jrdelmar/cbis | 6cce46680555d622ecea88f2ee2721209810abbe | [
"MIT"
] | 14 | 2020-01-28T22:38:54.000Z | 2022-03-11T23:43:34.000Z | tests/test_searcher.py | jrdelmar/cbis | 6cce46680555d622ecea88f2ee2721209810abbe | [
"MIT"
] | null | null | null | from pyimagesearch.searcher import Searcher
from pyimagesearch.utils import *
import pytest
indexPath = "D:/APP/cbis/"
verbose = True
#test Search class
@pytest.fixture
def searcher():
return Searcher(indexPath, verbose)
pred_file = "D://APP//cbis//tests//out//predictions_test.csv"
top_k = 20
def test_search_g... | 29.636364 | 78 | 0.713957 | 0 | 0 | 0 | 0 | 71 | 0.054448 | 0 | 0 | 196 | 0.150307 |
4e08b9785d412b27c9f6fb1800aa24f2a6fc367a | 9,484 | py | Python | ntfs.py | kartone/INDXRipper | 88e663115b8705b1bb153b28fd74f943c515b9ca | [
"MIT"
] | null | null | null | ntfs.py | kartone/INDXRipper | 88e663115b8705b1bb153b28fd74f943c515b9ca | [
"MIT"
] | null | null | null | ntfs.py | kartone/INDXRipper | 88e663115b8705b1bb153b28fd74f943c515b9ca | [
"MIT"
] | null | null | null | """
Provides functions for working with NTFS volumes
Author: Harel Segev
05/16/2020
"""
from construct import Struct, Padding, Computed, IfThenElse, BytesInteger, Const, Enum, Array, FlagsEnum, Switch, Tell
from construct import PaddedString, Pointer, Seek, Optional, StopIf, RepeatUntil, Padded
fro... | 33.75089 | 119 | 0.690953 | 59 | 0.006221 | 364 | 0.03838 | 0 | 0 | 0 | 0 | 1,716 | 0.180936 |
4e09007daa6d9ebbc5192124ce8ef2f0a488eb4d | 7,130 | py | Python | day24_mzn.py | galleon/adventofcode2021 | 2bf626821d8e2b2278c0009ef4f008433c3c3788 | [
"MIT"
] | null | null | null | day24_mzn.py | galleon/adventofcode2021 | 2bf626821d8e2b2278c0009ef4f008433c3c3788 | [
"MIT"
] | null | null | null | day24_mzn.py | galleon/adventofcode2021 | 2bf626821d8e2b2278c0009ef4f008433c3c3788 | [
"MIT"
] | null | null | null | from ortools.linear_solver import pywraplp
from ortools.sat.python import cp_model
my_program = [
["inp", "w"],
["mul", "x", "0"],
["add", "x", "z"],
["mod", "x", "26"],
["div", "z", "1"],
["add", "x", "12"],
["eql", "x", "w"],
["eql", "x", "0"],
["mul", "y", "0"],
["add", "y", ... | 23.453947 | 88 | 0.274474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,218 | 0.451332 |
4e0c94378cede26866700f316056f4a9b045008f | 486 | py | Python | writer.py | ZitRos/edu-text-analysis | a03f22f9c6e72e4cac4d38b9e963d1554cae35d0 | [
"MIT"
] | 9 | 2017-11-28T22:42:06.000Z | 2021-01-27T05:05:52.000Z | writer.py | ZitRos/edu-text-analysis | a03f22f9c6e72e4cac4d38b9e963d1554cae35d0 | [
"MIT"
] | null | null | null | writer.py | ZitRos/edu-text-analysis | a03f22f9c6e72e4cac4d38b9e963d1554cae35d0 | [
"MIT"
] | 1 | 2022-02-08T21:55:29.000Z | 2022-02-08T21:55:29.000Z | import xlsxwriter
from slugify import slugify
import os
def write_to_xlsx(filename, title="Worksheet", data=None):
directory = os.path.dirname(filename)
if not os.path.exists(directory):
os.makedirs(directory)
workbook = xlsxwriter.Workbook(filename)
worksheet = workbook.add_worksheet(slugify(title)[:28])
row_... | 24.3 | 58 | 0.746914 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0.022634 |
4e0ca604df69608c9b3245228eab46db3a285865 | 4,251 | py | Python | src/4. Ajuste de curvas/Metodos/MC_multilineal.py | thonyblaz/Numerical-Methods | fdeccb9e2eba4a1eb7892ab3a55bd6169c430502 | [
"MIT"
] | 1 | 2021-04-24T20:47:26.000Z | 2021-04-24T20:47:26.000Z | src/4. Ajuste de curvas/Metodos/MC_multilineal.py | Desarrollador2021/Numerical-Methods | fdeccb9e2eba4a1eb7892ab3a55bd6169c430502 | [
"MIT"
] | null | null | null | src/4. Ajuste de curvas/Metodos/MC_multilineal.py | Desarrollador2021/Numerical-Methods | fdeccb9e2eba4a1eb7892ab3a55bd6169c430502 | [
"MIT"
] | 1 | 2021-04-24T20:47:03.000Z | 2021-04-24T20:47:03.000Z |
import numpy as np
def sisEcua(mat_A, mat_B):
a_inv = np.linalg.inv(mat_A)
C = a_inv.dot(mat_B.T)
return C
def matrices(sm, smm, smy, smn, datos, cant_datos):
dimension = datos+1
s = (dimension, dimension)
mat_A = np.zeros(s)
mat_B = np.matrix(smy)
# contadores
n = len(smn)
... | 28.152318 | 71 | 0.584098 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,673 | 0.393554 |
4e0d346534f0cd20c64f85f0fdb70567bfe1e8d7 | 354 | py | Python | Aulas/Aula1_print.py | alessonsousa/Python3 | 49600ff4368f999c0fb608c796e2d11942edf09f | [
"MIT"
] | null | null | null | Aulas/Aula1_print.py | alessonsousa/Python3 | 49600ff4368f999c0fb608c796e2d11942edf09f | [
"MIT"
] | null | null | null | Aulas/Aula1_print.py | alessonsousa/Python3 | 49600ff4368f999c0fb608c796e2d11942edf09f | [
"MIT"
] | null | null | null | #Para mostra qualquer coisa na tela, Você usa o print()
print('Alesson', 'Sousa', sep='_')# O função sep='-' fala para o print o que colocar para separa os nome
print('Alesson', 'Sousa', sep='_', end='\n')#esse end='' é para fala o que vc quer no final da linha do print
#Exemplo
#123.456.789-00
print('123','456','7... | 32.181818 | 109 | 0.652542 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 284 | 0.793296 |
4e0e4eb43146dfe5157fdb0bd9781b0b55961a7f | 232 | py | Python | Day04/file_Closures.py | DongHenry/Py71 | 6e06cc4cda62daecba34ffbea4a8f03590a9098f | [
"MIT"
] | null | null | null | Day04/file_Closures.py | DongHenry/Py71 | 6e06cc4cda62daecba34ffbea4a8f03590a9098f | [
"MIT"
] | null | null | null | Day04/file_Closures.py | DongHenry/Py71 | 6e06cc4cda62daecba34ffbea4a8f03590a9098f | [
"MIT"
] | null | null | null | # 闭包
def func():
a = 1
b = 2
return a + b
def sum(a):
def add(b):
return a + b
return add
# add 函数名或函数的引用
# add() 函数的调用
num1 = func()
num2 = sum(2)
print(num2(5))
print(type(num1))
print(type(num2))
| 10.545455 | 20 | 0.534483 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 64 | 0.242424 |
4e0f55cd3aa79697bce0973576f40551777dd8c0 | 728 | py | Python | liquid/python/tags/inherited.py | pemontto/liquidpy | bf84d631a2ecab0c020ba883bf2a09042715f772 | [
"Apache-2.0"
] | null | null | null | liquid/python/tags/inherited.py | pemontto/liquidpy | bf84d631a2ecab0c020ba883bf2a09042715f772 | [
"Apache-2.0"
] | null | null | null | liquid/python/tags/inherited.py | pemontto/liquidpy | bf84d631a2ecab0c020ba883bf2a09042715f772 | [
"Apache-2.0"
] | null | null | null | """About tags inherited from standard mode
Attributes
BASE_GRAMMAR: The base grammar for python mode
tag_manager: The tag manager for python mode
"""
from pathlib import Path
from ...tags.manager import TagManager as TagManagerStandard
from ...tags.grammar import Grammar
from ...tags.tag import Tag as TagStand... | 29.12 | 78 | 0.741758 | 242 | 0.332418 | 0 | 0 | 0 | 0 | 0 | 0 | 324 | 0.445055 |
4e0fdb2ce2d3bb69607900f9e65b83e79e178cdd | 201 | py | Python | data_loader/__init__.py | kunato/style_swap_tensorflow | ab136c20fa5351852f1f4c986bed5b25eee3b890 | [
"Apache-2.0"
] | null | null | null | data_loader/__init__.py | kunato/style_swap_tensorflow | ab136c20fa5351852f1f4c986bed5b25eee3b890 | [
"Apache-2.0"
] | null | null | null | data_loader/__init__.py | kunato/style_swap_tensorflow | ab136c20fa5351852f1f4c986bed5b25eee3b890 | [
"Apache-2.0"
] | null | null | null | # data_loader
# __init__.py
from data_loader.image_data_loader import ImageDataLoader
from data_loader.coco_data_loader import COCODataLoader
from data_loader.tf_example_loader import TFExampleLoader
| 28.714286 | 57 | 0.885572 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.129353 |
4e10795466a7d1953a59fef51a1851c39d5083a4 | 2,131 | py | Python | cms_articles/migrations/0008_cms_3_4.py | snegovick/django-cms-articles | f7397bd5e303be6ed50bc53b71e27e40f4087f94 | [
"BSD-3-Clause"
] | 9 | 2016-04-18T15:59:50.000Z | 2019-09-12T07:11:15.000Z | cms_articles/migrations/0008_cms_3_4.py | snegovick/django-cms-articles | f7397bd5e303be6ed50bc53b71e27e40f4087f94 | [
"BSD-3-Clause"
] | 6 | 2019-01-22T17:53:48.000Z | 2020-07-19T17:35:31.000Z | cms_articles/migrations/0008_cms_3_4.py | snegovick/django-cms-articles | f7397bd5e303be6ed50bc53b71e27e40f4087f94 | [
"BSD-3-Clause"
] | 4 | 2017-02-10T17:19:30.000Z | 2020-02-02T16:58:20.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2017-02-25 11:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cms_articles', '0007_plugins'),
]
operations = [
... | 46.326087 | 236 | 0.670108 | 1,941 | 0.91084 | 0 | 0 | 0 | 0 | 0 | 0 | 630 | 0.295636 |
4e1250b3a0035feb90528471a9285da3a2f81ada | 1,561 | py | Python | tests/test_torchvision.py | osai-ai/dockai | 61cf10567cced9b8a5af2855ec880e8730532916 | [
"MIT"
] | null | null | null | tests/test_torchvision.py | osai-ai/dockai | 61cf10567cced9b8a5af2855ec880e8730532916 | [
"MIT"
] | null | null | null | tests/test_torchvision.py | osai-ai/dockai | 61cf10567cced9b8a5af2855ec880e8730532916 | [
"MIT"
] | null | null | null | from time import sleep
import pytest
import torch
from torchvision.ops import roi_align
class TestTorchvision:
@pytest.fixture(scope="class", params=[3, 17])
def num_points(self, request):
return request.param
@pytest.fixture(scope="class", params=[10, 64])
def width(self, request):
... | 31.857143 | 95 | 0.647662 | 1,469 | 0.941063 | 0 | 0 | 1,405 | 0.900064 | 0 | 0 | 62 | 0.039718 |
4e14a820dce8b0c05972db39e72bc127d5d06743 | 3,550 | py | Python | vcf_reader.py | ZhiGroup/ROH-DICE | 5a2edfd04e285fe1f40bb199117c03a33b176984 | [
"MIT"
] | 1 | 2021-09-01T15:46:26.000Z | 2021-09-01T15:46:26.000Z | vcf_reader.py | ZhiGroup/ROH-DICE | 5a2edfd04e285fe1f40bb199117c03a33b176984 | [
"MIT"
] | 1 | 2021-05-21T13:13:55.000Z | 2021-05-25T17:56:06.000Z | vcf_reader.py | ZhiGroup/ROH-DICE | 5a2edfd04e285fe1f40bb199117c03a33b176984 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# Created By : Ardalan Naseri
# Created Date: Mon September 21 2020
# =============================================================================
"""The module is a VCF reader to parse input... | 31.415929 | 117 | 0.468169 | 2,735 | 0.770423 | 0 | 0 | 0 | 0 | 0 | 0 | 384 | 0.108169 |
4e15463f1bd86c58fab84d9a5933a630bf1642d9 | 899 | py | Python | linux/.config/qtile/lib/layouts.py | joserc87/config-files | ca90f1591d249ac39abb946d169654a7c3346833 | [
"MIT"
] | null | null | null | linux/.config/qtile/lib/layouts.py | joserc87/config-files | ca90f1591d249ac39abb946d169654a7c3346833 | [
"MIT"
] | null | null | null | linux/.config/qtile/lib/layouts.py | joserc87/config-files | ca90f1591d249ac39abb946d169654a7c3346833 | [
"MIT"
] | null | null | null | """
Layout definitions
"""
from libqtile import layout
from .settings import COLS
from libqtile.config import Match
_layout_common_settings = dict(
border_focus=COLS['purple_4'],
border_normal=COLS['dark_1'],
single_border_width=0,
)
_max_layout_settings = {
**_layout_common_settings,
"border_focu... | 26.441176 | 77 | 0.724138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 288 | 0.320356 |
4e15597d3a91189d8d9a4e8575fb172c9d0972ad | 2,865 | py | Python | neighbor/tests.py | Elianehbmna/Neighborhood | 3e684fe813904f10fca7f3ea8c71adb1f2bc6a3d | [
"MIT"
] | null | null | null | neighbor/tests.py | Elianehbmna/Neighborhood | 3e684fe813904f10fca7f3ea8c71adb1f2bc6a3d | [
"MIT"
] | 5 | 2020-02-12T03:17:58.000Z | 2021-09-08T01:23:33.000Z | neighbor/tests.py | Elianehbmna/Neighbourhood | 3e684fe813904f10fca7f3ea8c71adb1f2bc6a3d | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth.models import User
from .models import Profile, Neighbourhood, Post, Business
# Create your tests here.
class ProfileTestClass(TestCase):
'''
Test case for the Profile class
'''
def setUp(self):
'''
Method that creates an inst... | 26.045455 | 89 | 0.622339 | 2,684 | 0.936824 | 0 | 0 | 0 | 0 | 0 | 0 | 1,093 | 0.381501 |
4e15cecc08b1cde9ac107937e12fe6ec9240cb6d | 190 | py | Python | api/suids/urls.py | CenterForOpenScience/SHARE | c7715af2881f6fa23197d4e7c381d90169a90ed1 | [
"Apache-2.0"
] | 87 | 2015-01-06T18:24:45.000Z | 2021-08-08T07:59:40.000Z | api/suids/urls.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 442 | 2015-01-01T19:16:01.000Z | 2022-03-30T21:10:26.000Z | api/suids/urls.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 67 | 2015-03-10T16:32:58.000Z | 2021-11-12T16:33:41.000Z | from rest_framework.routers import SimpleRouter
from api.suids import views
router = SimpleRouter()
router.register(r'suids', views.SuidViewSet, basename='suid')
urlpatterns = router.urls
| 23.75 | 61 | 0.805263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.073684 |
4e1a4e1f3d76e5fdbb618878f0f9c68ef36c94ef | 13,944 | py | Python | src/flintfiller/dataframe_to_frame_parser.py | discipl/flintfiller | 15d220c980a962ac2c4b7ac232f091666ab24e66 | [
"Apache-2.0"
] | null | null | null | src/flintfiller/dataframe_to_frame_parser.py | discipl/flintfiller | 15d220c980a962ac2c4b7ac232f091666ab24e66 | [
"Apache-2.0"
] | null | null | null | src/flintfiller/dataframe_to_frame_parser.py | discipl/flintfiller | 15d220c980a962ac2c4b7ac232f091666ab24e66 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2020 Nederlandse Organisatie voor Toegepast Natuur-
wetenschappelijk Onderzoek TNO / TNO, Netherlands Organisation for
applied scientific research
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You... | 41.748503 | 118 | 0.590863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,869 | 0.492613 |
4e1a546f6ea25dfb6456e34048120a18e209eaa0 | 208 | py | Python | celery_task/__init__.py | yougaUsth/simple-celery | 08ecf86933507dee79429f6e906c7d2eb799856c | [
"MIT"
] | null | null | null | celery_task/__init__.py | yougaUsth/simple-celery | 08ecf86933507dee79429f6e906c7d2eb799856c | [
"MIT"
] | null | null | null | celery_task/__init__.py | yougaUsth/simple-celery | 08ecf86933507dee79429f6e906c7d2eb799856c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from celery import Celery, platforms
app = Celery("task")
app.config_from_object('celery_task.celery_config')
platforms.C_FORCE_ROOT = True
| 18.909091 | 51 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 56 | 0.269231 |
4e1b7e1efb40a138e872299167e3dc139051bf3e | 4,677 | py | Python | tools/webcam/webcam_apis/nodes/mmdet_node.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | tools/webcam/webcam_apis/nodes/mmdet_node.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | tools/webcam/webcam_apis/nodes/mmdet_node.py | pallgeuer/mmpose | d3c17d5e6bdb9dbaca19f3bf53aa2802105355fd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from typing import List, Optional, Union
import numpy as np
from .builder import NODES
from .node import MultiInputNode, Node
try:
from mmdet.apis import inference_detector, init_detector
has_mmdet = True
except (ImportError, ModuleNotFoundError):
has_mmdet... | 32.034247 | 79 | 0.584135 | 4,292 | 0.917682 | 0 | 0 | 4,342 | 0.928373 | 0 | 0 | 698 | 0.149241 |
4e1e6490f04076ef930623904d9e0fdabc66c26f | 1,325 | py | Python | gryphon/fsm/machine.py | vittorfp/labskit_cli | 28e109b4a9f36a03d499eb953e04a4fb787632fe | [
"MIT"
] | null | null | null | gryphon/fsm/machine.py | vittorfp/labskit_cli | 28e109b4a9f36a03d499eb953e04a4fb787632fe | [
"MIT"
] | 1 | 2022-03-08T14:54:26.000Z | 2022-03-08T15:02:52.000Z | gryphon/fsm/machine.py | vittorfp/labskit_cli | 28e109b4a9f36a03d499eb953e04a4fb787632fe | [
"MIT"
] | null | null | null |
class HaltSignal(Exception):
def __init__(self):
super().__init__()
class Machine:
def __init__(self, initial_state, possible_states):
self.history = [initial_state.name]
self.possible_states = possible_states
self.current_state = initial_state
def find_state_by_name(se... | 29.444444 | 87 | 0.636226 | 1,319 | 0.995472 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 0.041509 |
4e1ef7bc29a97c874523d2f21ef24ab69fc641da | 708 | py | Python | cursos_complementarios/estructuras_datos_lineales_python/modulo_II_arrays/utils/cube.py | EdinsonRequena/articicial-inteligence-and-data-science | 953566220e64cbd8f732c2667b818da807bb54c0 | [
"MIT"
] | 30 | 2020-06-19T16:21:04.000Z | 2022-02-19T01:48:39.000Z | cursos_complementarios/estructuras_datos_lineales_python/modulo_II_arrays/utils/cube.py | Samsuesca/articicial-inteligence-and-data-science | 953566220e64cbd8f732c2667b818da807bb54c0 | [
"MIT"
] | 87 | 2021-02-12T04:42:13.000Z | 2021-09-20T04:25:29.000Z | cursos_complementarios/estructuras_datos_lineales_python/modulo_II_arrays/utils/cube.py | Samsuesca/articicial-inteligence-and-data-science | 953566220e64cbd8f732c2667b818da807bb54c0 | [
"MIT"
] | 11 | 2020-08-13T04:04:01.000Z | 2022-01-20T20:10:43.000Z |
from .array import Array
from .grid import Grid
class Cube(object):
"""three-dimensional array"""
def __init__(self, nrows, ncols, deep, value=None) -> None:
"""Initializes the Cube with nrows, ncols, deep and optional value"""
self.data = Array(deep)
for i in range(deep):
... | 27.230769 | 77 | 0.574859 | 656 | 0.926554 | 0 | 0 | 0 | 0 | 0 | 0 | 164 | 0.231638 |
4e210c17ece556dcd920b2bb641d6a18a1587dc6 | 8,015 | py | Python | testing/plugin_instance_tests.py | nanome-ai/nanome-plugin-api | f2ce6a5e3123ee7449a90c2659f3891124289f4a | [
"MIT"
] | 1 | 2020-04-10T09:47:54.000Z | 2020-04-10T09:47:54.000Z | testing/plugin_instance_tests.py | nanome-ai/nanome-plugin-api | f2ce6a5e3123ee7449a90c2659f3891124289f4a | [
"MIT"
] | 10 | 2019-05-30T18:29:10.000Z | 2020-02-15T02:16:42.000Z | testing/plugin_instance_tests.py | nanome-ai/nanome-plugin-api | f2ce6a5e3123ee7449a90c2659f3891124289f4a | [
"MIT"
] | 2 | 2020-02-04T02:56:21.000Z | 2020-04-25T20:05:16.000Z | import os
import sys
import unittest
import uuid
from nanome import PluginInstance
from nanome.api.plugin_instance import _DefaultPlugin
from nanome.api import structure, ui
from nanome.util import enums, Vector3, Quaternion, config
if sys.version_info.major >= 3:
from unittest.mock import MagicMock
e... | 35.464602 | 92 | 0.684841 | 7,581 | 0.945852 | 0 | 0 | 0 | 0 | 0 | 0 | 484 | 0.060387 |
4e21313453a76bb801fcf7c786e4c9fa435345a5 | 3,175 | py | Python | tests/test_bandits.py | tmcclintock/MultiArmedBandits | bb3214a5687c750ef86f02d6f6e84a4b73d58dcf | [
"MIT"
] | null | null | null | tests/test_bandits.py | tmcclintock/MultiArmedBandits | bb3214a5687c750ef86f02d6f6e84a4b73d58dcf | [
"MIT"
] | 1 | 2020-07-27T00:51:41.000Z | 2020-07-27T00:51:41.000Z | tests/test_bandits.py | tmcclintock/MultiArmedBandits | bb3214a5687c750ef86f02d6f6e84a4b73d58dcf | [
"MIT"
] | null | null | null | """
Tests of bandits.
"""
import numpy as np
import pytest
from unittest import TestCase
from bandit.bandit import (
CustomBandit,
EpsGreedyBandit,
GreedyBandit,
RandomBandit,
)
from bandit.environment import Environment
from bandit.reward import GaussianReward
class BanditTestCase(TestCase):
de... | 29.12844 | 68 | 0.605669 | 2,880 | 0.907087 | 0 | 0 | 0 | 0 | 0 | 0 | 68 | 0.021417 |
4e23be7cefc4b12688cd6b844ea628c44fb0147c | 265 | py | Python | src/parsimony/__init__.py | ryanfeather/parsimony | 0d3bbe247b47234a0c15962e538b2f04609c4a33 | [
"MIT"
] | 1 | 2018-07-02T11:08:29.000Z | 2018-07-02T11:08:29.000Z | src/parsimony/__init__.py | ryanfeather/parsimony | 0d3bbe247b47234a0c15962e538b2f04609c4a33 | [
"MIT"
] | 5 | 2015-03-19T13:29:29.000Z | 2015-04-04T19:47:01.000Z | src/parsimony/__init__.py | ryanfeather/parsimony | 0d3bbe247b47234a0c15962e538b2f04609c4a33 | [
"MIT"
] | null | null | null | from .release import __version__
from .generate import generate, mark_dirty, dirty, clean
from .exceptions import ParsimonyException
from . import generators
from . import configuration
from . import persistence
from .defaults import set_defaults
set_defaults() | 22.083333 | 56 | 0.822642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e269250407fa19774fcf1e0e1854392032b9961 | 569 | py | Python | pyrecard/subscription/plan.py | DiegoMagg/pyrecard | 4a7adc0342703b4eae6c42eabd2f7cd5e1a4d10f | [
"MIT"
] | 6 | 2020-09-03T12:56:49.000Z | 2020-09-03T13:28:31.000Z | pyrecard/subscription/plan.py | DiegoMagg/pyrecard | 4a7adc0342703b4eae6c42eabd2f7cd5e1a4d10f | [
"MIT"
] | 4 | 2020-08-25T15:28:54.000Z | 2020-08-31T17:08:13.000Z | pyrecard/subscription/plan.py | DiegoMagg/pyrecard | 4a7adc0342703b4eae6c42eabd2f7cd5e1a4d10f | [
"MIT"
] | null | null | null | from pyrecard.utils.pyrequest import pyrequest
PLAN_PATH = '/assinaturas/v1/plans'
def create(json):
return pyrequest('POST', PLAN_PATH, json)
def alter(plan_code, json):
return pyrequest('PUT', f'{PLAN_PATH}/{plan_code}', json)
def activate(plan_code):
return pyrequest('PUT', f'{PLAN_PATH}/{plan_co... | 19.62069 | 66 | 0.706503 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 178 | 0.31283 |
4e26c8f3d5348e863a10d16b62007dbfcaa204c5 | 1,126 | py | Python | setup.py | TimSusa/aptly-api-cli | 011ba8e7f464726b336b53f6b2cbdc4490b5180c | [
"MIT"
] | 17 | 2016-03-15T10:07:27.000Z | 2022-03-07T17:55:01.000Z | setup.py | TimSusa/aptly-api-cli | 011ba8e7f464726b336b53f6b2cbdc4490b5180c | [
"MIT"
] | 2 | 2016-03-15T12:50:58.000Z | 2018-04-17T03:45:17.000Z | setup.py | TimSusa/aptly-api-cli | 011ba8e7f464726b336b53f6b2cbdc4490b5180c | [
"MIT"
] | 5 | 2017-05-07T20:01:49.000Z | 2018-06-06T13:43:02.000Z | try:
from setuptools import setup, find_packages
from pkg_resources import Requirement, resource_filename
except ImportError:
from distutils.core import setup, find_packages
setup(
name='Aptly-Api-Cli',
version='0.1',
url='https://github.com/TimSusa/aptly_api_cli',
license='MIT',
keywor... | 33.117647 | 107 | 0.667851 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 575 | 0.510657 |
4e27d12ca0167eeef14eeab8dc9bfe483d5dc2db | 417 | py | Python | 2018-04/2018-04-11.py | shangpf1/python_study | 6730519ce7b5cf4612e1c778ae5876cfbb748a4f | [
"MIT"
] | null | null | null | 2018-04/2018-04-11.py | shangpf1/python_study | 6730519ce7b5cf4612e1c778ae5876cfbb748a4f | [
"MIT"
] | null | null | null | 2018-04/2018-04-11.py | shangpf1/python_study | 6730519ce7b5cf4612e1c778ae5876cfbb748a4f | [
"MIT"
] | null | null | null |
class Employee:
def __init__(self,first,last,pay):
self.first = first
self.last = last
self.email = first+last+'@123.com'
self.pay = pay
def fullname(self):
return('{} {}'.format(self.first,self.last))
emp_1 = Employee('hello','world',1900)
emp_2 = Employee(... | 18.130435 | 52 | 0.606715 | 261 | 0.625899 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.105516 |
4e28e3321377547a62600b472fa76b37318df52d | 37,697 | py | Python | instances/passenger_demand/pas-20210421-2109-int1/68.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int1/68.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int1/68.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 2290
passenger_arriving = (
(0, 5, 9, 3, 0, 0, 3, 7, 5, 2, 1, 0), # 0
(2, 4, 10, 6, 0, 0, 2, 3, 4, 2, 4, 0), # 1
(4, 9, 7, 4, 2, 0, 4, 5, 7, 4, 6, 0), # 2
(9, 9, 6, 4, 1, 0, 9, 8, 2, 5, 3, 0), # 3
(4, 6, 4, 8, 2, 0, 5, 6, 7, 3, 3, 0), # 4
(4, 3, 5, 3, 1, 0, 5, 8, 2, 2, 0... | 112.528358 | 215 | 0.727724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,638 | 0.043452 |
4e298d0ad6de43261aab1a6d6e7529e6494b22c8 | 658 | py | Python | src/heatmap.py | JsPatenaude/INF8808_projet | 601a7505188f379365a32594b484cee3d924a52a | [
"MIT"
] | null | null | null | src/heatmap.py | JsPatenaude/INF8808_projet | 601a7505188f379365a32594b484cee3d924a52a | [
"MIT"
] | null | null | null | src/heatmap.py | JsPatenaude/INF8808_projet | 601a7505188f379365a32594b484cee3d924a52a | [
"MIT"
] | null | null | null | import plotly.express as px
from preprocess import PreprocessHeatmap
def get_figure(df):
pp = PreprocessHeatmap()
heatmap_df = pp.preprocess_heatmap(df)
hover_template = \
'''
<b style="font-size: 20px;>%{x}, %{y}h00</b>
<br>
<span style="font-size: 16px;>%{z:.0f} likes générés</span>
... | 26.32 | 63 | 0.62766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 228 | 0.344411 |
4e2a78cc73dc66dd46aa1290d150d2b082861993 | 13,985 | py | Python | client/forumgame.py | codingforhelp/fbserv | b09cc2ce20eaa3714e80d23e0f5741f144d2eed2 | [
"MIT"
] | 5 | 2019-01-31T08:09:53.000Z | 2020-04-13T22:48:25.000Z | client/forumgame.py | codingforhelp/fbserv | b09cc2ce20eaa3714e80d23e0f5741f144d2eed2 | [
"MIT"
] | 2 | 2021-04-30T21:04:37.000Z | 2021-06-01T23:42:18.000Z | client/forumgame.py | codingforhelp/fbserv | b09cc2ce20eaa3714e80d23e0f5741f144d2eed2 | [
"MIT"
] | 3 | 2019-08-04T07:51:58.000Z | 2022-02-25T13:39:30.000Z | from dom import e, Div, TextInput, Button, TextArea
from basicboard import BasicBoard
from connection import getconn
from utils import queryparams, random, setseed
mainseed = 80
class Forumnode(e):
def __init__(self, root, args = {}):
super().__init__("div")
self.root = root
... | 36.609948 | 125 | 0.512835 | 13,803 | 0.986986 | 0 | 0 | 0 | 0 | 0 | 0 | 1,769 | 0.126493 |
4e2aa357eb6cd6758da7f0deccc68b00c56538d5 | 1,783 | py | Python | utest/test_detect_file_order.py | fanfank/timecat | 6488771d781489ea03d3490e55050a18522c8bd1 | [
"MIT"
] | 69 | 2016-01-08T03:23:57.000Z | 2021-05-06T03:14:10.000Z | utest/test_detect_file_order.py | fanfank/timecat | 6488771d781489ea03d3490e55050a18522c8bd1 | [
"MIT"
] | 1 | 2016-10-20T17:08:58.000Z | 2016-10-20T17:08:58.000Z | utest/test_detect_file_order.py | fanfank/timecat | 6488771d781489ea03d3490e55050a18522c8bd1 | [
"MIT"
] | 10 | 2016-01-15T14:30:29.000Z | 2020-09-24T02:42:14.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from include import *
from timecat import detect_file_format
from timecat import detect_datetime_format
case_num = 0
def dofo(f, start, end, regex_format_info):
global case_num
case_num += 1
print("case {}".format(case_num))
res = detect_file_format(f, start, ... | 32.418182 | 84 | 0.63152 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 566 | 0.317443 |
4e2c40a662d4bfc0d9d63abeff78cd1610530203 | 1,642 | py | Python | Downey2012a_exes/cap02/cookie2.py | crisgc/mab719 | 0514efdd4db649f472771e6f16df9a5611ed7db9 | [
"MIT"
] | null | null | null | Downey2012a_exes/cap02/cookie2.py | crisgc/mab719 | 0514efdd4db649f472771e6f16df9a5611ed7db9 | [
"MIT"
] | null | null | null | Downey2012a_exes/cap02/cookie2.py | crisgc/mab719 | 0514efdd4db649f472771e6f16df9a5611ed7db9 | [
"MIT"
] | null | null | null | """This file contains code for use with "Think Bayes",
by Allen B. Downey, available from greenteapress.com
Copyright 2012 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from thinkbayes import Pmf
from bowl import Bowl
class Cookie(Pmf):
"""A map from string bowl ID to probablity."""... | 23.457143 | 67 | 0.574909 | 1,058 | 0.644336 | 0 | 0 | 0 | 0 | 0 | 0 | 663 | 0.403776 |
4e2ce6d71349214a1161e5b470a89bc7da49773f | 6,513 | py | Python | tests/mathbot_tests.py | RubyMarsden/Crayfish | 33bbb1248beec2fc40eee59e462711dd8cbc33da | [
"MIT"
] | null | null | null | tests/mathbot_tests.py | RubyMarsden/Crayfish | 33bbb1248beec2fc40eee59e462711dd8cbc33da | [
"MIT"
] | 8 | 2021-03-19T06:35:48.000Z | 2021-03-31T14:23:24.000Z | tests/mathbot_tests.py | RubyMarsden/Crayfish | 33bbb1248beec2fc40eee59e462711dd8cbc33da | [
"MIT"
] | null | null | null | import unittest
from models import settings
from models.mathbot import *
from models.settings import U238_DECAY_CONSTANT, U238_DECAY_CONSTANT_ERROR, TH232_DECAY_CONSTANT, \
TH232_DECAY_CONSTANT_ERROR
class MathbotTests(unittest.TestCase):
########################################
### Outlier resistant me... | 40.453416 | 111 | 0.634423 | 6,256 | 0.96054 | 0 | 0 | 0 | 0 | 0 | 0 | 591 | 0.090742 |
4e2d4927d418a10f01fca137a00d8c7a207d49a7 | 2,748 | py | Python | flask_modular_auth/manager.py | fabian-rump/flask_modular_auth | 509def7b2cb366cba5d0d18187d99932c8ca00ef | [
"MIT"
] | null | null | null | flask_modular_auth/manager.py | fabian-rump/flask_modular_auth | 509def7b2cb366cba5d0d18187d99932c8ca00ef | [
"MIT"
] | null | null | null | flask_modular_auth/manager.py | fabian-rump/flask_modular_auth | 509def7b2cb366cba5d0d18187d99932c8ca00ef | [
"MIT"
] | null | null | null | from .abstract import AbstractAuthProvider, AbstractUnauthenticatedEntity
from .utils import _context_processor
from flask import _request_ctx_stack, has_request_context
class AuthManager:
def __init__(self, app=None, unauthorized_callback=None, unauthenticated_entity_class=None):
self._auth_providers = [... | 42.9375 | 157 | 0.71361 | 2,575 | 0.937045 | 0 | 0 | 0 | 0 | 0 | 0 | 673 | 0.244905 |
4e2febb20e4d67a6dafa8818361872984d650fb8 | 1,659 | py | Python | tests/test_decorators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_decorators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | tests/test_decorators.py | markin/elmo-alerting | 7562f8f05acbe9632a2e6c19da72d15c571b9e75 | [
"BSD-3-Clause"
] | null | null | null | from threading import Lock
import pytest
from elmo.api.decorators import require_lock, require_session
from elmo.api.exceptions import LockNotAcquired, PermissionDenied
def test_require_session_present():
"""Should succeed if a session ID is available."""
class TestClient(object):
def __init__(self... | 22.418919 | 65 | 0.615431 | 772 | 0.465341 | 0 | 0 | 250 | 0.150693 | 0 | 0 | 290 | 0.174804 |
4e30d02b5676aa65a9e86f44cc1848fd4a7d7bb2 | 13,400 | py | Python | models/iscnet/modules/relation_model.py | blakeyy/Relational-RfDNet | 72f4e35601e963c91515f40707174c0d79cb5403 | [
"MIT"
] | 1 | 2022-03-31T13:00:15.000Z | 2022-03-31T13:00:15.000Z | models/iscnet/modules/relation_model.py | blakeyy/Relational-RfDNet | 72f4e35601e963c91515f40707174c0d79cb5403 | [
"MIT"
] | null | null | null | models/iscnet/modules/relation_model.py | blakeyy/Relational-RfDNet | 72f4e35601e963c91515f40707174c0d79cb5403 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from net_utils.nn_distance import nn_distance
from net_utils.relation_tool import PositionalEmbedding
from models.registers import MODULES
from models.iscnet.modules.proposal_module import decode_scores
from configs.scannet_config... | 47.51773 | 172 | 0.592313 | 12,683 | 0.946493 | 0 | 0 | 10,414 | 0.777164 | 0 | 0 | 4,518 | 0.337164 |
4e3154ae1d10762e4681a612915a4720d50696c7 | 1,760 | py | Python | ipware/descriptor.py | phi1010/django-ipware | 9d4e5f3b17e8669757ea9590e3e02580bd310634 | [
"MIT"
] | null | null | null | ipware/descriptor.py | phi1010/django-ipware | 9d4e5f3b17e8669757ea9590e3e02580bd310634 | [
"MIT"
] | null | null | null | ipware/descriptor.py | phi1010/django-ipware | 9d4e5f3b17e8669757ea9590e3e02580bd310634 | [
"MIT"
] | null | null | null | from enum import Enum, auto
from typing import List, Union, Callable
from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network, ip_network, ip_address
from warnings import warn
class Order(Enum):
HEADER_APPENDED = auto()
HEADER_PREPENDED = auto()
class Header:
def __init__(self,
... | 38.26087 | 116 | 0.651136 | 1,559 | 0.885795 | 0 | 0 | 0 | 0 | 0 | 0 | 646 | 0.367045 |
4e31ecc86ddefaf67265db380dc7eba40617c43e | 2,333 | py | Python | locs/models/anisotropic_filter.py | mkofinas/locs | 4cb0ab9e989ebfee42d1d2850bdf3360336b5c1c | [
"MIT"
] | 16 | 2021-11-04T07:57:58.000Z | 2022-03-01T17:45:32.000Z | locs/models/anisotropic_filter.py | mkofinas/locs | 4cb0ab9e989ebfee42d1d2850bdf3360336b5c1c | [
"MIT"
] | null | null | null | locs/models/anisotropic_filter.py | mkofinas/locs | 4cb0ab9e989ebfee42d1d2850bdf3360336b5c1c | [
"MIT"
] | null | null | null | from torch import nn
import torch.nn.functional as F
from locs.models.activations import ACTIVATIONS
class AnisotropicEdgeFilter(nn.Module):
def __init__(self, in_size, pos_size, hidden_size, dummy_size, out_size,
act='elu', **kwargs):
super().__init__()
self.num_relative_feature... | 35.348485 | 77 | 0.629233 | 2,225 | 0.953708 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.034719 |
4e32180523c62ff4dfee0a5445151998ee1a7804 | 1,798 | py | Python | src/data_files/sample_data.py | gorried/hexgraph | b179e2fe0f8afc465ce92eac02f3cc2c4d1ac38e | [
"MIT"
] | null | null | null | src/data_files/sample_data.py | gorried/hexgraph | b179e2fe0f8afc465ce92eac02f3cc2c4d1ac38e | [
"MIT"
] | null | null | null | src/data_files/sample_data.py | gorried/hexgraph | b179e2fe0f8afc465ce92eac02f3cc2c4d1ac38e | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""
Daniel Gorrie
Large dataset sampler
"""
import random
import os
from os import listdir
from os.path import isfile, join
# Constants
INPUT_FILE = 'train.features'
INPUT_FILE_SIZE = 8352136
OUTPUT_FILE = 'train_small.features'
SAMPLE_SIZE = 110000
INPUT_LABEL_DIR = 'labels/'
OUTPUT_LABEL_DIR... | 24.630137 | 94 | 0.613459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 489 | 0.271969 |
4e323ee929773b5d99e66e15ebdc6631d0480bf5 | 1,581 | py | Python | utils/uniprot.py | glycosciences/covid-19-Annotations-on-Structures | 3337bc5aec0ba79287ab0fd8c4763b15a4783378 | [
"MIT"
] | 2 | 2020-04-06T18:12:47.000Z | 2021-08-01T20:17:59.000Z | utils/uniprot.py | glycosciences/covid-19-Annotations-on-Structures | 3337bc5aec0ba79287ab0fd8c4763b15a4783378 | [
"MIT"
] | 20 | 2020-04-02T18:02:14.000Z | 2020-08-10T12:29:46.000Z | utils/uniprot.py | glycosciences/covid-19-Annotations-on-Structures | 3337bc5aec0ba79287ab0fd8c4763b15a4783378 | [
"MIT"
] | 9 | 2020-04-06T12:39:02.000Z | 2021-08-01T20:18:00.000Z | import re
import urllib.request
"""
Collection of handy functions related to uniprot. Potential reimplementations
of code that would be available in various packages with the goal of keeping
dependencies at a minimum.
"""
def valid_uniprot_ac_pattern(uniprot_ac):
"""
Checks whether Uniprot AC is formally cor... | 29.830189 | 85 | 0.655281 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 881 | 0.557242 |
4e363f620d0dd72062004bc406ce4122903589f9 | 7,414 | py | Python | socialdistribution/api/adapters.py | CMPUT404-F21T0/CMPUT404-Project-BetterSocial | 04a621915108a434d50e900165cefdb0d4cca45c | [
"Apache-2.0"
] | null | null | null | socialdistribution/api/adapters.py | CMPUT404-F21T0/CMPUT404-Project-BetterSocial | 04a621915108a434d50e900165cefdb0d4cca45c | [
"Apache-2.0"
] | 2 | 2021-10-29T20:18:57.000Z | 2021-12-04T14:57:34.000Z | socialdistribution/api/adapters.py | CMPUT404-F21T0/CMPUT404-Project-BetterSocial | 04a621915108a434d50e900165cefdb0d4cca45c | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Union, Optional
from uuid import UUID
import requests
from requests.auth import HTTPBasicAuth
from yarl import URL
class BaseAdapter:
"""Default handlers for a given node connection. Methods should be overridden for each team, as needed."""
def __init__(self) -> None:
super(... | 37.256281 | 128 | 0.626652 | 7,020 | 0.946857 | 0 | 0 | 0 | 0 | 0 | 0 | 527 | 0.071082 |
4e375905fd80fe7f68027a1624911d3d06a78ce6 | 2,672 | py | Python | src/getFrustum.py | asr-ros/asr_resources_for_active_scene_recognition | dd402ea95fd877769f12e572cad85385e4ebe5b3 | [
"BSD-3-Clause"
] | null | null | null | src/getFrustum.py | asr-ros/asr_resources_for_active_scene_recognition | dd402ea95fd877769f12e572cad85385e4ebe5b3 | [
"BSD-3-Clause"
] | null | null | null | src/getFrustum.py | asr-ros/asr_resources_for_active_scene_recognition | dd402ea95fd877769f12e572cad85385e4ebe5b3 | [
"BSD-3-Clause"
] | 2 | 2017-03-03T16:59:55.000Z | 2019-12-06T12:10:33.000Z | #!/usr/bin/env python
'''
Copyright (c) 2016, Allgeyer Tobias, Aumann Florian, Borella Jocelyn, Karrenbauer Oliver, Marek Felix, Meissner Pascal, Stroh Daniel, Trautmann Jeremias
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the follo... | 54.530612 | 755 | 0.791542 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,883 | 0.704716 |
4e3a67bc274883baf27d3e4d3e4ad196d7ddbc63 | 33 | py | Python | iturmas/decorators/__init__.py | daniel-ufabc/match-classes | 2783cdf1c7363fcc14023a6cacad697b6af0f011 | [
"MIT"
] | null | null | null | iturmas/decorators/__init__.py | daniel-ufabc/match-classes | 2783cdf1c7363fcc14023a6cacad697b6af0f011 | [
"MIT"
] | null | null | null | iturmas/decorators/__init__.py | daniel-ufabc/match-classes | 2783cdf1c7363fcc14023a6cacad697b6af0f011 | [
"MIT"
] | null | null | null | from .auth import login_required
| 16.5 | 32 | 0.848485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e3b40be7c29c65a9fd22f72903754a1e504955c | 5,643 | py | Python | structures/solution/bar.py | EladSharony/Mechanics | 078f97bea84114fc1db6fe9700b92b96b18a0d5e | [
"MIT"
] | 24 | 2021-02-23T13:53:14.000Z | 2022-03-29T16:40:56.000Z | structures/solution/bar.py | EladSharony/Mechanics | 078f97bea84114fc1db6fe9700b92b96b18a0d5e | [
"MIT"
] | 2 | 2021-04-23T12:30:32.000Z | 2022-03-31T10:51:12.000Z | structures/solution/bar.py | EladSharony/Mechanics | 078f97bea84114fc1db6fe9700b92b96b18a0d5e | [
"MIT"
] | 12 | 2021-04-11T20:44:03.000Z | 2022-03-30T19:23:58.000Z | from geom2d import Segment, make_vector_between
from structures.model.bar import StrBar
from .node import StrNodeSolution
class StrBarSolution:
"""
A truss structure bar with the solution values included.
This class is a decorator of the original `StrBar` class that's
linked to the solution nodes, th... | 28.356784 | 67 | 0.608187 | 5,518 | 0.977849 | 0 | 0 | 2,774 | 0.491582 | 0 | 0 | 2,951 | 0.522949 |
4e3d4fa1300fa48573b88c6315f270637f616d76 | 1,631 | py | Python | tests/test_res_check_metaclass.py | misaki-sugiyama/unladen-chant | 28ac51ed9ef6eba8da8b5dafd13cf3abc1e63d5c | [
"Apache-2.0"
] | null | null | null | tests/test_res_check_metaclass.py | misaki-sugiyama/unladen-chant | 28ac51ed9ef6eba8da8b5dafd13cf3abc1e63d5c | [
"Apache-2.0"
] | null | null | null | tests/test_res_check_metaclass.py | misaki-sugiyama/unladen-chant | 28ac51ed9ef6eba8da8b5dafd13cf3abc1e63d5c | [
"Apache-2.0"
] | null | null | null | import pytest
pytestmark = pytest.mark.forked
from unladenchant.resourcecheck import MetaMixinResourceChecker
class MetaClassTest(MetaMixinResourceChecker, type):
pass
class BaseClass(metaclass=MetaClassTest):
pass
## Testing pass and failure
def rescheckPassed():
return True
def rescheckFailed():
r... | 26.737705 | 63 | 0.698958 | 518 | 0.317597 | 0 | 0 | 304 | 0.186389 | 0 | 0 | 137 | 0.083998 |
4e3df3a417c99ed4ce96f722ac39d7ce01ef8e82 | 219 | py | Python | baekjoon/1436/nth_666.py | ucyang/AlgoEx | 465c88f04b9449c06ee5c9a684ded5aba8ccf399 | [
"MIT"
] | null | null | null | baekjoon/1436/nth_666.py | ucyang/AlgoEx | 465c88f04b9449c06ee5c9a684ded5aba8ccf399 | [
"MIT"
] | null | null | null | baekjoon/1436/nth_666.py | ucyang/AlgoEx | 465c88f04b9449c06ee5c9a684ded5aba8ccf399 | [
"MIT"
] | null | null | null | import sys
input = lambda: sys.stdin.readline().rstrip()
n = int(input())
i = 666
c = 0
while True:
if str(i).find("666") != -1:
c += 1
if c == n:
print(i)
break
i += 1
| 14.6 | 45 | 0.452055 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0.022831 |
4e3f58928a5748c64ee63fdc647b83c5de587549 | 6,419 | py | Python | peitho/errors_and_parsers/abc_sysbio/abcsysbio_parser/ParseAndWrite.py | MichaelPHStumpf/Peitho | a4daa9a3b2d8960079573d08d5baa019b5ac857e | [
"MIT"
] | 1 | 2018-01-05T21:59:49.000Z | 2018-01-05T21:59:49.000Z | peitho/errors_and_parsers/abc_sysbio/abcsysbio_parser/ParseAndWrite.py | MichaelPHStumpf/Peitho | a4daa9a3b2d8960079573d08d5baa019b5ac857e | [
"MIT"
] | null | null | null | peitho/errors_and_parsers/abc_sysbio/abcsysbio_parser/ParseAndWrite.py | MichaelPHStumpf/Peitho | a4daa9a3b2d8960079573d08d5baa019b5ac857e | [
"MIT"
] | 3 | 2018-01-05T22:00:09.000Z | 2018-12-25T13:32:10.000Z | from peitho.errors_and_parsers.abc_sysbio.abcsysbio_parser.ODEPythonWriter import ODEPythonWriter
from peitho.errors_and_parsers.abc_sysbio.abcsysbio_parser.GillespiePythonWriter import GillespiePythonWriter
from peitho.errors_and_parsers.abc_sysbio.abcsysbio_parser.SDEPythonWriter import SDEPythonWriter
from peitho.er... | 51.352 | 145 | 0.598068 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,026 | 0.315625 |
4e3fc3968ee8f0017872bef877f1376109518f81 | 390 | py | Python | unitests/argcat_unit_test.py | dex1n/ArgCat | 3ff28426d7f497ce417ebd42c4832789e3b3b4b0 | [
"MIT"
] | 1 | 2021-03-21T06:56:43.000Z | 2021-03-21T06:56:43.000Z | unitests/argcat_unit_test.py | dex1n/ArgCat | 3ff28426d7f497ce417ebd42c4832789e3b3b4b0 | [
"MIT"
] | null | null | null | unitests/argcat_unit_test.py | dex1n/ArgCat | 3ff28426d7f497ce417ebd42c4832789e3b3b4b0 | [
"MIT"
] | null | null | null | import unittest
import os
import sys
class ArgCatUnitTest(unittest.TestCase):
def __init__(self, methodName: str) -> None:
super().__init__(methodName=methodName)
self._cur_path = os.path.dirname(os.path.abspath(sys.modules[self.__module__].__file__))
def abs_path_of_test_file(self, file_name:... | 32.5 | 96 | 0.725641 | 351 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e3fe1c8c8818994caf91d65e4c3869ac570639f | 173 | py | Python | Year calculation.py | alaminskaib/PythonPrograms | 0112715d7700a4ebfd0da64a62f8ac20a43f7c79 | [
"MIT"
] | 2 | 2019-11-11T17:19:10.000Z | 2019-11-11T17:22:46.000Z | Year calculation.py | alaminskaib/PythonPrograms | 0112715d7700a4ebfd0da64a62f8ac20a43f7c79 | [
"MIT"
] | null | null | null | Year calculation.py | alaminskaib/PythonPrograms | 0112715d7700a4ebfd0da64a62f8ac20a43f7c79 | [
"MIT"
] | null | null | null | year= int(input("Give the value of year:"))
if((year%4==0 and year%100==0) or (Year%400==0)):
print("This is a leap year")
else:
print("This is not leap year")
| 28.833333 | 50 | 0.606936 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.398844 |
4e408675dcb9ee527589d07af00ac4cec8b7ef57 | 535 | py | Python | innterpret/attribution/patternattr.py | paudom/iNNterpret | 8e6a4fc43bfc497e26fea37942765a5efaf5b7c4 | [
"MIT"
] | 2 | 2019-03-08T12:23:03.000Z | 2019-07-05T14:05:19.000Z | innterpret/attribution/patternattr.py | paudom/iNNterpret | 8e6a4fc43bfc497e26fea37942765a5efaf5b7c4 | [
"MIT"
] | 7 | 2020-01-28T22:38:40.000Z | 2022-03-11T23:44:34.000Z | innterpret/attribution/patternattr.py | paudom/iNNterpret | 8e6a4fc43bfc497e26fea37942765a5efaf5b7c4 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
# -- IMPORT -- #
from ..utils.interfaces import Method
class PatternAttribution(Method):
"""CLASS::PatternAttribution:
---
Description:
---
> Gets the attribution using patterns.
Arguments:
---
Link:
---
>- http://arxiv.org/abs/1705.05598."""
def __init__(sel... | 17.833333 | 55 | 0.650467 | 439 | 0.81903 | 0 | 0 | 0 | 0 | 0 | 0 | 262 | 0.488806 |
4e40e56669e17e3ab0d16330e3eb1bb070b4f8b0 | 140 | py | Python | idawilli/__init__.py | CrackerCat/idawilli | 4cf895cf88144e9394a0aa21200cf35e84ca1cba | [
"Apache-2.0"
] | null | null | null | idawilli/__init__.py | CrackerCat/idawilli | 4cf895cf88144e9394a0aa21200cf35e84ca1cba | [
"Apache-2.0"
] | null | null | null | idawilli/__init__.py | CrackerCat/idawilli | 4cf895cf88144e9394a0aa21200cf35e84ca1cba | [
"Apache-2.0"
] | null | null | null | def align(value, alignment=0x1000):
if value % alignment == 0:
return value
return value + (alignment - (value % alignment)) | 35 | 52 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9d62368843928d090cd812f1e7a939bf13155d3f | 988 | py | Python | tests/mock_urllib.py | cedricduriau/PackagerBuddy | 3eda40cd1b72f030e4f02e38af452e6377b20148 | [
"MIT"
] | 1 | 2019-01-10T11:15:40.000Z | 2019-01-10T11:15:40.000Z | tests/mock_urllib.py | cedricduriau/PackagerBuddy | 3eda40cd1b72f030e4f02e38af452e6377b20148 | [
"MIT"
] | 6 | 2019-01-06T16:56:22.000Z | 2019-01-07T01:43:54.000Z | tests/mock_urllib.py | cedricduriau/PackagerBuddy | 3eda40cd1b72f030e4f02e38af452e6377b20148 | [
"MIT"
] | null | null | null | # stdlib modules
try:
from urllib.response import addinfourl
from urllib.error import HTTPError
from urllib.request import HTTPHandler
from io import StringIO
except ImportError:
from urllib2 import addinfourl, HTTPError, HTTPHandler
from StringIO import StringIO
def mock_response(req):
ur... | 29.058824 | 68 | 0.648785 | 99 | 0.100202 | 0 | 0 | 0 | 0 | 0 | 0 | 157 | 0.158907 |
9d6381be8993257224fb80b97034c3a236987a13 | 2,192 | py | Python | slickbird/web/hcollection.py | lpenz/slickbird | 1ad6c615be7edbc0c8c5abd97373058abea3d794 | [
"Apache-2.0"
] | null | null | null | slickbird/web/hcollection.py | lpenz/slickbird | 1ad6c615be7edbc0c8c5abd97373058abea3d794 | [
"Apache-2.0"
] | null | null | null | slickbird/web/hcollection.py | lpenz/slickbird | 1ad6c615be7edbc0c8c5abd97373058abea3d794 | [
"Apache-2.0"
] | null | null | null | '''Slickbird collection handler'''
import logging
import json
from tornado.web import URLSpec
import tornado.web
from slickbird import datparse
import slickbird.orm as orm
import slickbird
from slickbird.web import hbase
def _log():
if not _log.logger:
_log.logger = logging.getLogger(__name__)
ret... | 28.842105 | 78 | 0.570255 | 1,154 | 0.52646 | 218 | 0.099453 | 867 | 0.395529 | 0 | 0 | 528 | 0.240876 |
9d664e109ebe34ba1e2952a24047d4157da5bc86 | 715 | py | Python | connected_devices.py | savlakaran/bluetooth-profile-manager | a485560cecd6668241539d7d7fa96756a1a8dc9f | [
"MIT"
] | null | null | null | connected_devices.py | savlakaran/bluetooth-profile-manager | a485560cecd6668241539d7d7fa96756a1a8dc9f | [
"MIT"
] | null | null | null | connected_devices.py | savlakaran/bluetooth-profile-manager | a485560cecd6668241539d7d7fa96756a1a8dc9f | [
"MIT"
] | null | null | null | import pydbus
bus = pydbus.SystemBus()
adapter = bus.get('org.bluez', '/org/bluez/hci0')
mngr = bus.get('org.bluez', '/')
def list_connected_devices():
connected = []
mngd_objs = mngr.GetManagedObjects()
for path in mngd_objs:
con_state = mngd_objs[path].get('org.bluez.Device1', {}).get('Connecte... | 31.086957 | 88 | 0.625175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 156 | 0.218182 |
9d66606d079a0a649bc4ef6dda1629c7be67e773 | 5,079 | py | Python | etl_base/etl_base/dags/acme/operators/file_operators.py | buckylee2019/sqlg-airflow | 37610a23b99bea8d9fdc8b066a01736ff2ff0c9d | [
"Apache-2.0"
] | null | null | null | etl_base/etl_base/dags/acme/operators/file_operators.py | buckylee2019/sqlg-airflow | 37610a23b99bea8d9fdc8b066a01736ff2ff0c9d | [
"Apache-2.0"
] | null | null | null | etl_base/etl_base/dags/acme/operators/file_operators.py | buckylee2019/sqlg-airflow | 37610a23b99bea8d9fdc8b066a01736ff2ff0c9d | [
"Apache-2.0"
] | 1 | 2022-03-10T03:47:35.000Z | 2022-03-10T03:47:35.000Z | # -*- coding: utf-8 -*-
#
# 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
... | 40.632 | 105 | 0.669817 | 4,023 | 0.792085 | 0 | 0 | 1,402 | 0.276039 | 0 | 0 | 2,197 | 0.432565 |
9d675985cd1e3fa2d6a896298711a9c21776ae26 | 7,052 | py | Python | pyllusion/image/utilities.py | RebeccaHirst/Pyllusion | 9944076e38bced0eabb49c607482b71809150bdb | [
"MIT"
] | null | null | null | pyllusion/image/utilities.py | RebeccaHirst/Pyllusion | 9944076e38bced0eabb49c607482b71809150bdb | [
"MIT"
] | null | null | null | pyllusion/image/utilities.py | RebeccaHirst/Pyllusion | 9944076e38bced0eabb49c607482b71809150bdb | [
"MIT"
] | null | null | null | import numpy as np
import PIL.ImageColor, PIL.ImageFont
from .rescale import rescale
def _rgb(x):
"""Convert 0-1 values to RGB 0-255 values.
"""
return rescale(x, to=[0, 255], scale=[0, 1])
def _color(color="black", alpha=1, mode="RGB"):
"""Sanitize color to RGB(A) format.
"""
if isinstance... | 32.648148 | 86 | 0.548497 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,585 | 0.224759 |
9d67bc8055c64e00d851f4955360ca97f28db935 | 6,971 | py | Python | pyfluka/pyfluka_merge.py | morgenst/pyfluka | 6dd3aa8cc29cfce0b2f084fb6b08bdebd2233298 | [
"MIT"
] | null | null | null | pyfluka/pyfluka_merge.py | morgenst/pyfluka | 6dd3aa8cc29cfce0b2f084fb6b08bdebd2233298 | [
"MIT"
] | null | null | null | pyfluka/pyfluka_merge.py | morgenst/pyfluka | 6dd3aa8cc29cfce0b2f084fb6b08bdebd2233298 | [
"MIT"
] | null | null | null | import sys
import argparse
import fnmatch
import os
import re
import shutil
import glob
import logging
import multiprocessing
from copy_reg import pickle
from types import MethodType
_logger = logging.getLogger('default')
_logger.addHandler(logging.StreamHandler())
_logger.setLevel(logging.CRITICAL)
def _pickle_meth... | 36.307292 | 125 | 0.551427 | 5,300 | 0.760293 | 0 | 0 | 299 | 0.042892 | 0 | 0 | 884 | 0.126811 |
9d6864036da06d6197930101a35bf7b6e92aebea | 1,325 | py | Python | calculation.py | n-a-iliev/NBA-PER-Calculator | 590c617cc8c47009224a33f60fc4cba75f4b26bd | [
"MIT"
] | null | null | null | calculation.py | n-a-iliev/NBA-PER-Calculator | 590c617cc8c47009224a33f60fc4cba75f4b26bd | [
"MIT"
] | null | null | null | calculation.py | n-a-iliev/NBA-PER-Calculator | 590c617cc8c47009224a33f60fc4cba75f4b26bd | [
"MIT"
] | null | null | null | from balldontlie import balldontlie, player, stats
from matplotlib import pyplot as plt
'''This function gets more information about the player by inputting
their name and dataset to search'''
def getplayer(firstname, lastname, datalist):
for players in datalist:
for info in players.data:
... | 33.974359 | 99 | 0.659623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 343 | 0.258868 |