hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
482dddc4b95b4877167dc37f7f640ecf5a8978b8 | 13,304 | py | Python | zfs/dnode.py | hiliev/py-zfs-recovery | ec3bb3316b28b91c197993d8c0a0803d4ab39605 | [
"BSD-3-Clause"
] | 14 | 2017-07-09T19:25:14.000Z | 2020-07-18T11:58:36.000Z | zfs/dnode.py | hiliev/py-zfs-recovery | ec3bb3316b28b91c197993d8c0a0803d4ab39605 | [
"BSD-3-Clause"
] | 8 | 2018-03-24T08:58:47.000Z | 2021-01-20T17:18:37.000Z | zfs/dnode.py | hiliev/py-zfs-recovery | ec3bb3316b28b91c197993d8c0a0803d4ab39605 | [
"BSD-3-Clause"
] | 2 | 2018-03-17T23:16:35.000Z | 2018-04-14T10:06:04.000Z | # Copyright (c) 2017 Hristo Iliev <github@hiliev.eu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of c... | 33.094527 | 120 | 0.555848 |
8bc8473479b2f60615ebf15d36671f935a2ea859 | 5,391 | py | Python | tests/components/test_class_RunTask.py | aimakerspace/Synergos | ce972f6b031535e82be6724f42118c33f90e9189 | [
"Apache-2.0"
] | null | null | null | tests/components/test_class_RunTask.py | aimakerspace/Synergos | ce972f6b031535e82be6724f42118c33f90e9189 | [
"Apache-2.0"
] | null | null | null | tests/components/test_class_RunTask.py | aimakerspace/Synergos | ce972f6b031535e82be6724f42118c33f90e9189 | [
"Apache-2.0"
] | 3 | 2021-11-25T03:26:52.000Z | 2022-01-24T09:48:37.000Z | #!/usr/bin/env python
####################
# Required Modules #
####################
# Generic/Built-in
import logging
# Libs
# Custom
from synergos.endpoints import RUN_ENDPOINTS
from conftest import (
PROJECT_KEY,
EXPT_KEY_1, EXPT_KEY_2,
check_resp_structure,
check_availability_in_single_archive... | 31.16185 | 81 | 0.595993 |
44eb9fe7b537f9bee8a249581408d34ca23f575a | 904 | py | Python | venv/bin/rst2xetex.py | RyanHelgoth/CMPUT404-Lab5 | 82424bf5a9b80ff186bd69d224457c8b70a3bdf3 | [
"Apache-2.0"
] | null | null | null | venv/bin/rst2xetex.py | RyanHelgoth/CMPUT404-Lab5 | 82424bf5a9b80ff186bd69d224457c8b70a3bdf3 | [
"Apache-2.0"
] | null | null | null | venv/bin/rst2xetex.py | RyanHelgoth/CMPUT404-Lab5 | 82424bf5a9b80ff186bd69d224457c8b70a3bdf3 | [
"Apache-2.0"
] | null | null | null | #!/home/student/Lab5/CMPUT404-Lab5/venv/bin/python3
# $Id: rst2xetex.py 7847 2015-03-17 17:30:47Z milde $
# Author: Guenter Milde
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing Lua/XeLaTeX code.
"""
try:
import locale
locale.setloca... | 32.285714 | 77 | 0.675885 |
a247aaffc90e1800c4f0b1cccef3ee92807bd07e | 533 | py | Python | listparser/helpers/enums.py | riccardorestagno/BuzzFeed-Reddit-Bot | 8c8b3c9da3e56c26565aaab2058036f55adebb0d | [
"MIT"
] | 7 | 2017-09-27T14:17:39.000Z | 2019-09-23T05:52:03.000Z | listparser/helpers/enums.py | riccardorestagno/list-parser-bot | 8c8b3c9da3e56c26565aaab2058036f55adebb0d | [
"MIT"
] | null | null | null | listparser/helpers/enums.py | riccardorestagno/list-parser-bot | 8c8b3c9da3e56c26565aaab2058036f55adebb0d | [
"MIT"
] | 6 | 2017-09-06T17:54:42.000Z | 2019-09-13T20:35:49.000Z | from enum import Enum
class ArticleType(Enum):
All = 1
Business_Insider = 2
BuzzFeed = 3
CollegeHumor = 4
Cracked = 5
Polygon = 6
Screen_Rant = 7
def convert_enum_to_string(enum):
return enum.name.replace("_", " ")
def convert_string_to_articletype_enum(string):
return ArticleT... | 19.035714 | 67 | 0.641651 |
bcd8bc74dd751569eae9af852f336b9b06fec985 | 8,311 | py | Python | cotk/dataloader/sentence_classification.py | ZhihongShao/cotk | 252ebc20c9ce175327e3721a9ddbdbb0bffd2744 | [
"Apache-2.0"
] | null | null | null | cotk/dataloader/sentence_classification.py | ZhihongShao/cotk | 252ebc20c9ce175327e3721a9ddbdbb0bffd2744 | [
"Apache-2.0"
] | null | null | null | cotk/dataloader/sentence_classification.py | ZhihongShao/cotk | 252ebc20c9ce175327e3721a9ddbdbb0bffd2744 | [
"Apache-2.0"
] | null | null | null | """Dataloader for language generation"""
from collections import Counter
from itertools import chain
import numpy as np
# from .._utils.unordered_hash import UnorderedSha256
from .._utils.file_utils import get_resource_file_path
from .._utils import hooks
from .dataloader import LanguageProcessingBase
from ..metric i... | 35.216102 | 98 | 0.658405 |
f7b1393de898449000c60dd88afaf04c6ad5bc11 | 11,648 | py | Python | config/settings/base.py | veglez/my-wallet | 80b3811d13a3aa8d211b50b0fe37f015ffd5393c | [
"MIT"
] | null | null | null | config/settings/base.py | veglez/my-wallet | 80b3811d13a3aa8d211b50b0fe37f015ffd5393c | [
"MIT"
] | null | null | null | config/settings/base.py | veglez/my-wallet | 80b3811d13a3aa8d211b50b0fe37f015ffd5393c | [
"MIT"
] | null | null | null | """
Base settings to build other settings files upon.
"""
from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# mywallet/
APPS_DIR = ROOT_DIR / "mywallet"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
if READ_DOT_EN... | 40.585366 | 93 | 0.633156 |
a486585e5392da2ae42464bacfcb2dfd11f22c90 | 159 | py | Python | libs/youzan/__init__.py | fovegage/python3-youzan-pay | 793cfad34e2d64b365c0732f30509d1676847b5b | [
"MIT"
] | 15 | 2019-01-19T15:11:59.000Z | 2019-10-22T04:23:24.000Z | libs/youzan/__init__.py | fovegage/python3-youzan-pay | 793cfad34e2d64b365c0732f30509d1676847b5b | [
"MIT"
] | null | null | null | libs/youzan/__init__.py | fovegage/python3-youzan-pay | 793cfad34e2d64b365c0732f30509d1676847b5b | [
"MIT"
] | 5 | 2019-03-29T17:05:49.000Z | 2019-07-27T16:01:58.000Z | # -*- coding: utf-8 -*-
# @Time : 2019/1/18 9:20
# @Author : fovegage
# @Email : fovegage@gmail.com
# @File : __init__.py.py
# @Software: PyCharm | 26.5 | 32 | 0.566038 |
0a5e97b7c380da694314b89ea1d07ceb8cf99ed0 | 553 | py | Python | ballometer/sht.py | wipfli/ballometer | db86abe4f9dd541c96c58110579ae9dec729d119 | [
"MIT"
] | null | null | null | ballometer/sht.py | wipfli/ballometer | db86abe4f9dd541c96c58110579ae9dec729d119 | [
"MIT"
] | 6 | 2020-09-26T06:42:30.000Z | 2021-02-17T17:12:47.000Z | ballometer/sht.py | wipfli/ballometer | db86abe4f9dd541c96c58110579ae9dec729d119 | [
"MIT"
] | null | null | null | try:
import busio
import adafruit_sht31d
except ImportError:
pass
class SHT:
def __init__(self):
self._sensor = adafruit_sht31d.SHT31D(i2c_bus=busio.I2C(24, 23))
@property
def temperature(self):
'''returns the temperature in Kelvin'''
T = self._sensor.temperature # de... | 24.043478 | 72 | 0.627486 |
fe0db2fa8304a336b480b95e9e8c73ba6f47d1c9 | 12,119 | py | Python | baselines/ecbp/agents/buffer/kbps_process.py | MouseHu/emdqn | ba907e959f21dd0b5a17117accccae9c82a79a3b | [
"MIT"
] | null | null | null | baselines/ecbp/agents/buffer/kbps_process.py | MouseHu/emdqn | ba907e959f21dd0b5a17117accccae9c82a79a3b | [
"MIT"
] | null | null | null | baselines/ecbp/agents/buffer/kbps_process.py | MouseHu/emdqn | ba907e959f21dd0b5a17117accccae9c82a79a3b | [
"MIT"
] | 1 | 2021-04-26T13:55:47.000Z | 2021-04-26T13:55:47.000Z | import numpy as np
from sklearn.neighbors import BallTree, KDTree
import os
from baselines.ecbp.agents.buffer.lru_knn_gpu_ps import LRU_KNN_GPU_PS
from baselines.ecbp.agents.buffer.lru_knn_ps import LRU_KNN_PS
import gc
from baselines.deepq.experiments.atari.knn_cuda_fixmem import knn as knn_cuda_fixmem
import copy
fro... | 48.09127 | 128 | 0.607063 |
0cfe22f9d15cdaff879f4d0346f39ad2ad365f7a | 1,828 | py | Python | zz-practice/learn.py | aloneZERO/Py-Party | d9f1daf0a4e35269159741b2dbbd905e8823c3bb | [
"Apache-2.0"
] | 3 | 2017-04-05T02:10:55.000Z | 2018-02-07T08:27:47.000Z | zz-practice/learn.py | aloneZERO/Py-Party | d9f1daf0a4e35269159741b2dbbd905e8823c3bb | [
"Apache-2.0"
] | null | null | null | zz-practice/learn.py | aloneZERO/Py-Party | d9f1daf0a4e35269159741b2dbbd905e8823c3bb | [
"Apache-2.0"
] | 3 | 2018-02-07T06:09:49.000Z | 2020-08-06T08:50:13.000Z | #!python3
# coding: utf-8
import copy
import time
import utils
import zz_info
import zz_data
# 燥起来
def fk_zz(session, section):
batchId = 1
jid = section['jid'] # 章节序号
section_status = zz_info.getSectionStatus(session, jid)
last_time = int(section_status['learned_time'])
while True:
learned_time = int(sect... | 23.74026 | 84 | 0.696389 |
b6127f69d52ee25a88e79da8fabd9ade26267d3d | 2,218 | py | Python | runs/nodes/start_ansible_hosts.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 2 | 2020-07-24T14:19:57.000Z | 2020-08-10T18:30:08.000Z | runs/nodes/start_ansible_hosts.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | null | null | null | runs/nodes/start_ansible_hosts.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 1 | 2021-07-09T10:29:11.000Z | 2021-07-09T10:29:11.000Z | """
时间:2020/6/12
作者:lurui
功能:根据提供的nodes模块列表生成nodes的ansible模块的nodes_hosts文件
时间:2020/6/17
作者:lurui
修改:基路径 basedir = os.path.dirname(os.path.dirname(os.getcwd())),改为调用者路径 basedir = os.path.abspath('.')
时间:2020/8/11
作者:lurui
修改:node名称由k8s-node-{0}-{1}改为三位k8s-node-{0}-{1}-{2}
"""
import os
import configparser
def start... | 31.239437 | 132 | 0.628494 |
e04fde7f4b9f1708638975d82aabe46b633fe549 | 3,691 | py | Python | speakInOut/autho/forms.py | pvgupta24/inout | 621309cf9a2ff83a0d5aa8c4dd490daa42ed8484 | [
"MIT"
] | null | null | null | speakInOut/autho/forms.py | pvgupta24/inout | 621309cf9a2ff83a0d5aa8c4dd490daa42ed8484 | [
"MIT"
] | 7 | 2020-06-06T00:01:29.000Z | 2022-02-10T11:07:34.000Z | speakInOut/autho/forms.py | pvgupta24/inout | 621309cf9a2ff83a0d5aa8c4dd490daa42ed8484 | [
"MIT"
] | 2 | 2020-02-11T14:44:32.000Z | 2020-02-21T17:39:04.000Z | from datetime import date
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
def validate_username_available(username):
""" validator that throws an error if the given username already exists."""
if User.objects.filter(username__icontains=userna... | 39.688172 | 113 | 0.700352 |
af97b87f78d6be6188dd49ac209d7c977566241e | 1,637 | py | Python | src/microprobe/model/__init__.py | rbertran/microprobe | 232b60aad88b3541de1a962d6da924b234cd521c | [
"Apache-2.0"
] | 2 | 2019-11-20T18:29:02.000Z | 2019-11-20T18:29:05.000Z | src/microprobe/model/__init__.py | rbertran/microprobe | 232b60aad88b3541de1a962d6da924b234cd521c | [
"Apache-2.0"
] | null | null | null | src/microprobe/model/__init__.py | rbertran/microprobe | 232b60aad88b3541de1a962d6da924b234cd521c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 IBM Corporation
#
# 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, ... | 22.736111 | 74 | 0.66402 |
7b86db4dbd3572486f9a0516ee817d64e96f086d | 900 | py | Python | examples/new_theme.py | jojoelfe/napari | b52a136dad392c091b0008c0b8d7fcc5ef460f66 | [
"BSD-3-Clause"
] | 7 | 2018-07-03T17:35:46.000Z | 2018-11-07T15:48:58.000Z | examples/new_theme.py | maweigert/napari | 48cdf4d1c4bcf6f76603e90b1c0c7498e2aba6c0 | [
"BSD-3-Clause"
] | 120 | 2018-09-04T22:05:13.000Z | 2019-03-02T01:13:57.000Z | examples/new_theme.py | maweigert/napari | 48cdf4d1c4bcf6f76603e90b1c0c7498e2aba6c0 | [
"BSD-3-Clause"
] | 8 | 2018-09-04T21:48:26.000Z | 2019-01-29T04:48:30.000Z | """
New theme
=========
Displays an image and sets the theme to new custom theme.
"""
from skimage import data
import napari
from napari.utils.theme import available_themes, get_theme, register_theme
# create the viewer with an image
viewer = napari.view_image(data.astronaut(), rgb=True, name='astronaut')
# List ... | 22.5 | 74 | 0.71 |
ec78a08a317a2190aff7c791d5928b6fab18eb7e | 3,367 | py | Python | tests/test_sonnendach_reference.py | timtroendle/possibility-for-electricity-autarky | a3d3c99ef90bbccd7232e2170317a259a77661d3 | [
"MIT"
] | 11 | 2018-11-12T14:00:19.000Z | 2021-11-16T19:00:34.000Z | tests/test_sonnendach_reference.py | timtroendle/possibility-for-electricity-autarky | a3d3c99ef90bbccd7232e2170317a259a77661d3 | [
"MIT"
] | 8 | 2020-04-14T15:54:58.000Z | 2020-10-23T12:59:59.000Z | tests/test_sonnendach_reference.py | timtroendle/possibility-for-electricity-autarky | a3d3c99ef90bbccd7232e2170317a259a77661d3 | [
"MIT"
] | 4 | 2019-03-21T01:44:01.000Z | 2021-06-20T03:16:51.000Z | """Test whether our estimations are close to the ones from sonnendach.ch"""
import os
from pathlib import Path
import pytest
import rasterio
import rasterio.mask
from rasterstats import zonal_stats
import fiona
from src.technical_eligibility import Eligibility
ROOT_DIR = Path(os.path.abspath(__file__)).parent.parent... | 51.8 | 118 | 0.743689 |
48eea26ba1f209704c1d838bee10e952b77ebf98 | 2,577 | py | Python | dims.py | vkopey/Thread-turning-simulator | 9622d6294ddec56bb5e48db2a7b2ff52f2399467 | [
"MIT"
] | null | null | null | dims.py | vkopey/Thread-turning-simulator | 9622d6294ddec56bb5e48db2a7b2ff52f2399467 | [
"MIT"
] | 1 | 2018-06-28T10:46:44.000Z | 2019-05-20T11:17:14.000Z | dims.py | vkopey/Thread-turning-simulator | 9622d6294ddec56bb5e48db2a7b2ff52f2399467 | [
"MIT"
] | 1 | 2019-07-16T18:32:51.000Z | 2019-07-16T18:32:51.000Z | # -*- coding: utf-8 -*-
from math import atan, degrees, tan
class Dim:
"Клас описує поняття розміру"
n=0.0 #номінальний розмір
ei=0.0 #нижнє відхилення
es=0.0 #верхнє відхилення
v=0.0 #дійсне значення
def __init__(self,n,ei,es,doc):
"конструктор"
self.n=n
sel... | 39.646154 | 100 | 0.611176 |
ddec13a88098a0f7c5f31472189a870dfa84115a | 32,262 | py | Python | safe_relay_service/relay/tasks.py | CirclesUBI/safe-relay-service | e6844e2b92316ddc099d5b39711487a6e46d5a93 | [
"MIT"
] | 2 | 2020-10-19T09:59:11.000Z | 2021-02-04T12:26:12.000Z | safe_relay_service/relay/tasks.py | CirclesUBI/safe-relay-service | e6844e2b92316ddc099d5b39711487a6e46d5a93 | [
"MIT"
] | 24 | 2019-12-11T14:43:38.000Z | 2022-03-01T12:37:24.000Z | safe_relay_service/relay/tasks.py | CirclesUBI/safe-relay-service | e6844e2b92316ddc099d5b39711487a6e46d5a93 | [
"MIT"
] | null | null | null | from datetime import timedelta
from typing import List
from django.conf import settings
from django.utils import timezone
from celery import app
from celery.utils.log import get_task_logger
from ethereum.utils import check_checksum, checksum_encode, mk_contract_address
from redis.exceptions import LockError
from gno... | 51.209524 | 120 | 0.632044 |
7ff83a28c7570b23d121fa730b8ac7d7d99015bd | 5,291 | py | Python | tests/test_django_models.py | rubickcz/django-choice-enumfields | 1b11115eb0631c156a788ce9b1b207f672b9a0e9 | [
"MIT"
] | null | null | null | tests/test_django_models.py | rubickcz/django-choice-enumfields | 1b11115eb0631c156a788ce9b1b207f672b9a0e9 | [
"MIT"
] | null | null | null | tests/test_django_models.py | rubickcz/django-choice-enumfields | 1b11115eb0631c156a788ce9b1b207f672b9a0e9 | [
"MIT"
] | null | null | null | # -- encoding: UTF-8 --
from django.core.exceptions import ValidationError
from django.db import connection
import pytest
from .enums import Color, IntegerEnum, LabeledEnum, StateFlow, StateFlowAnyFirst, SubIntegerEnum, Taste, ZeroEnum
from .models import MyModel
@pytest.mark.django_db
def test_field_value():
... | 32.066667 | 113 | 0.715933 |
ad88045039f95387b537725e9f8512ac9d311d45 | 14,542 | py | Python | homeassistant/helpers/entity_component.py | wanman/home-assistant | 633aaed22b0de0129d1e72e23bcd974b9ce13656 | [
"Apache-2.0"
] | null | null | null | homeassistant/helpers/entity_component.py | wanman/home-assistant | 633aaed22b0de0129d1e72e23bcd974b9ce13656 | [
"Apache-2.0"
] | 1 | 2017-03-10T22:17:06.000Z | 2017-03-10T22:17:06.000Z | homeassistant/helpers/entity_component.py | wanman/home-assistant | 633aaed22b0de0129d1e72e23bcd974b9ce13656 | [
"Apache-2.0"
] | null | null | null | """Helpers for components that manage entities."""
import asyncio
from datetime import timedelta
from homeassistant import config as conf_util
from homeassistant.bootstrap import (
async_prepare_setup_platform, async_prepare_setup_component)
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_SCAN_INTERVAL,... | 35.99505 | 79 | 0.630587 |
ae69c11f416f244d870439628fed39cdddb017f3 | 11,010 | py | Python | frappe/core/doctype/user/test_user.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | frappe/core/doctype/user/test_user.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | frappe/core/doctype/user/test_user.py | ektai/frappe3 | 44aa948b4d5a0d729eacfb3dabdc9c8894ae1799 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, unittest
from frappe.model.delete_doc import delete_doc
from frappe.utils.data import today, add_to_date
from frappe import _dict
from frappe.limits import update_... | 36.098361 | 108 | 0.726703 |
4308dec371ea1e409bbedd65c18c9ae2a20e36e1 | 4,239 | py | Python | toppra/constraint/canonical_conic.py | shintarokkk/toppra | 1a7be8feb68fec91459d6dc625f0114692dac885 | [
"MIT"
] | null | null | null | toppra/constraint/canonical_conic.py | shintarokkk/toppra | 1a7be8feb68fec91459d6dc625f0114692dac885 | [
"MIT"
] | 1 | 2020-06-01T21:27:23.000Z | 2020-06-01T21:27:23.000Z | toppra/constraint/canonical_conic.py | shintarokkk/toppra | 1a7be8feb68fec91459d6dc625f0114692dac885 | [
"MIT"
] | 2 | 2020-04-06T16:22:25.000Z | 2020-06-12T00:45:10.000Z | from .constraint import Constraint
from .constraint import ConstraintType, DiscretizationType
import numpy as np
class CanonicalConicConstraint(Constraint):
"""Base class for all canonical conic constraints.
A canonical conic constraint is one with the following form
.. math::
(a[i] + da[i]) u ... | 37.513274 | 107 | 0.601085 |
5c31d0d6747a3adf2a53b70769120350e9d3eaea | 28,920 | py | Python | source/file_utils.py | ohadrozen/inferbert | 2e450aba894937e5769dcf028e4a8a597991fe43 | [
"Apache-2.0"
] | null | null | null | source/file_utils.py | ohadrozen/inferbert | 2e450aba894937e5769dcf028e4a8a597991fe43 | [
"Apache-2.0"
] | 1 | 2021-08-22T08:10:10.000Z | 2021-08-23T02:38:23.000Z | source/file_utils.py | ohadrozen/inferbert | 2e450aba894937e5769dcf028e4a8a597991fe43 | [
"Apache-2.0"
] | 2 | 2021-08-22T08:13:31.000Z | 2021-08-22T08:19:29.000Z | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import fnmatch
import json
import logging
import os
import shutil
import sys
import tarfile
import tempfile
from contextlib import context... | 35.747837 | 144 | 0.651418 |
13dd948606273f5c9bd67c58e2c9a1062f4d2422 | 2,078 | py | Python | main.py | Noel-jediknight/full-stackwebapp | 0628b9aac90bde9fdacd94e81fc64e7fd4a905cf | [
"MIT"
] | null | null | null | main.py | Noel-jediknight/full-stackwebapp | 0628b9aac90bde9fdacd94e81fc64e7fd4a905cf | [
"MIT"
] | null | null | null | main.py | Noel-jediknight/full-stackwebapp | 0628b9aac90bde9fdacd94e81fc64e7fd4a905cf | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from pydantic import BaseModel
from fastapi.encoders import jsonable_encoder
from fastapi.middleware.cors import CORSMiddleware
app=FastAPI()
origin=["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origin,
allow_credentials=True,
allow_methods=["*"],
... | 21.645833 | 84 | 0.621752 |
01424a92b3efca6a1e14ffbcfb50d4a140fd3beb | 2,683 | py | Python | python/dnd-character/dnd_character_test.py | ropable/exercism | 9dde2a7952badec03428b5f9dfb8499a7ce55458 | [
"MIT"
] | 9 | 2020-12-12T03:29:33.000Z | 2021-08-11T13:08:06.000Z | python/dnd-character/dnd_character_test.py | ropable/exercism | 9dde2a7952badec03428b5f9dfb8499a7ce55458 | [
"MIT"
] | null | null | null | python/dnd-character/dnd_character_test.py | ropable/exercism | 9dde2a7952badec03428b5f9dfb8499a7ce55458 | [
"MIT"
] | 1 | 2020-11-02T10:40:06.000Z | 2020-11-02T10:40:06.000Z | import unittest
from dnd_character import Character, modifier
# Tests adapted from `problem-specifications//canonical-data.json`
class DndCharacterTest(unittest.TestCase):
def test_ability_modifier_for_score_3_is_n4(self):
self.assertEqual(modifier(3), -4)
def test_ability_modifier_for_score_4_is_n... | 34.397436 | 79 | 0.712262 |
718c42d009346e9ead6e3efcc8e562b69d7bfeb5 | 5,824 | py | Python | intersight/models/hyperflex_feature_limit_entry_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | intersight/models/hyperflex_feature_limit_entry_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | intersight/models/hyperflex_feature_limit_entry_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight OpenAPI specification.
The Cisco Intersight OpenAPI specification.
OpenAPI spec version: 1.0.9-1461
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexFeatureL... | 32 | 576 | 0.613839 |
33193c222f5dc20ab18e2323fba2f18d48e98f1e | 1,031 | py | Python | examples/sharepoint/connect_with_client_certificate_adal.py | theodoriss/Office365-REST-Python-Client | 3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e | [
"MIT"
] | 544 | 2016-08-04T17:10:16.000Z | 2022-03-31T07:17:20.000Z | examples/sharepoint/connect_with_client_certificate_adal.py | theodoriss/Office365-REST-Python-Client | 3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e | [
"MIT"
] | 438 | 2016-10-11T12:24:22.000Z | 2022-03-31T19:30:35.000Z | examples/sharepoint/connect_with_client_certificate_adal.py | theodoriss/Office365-REST-Python-Client | 3bd7a62dadcd3f0a0aceeaff7584fff3fd44886e | [
"MIT"
] | 202 | 2016-08-22T19:29:40.000Z | 2022-03-30T20:26:15.000Z | import os
from office365.runtime.auth.token_response import TokenResponse
from office365.sharepoint.client_context import ClientContext
from tests import test_site_url, test_tenant
cert_settings = {
'client_id': '51d03106-4726-442c-86db-70b32fa7547f',
'thumbprint': "6B36FBFC86FB1C019EB6496494B9195E6D179DDB",
... | 34.366667 | 80 | 0.748788 |
163e86af2291e497d8ba576bef3d6ff2a3505314 | 3,364 | py | Python | tests/test_visitors/test_ast/test_naming/conftest.py | sourya/wemake-python-styleguide | 313a11a62fac2fb2067252db4e6a6530e070e382 | [
"MIT"
] | null | null | null | tests/test_visitors/test_ast/test_naming/conftest.py | sourya/wemake-python-styleguide | 313a11a62fac2fb2067252db4e6a6530e070e382 | [
"MIT"
] | null | null | null | tests/test_visitors/test_ast/test_naming/conftest.py | sourya/wemake-python-styleguide | 313a11a62fac2fb2067252db4e6a6530e070e382 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
# Imports:
import_alias = """
import os as {0}
"""
from_import_alias = """
from os import path as {0}
"""
# Function names:
function_name = 'def {0}(): ...'
method_name = """
class Input(object):
def {0}(self): ...
"""
# Function arguments:
function_argument = 'def tes... | 16.904523 | 77 | 0.629905 |
160a4f7fca5245668abdd7575e192c7737797fdb | 1,497 | py | Python | src/cltl/backend/api/backend.py | leolani/cltl-backend | 4ecc6227f9d48e40b9f59e6d78e0fcee9cdadbd4 | [
"MIT"
] | null | null | null | src/cltl/backend/api/backend.py | leolani/cltl-backend | 4ecc6227f9d48e40b9f59e6d78e0fcee9cdadbd4 | [
"MIT"
] | null | null | null | src/cltl/backend/api/backend.py | leolani/cltl-backend | 4ecc6227f9d48e40b9f59e6d78e0fcee9cdadbd4 | [
"MIT"
] | null | null | null | import logging
from cltl.backend.api.microphone import Microphone
from cltl.backend.api.text_to_speech import TextToSpeech
logger = logging.getLogger(__name__)
class Backend:
"""
Abstract Backend on which all Backends are based
Exposes
:class:`~cltl.backend.api.microphone.Microphone`
Parameter... | 22.343284 | 75 | 0.602538 |
27354d423aba4087b35fa36658a151f96ee42882 | 1,395 | py | Python | tests/compas/datastructures/test_mesh_operations.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | tests/compas/datastructures/test_mesh_operations.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | 9 | 2019-09-11T08:53:19.000Z | 2019-09-16T08:35:39.000Z | tests/compas/datastructures/test_mesh_operations.py | Licini/compas | 34f65adb3d0abc3f403312ffba62aa76f3376292 | [
"MIT"
] | null | null | null | import pytest
from compas.datastructures import Mesh
from compas.datastructures import mesh_insert_vertex_on_edge
from compas.datastructures import mesh_substitute_vertex_in_faces
@pytest.fixture
def mesh_0():
vertices = [
[1.0, 0.0, 0.0],
[1.0, 2.0, 0.0],
[0.0, 1.0, 0.0],
[2.0, 1... | 29.0625 | 65 | 0.683154 |
e224e6f09fa3c1b650494125a75b61b08462eaf3 | 76 | py | Python | src/__tests__/integration/failures/setup_test.py | jest-community/jest-pytest | b197b0b31e3ca5c411202d97583cbd2d2b0b92e9 | [
"MIT"
] | 37 | 2018-05-22T07:17:26.000Z | 2022-03-03T13:14:46.000Z | src/__tests__/integration/failures/setup_test.py | jondot/jest-pytest | b197b0b31e3ca5c411202d97583cbd2d2b0b92e9 | [
"MIT"
] | 34 | 2018-05-22T07:19:40.000Z | 2022-03-11T23:21:03.000Z | src/__tests__/integration/failures/setup_test.py | jondot/jest-pytest | b197b0b31e3ca5c411202d97583cbd2d2b0b92e9 | [
"MIT"
] | 8 | 2018-05-30T20:05:26.000Z | 2021-02-19T14:17:05.000Z | def setup_module(module):
wtf
def test_something():
assert 1 == 1
| 10.857143 | 25 | 0.644737 |
a6a784da76db769a97ee3f032c89939167918c1a | 7,898 | py | Python | sdk/python/pulumi_azure_native/costmanagement/v20190401preview/get_budget.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/costmanagement/v20190401preview/get_budget.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/costmanagement/v20190401preview/get_budget.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.091371 | 929 | 0.660167 |
db1bbfc702a77182b67dfc3bd80978d3f5c3cb38 | 5,653 | py | Python | flask_monitoringdashboard/controllers/endpoints.py | mcknz-gy/Flask-MonitoringDashboard | c3126971ce4af6abb3bbf763f042bc0a6dfb48b2 | [
"MIT"
] | 630 | 2018-03-03T23:52:07.000Z | 2022-03-30T10:55:46.000Z | flask_monitoringdashboard/controllers/endpoints.py | mcknz-gy/Flask-MonitoringDashboard | c3126971ce4af6abb3bbf763f042bc0a6dfb48b2 | [
"MIT"
] | 292 | 2018-03-05T11:27:57.000Z | 2022-03-28T23:05:48.000Z | flask_monitoringdashboard/controllers/endpoints.py | mcknz-gy/Flask-MonitoringDashboard | c3126971ce4af6abb3bbf763f042bc0a6dfb48b2 | [
"MIT"
] | 146 | 2018-03-22T09:53:36.000Z | 2022-02-03T08:13:50.000Z | import datetime
from numpy import median
from sqlalchemy import and_
from flask_monitoringdashboard import config
from flask_monitoringdashboard.core import cache
from flask_monitoringdashboard.core.colors import get_color
from flask_monitoringdashboard.core.measurement import add_decorator
from flask_monitoringdashb... | 37.190789 | 97 | 0.708473 |
769795123dd5ccc1d63a649d5fb3be723f16222f | 721 | py | Python | lib/config.py | PaulMndn/VRMLbot | c0e688d6f3458e1298b1ee613238a96a98a38e4f | [
"MIT"
] | null | null | null | lib/config.py | PaulMndn/VRMLbot | c0e688d6f3458e1298b1ee613238a96a98a38e4f | [
"MIT"
] | null | null | null | lib/config.py | PaulMndn/VRMLbot | c0e688d6f3458e1298b1ee613238a96a98a38e4f | [
"MIT"
] | null | null | null | import json
from pathlib import Path
import logging
__all__ = [
"get_config"
]
log = logging.getLogger(__name__)
class Config:
def __init__(self):
self._path = Path("config.json")
if not self._path.exists():
log.critical("No config file found. Exiting.")
raise FileNotF... | 27.730769 | 75 | 0.619972 |
2f591bbccdc11f47fdcdfb2e0df4ac161f9f7092 | 644 | py | Python | cms/test_utils/project/sampleapp/cms_app.py | tonatos/django-cms | 96003df57c2dc0215bf109dc74a85aa0c798d1b4 | [
"BSD-3-Clause"
] | 1 | 2016-08-23T16:20:29.000Z | 2016-08-23T16:20:29.000Z | cms/test_utils/project/sampleapp/cms_app.py | tonatos/django-cms | 96003df57c2dc0215bf109dc74a85aa0c798d1b4 | [
"BSD-3-Clause"
] | null | null | null | cms/test_utils/project/sampleapp/cms_app.py | tonatos/django-cms | 96003df57c2dc0215bf109dc74a85aa0c798d1b4 | [
"BSD-3-Clause"
] | null | null | null | from cms.app_base import CMSApp
from cms.test_utils.project.sampleapp.menu import SampleAppMenu
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class SampleApp(CMSApp):
name = _("Sample App")
urls = ["cms.test_utils.project.sampleapp.urls"]
menus = [SampleA... | 26.833333 | 63 | 0.740683 |
baa62633a661cb44923880e25c832e5a0b84c950 | 1,405 | py | Python | tests/test_response.py | MoonMoon1919/peyton | 950f426332496de75ef26d196e67d7e469f805bc | [
"MIT"
] | 1 | 2020-09-20T21:16:32.000Z | 2020-09-20T21:16:32.000Z | tests/test_response.py | MoonMoon1919/peyton | 950f426332496de75ef26d196e67d7e469f805bc | [
"MIT"
] | 2 | 2021-05-04T14:43:13.000Z | 2021-06-02T14:12:23.000Z | tests/test_response.py | MoonMoon1919/peyton | 950f426332496de75ef26d196e67d7e469f805bc | [
"MIT"
] | null | null | null | """."""
import base64
import json
import sys
from os import path
import pytest
from peyton.response import Response
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
def test_response_obj():
resp = Response(status_code=200, headers={}, body={"message": "received GET"})
j = resp.to_json()
... | 24.649123 | 88 | 0.666904 |
35d53641baad4fa7fac3f826f2666679065384ec | 460 | py | Python | 25.py | fptitsyn/task-17 | 7345255b2b614d0b91431a8d91b40b2f4d22c5ac | [
"MIT"
] | null | null | null | 25.py | fptitsyn/task-17 | 7345255b2b614d0b91431a8d91b40b2f4d22c5ac | [
"MIT"
] | null | null | null | 25.py | fptitsyn/task-17 | 7345255b2b614d0b91431a8d91b40b2f4d22c5ac | [
"MIT"
] | null | null | null | if __name__ == "__main__":
path = input("Enter a path to file: ")
with open(path, "r", encoding="utf-8") as f:
a = [int(i) for i in f]
count = 0
max_dif = 0
for i in range(len(a) - 1):
for j in range(i + 1, len(a)):
if ((a[i] - a[j]) % 46 == 0) and ((a[i] % 13 =... | 28.75 | 85 | 0.430435 |
8f4ec104650079836329c92bf19518149ae7d1c3 | 26,507 | py | Python | python/tvm/relay/transform/transform.py | akosik-anyvision/incubator-tvm | e1b11712ac09c32614483d24a4c7e0245ee4cb4b | [
"Apache-2.0"
] | 9 | 2019-12-17T08:03:54.000Z | 2022-01-19T02:34:23.000Z | python/tvm/relay/transform/transform.py | akosik-anyvision/incubator-tvm | e1b11712ac09c32614483d24a4c7e0245ee4cb4b | [
"Apache-2.0"
] | 2 | 2020-06-18T21:15:42.000Z | 2020-06-24T17:38:37.000Z | python/tvm/relay/transform/transform.py | akosik-anyvision/incubator-tvm | e1b11712ac09c32614483d24a4c7e0245ee4cb4b | [
"Apache-2.0"
] | 3 | 2020-10-04T20:30:18.000Z | 2022-01-24T18:03:52.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 29.985294 | 100 | 0.664315 |
04d0524c6466fca5fc05e30dd5b36db0d1461df7 | 1,693 | py | Python | Ensemble Methods/RandomForest_Classification.py | AbuBakkar32/ML-DL-NLP-TP-FE-MP | 2525b6b32fc1876e65643b8c221ffda591981623 | [
"MIT"
] | 2 | 2020-10-20T10:35:31.000Z | 2020-11-19T14:08:05.000Z | Ensemble Methods/RandomForest_Classification.py | AbuBakkar32/ML-DL-NLP-TP-FE-MP | 2525b6b32fc1876e65643b8c221ffda591981623 | [
"MIT"
] | null | null | null | Ensemble Methods/RandomForest_Classification.py | AbuBakkar32/ML-DL-NLP-TP-FE-MP | 2525b6b32fc1876e65643b8c221ffda591981623 | [
"MIT"
] | null | null | null | #Import Libraries
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
dataset = pd.read_csv('BankNote_Authentication.csv')
X = dataset.iloc[:, [0,1]].values
y = dataset.iloc[:, 4].values
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, ... | 29.701754 | 93 | 0.683993 |
b7a56a7dc0f607168fc269e4845fedbb9b650d86 | 21,176 | bzl | Python | third_party/repositories/scala_2_13.bzl | renovate-bot/rules_scala | 6e37eac5194d535f59c4a2f363e67207fd004aca | [
"Apache-2.0"
] | 326 | 2016-02-24T18:28:10.000Z | 2022-03-30T08:51:08.000Z | third_party/repositories/scala_2_13.bzl | renovate-bot/rules_scala | 6e37eac5194d535f59c4a2f363e67207fd004aca | [
"Apache-2.0"
] | 1,157 | 2016-02-24T04:26:27.000Z | 2022-03-31T05:59:14.000Z | third_party/repositories/scala_2_13.bzl | renovate-bot/rules_scala | 6e37eac5194d535f59c4a2f363e67207fd004aca | [
"Apache-2.0"
] | 262 | 2016-02-24T18:29:21.000Z | 2022-03-24T21:39:20.000Z | artifacts = {
"io_bazel_rules_scala_scala_library": {
"artifact": "org.scala-lang:scala-library:2.13.6",
"sha256": "f19ed732e150d3537794fd3fe42ee18470a3f707efd499ecd05a99e727ff6c8a",
},
"io_bazel_rules_scala_scala_compiler": {
"artifact": "org.scala-lang:scala-compiler:2.13.6",
... | 44.301255 | 85 | 0.683368 |
d769de84a83511c3ada6e7084748282c60c417a8 | 1,554 | py | Python | openslides_backend/action/mixins/sequential_numbers_mixin.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | openslides_backend/action/mixins/sequential_numbers_mixin.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | openslides_backend/action/mixins/sequential_numbers_mixin.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from typing import Any, Dict, Optional
from datastore.shared.util import DeletedModelsBehaviour
from ...models.models import Model
from ...services.datastore.interface import DatastoreService
from ...shared.filters import FilterOperator
from ..generics.create import CreateAction
from ..util.typing import ActionResult... | 33.06383 | 74 | 0.675032 |
dd8af5a30761dc3b22e0a7380d4676f81b8d963f | 3,665 | py | Python | keystone/tests/unit/common/test_json_home.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 615 | 2015-01-07T12:32:52.000Z | 2022-03-24T03:49:47.000Z | keystone/tests/unit/common/test_json_home.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 11 | 2015-04-13T18:52:40.000Z | 2021-08-21T06:13:05.000Z | keystone/tests/unit/common/test_json_home.py | ferag/keystone | af1c1a822a8dfdd543c6e4d48264f5b8be2bdfc7 | [
"Apache-2.0"
] | 696 | 2015-01-15T00:31:07.000Z | 2022-03-16T09:56:00.000Z | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 39.836957 | 79 | 0.669577 |
7a1f99210397f2ae05e6dd7c838a92a560064cee | 1,359 | py | Python | tools/vis_result.py | Wang-hao-thu/PatchCore_anomaly_detection | ac4068c8fa6f50d4252385258096b7dc85d1abc5 | [
"Apache-2.0"
] | null | null | null | tools/vis_result.py | Wang-hao-thu/PatchCore_anomaly_detection | ac4068c8fa6f50d4252385258096b7dc85d1abc5 | [
"Apache-2.0"
] | null | null | null | tools/vis_result.py | Wang-hao-thu/PatchCore_anomaly_detection | ac4068c8fa6f50d4252385258096b7dc85d1abc5 | [
"Apache-2.0"
] | null | null | null | import sys
import numpy as np
from tqdm import tqdm
import math
result_file = sys.argv[1]
tmp_file = sys.argv[2]
def get_result(result_file):
f1 = open(result_file,'r')
f2 = open(tmp_file, 'w')
neg = {}
neg_score = []
pos = {}
pos_score = []
for line in tqdm(f1.readlines()):
img_pat... | 31.604651 | 180 | 0.599706 |
550d9e9f229436152f59e9964ea113498c82323a | 199 | py | Python | scripts/quest/q25712s.py | lynsone/swordie | 7e9d564c1f2659a87e01c376089e1ee0a3842c5b | [
"MIT"
] | 2 | 2020-08-25T06:55:19.000Z | 2021-03-15T14:37:34.000Z | scripts/quest/q25712s.py | lynsone/swordie | 7e9d564c1f2659a87e01c376089e1ee0a3842c5b | [
"MIT"
] | null | null | null | scripts/quest/q25712s.py | lynsone/swordie | 7e9d564c1f2659a87e01c376089e1ee0a3842c5b | [
"MIT"
] | 3 | 2020-08-25T06:55:25.000Z | 2020-12-01T13:07:43.000Z | # q25712s - Kaiser 4th job advancement
if chr.getJob() == 6111:
sm.jobAdvance(6112)
sm.completeQuest(25712)
else:
sm.sendSayOkay("You're currently not a third job Kaiser.")
sm.dispose()
| 22.111111 | 62 | 0.698492 |
ac526175783c68a4b74dfc5e1a6c400e53681113 | 527 | py | Python | posts/admin.py | TrueDi1905/yatube | 074fac97a47332933f35350a95f661903aac014f | [
"BSD-3-Clause"
] | null | null | null | posts/admin.py | TrueDi1905/yatube | 074fac97a47332933f35350a95f661903aac014f | [
"BSD-3-Clause"
] | null | null | null | posts/admin.py | TrueDi1905/yatube | 074fac97a47332933f35350a95f661903aac014f | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from .models import Post, Group
class PostAdmin(admin.ModelAdmin):
list_display = ("pk", "text", "pub_date", "author")
search_fields = ("text",)
list_filter = ("pub_date",)
empty_value_display = "-пусто-"
class GroupAdmin(admin.ModelAdmin):
list_display = ("titl... | 23.954545 | 55 | 0.688805 |
b29fb056f35e93eb001de809ee138d9e3c8ce362 | 3,382 | py | Python | word-ranking/web/db.py | sironitomas/october-challenge | b12807779a7c73c54f9af06f7ec2826197cff721 | [
"MIT"
] | null | null | null | word-ranking/web/db.py | sironitomas/october-challenge | b12807779a7c73c54f9af06f7ec2826197cff721 | [
"MIT"
] | null | null | null | word-ranking/web/db.py | sironitomas/october-challenge | b12807779a7c73c54f9af06f7ec2826197cff721 | [
"MIT"
] | null | null | null | import hashlib
import mysql.connector
from mysql.connector import errorcode
DB_NAME = 'ranking'
def connect():
try:
cnx = mysql.connector.connect(user='root',
password='my-strong-password',
host='db')
return cnx
excep... | 29.408696 | 78 | 0.548788 |
b8e17d0eaa53977700877ff30422099e1e1f8299 | 780 | py | Python | manage.py | chenke91/ihaveablog | 64000723589d3f5a074bd09f045cb5d6c3daf6dd | [
"MIT"
] | null | null | null | manage.py | chenke91/ihaveablog | 64000723589d3f5a074bd09f045cb5d6c3daf6dd | [
"MIT"
] | null | null | null | manage.py | chenke91/ihaveablog | 64000723589d3f5a074bd09f045cb5d6c3daf6dd | [
"MIT"
] | null | null | null | #!/Users/ck-air/dev/ihaveablog/venv3/bin/python
import os
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from app import create_app, db
from app.models import User, Blog, Category
app = create_app(os.getenv('BLOG_CONFIG') or 'default')
manager = Manager(app)
migrate... | 26.896552 | 72 | 0.746154 |
5ee089dbbb0b974d7955276679d6ebc5157e57af | 56,516 | py | Python | src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py | xhl873/azure-cli | 6448a3437b7139c29a77ba2cb0f592d2f2146afc | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py | xhl873/azure-cli | 6448a3437b7139c29a77ba2cb0f592d2f2146afc | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py | xhl873/azure-cli | 6448a3437b7139c29a77ba2cb0f592d2f2146afc | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | 59.742072 | 288 | 0.638297 |
1bb3d6b3f7da8eb0b604dbd27453b5db60c085be | 467 | py | Python | config.py | McMvMc/lsm_mike | 7c62d9e1ef9a60bbd5de04b4481485c3b9648359 | [
"MIT"
] | null | null | null | config.py | McMvMc/lsm_mike | 7c62d9e1ef9a60bbd5de04b4481485c3b9648359 | [
"MIT"
] | null | null | null | config.py | McMvMc/lsm_mike | 7c62d9e1ef9a60bbd5de04b4481485c3b9648359 | [
"MIT"
] | null | null | null | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Shapenet config
SHAPENET_VOX = {
32: os.path.join(BASE_DIR, 'data/shapenet_release/voxels/modelVoxels32'),
64: os.path.join(BASE_DIR, 'data/shapenet_release/voxels/modelVoxels64')
}
SHAPENET_IM = os.path.join(BASE_DIR, 'data/shapenet_release/r... | 31.133333 | 77 | 0.770878 |
cefa31a5e12ced83854b7b7013c4e93fd3b2152c | 11,785 | py | Python | jishaku/shim/paginator_200.py | danrfq/jishaku | d1d10e80a729b169c3c86eecbb0403ea30d4f414 | [
"MIT"
] | 1 | 2022-01-07T10:43:20.000Z | 2022-01-07T10:43:20.000Z | jishaku/shim/paginator_200.py | danrfq/jishaku | d1d10e80a729b169c3c86eecbb0403ea30d4f414 | [
"MIT"
] | null | null | null | jishaku/shim/paginator_200.py | danrfq/jishaku | d1d10e80a729b169c3c86eecbb0403ea30d4f414 | [
"MIT"
] | 1 | 2022-03-15T02:21:39.000Z | 2022-03-15T02:21:39.000Z | # -*- coding: utf-8 -*-
"""
jishaku.paginators (shim for discord.py 2.0.0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Paginator-related tools and interfaces for Jishaku.
:copyright: (c) 2021 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import asyncio
import discord
from discord import ... | 35.39039 | 128 | 0.645057 |
2376fdbd509cb848005c870c62619ae40f85d028 | 37,892 | py | Python | neutron/tests/unit/agent/linux/test_ovs_lib.py | bradleyjones/neutron | d283e23d7658162f911240bf6a4e707e3709093a | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/agent/linux/test_ovs_lib.py | bradleyjones/neutron | d283e23d7658162f911240bf6a4e707e3709093a | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/agent/linux/test_ovs_lib.py | bradleyjones/neutron | d283e23d7658162f911240bf6a4e707e3709093a | [
"Apache-2.0"
] | null | null | null | # Copyright 2012, VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 41.276688 | 79 | 0.585533 |
4d10f8ccb8cbb1532421acb13fc98a381c8d61c5 | 2,354 | py | Python | api/resources/webapp/swipes.py | jimbunny/wedding-invitation | a3648454e1105d9362f95d9f6e69055a7522e15b | [
"MIT"
] | null | null | null | api/resources/webapp/swipes.py | jimbunny/wedding-invitation | a3648454e1105d9362f95d9f6e69055a7522e15b | [
"MIT"
] | null | null | null | api/resources/webapp/swipes.py | jimbunny/wedding-invitation | a3648454e1105d9362f95d9f6e69055a7522e15b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# author:jingtongyu
# datetime:2020/6/7 10:14 下午
# software: PyCharm
from flask_restful import Resource
from flask_restful.reqparse import RequestParser
from common import code, pretty_result
import os
import json
from werkzeug.datastructures import FileStorage
root = os.p... | 33.628571 | 119 | 0.578165 |
2b064e8d58479f14479e97b1f6926b30f218605f | 10,646 | py | Python | babyai/rl/algos/base.py | m-smith/babyai | deb79a8171eaf3c7e1e131a49e92caaf89eecd8d | [
"BSD-3-Clause"
] | 411 | 2019-02-13T13:57:10.000Z | 2022-03-15T22:47:27.000Z | babyai/rl/algos/base.py | m-smith/babyai | deb79a8171eaf3c7e1e131a49e92caaf89eecd8d | [
"BSD-3-Clause"
] | 47 | 2019-02-19T17:23:35.000Z | 2021-05-05T15:16:03.000Z | babyai/rl/algos/base.py | m-smith/babyai | deb79a8171eaf3c7e1e131a49e92caaf89eecd8d | [
"BSD-3-Clause"
] | 100 | 2019-02-13T23:35:25.000Z | 2022-02-10T17:58:25.000Z | from abc import ABC, abstractmethod
import torch
import numpy
from babyai.rl.format import default_preprocess_obss
from babyai.rl.utils import DictList, ParallelEnv
from babyai.rl.utils.supervised_losses import ExtraInfoCollector
class BaseAlgo(ABC):
"""The base class for RL algorithms."""
def __init__(self... | 41.585938 | 104 | 0.63235 |
408681ed1131d64e85e852faab94916533f5ad3a | 6,171 | py | Python | setup.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 2 | 2015-01-12T14:47:19.000Z | 2018-10-03T09:27:22.000Z | setup.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | null | null | null | setup.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 1 | 2020-03-20T20:19:33.000Z | 2020-03-20T20:19:33.000Z | #!/usr/bin/env python
from distutils.core import setup
setup(
name="npyscreen",
version="4.2.0",
description="Writing user interfaces without all that ugly mucking about in hyperspace",
author="Nicholas Cole",
author_email="n@npcole.com",
url="http://www.npcole.com/npyscreen/",
packages=['npyscreen'],
license=... | 44.395683 | 250 | 0.782531 |
61b329c60719060cb97b0371435619ab5d833da5 | 14,416 | py | Python | src/dynamodb_encryption_sdk/structures.py | robin-aws/aws-dynamodb-encryption-python | 25c7c3d80bfbe0deb661b4beb86f61b8b2f8545e | [
"Apache-2.0"
] | 57 | 2018-08-23T00:32:37.000Z | 2022-03-24T20:59:01.000Z | src/dynamodb_encryption_sdk/structures.py | robin-aws/aws-dynamodb-encryption-python | 25c7c3d80bfbe0deb661b4beb86f61b8b2f8545e | [
"Apache-2.0"
] | 91 | 2018-08-06T17:32:28.000Z | 2022-03-31T10:23:02.000Z | src/dynamodb_encryption_sdk/structures.py | robin-aws/aws-dynamodb-encryption-python | 25c7c3d80bfbe0deb661b4beb86f61b8b2f8545e | [
"Apache-2.0"
] | 38 | 2018-10-17T12:02:37.000Z | 2022-02-13T02:53:14.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 40.608451 | 120 | 0.676332 |
283f63bbe2faed5ef8c161dc156746ce3e623287 | 1,169 | py | Python | pyapprox/sys_utilities.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 26 | 2019-12-16T02:21:15.000Z | 2022-03-17T09:59:18.000Z | pyapprox/sys_utilities.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 9 | 2020-03-03T03:04:55.000Z | 2021-08-19T22:50:42.000Z | pyapprox/sys_utilities.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 7 | 2020-03-02T03:49:17.000Z | 2021-02-17T02:07:53.000Z | import sys, os
import pkg_resources
import importlib
import numpy as np
def trace_error_with_msg(msg, e: Exception):
exc_type, exc_obj, exc_tb = sys.exc_info()
fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
print(msg)
print(f'Failed with error: {e}')
details = f"""
Error type: {... | 22.480769 | 64 | 0.644996 |
ce377857ff0550c9ba921f1ca78d79f68791948e | 12,004 | py | Python | python/ray/util/actor_pool.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | python/ray/util/actor_pool.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 51 | 2018-05-17T05:55:28.000Z | 2020-03-18T06:49:49.000Z | python/ray/util/actor_pool.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | import ray
from ray.util.annotations import PublicAPI
@PublicAPI(stability="beta")
class ActorPool:
"""Utility class to operate on a fixed pool of actors.
Arguments:
actors (list): List of Ray actor handles to use in this pool.
Examples:
>>> import ray
>>> from ray.util.actor_poo... | 37.630094 | 86 | 0.559064 |
174942b28e48f699f26a4c51d2add9385d44e6c5 | 213 | py | Python | dayrolling.py | ClownMonster/StockPrediction_MLmodel_python | ea5562ce377422f072b6907e7547a44483d1e81e | [
"MIT"
] | null | null | null | dayrolling.py | ClownMonster/StockPrediction_MLmodel_python | ea5562ce377422f072b6907e7547a44483d1e81e | [
"MIT"
] | null | null | null | dayrolling.py | ClownMonster/StockPrediction_MLmodel_python | ea5562ce377422f072b6907e7547a44483d1e81e | [
"MIT"
] | null | null | null | '''
Prints the data rolling back of 7days from the day need to visualize
'''
from ProcessedDataframe import trainData
def mean_data():
train_df = trainData()
d = train_df.rolling(7).mean()
return d
| 19.363636 | 69 | 0.704225 |
93f393308f448c848b1d173bb51bfb0997d32ef1 | 2,074 | py | Python | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}_api/api/schemas.py | frank2411/cookiecutter_flasktemplate | fc80827f0f7e7b87679790c8c1d9094518576b5b | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}_api/api/schemas.py | frank2411/cookiecutter_flasktemplate | fc80827f0f7e7b87679790c8c1d9094518576b5b | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}_api/api/schemas.py | frank2411/cookiecutter_flasktemplate | fc80827f0f7e7b87679790c8c1d9094518576b5b | [
"Apache-2.0"
] | null | null | null | import uuid
from marshmallow_sqlalchemy.fields import Related
from sqlalchemy.orm.exc import NoResultFound
class FixedRelated(Related): # pragma: no cover
default_error_messages = {
"invalid": "Could not deserialize related value {value!r}; "
"expected a dictionary with keys {keys!r}",
... | 37.709091 | 86 | 0.613308 |
29e9f493ea18f72f4489a55151f43dbc9521b162 | 743 | py | Python | 257. Binary Tree Paths.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 257. Binary Tree Paths.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | 257. Binary Tree Paths.py | patrick-luo/Leet-Code | 989ec20c1069ce93e1d0e9ae4a4dfc59b1b1622a | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def binaryTreePaths(self, root):
"""
:type root: TreeNode
:rtype: List[str]
"""
d... | 26.535714 | 56 | 0.475101 |
25409d1814f7cde0a2f0b58785c4d633be3a806e | 557 | py | Python | koroviev/utils.py | Egnod/koroviev | aea948c54177357ae7e2101541221d2d907f6aeb | [
"MIT"
] | null | null | null | koroviev/utils.py | Egnod/koroviev | aea948c54177357ae7e2101541221d2d907f6aeb | [
"MIT"
] | 2 | 2020-09-13T21:12:27.000Z | 2020-09-13T21:13:44.000Z | koroviev/utils.py | Egnod/koroviev | aea948c54177357ae7e2101541221d2d907f6aeb | [
"MIT"
] | null | null | null | from functools import wraps
from typing import Callable
from termcolor import cprint
def config_file_required(func: Callable) -> Callable:
"""Decorator for cli methods with required exists config file in
project."""
@wraps(func)
def wrapper(self, *args, **kwargs) -> None:
if not self._cfg_ex... | 25.318182 | 100 | 0.610413 |
568b4976bd8436dcb87f814d5247ce80a282e67a | 838 | py | Python | tiers/helpers.py | appsembler/django-tiers | 7c59be2a31a767e1917bc4296c1c986427e35b8a | [
"MIT"
] | 2 | 2017-04-10T19:50:35.000Z | 2021-08-13T09:00:07.000Z | tiers/helpers.py | appsembler/django-tiers | 7c59be2a31a767e1917bc4296c1c986427e35b8a | [
"MIT"
] | 28 | 2017-03-07T19:47:15.000Z | 2022-03-30T13:12:26.000Z | tiers/helpers.py | appsembler/django-tiers | 7c59be2a31a767e1917bc4296c1c986427e35b8a | [
"MIT"
] | null | null | null | from .app_settings import settings
def is_equal_or_sub_url(request_url, checked_url):
"""Stupidly simple method to check for URLs equality"""
if request_url == checked_url:
return True
request_url = request_url.rstrip('/')
checked_url = checked_url.rstrip('/')
return request_url.startswit... | 28.896552 | 78 | 0.711217 |
6c31da8ae5a2a72ce531b9e961a8b1da09e37fd5 | 893 | py | Python | examples/frameworks/fire/fire_grouping_cmd.py | thepycoder/clearml | 717edba8c2b39fb7486bd2aba9ca0294f309b4c3 | [
"Apache-2.0"
] | 2,097 | 2019-06-11T14:36:25.000Z | 2020-12-21T03:52:59.000Z | examples/frameworks/fire/fire_grouping_cmd.py | thepycoder/clearml | 717edba8c2b39fb7486bd2aba9ca0294f309b4c3 | [
"Apache-2.0"
] | 247 | 2019-06-11T15:10:26.000Z | 2020-12-21T17:34:32.000Z | examples/frameworks/fire/fire_grouping_cmd.py | thepycoder/clearml | 717edba8c2b39fb7486bd2aba9ca0294f309b4c3 | [
"Apache-2.0"
] | 256 | 2019-06-11T14:36:28.000Z | 2020-12-18T08:32:47.000Z | # ClearML - Example of Python Fire integration, with commands grouped inside classes
#
from clearml import Task
import fire
class Other(object):
def status(self):
return "Other"
class IngestionStage(object):
def __init__(self):
self.other = Other()
def run(self):
return "Ingest... | 19.844444 | 84 | 0.641657 |
9ce54c4c1c026777bee52e1b27565a7d0d969d1a | 186 | py | Python | suave/urls.py | radiosilence/django-suave | 19eb23de0589bdce68f91d580c53da179835ed90 | [
"MIT"
] | null | null | null | suave/urls.py | radiosilence/django-suave | 19eb23de0589bdce68f91d580c53da179835ed90 | [
"MIT"
] | 1 | 2020-09-25T07:00:39.000Z | 2020-09-28T06:51:09.000Z | suave/urls.py | radiosilence/django-suave | 19eb23de0589bdce68f91d580c53da179835ed90 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('suave.views',
url(r'^(?P<url>[-\w\/]+)/$', 'page', name='page'),
url(r'^$', 'page', name='page'),
)
| 23.25 | 54 | 0.586022 |
c2906c8a3833780f8269a7eabf7eda1e474622f8 | 5,694 | py | Python | pywikibot/families/wiktionary_family.py | xqt/pwb | 9a4fe27138f32952e533256195849d05855df0b0 | [
"MIT"
] | null | null | null | pywikibot/families/wiktionary_family.py | xqt/pwb | 9a4fe27138f32952e533256195849d05855df0b0 | [
"MIT"
] | 1 | 2021-12-08T16:29:41.000Z | 2021-12-08T16:29:41.000Z | pywikibot/families/wiktionary_family.py | xqt/pwb | 9a4fe27138f32952e533256195849d05855df0b0 | [
"MIT"
] | 2 | 2022-01-04T04:10:38.000Z | 2022-01-04T04:18:18.000Z | """Family module for Wiktionary."""
#
# (C) Pywikibot team, 2005-2022
#
# Distributed under the terms of the MIT license.
#
from pywikibot import family
from pywikibot.tools import classproperty
# The Wikimedia family that is known as Wiktionary
class Family(family.SubdomainFamily, family.WikimediaFamily):
"""Fa... | 44.834646 | 82 | 0.429575 |
b8e7cd240993cbbcd8fa96eba4a15e7823668348 | 218 | py | Python | Curso Python/Mundo 1/Modulo2/Desafios/Desafios 2/des006.py | catabimbas/Curso-Python | 72549952db77fa9b0ea3746b83f94592e3fdeb30 | [
"MIT"
] | null | null | null | Curso Python/Mundo 1/Modulo2/Desafios/Desafios 2/des006.py | catabimbas/Curso-Python | 72549952db77fa9b0ea3746b83f94592e3fdeb30 | [
"MIT"
] | null | null | null | Curso Python/Mundo 1/Modulo2/Desafios/Desafios 2/des006.py | catabimbas/Curso-Python | 72549952db77fa9b0ea3746b83f94592e3fdeb30 | [
"MIT"
] | null | null | null | numbase = int(input('Digite um valor: '))
duble = numbase * 2
triple = numbase * 3
rq = numbase ** 0.5
print('O dobro do valor: {} \nO triplo do valor: {} \nA raiz quadrada do valor: {:.2f}'.format(duble, triple, rq))
| 36.333333 | 114 | 0.646789 |
e9b4672409bab981632228bb65e76e1ec77b7c67 | 2,254 | py | Python | Solutions/Problem_061.py | PraneethJain/Project-Euler | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | 2 | 2022-03-11T21:31:52.000Z | 2022-03-11T21:37:14.000Z | Solutions/Problem_061.py | PraneethJain/Project-Euler-100 | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | null | null | null | Solutions/Problem_061.py | PraneethJain/Project-Euler-100 | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | 1 | 2022-03-07T12:55:36.000Z | 2022-03-07T12:55:36.000Z | from time import time
def triangular_check(t: int) -> bool:
n = ((8 * t + 1) ** 0.5 - 1) / 2
return n == int(n)
def square_check(s: int) -> bool:
n = s**0.5
return n == int(n)
def pentagonal_check(p: int) -> bool:
n = (1 + (24 * p + 1) ** 0.5) / 6
return n == int(n)
def hexagonal_check(h... | 25.044444 | 85 | 0.43567 |
dea183ba25f7dec8fcde5b8cc82c1e977ac4e87f | 19,134 | py | Python | python/ccxt/coinone.py | KaceyBolman/ccxt | d34a0651b209ac77453f05c4ce31883f0cd2d6b8 | [
"MIT"
] | 1 | 2018-07-31T12:27:28.000Z | 2018-07-31T12:27:28.000Z | python/ccxt/coinone.py | rerefreshing/ccxt | 7c50f338dcb282c0aee4d69a1ac4ca47255fdf15 | [
"MIT"
] | null | null | null | python/ccxt/coinone.py | rerefreshing/ccxt | 7c50f338dcb282c0aee4d69a1ac4ca47255fdf15 | [
"MIT"
] | 2 | 2019-03-14T15:17:46.000Z | 2019-09-08T19:26:04.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import base64
import hashlib
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.... | 42.238411 | 369 | 0.485001 |
d1a1a77ce30f26ad3b65e414739e76dcb4c53333 | 7,824 | py | Python | api/src/opentrons/drivers/utils.py | anuwrag/opentrons | 28c8d76a19e367c6bd38f5290faaa32abf378715 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/drivers/utils.py | anuwrag/opentrons | 28c8d76a19e367c6bd38f5290faaa32abf378715 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/drivers/utils.py | anuwrag/opentrons | 28c8d76a19e367c6bd38f5290faaa32abf378715 | [
"Apache-2.0"
] | null | null | null | import binascii
import logging
import time
from typing import Dict, Optional, Mapping, Iterable, Sequence
import re
from opentrons.drivers.types import (
Temperature,
PlateTemperature,
RPM,
HeaterShakerLabwareLatchStatus,
)
log = logging.getLogger(__name__)
# Number of digits after the decimal point ... | 34.017391 | 88 | 0.672163 |
e1c3ffda62a818e29b5e89cd39616b7dc04db044 | 631 | py | Python | Suanfa/01_abc.py | ivitan/LearnPython | f7c1c8f450f5cbcbd8cabe03711c5e0d81dfdee3 | [
"MIT"
] | 1 | 2020-02-05T12:13:31.000Z | 2020-02-05T12:13:31.000Z | Suanfa/01_abc.py | ivitan/LearnPython | f7c1c8f450f5cbcbd8cabe03711c5e0d81dfdee3 | [
"MIT"
] | null | null | null | Suanfa/01_abc.py | ivitan/LearnPython | f7c1c8f450f5cbcbd8cabe03711c5e0d81dfdee3 | [
"MIT"
] | null | null | null | # a+b+c=100,a**2+b**2=c**2,a,b,c为自然数,求a,b,c
# 每台机器的总时间不同,但是执行基本运算数大体相同
#T(n) = n^3 * 2
import time
start_time = time.time()
# 枚举a,b,c
# 时间复杂度 T = 1000 * 1000 * 1000 * 2
# for a in range(0,1001):
# for b in range(0,1001):
# for c in range(0,1001):
# if a+b+c==1000 and a**2+b**2==c**2:
# ... | 26.291667 | 51 | 0.502377 |
fed675391e037a1554b29fb2cdba756a27ac6bee | 2,358 | py | Python | tests/neighbors/test_nng.py | cthoyt/kiez | 25f9f103ed51d4084e10f7ac532bb24183fe3894 | [
"BSD-3-Clause"
] | 13 | 2021-07-22T12:35:07.000Z | 2022-02-15T04:35:17.000Z | tests/neighbors/test_nng.py | cthoyt/kiez | 25f9f103ed51d4084e10f7ac532bb24183fe3894 | [
"BSD-3-Clause"
] | 10 | 2021-07-23T11:20:32.000Z | 2022-02-06T12:59:06.000Z | tests/neighbors/test_nng.py | cthoyt/kiez | 25f9f103ed51d4084e10f7ac532bb24183fe3894 | [
"BSD-3-Clause"
] | 2 | 2021-07-23T10:53:57.000Z | 2021-09-01T01:14:37.000Z | import numpy as np
import pytest
from kiez.neighbors import NNG
from numpy.testing import assert_array_equal
rng = np.random.RandomState(2)
def test_wrong_metric():
with pytest.raises(ValueError) as exc_info:
NNG(metric="jibberish")
assert "Unknown" in exc_info
def test_wrong_dir(n_samples=20, ... | 27.418605 | 78 | 0.664122 |
084f71e11e3585460d164349e7b713c8e9ce8313 | 1,468 | py | Python | src/programy/triggers/excepter.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | src/programy/triggers/excepter.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | src/programy/triggers/excepter.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | """
Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, m... | 50.62069 | 120 | 0.792916 |
210d1a32ae551d82397d81b39c2b980ce2da5647 | 792 | py | Python | tests/functional/manifests/test_manifest.py | miohtama/ape | 622deb25076d33de0edb3a23449ccdc04c3288cd | [
"Apache-2.0"
] | null | null | null | tests/functional/manifests/test_manifest.py | miohtama/ape | 622deb25076d33de0edb3a23449ccdc04c3288cd | [
"Apache-2.0"
] | null | null | null | tests/functional/manifests/test_manifest.py | miohtama/ape | 622deb25076d33de0edb3a23449ccdc04c3288cd | [
"Apache-2.0"
] | null | null | null | import pytest # type: ignore
import requests
from hypothesis import HealthCheck, given, settings
from hypothesis_jsonschema import from_schema # type: ignore
from ape.types.manifest import PackageManifest
ETHPM_MANIFEST_SCHEMA_URI = (
"https://raw.githubusercontent.com/ethpm/ethpm-spec/master/spec/v3.spec.json"... | 33 | 81 | 0.804293 |
e6c4eb2aa0f85e7fdc96c30c22d55fdf2284c58d | 22,597 | py | Python | evennia/commands/default/general.py | FreeDelete-Software/ALPACAS-evennia | dd95de145ea31391238dc03d61b14b6b31a5b715 | [
"BSD-3-Clause"
] | null | null | null | evennia/commands/default/general.py | FreeDelete-Software/ALPACAS-evennia | dd95de145ea31391238dc03d61b14b6b31a5b715 | [
"BSD-3-Clause"
] | null | null | null | evennia/commands/default/general.py | FreeDelete-Software/ALPACAS-evennia | dd95de145ea31391238dc03d61b14b6b31a5b715 | [
"BSD-3-Clause"
] | null | null | null | """
General Character commands usually available to all characters
"""
import re
from django.conf import settings
from evennia.utils import utils
from evennia.typeclasses.attributes import NickTemplateInvalid
COMMAND_DEFAULT_CLASS = utils.class_from_module(settings.COMMAND_DEFAULT_CLASS)
# limit symbol import for API... | 30.870219 | 102 | 0.531575 |
5a3c1b9dfdee1fe3834941cb5507d1dd51fd40c9 | 2,670 | py | Python | vendor/github.com/google/go-jsonnet/cpp-jsonnet/case_studies/micromanage/cmds.py | BenHall/kubeless | 398d0ee779d848655cf34dd28739f68a2f7bac8a | [
"Apache-2.0"
] | null | null | null | vendor/github.com/google/go-jsonnet/cpp-jsonnet/case_studies/micromanage/cmds.py | BenHall/kubeless | 398d0ee779d848655cf34dd28739f68a2f7bac8a | [
"Apache-2.0"
] | null | null | null | vendor/github.com/google/go-jsonnet/cpp-jsonnet/case_studies/micromanage/cmds.py | BenHall/kubeless | 398d0ee779d848655cf34dd28739f68a2f7bac8a | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All rights reserved.
#
# 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 ag... | 37.605634 | 83 | 0.535581 |
f672e10e77cb7db9e9f6da86f0db261d28e178f1 | 3,428 | py | Python | app/gws/plugin/ows_provider/wfs/provider.py | gbd-consult/gbd-websuite | 7212f41081c04614fdb4641e902d4de3424da8c5 | [
"Apache-2.0"
] | 3 | 2020-07-24T10:10:18.000Z | 2022-03-16T10:22:04.000Z | app/gws/plugin/ows_provider/wfs/provider.py | gbd-consult/gbd-websuite | 7212f41081c04614fdb4641e902d4de3424da8c5 | [
"Apache-2.0"
] | 28 | 2020-03-03T17:35:58.000Z | 2021-07-12T12:05:47.000Z | app/gws/plugin/ows_provider/wfs/provider.py | gbd-consult/gbd-websuite | 7212f41081c04614fdb4641e902d4de3424da8c5 | [
"Apache-2.0"
] | 1 | 2021-02-22T14:32:10.000Z | 2021-02-22T14:32:10.000Z | """WFS provider."""
import gws
import gws.base.metadata
import gws.base.ows
import gws.lib.extent
import gws.lib.gis
import gws.lib.ows
import gws.lib.shape
import gws.types as t
from . import caps
"""
References
wfs 1.0.0: http://portal.opengeospatial.org/files/?artifact_id=7176 Sec 13.7.3
wfs 1.1.0: ht... | 30.882883 | 105 | 0.630105 |
269d367974809d79cdaf648e542db28d3c0ae879 | 6,612 | py | Python | yosys_spde_flow/postprocess_yosys_edif.py | antmicro/yosys-SpDE-flow | 8c337d736b19e5927811dcada7b9aea9b31fe4c6 | [
"Apache-2.0"
] | null | null | null | yosys_spde_flow/postprocess_yosys_edif.py | antmicro/yosys-SpDE-flow | 8c337d736b19e5927811dcada7b9aea9b31fe4c6 | [
"Apache-2.0"
] | null | null | null | yosys_spde_flow/postprocess_yosys_edif.py | antmicro/yosys-SpDE-flow | 8c337d736b19e5927811dcada7b9aea9b31fe4c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
from pathlib import Path
import re
def convert_lut_init_to_hex(val: str) -> str:
"""Converts EDIF decimal and hexadecimal notation to hexadecimal for SpDE.
Args:
val (str): value in decimal or hexadecimal notation (i.e. ``16'hABCD``)
Returns:
str: ... | 35.934783 | 217 | 0.553085 |
e86a83da2e2e4e6aed077e21c19f23f2e56d8b0a | 11,340 | py | Python | built-in/TensorFlow/Official/cv/image_classification/ResNet50_ID0360_for_TensorFlow2.X/tensorflow/tf2_common/training/utils.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/TensorFlow/Official/cv/image_classification/ResNet50_ID0360_for_TensorFlow2.X/tensorflow/tf2_common/training/utils.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/TensorFlow/Official/cv/image_classification/ResNet50_ID0360_for_TensorFlow2.X/tensorflow/tf2_common/training/utils.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 32.4 | 80 | 0.686684 |
dfc6fcd167a6937d6eb27e24f74ee74f81447e32 | 655 | py | Python | tests/regression_test/markdown_snippets.py | plaflamme/mdbook-plantuml | f6814b44cbddf856ef2120557a4ff3c1cf72f19f | [
"MIT"
] | null | null | null | tests/regression_test/markdown_snippets.py | plaflamme/mdbook-plantuml | f6814b44cbddf856ef2120557a4ff3c1cf72f19f | [
"MIT"
] | null | null | null | tests/regression_test/markdown_snippets.py | plaflamme/mdbook-plantuml | f6814b44cbddf856ef2120557a4ff3c1cf72f19f | [
"MIT"
] | null | null | null |
class Snippet:
def __init__(self, code):
self.plantuml_code = code.strip()
self.markdown = "```plantuml\n{}\n```".format(self.plantuml_code)
ab_class_diagram = Snippet("""\
@startuml
A --|> B
@enduml
""")
cd_class_diagram = Snippet("""\
@startuml
C --|> D
@enduml
""")
ditaa = Snippet("""\
@sta... | 19.264706 | 73 | 0.381679 |
7fe2bbaa096002ac6b37c5634f64f7e10284e0ab | 3,810 | py | Python | fastai/collab.py | fish5421/fastai_update | c3dbdfba59512b5004093119f7676f224eb1d15c | [
"Apache-2.0"
] | 1 | 2019-12-18T22:49:21.000Z | 2019-12-18T22:49:21.000Z | fastai/collab.py | fish5421/fastai_update | c3dbdfba59512b5004093119f7676f224eb1d15c | [
"Apache-2.0"
] | null | null | null | fastai/collab.py | fish5421/fastai_update | c3dbdfba59512b5004093119f7676f224eb1d15c | [
"Apache-2.0"
] | 1 | 2019-01-12T17:43:19.000Z | 2019-01-12T17:43:19.000Z | "Module support for Collaborative Filtering"
from .torch_core import *
from .basic_train import *
from .data import *
from .layers import *
__all__ = ['CollabFilteringDataset', 'EmbeddingDotBias', 'get_collab_learner']
@dataclass
class CollabFilteringDataset(DatasetBase):
"Base dataset for collaborative filtering... | 47.625 | 120 | 0.693176 |
40ade410d871b79f8a7d9178ba86c69eff8a674c | 4,377 | py | Python | gunicorn/app/django_wsgi.py | chalkchisel/gunicorn | 4d87f1696202fcf1f54dbaee1d86bb2638865f34 | [
"MIT"
] | null | null | null | gunicorn/app/django_wsgi.py | chalkchisel/gunicorn | 4d87f1696202fcf1f54dbaee1d86bb2638865f34 | [
"MIT"
] | null | null | null | gunicorn/app/django_wsgi.py | chalkchisel/gunicorn | 4d87f1696202fcf1f54dbaee1d86bb2638865f34 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
""" module used to build the django wsgi application """
import os
import re
import sys
import time
try:
from io import StringIO
from imp import reload
except ImportError:
from St... | 36.475 | 98 | 0.64085 |
2848ad32094cfe2ff7340ab3e1ecb3055657b743 | 2,566 | py | Python | neo/rawio/tests/test_neuralynxrawio.py | lkoelman/python-neo | 6b0454519b4ead6605d3ce4100a07c33f57df830 | [
"BSD-3-Clause"
] | 1 | 2020-01-13T16:06:56.000Z | 2020-01-13T16:06:56.000Z | neo/rawio/tests/test_neuralynxrawio.py | lkoelman/python-neo | 6b0454519b4ead6605d3ce4100a07c33f57df830 | [
"BSD-3-Clause"
] | 8 | 2018-06-02T11:46:10.000Z | 2018-09-04T15:51:45.000Z | src/neo/neo/rawio/tests/test_neuralynxrawio.py | grg2rsr/SeqPeelSort | 58a207976fb33a50ea8e42b70d7da73b03474f42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# needed for python 3 compatibility
from __future__ import unicode_literals, print_function, division, absolute_import
import unittest
from neo.rawio.neuralynxrawio import NeuralynxRawIO
from neo.rawio.tests.common_rawio_test import BaseTestRawIO
import logging
logging.getLogger().setLevel(... | 38.298507 | 82 | 0.676539 |
e9be373f642f905e409db864c3453e849257f2ed | 19,928 | py | Python | loewieec_sync_hk/bk20170427/sale.py | lester-lees/extra_addons_hk | edd2c2595146bc9c99b75a2d0831a93f940fa55c | [
"Apache-2.0"
] | null | null | null | loewieec_sync_hk/bk20170427/sale.py | lester-lees/extra_addons_hk | edd2c2595146bc9c99b75a2d0831a93f940fa55c | [
"Apache-2.0"
] | null | null | null | loewieec_sync_hk/bk20170427/sale.py | lester-lees/extra_addons_hk | edd2c2595146bc9c99b75a2d0831a93f940fa55c | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
from openerp.osv import fields,osv
import datetime
from openpyxl.reader.excel import load_workbook
import os
import re
from openerp import tools
class product_tmalljd(osv.osv):
_name = "product.tmalljd"
#_inherits = {'product.product': 'product_id'}
def _get_ean13(self, cr, uid,... | 46.344186 | 255 | 0.601666 |
bc4163dbbfffdf72c7aabe4a148a133b86b79c2c | 96,001 | py | Python | tlux/plot.py | tchlux/tlux | 873cf3b1cf1466863f0fb95f23afe149ff89ad79 | [
"MIT"
] | 1 | 2022-03-30T18:43:25.000Z | 2022-03-30T18:43:25.000Z | tlux/plot.py | tchlux/tlux | 873cf3b1cf1466863f0fb95f23afe149ff89ad79 | [
"MIT"
] | null | null | null | tlux/plot.py | tchlux/tlux | 873cf3b1cf1466863f0fb95f23afe149ff89ad79 | [
"MIT"
] | null | null | null | # This module serves to provide a simplified interface to *offline*
# python plotly plotting. The user can produce plots without ever
# interacting directly with the dictionary objects that plotly
# expects. This module currently supports 2D and 3D scatter plots with
# numerical axes, histograms, subplots (with varying... | 47.407901 | 174 | 0.552307 |
62ef09918a71ef82c9aa1c534062a67a20b1108d | 2,397 | py | Python | test/pcdcp_test/PCDCPParser_test.py | usgs/geomag-algorithms | a83a0e36bed9307828e37b9130c25dbc26dd1bc9 | [
"CC0-1.0"
] | 49 | 2015-10-06T17:57:20.000Z | 2022-01-12T18:40:17.000Z | test/pcdcp_test/PCDCPParser_test.py | usgs/geomag-algorithms | a83a0e36bed9307828e37b9130c25dbc26dd1bc9 | [
"CC0-1.0"
] | 229 | 2015-01-26T20:10:36.000Z | 2022-03-12T00:46:33.000Z | test/pcdcp_test/PCDCPParser_test.py | alejandrodelcampillo/geomag-algorithms | 43a734d63a8eb2a696f14237e0054e21d36de7c3 | [
"CC0-1.0"
] | 44 | 2015-03-03T16:18:18.000Z | 2021-11-06T17:07:38.000Z | """Tests for the PCDCP Parser class."""
from numpy.testing import assert_equal
from geomagio.pcdcp import PCDCPParser
PCDCP_EXAMPLE = """
BOU 2015 001 01-Jan-15 HEZF 0.01nT File Version 2.00
0000 2086167 -5707 4745737 5237768
0001 2086190 -5664 4745737 5237777
0002 2086213 -5638 4745741 52377... | 34.242857 | 73 | 0.696704 |
14880d2bd31abddf7da5875bf48154396645072e | 10,283 | py | Python | rcnn/soft_nms.py | Edward-Sun/TSP-Detection | da63a9f23053df22629d1ad1e2c93e548689ba84 | [
"Apache-2.0"
] | 37 | 2021-10-12T13:05:00.000Z | 2022-03-22T02:13:02.000Z | rcnn/soft_nms.py | Edward-Sun/TSP-Detection | da63a9f23053df22629d1ad1e2c93e548689ba84 | [
"Apache-2.0"
] | 2 | 2021-11-01T09:19:55.000Z | 2021-12-16T07:31:11.000Z | rcnn/soft_nms.py | Edward-Sun/TSP-Detection | da63a9f23053df22629d1ad1e2c93e548689ba84 | [
"Apache-2.0"
] | 1 | 2021-10-15T00:40:17.000Z | 2021-10-15T00:40:17.000Z | # This implementation is from
# https://github.com/facebookresearch/detectron2/pull/1183
import torch
import numpy as np
from detectron2.structures import Boxes, RotatedBoxes, pairwise_iou, pairwise_iou_rotated
def soft_nms(boxes, scores, method, gaussian_sigma, linear_threshold, prune_threshold, topk_per_image):
... | 38.513109 | 104 | 0.628805 |
aae32588d2b21a44e3915afa734fae6da4153001 | 2,020 | py | Python | color_detect.py | prityushchandra/image-processing | 73d975a355b7d382c67f1b39e09e4c5b952155fb | [
"MIT"
] | null | null | null | color_detect.py | prityushchandra/image-processing | 73d975a355b7d382c67f1b39e09e4c5b952155fb | [
"MIT"
] | null | null | null | color_detect.py | prityushchandra/image-processing | 73d975a355b7d382c67f1b39e09e4c5b952155fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import cv2
def nothing(x):
pass
def get_frame(cap, scaling_factor):
# Capture the frame from video capture object
ret, frame = cap.read()
# Resize the input frame
frame = cv2.resize(frame, None, fx=scaling_factor,
fy=scaling_factor, interpolation... | 23.218391 | 93 | 0.70099 |
66e8c5cf923b39e66acd9eff65148a7742949b13 | 4,502 | py | Python | sympy/geometry/tests/test_parabola.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | sympy/geometry/tests/test_parabola.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | sympy/geometry/tests/test_parabola.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2018-10-22T09:17:11.000Z | 2018-10-22T09:17:11.000Z | from __future__ import division
from sympy import Rational, oo, sqrt
from sympy import Line, Point, Point2D, Parabola, Segment2D, Ray2D
from sympy import Circle, Ellipse
from sympy.utilities.pytest import raises
def test_parabola_geom():
p1 = Point(0, 0)
p2 = Point(3, 7)
p3 = Point(0, 4)
p4 = Point(6... | 41.302752 | 106 | 0.624611 |
7ac0f449eda3f698bfee0ac3d4d7f93b8ccf5cf1 | 1,693 | py | Python | boa3/model/builtin/interop/storage/findoptionstype.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | null | null | null | boa3/model/builtin/interop/storage/findoptionstype.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | null | null | null | boa3/model/builtin/interop/storage/findoptionstype.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict
from boa3.model.symbol import ISymbol
from boa3.model.type.itype import IType
from boa3.model.type.primitive.inttype import IntType
class FindOptionsType(IntType):
"""
A class used to represent Neo interop FindOptions type
"""
def __init__(self):
super().__init__... | 30.232143 | 80 | 0.665092 |
8905441b8c521a2ebe6e6b46473d058d86c843f9 | 13,326 | py | Python | app/functions/kf_evaluator.py | klehman-rally/kingfisher | e5f0eff0fcc596b15d799d67f20e7e6e54ea7d2e | [
"BSD-3-Clause"
] | null | null | null | app/functions/kf_evaluator.py | klehman-rally/kingfisher | e5f0eff0fcc596b15d799d67f20e7e6e54ea7d2e | [
"BSD-3-Clause"
] | null | null | null | app/functions/kf_evaluator.py | klehman-rally/kingfisher | e5f0eff0fcc596b15d799d67f20e7e6e54ea7d2e | [
"BSD-3-Clause"
] | null | null | null | import sys, os
import base64
import json
from datetime import datetime
from itertools import chain
from app.helpers.pubsub import publish
#############################################################################################################################
WEBHOOK_NOGO_TOPIC = os.getenv('KF_WEBHOOK_NOGO')
WE... | 41.385093 | 130 | 0.597629 |
61cef6b38bd76a0c904df8b01ba97efc25c2eed7 | 4,550 | py | Python | open_spiel/python/algorithms/external_sampling_mccfr_test.py | Limmen/open_spiel | 2d4d7b783a9161e2c4c90f70dec29d6982fac6c1 | [
"Apache-2.0"
] | 1 | 2021-12-31T01:45:58.000Z | 2021-12-31T01:45:58.000Z | open_spiel/python/algorithms/external_sampling_mccfr_test.py | Limmen/open_spiel | 2d4d7b783a9161e2c4c90f70dec29d6982fac6c1 | [
"Apache-2.0"
] | null | null | null | open_spiel/python/algorithms/external_sampling_mccfr_test.py | Limmen/open_spiel | 2d4d7b783a9161e2c4c90f70dec29d6982fac6c1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 DeepMind Technologies Limited
#
# 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 agr... | 38.235294 | 79 | 0.741978 |
4f0530765db952e51b16d15b3d9e6d875317f870 | 3,871 | py | Python | nova/db/sqlalchemy/migrate_repo/versions/070_untie_nova_network_models.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/070_untie_nova_network_models.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/070_untie_nova_network_models.py | russellb/nova | 99c2e02b44a1012c8e26fc7658dc40ec4620a1ee | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 38.71 | 78 | 0.633686 |
9b1f80e3a404c4cdcde8be748c8de57a9799d0c6 | 123 | py | Python | AI/data/constants.py | yast-ia/YastAI | f5a05841126da4acd9b7250c5bf6f627ac1703d5 | [
"MIT"
] | 1 | 2020-08-23T22:00:17.000Z | 2020-08-23T22:00:17.000Z | AI/data/constants.py | sborquez/her2bdl | f9ac9ef19bf5023f3f9d15bef663d3b1a0c92c81 | [
"MIT"
] | null | null | null | AI/data/constants.py | sborquez/her2bdl | f9ac9ef19bf5023f3f9d15bef663d3b1a0c92c81 | [
"MIT"
] | 1 | 2020-08-23T18:34:12.000Z | 2020-08-23T18:34:12.000Z | """
Data and dataset constants
==========================
Collections of variables for datasets and data processing.
"""
| 15.375 | 58 | 0.593496 |
8338a6379b1b37687901146fdc48795c6c581e40 | 1,922 | py | Python | filelists/fileCheck.py | cbaeck1/T2KWP | e3682bee5b96d049d66c586910d34d802ab47637 | [
"BSD-3-Clause"
] | null | null | null | filelists/fileCheck.py | cbaeck1/T2KWP | e3682bee5b96d049d66c586910d34d802ab47637 | [
"BSD-3-Clause"
] | null | null | null | filelists/fileCheck.py | cbaeck1/T2KWP | e3682bee5b96d049d66c586910d34d802ab47637 | [
"BSD-3-Clause"
] | null | null | null | import os
import glob
def load_filepaths_and_text(filename, split="|"):
with open(filename, encoding='utf-8-sig') as f:
filepaths_and_text = [line.strip().split(split) for line in f]
return filepaths_and_text
# 전체
datapath = '/mnt/d/data'
# sample
#datapath = ''
filepaths = [
'korean_public_wav/korea... | 28.264706 | 104 | 0.623309 |
d5bda19c7a2b5a9682bc2d0353117bf95c47fe6b | 7,661 | py | Python | test/tools_Fitting_FitData.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | test/tools_Fitting_FitData.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | test/tools_Fitting_FitData.py | jjacob/DailyPythonScripts | cd6c515c6242d1f3b44e97c8ad05946721b6a36a | [
"Apache-2.0"
] | null | null | null | '''
Created on 31 Oct 2012
@author: kreczko
'''
import unittest
from tools.Fitting import FitData, FitDataCollection
from rootpy.plotting import Hist
import numpy as np
from tools.hist_utilities import adjust_overflow_to_limit
N_bkg1 = 9000
N_signal = 1000
N_bkg1_obs = 10000
N_signal_obs = 2000
N_data = N_bkg1_obs + ... | 45.064706 | 216 | 0.679154 |
0ef56fbbc445a2a295097b6922f77a19ccba8e0e | 26,635 | py | Python | src/folio_migration_tools/migration_tasks/loans_migrator.py | chadmcinnis/folio_migration_tools | 39ee044a713a34c323324a956e3e8b54ee05c194 | [
"MIT"
] | null | null | null | src/folio_migration_tools/migration_tasks/loans_migrator.py | chadmcinnis/folio_migration_tools | 39ee044a713a34c323324a956e3e8b54ee05c194 | [
"MIT"
] | null | null | null | src/folio_migration_tools/migration_tasks/loans_migrator.py | chadmcinnis/folio_migration_tools | 39ee044a713a34c323324a956e3e8b54ee05c194 | [
"MIT"
] | null | null | null | import copy
import csv
import json
import logging
import sys
import time
import traceback
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from typing import Optional
from urllib.error import HTTPError
import requests
from dateutil import parser as du_parser
from folio_uuid.fo... | 44.317804 | 99 | 0.610325 |
77278587fed394619dab0cb9d6f09fc8409af44f | 516 | py | Python | constants.py | tchayintr/cfparser-service | 8a28a572c1570efc845cfe5786cb9730f111d777 | [
"Apache-2.0"
] | null | null | null | constants.py | tchayintr/cfparser-service | 8a28a572c1570efc845cfe5786cb9730f111d777 | [
"Apache-2.0"
] | 1 | 2020-05-18T04:43:32.000Z | 2020-05-18T04:43:32.000Z | constants.py | tchayintr/cfparser-service | 8a28a572c1570efc845cfe5786cb9730f111d777 | [
"Apache-2.0"
] | null | null | null | # for app
APP_DEFAULT_BRACKETS_FORMAT = '[]'
APP_DEFAULT_DELIMITER_PARSED_TREE = '▏' # U+258F (Left one eighth block)
APP_DEFAULT_DELIMITER_PROB = '▁' # U+2581 (Lower one eighth block)
APP_DEFAULT_JSONIFY_KEY_RESULT = 'result'
APP_DEFAULT_LOG_DIR = 'log'
APP_DEFAULT_MODEL_PATH = 'models/main/cfparser-ap... | 36.857143 | 77 | 0.763566 |
5faaf916b74178a25c45da68d435aa335f5db106 | 11,956 | py | Python | airflow/operators/s3_to_hive_operator.py | dmnpignaud/incubator-airflow | 9b5d2f6f6ca5f81e94169f1fd49e4372d0e88bfb | [
"Apache-2.0"
] | 2 | 2018-11-07T10:02:34.000Z | 2018-11-07T10:03:40.000Z | airflow/airflow/operators/s3_to_hive_operator.py | kira-lin/ve450-airflow-on-k8s | f28e8b468568c8623134db5a1a8757860788799f | [
"Apache-2.0"
] | 1 | 2018-11-05T21:12:08.000Z | 2019-07-26T21:00:05.000Z | airflow/airflow/operators/s3_to_hive_operator.py | kira-lin/ve450-airflow-on-k8s | f28e8b468568c8623134db5a1a8757860788799f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 41.950877 | 78 | 0.588658 |
a9a7302bf2bdc1e18b089f25ec17e63f11337e81 | 22 | py | Python | Python/BackgroundApp/BackgroundApp/PythonHome/WinRTExtension.zip/WinRT/__init__.py | Carlosgm02/UWP-Languages | b5653c8f452b204645e3b6276caa95de2432f77e | [
"MIT"
] | 6 | 2019-10-30T08:41:15.000Z | 2021-02-24T09:20:46.000Z | Python/BackgroundApp/BackgroundApp/PythonHome/WinRTExtension.zip/WinRT/__init__.py | carlosgm02/uwp-languages | b5653c8f452b204645e3b6276caa95de2432f77e | [
"MIT"
] | null | null | null | Python/BackgroundApp/BackgroundApp/PythonHome/WinRTExtension.zip/WinRT/__init__.py | carlosgm02/uwp-languages | b5653c8f452b204645e3b6276caa95de2432f77e | [
"MIT"
] | null | null | null | from _winrt import *
| 11 | 21 | 0.727273 |
7cb2c249267e795cb5962e9a7f6364578468c89d | 4,781 | py | Python | subaru_calcs.py | mikeireland/opticstools | 8ce59ee9016e871e92c412a9beb908f2354319b6 | [
"MIT"
] | null | null | null | subaru_calcs.py | mikeireland/opticstools | 8ce59ee9016e871e92c412a9beb908f2354319b6 | [
"MIT"
] | null | null | null | subaru_calcs.py | mikeireland/opticstools | 8ce59ee9016e871e92c412a9beb908f2354319b6 | [
"MIT"
] | null | null | null | """Some diffraction calculations for the RHEA slit feed. Computes the overlap between
a diffraction limited beam and the RHEA IFU, averaging over a user-defined array of
pointing offsets in lenslet units. Overlaps are computed both at the
microlens plane and the fiber plane, demonstrating self-consistency.
In the c... | 33.907801 | 123 | 0.707174 |
d353da20297433d5db69b68c540afb54826baa6d | 2,232 | py | Python | tests/parsing/test_summary.py | mralext20/avwx-engine | 4eabc2a4a08cd931d6f0fab7590ea09390af43e2 | [
"MIT"
] | 30 | 2015-09-08T20:38:41.000Z | 2019-03-10T07:10:47.000Z | tests/parsing/test_summary.py | mralext20/avwx-engine | 4eabc2a4a08cd931d6f0fab7590ea09390af43e2 | [
"MIT"
] | 13 | 2019-11-18T17:03:54.000Z | 2021-09-04T03:53:55.000Z | tests/parsing/test_summary.py | mralext20/avwx-engine | 4eabc2a4a08cd931d6f0fab7590ea09390af43e2 | [
"MIT"
] | 16 | 2019-11-18T01:55:49.000Z | 2021-09-20T03:22:58.000Z | """
Test summary functions
"""
# library
import unittest
# module
from avwx import structs
from avwx.parsing import summary
class TestSummary(unittest.TestCase):
"""Test summary functions"""
def test_metar(self):
"""Tests that METAR translations are summarized in the proper order"""
self.as... | 36.590164 | 96 | 0.512545 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.