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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8c3a3975d43254e1d8881a6fad802c8c224ad325 | 512 | py | Python | desafios-py/expert/d0001-latitude-longitude-ip/d0001-latitude-longitude-ip-v0.py | Lsitjs/challenges-python | fbbfa4d7860ee8efa4d0d3eee4999ea379933224 | [
"MIT"
] | null | null | null | desafios-py/expert/d0001-latitude-longitude-ip/d0001-latitude-longitude-ip-v0.py | Lsitjs/challenges-python | fbbfa4d7860ee8efa4d0d3eee4999ea379933224 | [
"MIT"
] | null | null | null | desafios-py/expert/d0001-latitude-longitude-ip/d0001-latitude-longitude-ip-v0.py | Lsitjs/challenges-python | fbbfa4d7860ee8efa4d0d3eee4999ea379933224 | [
"MIT"
] | null | null | null | # terminal pip install requests
import requests
ip=input("Prezado(a) usuário(a), informe seu ip: ")
#o key é desnecessário é so colar url ja com a chave obtida no site https://ipstack.com/quickstart
#ex http://api.ipstack.com/{ip}?access_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
key=input("Informar chave de acesso no site... | 32 | 98 | 0.755859 |
693b14d6dec4592a82f3ed13bd46020a20d9c410 | 1,227 | py | Python | aitlas/base/segmentation.py | alex-hayhoe/aitlas-docker | 57686f9c18f28c884511fc0c84618506cbf61eae | [
"MIT"
] | null | null | null | aitlas/base/segmentation.py | alex-hayhoe/aitlas-docker | 57686f9c18f28c884511fc0c84618506cbf61eae | [
"MIT"
] | null | null | null | aitlas/base/segmentation.py | alex-hayhoe/aitlas-docker | 57686f9c18f28c884511fc0c84618506cbf61eae | [
"MIT"
] | null | null | null | import logging
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from ..metrics import F1ScoreSample
from ..utils import stringify
from .models import BaseModel
from .schemas import BaseSegmentationClassifierSchema
from .metrics import SegmentationRunningScore
logging.basicC... | 27.266667 | 97 | 0.720456 |
ab2a955de41b01bfac564fdf7269a8a1ee2b2bc1 | 95 | py | Python | archived_projects_(dead)/declare_pyside/typehint/__init__.py | likianta/declare-qtquick | 93c2ce49d841ccdeb0272085c5f731139927f0d7 | [
"MIT"
] | 3 | 2021-11-02T03:45:27.000Z | 2022-03-27T05:33:36.000Z | declare_pyside/typehint/__init__.py | Likianta/pyml | b0005b36aa94958a7d3e306a9df65fea46669d18 | [
"MIT"
] | null | null | null | declare_pyside/typehint/__init__.py | Likianta/pyml | b0005b36aa94958a7d3e306a9df65fea46669d18 | [
"MIT"
] | null | null | null | from . import pyside
from . import qmlside
from . import widgets_support
from .common import *
| 19 | 29 | 0.778947 |
7fe95693b40eca1abe1d0002f62379ad45bf1155 | 6,703 | py | Python | code_complete/code_completer.py | berjc/code-complete | 03c1acb2561cb85e62e791a81ecd624b6297c1c0 | [
"MIT"
] | 1 | 2017-04-29T12:55:42.000Z | 2017-04-29T12:55:42.000Z | code_complete/code_completer.py | berjc/code-complete | 03c1acb2561cb85e62e791a81ecd624b6297c1c0 | [
"MIT"
] | null | null | null | code_complete/code_completer.py | berjc/code-complete | 03c1acb2561cb85e62e791a81ecd624b6297c1c0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Encapsulates Functionality for Testing and Iterating on the Code Complete File. """
import glob
import os
import re
import shutil
import subprocess
from config import READ_OPT
from config import WRITE_OPT
LINE = '=' * 100
# TODO : Fix Task Solution Comment
class CodeCompleter(object):
... | 41.122699 | 132 | 0.650306 |
7510edb25dfae870dce6245b3400b4fd71cc6f96 | 3,425 | py | Python | tests/ex/test_shell_out.py | trishume/VintageousPlus | 1dd62435138234979fe5bb413e1731119b017daf | [
"MIT"
] | 6 | 2017-04-01T05:30:08.000Z | 2017-04-05T14:17:40.000Z | tests/ex/test_shell_out.py | trishume/VintageousPlus | 1dd62435138234979fe5bb413e1731119b017daf | [
"MIT"
] | 1 | 2017-04-04T06:47:13.000Z | 2017-04-04T14:26:32.000Z | tests/ex/test_shell_out.py | trishume/VintageousPlus | 1dd62435138234979fe5bb413e1731119b017daf | [
"MIT"
] | null | null | null | import unittest
import os
import sublime
from VintageousPlus.tests import set_text
from VintageousPlus.tests import add_sel
from VintageousPlus.tests import get_sel
from VintageousPlus.tests import ViewTest
import VintageousPlus.ex.plat as plat
class Test_ex_shell_out_no_input(ViewTest):
@unittest.skipIf(os.nam... | 33.252427 | 102 | 0.625985 |
5357d2e914a16f2c92bf5055eb46dd94188b1347 | 6,267 | py | Python | v3_baseline/.ipynb_checkpoints/model-checkpoint.py | egeersu/Multihop-GNN | 1638eb2408030004112b8c19d4a2f68571eb4011 | [
"MIT"
] | 2 | 2021-09-18T17:59:56.000Z | 2022-03-03T12:26:26.000Z | v3_baseline/.ipynb_checkpoints/model-checkpoint.py | egeersu/Multihop-GNN | 1638eb2408030004112b8c19d4a2f68571eb4011 | [
"MIT"
] | null | null | null | v3_baseline/.ipynb_checkpoints/model-checkpoint.py | egeersu/Multihop-GNN | 1638eb2408030004112b8c19d4a2f68571eb4011 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from dgl.nn.pytorch import RelGraphConv
from hyperpara import *
import torch.nn.functional as F
import dgl
from functools import partial
import dgl
class RGCN(nn.Module):
def __init__(self, num_nodes, gnn_h_dim, out_dim, num_rels,
num_gcn_hidden_layers, dropou... | 35.607955 | 114 | 0.588001 |
ca937b749aebd56405abf312b06faea782dc646e | 247 | py | Python | tools/pbox.py | tlk/nintendo-box | 721eab32d078329302c2a3be3bcfa1d5d6d203f6 | [
"MIT"
] | null | null | null | tools/pbox.py | tlk/nintendo-box | 721eab32d078329302c2a3be3bcfa1d5d6d203f6 | [
"MIT"
] | null | null | null | tools/pbox.py | tlk/nintendo-box | 721eab32d078329302c2a3be3bcfa1d5d6d203f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from game import ngame
print('digraph {')
print('graph [pad="2", nodesep="5", ranksep="10"];')
for j in range(32):
for k in range(32):
if ((ngame.pbox[j]>>k)&1):
print(f'c{j} -> d{k};')
print('}')
| 19 | 52 | 0.538462 |
a97330b478151a7dc9838c10fa445db1c57746aa | 355 | py | Python | wireless/sims/instance-get-example-1/instance-get-example-1.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 3 | 2020-05-05T10:01:02.000Z | 2021-02-06T14:23:13.000Z | wireless/sims/instance-get-example-1/instance-get-example-1.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | wireless/sims/instance-get-example-1/instance-get-example-1.6.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 1 | 2019-10-02T14:36:36.000Z | 2019-10-02T14:36:36.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# required for all twilio access tokens
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
sim = client.wireless.sims('DEAAAAAAAAAAAAAAAAAAAA... | 27.307692 | 72 | 0.814085 |
bdab157cb101116d0f14c00e3af8d1bbe500f7fb | 5,348 | py | Python | tests/aggregate/test_as_dict.py | proteanhq/protean | 2006832265435cad8d4f9b86d1a789d8828d2707 | [
"BSD-3-Clause"
] | 6 | 2018-09-26T04:54:09.000Z | 2022-03-30T01:01:45.000Z | tests/aggregate/test_as_dict.py | proteanhq/protean | 2006832265435cad8d4f9b86d1a789d8828d2707 | [
"BSD-3-Clause"
] | 261 | 2018-09-20T09:53:33.000Z | 2022-03-08T17:43:04.000Z | tests/aggregate/test_as_dict.py | proteanhq/protean | 2006832265435cad8d4f9b86d1a789d8828d2707 | [
"BSD-3-Clause"
] | 6 | 2018-07-22T07:09:15.000Z | 2021-02-02T05:17:23.000Z | from datetime import datetime
from protean import BaseAggregate, BaseEntity, BaseValueObject
from protean.fields import (
DateTime,
HasMany,
HasOne,
Integer,
Reference,
String,
Text,
ValueObject,
)
class TestAggregateWithNoEnclosedEntitiesOrValueObjects:
def test_basic_as_dict(sel... | 31.458824 | 81 | 0.55647 |
c60ce6382422ace6155a357750ca1b5069a32976 | 70 | py | Python | diving_in_python/week_1/mypackage/utils.py | assassinen/coursera_mfti_python | eee7b3c55256f391c1be32924fa1ad3364b307f2 | [
"Apache-2.0"
] | null | null | null | diving_in_python/week_1/mypackage/utils.py | assassinen/coursera_mfti_python | eee7b3c55256f391c1be32924fa1ad3364b307f2 | [
"Apache-2.0"
] | null | null | null | diving_in_python/week_1/mypackage/utils.py | assassinen/coursera_mfti_python | eee7b3c55256f391c1be32924fa1ad3364b307f2 | [
"Apache-2.0"
] | null | null | null | def multiplay(a, b):
return a * b
def sum(a, b):
return a + b | 14 | 20 | 0.542857 |
71c08bef134cda57430c5509009f248dbc2ae007 | 217 | py | Python | tests/drf/mocks.py | taxidriver77/django-angular | f8d9dc58e05c99b6abe694e6be4b4de769664657 | [
"0BSD"
] | 8 | 2016-01-11T11:01:29.000Z | 2019-05-26T18:00:06.000Z | tests/drf/mocks.py | sv1jsb/django-angular | d527e812e02227c0b7151b9211c8248e6298c4df | [
"0BSD"
] | 3 | 2020-02-11T23:41:57.000Z | 2021-06-10T19:13:54.000Z | tests/drf/mocks.py | taxidriver77/django-angular | f8d9dc58e05c99b6abe694e6be4b4de769664657 | [
"0BSD"
] | 8 | 2016-12-19T00:02:26.000Z | 2022-01-11T13:52:43.000Z | # -*- coding: utf-8 -*-
mock_user1 = {
"email": "test@test.com",
"username": "test",
"password": "test",
}
mock_user2 = {
"email": "test2@test.com",
"username": "test2",
"password": "test2",
}
| 18.083333 | 30 | 0.520737 |
af76e407253faaa8bd8f764bb474e358c162a7ba | 1,477 | py | Python | setup.py | victoriamorris/nielsenTools | 51981f0becc3ba93213bd116aac580b51dbdabe6 | [
"MIT"
] | null | null | null | setup.py | victoriamorris/nielsenTools | 51981f0becc3ba93213bd116aac580b51dbdabe6 | [
"MIT"
] | null | null | null | setup.py | victoriamorris/nielsenTools | 51981f0becc3ba93213bd116aac580b51dbdabe6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""setup.py file for nielsenTools."""
# Import required modules
from distutils.core import setup
__author__ = 'Victoria Morris'
__license__ = 'MIT License'
__version__ = '1.0.0'
__status__ = '4 - Beta Development'
# Version
version = '1.0.0'
# Long descr... | 24.213115 | 73 | 0.618145 |
9a70054536516987cad963a4d144b776699f5747 | 1,845 | py | Python | tf2onnx/constants.py | garymm/tensorflow-onnx | a8f78ac7903493dee579304b7b1717aa9ec9706f | [
"Apache-2.0"
] | null | null | null | tf2onnx/constants.py | garymm/tensorflow-onnx | a8f78ac7903493dee579304b7b1717aa9ec9706f | [
"Apache-2.0"
] | null | null | null | tf2onnx/constants.py | garymm/tensorflow-onnx | a8f78ac7903493dee579304b7b1717aa9ec9706f | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
"""
common constants
"""
from onnx import helper
TF2ONNX_PACKAGE_NAME = __name__.split('.')[0]
# Built-in supported domains
ONNX_DOMAIN = ""
AI_ONNX_ML_DOMAIN = "ai.onnx.ml"
MICROSOFT_DOMAIN = "com.microsoft"
CONTRIB_OPS_DOMAIN = "ai.onnx.contrib"
# Default opset version for ... | 30.75 | 109 | 0.731707 |
469d4b0f5da498128deff58c466200e0aa41d9a7 | 2,992 | py | Python | tests/test_read_user_dict.py | rgalbo/cookiecutter | 3bc7b987e4ae9dcee996ae0b00375c1325b8d866 | [
"BSD-3-Clause"
] | 7 | 2019-11-03T03:30:43.000Z | 2021-01-03T04:04:36.000Z | tests/test_read_user_dict.py | rgalbo/cookiecutter | 3bc7b987e4ae9dcee996ae0b00375c1325b8d866 | [
"BSD-3-Clause"
] | 1 | 2019-09-05T09:50:32.000Z | 2019-09-05T09:59:01.000Z | tests/test_read_user_dict.py | rgalbo/cookiecutter | 3bc7b987e4ae9dcee996ae0b00375c1325b8d866 | [
"BSD-3-Clause"
] | 2 | 2017-10-20T13:12:25.000Z | 2022-02-14T05:30:32.000Z | # -*- coding: utf-8 -*-
"""
test_read_user_dict
-------------------
"""
from __future__ import unicode_literals
import click
import pytest
from cookiecutter.prompt import (
process_json,
read_user_dict,
)
def test_process_json_invalid_json():
with pytest.raises(click.UsageError) as exc_info:
p... | 23.015385 | 76 | 0.561497 |
053e1bd84b802d9bcb66c57bbed3b77c1ec79d38 | 3,808 | py | Python | Psychoemotional_simulator/old/2_im_em_ok.py | Izabella13/Trainer_for_facial_muscles | b3ce8e413605d766bd0141da18ffb1ea6a7e49ae | [
"Apache-2.0"
] | null | null | null | Psychoemotional_simulator/old/2_im_em_ok.py | Izabella13/Trainer_for_facial_muscles | b3ce8e413605d766bd0141da18ffb1ea6a7e49ae | [
"Apache-2.0"
] | null | null | null | Psychoemotional_simulator/old/2_im_em_ok.py | Izabella13/Trainer_for_facial_muscles | b3ce8e413605d766bd0141da18ffb1ea6a7e49ae | [
"Apache-2.0"
] | null | null | null | # Импорт нужных библиотек
from time import sleep
import numpy as np
import csv
import cv2
import os
import dlib
import glob
import math
dat_path = '../windows/Data/'
dis_path = '../discript/'
dlib_face = 'dlib_face_recognition_resnet_model_v1.dat'
shape = 'shape_predictor_68_face_landmarks.dat'
# Расположение изображ... | 36.615385 | 84 | 0.685924 |
3ac2c7b45ee0bc1300013b0b5649c65b077d2f6c | 465 | py | Python | data/scripts/templates/object/tangible/wearables/wookiee/shared_wke_gloves_s01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/wearables/wookiee/shared_wke_gloves_s01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/wearables/wookiee/shared_wke_gloves_s01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/wookiee/shared_wke_gloves_s01.iff"
result.attribute_templ... | 27.352941 | 80 | 0.737634 |
92b5c1e08b2274e7861f30b1dbe5ba3ccfc3875f | 762 | py | Python | openprocurement/auction/esco/tests/unit/test_bidders.py | ProzorroUKR/openprocurement.auction.esco | 16a127ac7fc47cacaaf5f2eb708ea8b273e57e56 | [
"Apache-2.0"
] | null | null | null | openprocurement/auction/esco/tests/unit/test_bidders.py | ProzorroUKR/openprocurement.auction.esco | 16a127ac7fc47cacaaf5f2eb708ea8b273e57e56 | [
"Apache-2.0"
] | 3 | 2017-10-26T12:42:01.000Z | 2017-11-06T10:41:49.000Z | openprocurement/auction/esco/tests/unit/test_bidders.py | ProzorroUKR/openprocurement.auction.esco | 16a127ac7fc47cacaaf5f2eb708ea8b273e57e56 | [
"Apache-2.0"
] | 4 | 2017-07-10T12:03:38.000Z | 2017-09-08T10:19:46.000Z | # -*- coding: utf-8 -*-
from openprocurement.auction.esco.tests.unit.constants import AUCTIONS
def test_set_auction_and_participation_urls(universal_auction, mocker):
mock_prepare_auction_and_participation_urls = mocker.MagicMock()
base = 'openprocurement.auction.worker.auctions.{}.prepare_auction_and_partici... | 44.823529 | 94 | 0.799213 |
d1dd15a7d63a7e7a1cb587b686515734eb8d89b6 | 7,731 | py | Python | interface.py | ironman5366/W.I.L.L-Telegram | 3ca8f420ccef4ffd31c44f16a86df357f7f9866c | [
"MIT"
] | null | null | null | interface.py | ironman5366/W.I.L.L-Telegram | 3ca8f420ccef4ffd31c44f16a86df357f7f9866c | [
"MIT"
] | null | null | null | interface.py | ironman5366/W.I.L.L-Telegram | 3ca8f420ccef4ffd31c44f16a86df357f7f9866c | [
"MIT"
] | null | null | null | #Builtin imports
import logging
#External imports
import dataset
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove, InlineKeyboardButton, InlineKeyboardMarkup)
from telegram.ext import (
Updater, CommandHandler, MessageHandler, Filters, Job, CallbackQueryHandler, RegexHandler, ConversationHandler, Hand... | 41.342246 | 133 | 0.646747 |
b52232d2a8e490802bc2f84bd05f32a46648d40b | 11,950 | py | Python | catkin_ws/devel/.private/baxter_interface/lib/python2.7/dist-packages/baxter_interface/cfg/PositionFFJointTrajectoryActionServerConfig.py | roop-pal/robotic-folding | a0e062ac6d23cd07fe10e3f45abc4ba50e533141 | [
"RSA-MD"
] | null | null | null | catkin_ws/devel/.private/baxter_interface/lib/python2.7/dist-packages/baxter_interface/cfg/PositionFFJointTrajectoryActionServerConfig.py | roop-pal/robotic-folding | a0e062ac6d23cd07fe10e3f45abc4ba50e533141 | [
"RSA-MD"
] | null | null | null | catkin_ws/devel/.private/baxter_interface/lib/python2.7/dist-packages/baxter_interface/cfg/PositionFFJointTrajectoryActionServerConfig.py | roop-pal/robotic-folding | a0e062ac6d23cd07fe10e3f45abc4ba50e533141 | [
"RSA-MD"
] | null | null | null | ## *********************************************************
##
## File autogenerated for the baxter_interface package
## by the dynamic_reconfigure package.
## Please do not edit.
##
## ********************************************************/
from dynamic_reconfigure.encoding import extract_params
inf = float('i... | 322.972973 | 11,063 | 0.677657 |
7936dffca2625fa5413907654152bd8a3dc38f70 | 31,716 | py | Python | mvregfus/imaris.py | m-albert/MVRegFus | dc55537bdf87a60a0a023644a042f1a398db7c9c | [
"BSD-3-Clause"
] | 7 | 2020-04-27T01:00:38.000Z | 2021-12-05T01:04:52.000Z | mvregfus/imaris.py | m-albert/MVRegFus | dc55537bdf87a60a0a023644a042f1a398db7c9c | [
"BSD-3-Clause"
] | 7 | 2020-07-21T14:15:08.000Z | 2021-02-24T12:21:33.000Z | mvregfus/imaris.py | m-albert/MVRegFus | dc55537bdf87a60a0a023644a042f1a398db7c9c | [
"BSD-3-Clause"
] | 3 | 2020-07-21T14:44:01.000Z | 2022-03-13T16:58:21.000Z | """
file taken and modified from https://github.com/tlambert03/imarispy/blob/master/imarispy
(added functions from utils.py for easy single file import)
"""
# from .util import h5str, make_thumbnail, subsample_data
import logging
import os
import re
import h5py
import numpy as np
logger = logging.getLogger(__name__)... | 40.713736 | 128 | 0.512864 |
22b512610cade77302af75c26f968ff9d65a06bb | 1,232 | py | Python | home_application/views.py | xieyag/testA | 97a2e762497e90ecf14676a90f9b65950736f312 | [
"Apache-2.0"
] | null | null | null | home_application/views.py | xieyag/testA | 97a2e762497e90ecf14676a90f9b65950736f312 | [
"Apache-2.0"
] | 4 | 2020-02-12T03:00:16.000Z | 2021-06-10T21:45:39.000Z | home_application/views.py | xieyag/testA | 97a2e762497e90ecf14676a90f9b65950736f312 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obt... | 30.8 | 115 | 0.734578 |
56d5903059aa69dc7ac8641d9ccebadcbb2e3146 | 8,873 | py | Python | src/openprocurement/tender/location/models.py | BohdanBorkivskyi/openprocurement.api | 9f4134a15243f8a82a28de72c5ffac6f16e7f06b | [
"Apache-2.0"
] | null | null | null | src/openprocurement/tender/location/models.py | BohdanBorkivskyi/openprocurement.api | 9f4134a15243f8a82a28de72c5ffac6f16e7f06b | [
"Apache-2.0"
] | null | null | null | src/openprocurement/tender/location/models.py | BohdanBorkivskyi/openprocurement.api | 9f4134a15243f8a82a28de72c5ffac6f16e7f06b | [
"Apache-2.0"
] | null | null | null | from schematics.transforms import whitelist
from schematics.types import StringType, URLType, BooleanType, IntType, ValidationError
from schematics.types.compound import ModelType, ListType
from zope.interface import implementer
from openprocurement.agreement.core.models.agreement import Agreement
from openprocurement... | 47.704301 | 161 | 0.672377 |
4007723856584db9008635ae01654a61b09ae55e | 1,939 | py | Python | urbit/cue.py | laanwj/urbit-tools | b3823d50d5ab84c0852593e3255c0d7c51de6d1c | [
"MIT"
] | 18 | 2015-02-03T19:27:18.000Z | 2021-04-04T03:03:57.000Z | urbit/cue.py | laanwj/urbit-tools | b3823d50d5ab84c0852593e3255c0d7c51de6d1c | [
"MIT"
] | null | null | null | urbit/cue.py | laanwj/urbit-tools | b3823d50d5ab84c0852593e3255c0d7c51de6d1c | [
"MIT"
] | 2 | 2015-10-02T01:37:13.000Z | 2017-06-04T03:41:49.000Z |
# jam format
# 0 10
# 1 1100
# 2 100.1000
# 3 110.1000
# 4 1001.1000
# 5 1011.1000
# 7 1111.1000
# 8 100.0001.0000
# 15 111.1001.0000
# 31 1111.1011.0000
# 63 1.1111.1101.0000
#127 ... | 24.858974 | 68 | 0.449716 |
2e458d9398af5df935cd63e9a6e96a7b84080382 | 928 | py | Python | xlsxwriter/test/comparison/test_data_validation07.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_data_validation07.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_data_validation07.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompare... | 24.421053 | 79 | 0.579741 |
679e8fc43d493624920bad7587534c018aa769bd | 3,735 | py | Python | superviselySDK/supervisely_lib/nn/hosted/inference_batch.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 40 | 2019-05-05T08:08:18.000Z | 2021-10-17T00:07:58.000Z | superviselySDK/supervisely_lib/nn/hosted/inference_batch.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 8 | 2019-06-13T06:00:08.000Z | 2021-07-24T05:25:33.000Z | superviselySDK/supervisely_lib/nn/hosted/inference_batch.py | nicehuster/mmdetection-supervisely-person-datasets | ff1b57e16a71378510571dbb9cebfdb712656927 | [
"Apache-2.0"
] | 6 | 2019-07-30T06:36:27.000Z | 2021-06-03T11:57:36.000Z | # coding: utf-8
from copy import deepcopy
import os
from supervisely_lib import logger
from supervisely_lib.annotation.annotation import Annotation
from supervisely_lib.imaging import image as sly_image
from supervisely_lib.io.json import load_json_file
from supervisely_lib.nn.config import AlwaysPassingConfigValidat... | 54.926471 | 119 | 0.763855 |
47f64ae59b0dc5d4b6929e272da450e15e06bf3b | 218 | py | Python | FIAP - python/Capitulo3-Listas/CriandoListas.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | FIAP - python/Capitulo3-Listas/CriandoListas.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | FIAP - python/Capitulo3-Listas/CriandoListas.py | AlamoVinicius/code-pratice | 924a3ff782caf3695bbeeac39fa02fb23781cd75 | [
"MIT"
] | null | null | null | # Lista preenchida estaticamente
lista_estaticamente = ['xpto', True]
# Lista preenchida dinamicamente
lista_dinamica = [input('Digite um usuário: '), bool(int(input('Está logado?')))]
# Lista vazia:
lista_vazia = [] | 27.25 | 81 | 0.733945 |
49c2cd91b1010c1748480034454ef625005ce078 | 1,906 | py | Python | test/test_pyCLIP.py | guma44/pyCLIP | 9fb21100aa5f40c5cf6a4964ca7f4192e623e575 | [
"MIT"
] | null | null | null | test/test_pyCLIP.py | guma44/pyCLIP | 9fb21100aa5f40c5cf6a4964ca7f4192e623e575 | [
"MIT"
] | null | null | null | test/test_pyCLIP.py | guma44/pyCLIP | 9fb21100aa5f40c5cf6a4964ca7f4192e623e575 | [
"MIT"
] | null | null | null | import os
import sys
from Bio import SeqIO
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(script_dir, ".."))
import ShortRead
for rec in SeqIO.parse(os.path.join(script_dir, 'test.fa'), 'fasta'):
actual = rec.id.split('|')[0].split(':')
read = ShortRead.ShortRead(chrom='c... | 30.741935 | 69 | 0.449108 |
b5e5e998561d16deb6e1425f400d92650d74d40b | 24,981 | py | Python | tests/www/views/test_views_acl.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 1 | 2021-03-03T07:00:02.000Z | 2021-03-03T07:00:02.000Z | tests/www/views/test_views_acl.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 36 | 2021-11-26T00:08:49.000Z | 2021-11-26T00:09:33.000Z | tests/www/views/test_views_acl.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 3 | 2020-06-30T02:38:17.000Z | 2022-01-19T06:14:08.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... | 32.740498 | 108 | 0.708819 |
a0b30a7cae8a6f4033ac7c9d10908fa716a8f3d3 | 8,208 | py | Python | utest/running/test_userhandlers.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-09-13T08:56:49.000Z | 2021-01-10T11:21:34.000Z | utest/running/test_userhandlers.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-10-15T19:39:58.000Z | 2020-10-15T19:41:03.000Z | utest/running/test_userhandlers.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-02-29T15:42:22.000Z | 2018-05-08T08:58:18.000Z | import sys
import unittest
from robot.errors import DataError
from robot.model import Keywords
from robot.running.userkeyword import EmbeddedArgumentsHandler
from robot.running.arguments import EmbeddedArguments, UserKeywordArgumentParser
from robot.utils.asserts import (assert_equal, assert_true, assert_raises,
... | 38 | 83 | 0.568226 |
b55bd52ebdec79ff1d4ced8480ebb02c9cea1d93 | 3,148 | py | Python | cen/experiment/utils.py | crodriguez1a/cen | f03397a0bf4ac24162e270907d623f8658179e88 | [
"Apache-2.0"
] | 6 | 2020-02-23T04:53:08.000Z | 2022-01-10T18:13:37.000Z | cen/experiment/utils.py | crodriguez1a/cen | f03397a0bf4ac24162e270907d623f8658179e88 | [
"Apache-2.0"
] | null | null | null | cen/experiment/utils.py | crodriguez1a/cen | f03397a0bf4ac24162e270907d623f8658179e88 | [
"Apache-2.0"
] | 5 | 2020-09-27T23:46:33.000Z | 2021-10-14T07:42:54.000Z | # Copyright 2020 Maruan Al-Shedivat. 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 appli... | 29.148148 | 80 | 0.6223 |
3b916aa30d7f2f4d0b7e6b29de6b6c4b05c11878 | 2,855 | py | Python | Nancy/strat/comparisons/make_readme.py | SalishSeaCast/analysis | 5964628f08ca1f36121a5d8430ad5b4ae7756c7a | [
"Apache-2.0"
] | null | null | null | Nancy/strat/comparisons/make_readme.py | SalishSeaCast/analysis | 5964628f08ca1f36121a5d8430ad5b4ae7756c7a | [
"Apache-2.0"
] | null | null | null | Nancy/strat/comparisons/make_readme.py | SalishSeaCast/analysis | 5964628f08ca1f36121a5d8430ad5b4ae7756c7a | [
"Apache-2.0"
] | null | null | null | """Salish Sea NEMO IPython Notebook collection README generator
Copyright 2013-2016 The Salish Sea MEOPAR Contributors
and The University of British Columbia
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 L... | 36.139241 | 76 | 0.678459 |
db74d525da6294ebb40993b40634ba9bfffd3ce3 | 2,489 | py | Python | numpy-pandas-matplotlib/functions_vectorised.py | AxoyTO/ML-DL-DS-Python-Studies | ffef653190d1106e01244a4ea7f3f953b9d97882 | [
"Unlicense"
] | null | null | null | numpy-pandas-matplotlib/functions_vectorised.py | AxoyTO/ML-DL-DS-Python-Studies | ffef653190d1106e01244a4ea7f3f953b9d97882 | [
"Unlicense"
] | null | null | null | numpy-pandas-matplotlib/functions_vectorised.py | AxoyTO/ML-DL-DS-Python-Studies | ffef653190d1106e01244a4ea7f3f953b9d97882 | [
"Unlicense"
] | 1 | 2021-12-08T13:00:41.000Z | 2021-12-08T13:00:41.000Z | import numpy
import numpy as np
import pickle
from itertools import groupby
def prod_non_zero_diag(X: np.ndarray) -> int:
if not 0 in X.diagonal():
return X.diagonal().prod()
if len(X.diagonal().nonzero()[0]) == 0:
return -1
else:
prod = 1
for i in X[X.diagonal().nonzero(),... | 23.481132 | 72 | 0.506227 |
04ffbb54417c472b7e6ccffe19048cce86b858cd | 1,574 | py | Python | tools/find_includes.py | meghanto/tiny_vm | da19e9f4bff3b48349bf13f8dc725d387d01e1f5 | [
"CC-BY-3.0"
] | 2 | 2022-01-12T03:16:07.000Z | 2022-01-15T07:52:48.000Z | tools/find_includes.py | meghanto/tiny_vm | da19e9f4bff3b48349bf13f8dc725d387d01e1f5 | [
"CC-BY-3.0"
] | 2 | 2022-01-25T20:52:54.000Z | 2022-01-31T02:46:45.000Z | tools/find_includes.py | meghanto/tiny_vm | da19e9f4bff3b48349bf13f8dc725d387d01e1f5 | [
"CC-BY-3.0"
] | 10 | 2022-01-04T04:36:07.000Z | 2022-01-15T00:55:27.000Z | """
Scan #include references in C/C++ code
"""
import argparse
import pathlib
import logging
import re
logging.basicConfig()
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
C_SUFFIXES = ["h", "c"] # FIXME: Need comprehensive suffix list
def cli() -> object:
"""Command line arguments"""
parser =... | 24.984127 | 74 | 0.543837 |
7ad85af44829b972b33aad6a596ad03693c1a8e8 | 333 | py | Python | app.py | ptrkdy/weather_bot | 0b68e74421a026ff59d17f730eb87cb2dea7cacf | [
"Apache-2.0"
] | null | null | null | app.py | ptrkdy/weather_bot | 0b68e74421a026ff59d17f730eb87cb2dea7cacf | [
"Apache-2.0"
] | null | null | null | app.py | ptrkdy/weather_bot | 0b68e74421a026ff59d17f730eb87cb2dea7cacf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from flask import Flask
app = Flask(__name__)
# tell our app which pages it will accept
# check conversation
# check slots
# imagine endpoint design -> /chatbot /conversation /slots /user
@app.route('/') # 'http://www.ourapi.com/' root directory
def home():
return "Hello, world!"
app.run... | 15.857143 | 64 | 0.702703 |
aa266f4d379a013665e4e63bae7821b118b83baa | 1,149 | py | Python | day3/python/main.py | freidrichen/advent-of-code-2019 | 08aca50e86700504d35c934a308a640a95de586e | [
"MIT"
] | null | null | null | day3/python/main.py | freidrichen/advent-of-code-2019 | 08aca50e86700504d35c934a308a640a95de586e | [
"MIT"
] | null | null | null | day3/python/main.py | freidrichen/advent-of-code-2019 | 08aca50e86700504d35c934a308a640a95de586e | [
"MIT"
] | null | null | null | import numpy as np
def get_sections(line):
return [(s[0], int(s[1:])) for s in line.split(',')]
def get_coords(sections):
coords = set()
current_coord = np.array([0, 0])
for direction, length in sections:
if direction == 'U':
dir_unit = np.array([0, -1])
elif direction ==... | 28.725 | 72 | 0.604874 |
c95000c188c1f4473e5b7cc123b641675e66706e | 2,112 | py | Python | kolibri/core/auth/management/commands/resumesync.py | MBKayro/kolibri | 0a38a5fb665503cf8f848b2f65938e73bfaa5989 | [
"MIT"
] | 545 | 2016-01-19T19:26:55.000Z | 2022-03-20T00:13:04.000Z | kolibri/core/auth/management/commands/resumesync.py | MBKayro/kolibri | 0a38a5fb665503cf8f848b2f65938e73bfaa5989 | [
"MIT"
] | 8,329 | 2016-01-19T19:32:02.000Z | 2022-03-31T21:23:12.000Z | kolibri/core/auth/management/commands/resumesync.py | MBKayro/kolibri | 0a38a5fb665503cf8f848b2f65938e73bfaa5989 | [
"MIT"
] | 493 | 2016-01-19T19:26:48.000Z | 2022-03-28T14:35:05.000Z | from kolibri.core.auth.constants.morango_sync import DATA_PORTAL_SYNCING_BASE_URL
from kolibri.core.auth.management.utils import get_network_connection
from kolibri.core.auth.management.utils import MorangoSyncCommand
class Command(MorangoSyncCommand):
help = "Allow the syncing of facility data with Kolibri Data ... | 36.413793 | 99 | 0.608902 |
821ad0604faf35c7e7ce9deddf3a4740ee57a73f | 2,697 | py | Python | venv/lib/python3.8/site-packages/applicationinsights/channel/contracts/MetricData.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/applicationinsights/channel/contracts/MetricData.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/applicationinsights/channel/contracts/MetricData.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | import collections
import copy
from .Utils import _write_complex_object
class MetricData(object):
"""Data contract class for type MetricData.
"""
ENVELOPE_TYPE_NAME = 'Microsoft.ApplicationInsights.Metric'
DATA_TYPE_NAME = 'MetricData'
_defaults = collections.OrderedDict([
... | 26.70297 | 88 | 0.510197 |
bf3796eba5c4a475c58de564c37841c056fce88e | 16,732 | py | Python | app/calculadora.py | mylesdonaldson/calculadora-tk | 1679aa57035fbba10a381b7804afbb8d37c5b325 | [
"MIT"
] | 1 | 2022-01-17T00:29:43.000Z | 2022-01-17T00:29:43.000Z | app/calculadora.py | mylesdonaldson/calculadora-tk | 1679aa57035fbba10a381b7804afbb8d37c5b325 | [
"MIT"
] | null | null | null | app/calculadora.py | mylesdonaldson/calculadora-tk | 1679aa57035fbba10a381b7804afbb8d37c5b325 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @autor: Matheus Felipe
# @github: github.com/matheusfelipeog
# Builtins
import sys
import os
import platform
import tkinter as tk
from tkinter import Menu, FALSE
from functools import partial
from json import load as json_load
from json import dump as json_dump
from copy import deepcopy
... | 42.040201 | 102 | 0.629094 |
5f1d2da412e53a57b593a9370cf1f8cec76d4da2 | 3,687 | py | Python | pymodule/rule.py | ymktw/SDNProbe | 46dee9737951012dc378f4d71675844402093569 | [
"Apache-2.0"
] | 3 | 2017-07-17T04:12:27.000Z | 2017-07-22T06:37:21.000Z | pymodule/rule.py | ymktw/SDNProbe | 46dee9737951012dc378f4d71675844402093569 | [
"Apache-2.0"
] | null | null | null | pymodule/rule.py | ymktw/SDNProbe | 46dee9737951012dc378f4d71675844402093569 | [
"Apache-2.0"
] | null | null | null | import cPickle
def dump_rules(filename, rules):
with open(filename, 'w') as f:
cPickle.dump(rules, f, cPickle.HIGHEST_PROTOCOL)
def load_rules(filename):
with open(filename, 'r') as f:
rules = cPickle.load(f)
return rules
class Rule():
APPLY_ACTION = 0
CLEAR_ACTION = 1
WRITE_A... | 27.514925 | 139 | 0.616762 |
01d7e6124fa080baf4b7e1bf8116ac821b6cbf4a | 14,672 | py | Python | test/e2e/v1beta1/argo_workflow.py | jardon/katib | 9c88bbce8e0b3b43f0e791de6983d6d10a207a1b | [
"Apache-2.0"
] | null | null | null | test/e2e/v1beta1/argo_workflow.py | jardon/katib | 9c88bbce8e0b3b43f0e791de6983d6d10a207a1b | [
"Apache-2.0"
] | null | null | null | test/e2e/v1beta1/argo_workflow.py | jardon/katib | 9c88bbce8e0b3b43f0e791de6983d6d10a207a1b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.814433 | 110 | 0.562432 |
18e8f6dbec7ca0229b29a754c039d4b6a722f128 | 988 | py | Python | src/train/train_logistic_reg.py | CristianViorelPopa/transformers-dialect-identification | 75edbc39c4b91967b99b63d97f7cd6644c48f8a7 | [
"MIT"
] | 3 | 2021-11-04T09:26:19.000Z | 2022-01-13T00:20:41.000Z | src/train/train_logistic_reg.py | CristianViorelPopa/transformers-dialect-identification | 75edbc39c4b91967b99b63d97f7cd6644c48f8a7 | [
"MIT"
] | null | null | null | src/train/train_logistic_reg.py | CristianViorelPopa/transformers-dialect-identification | 75edbc39c4b91967b99b63d97f7cd6644c48f8a7 | [
"MIT"
] | null | null | null | import argparse
import pickle
from sklearn.datasets import load_svmlight_file
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GridSearchCV
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--data-file", required=True,
help="Location... | 29.058824 | 85 | 0.708502 |
be78367fd6cd713d44ccf34a37009c995c3eb564 | 667 | py | Python | 2021/puzzle_07.py | ericvw/advent-of-code | dec645d778fe5532f1b7796220bb6c89a156911f | [
"MIT"
] | null | null | null | 2021/puzzle_07.py | ericvw/advent-of-code | dec645d778fe5532f1b7796220bb6c89a156911f | [
"MIT"
] | null | null | null | 2021/puzzle_07.py | ericvw/advent-of-code | dec645d778fe5532f1b7796220bb6c89a156911f | [
"MIT"
] | null | null | null | import fileinput
from itertools import chain
import math
import statistics
# Parse
crab_positions = [
int(x)
for x in chain.from_iterable(line.rstrip().split(",") for line in fileinput.input())
]
# Main
# Part 1
median = int(statistics.median(crab_positions))
deltas_to_align = [abs(p - median) for p in crab_... | 22.233333 | 88 | 0.701649 |
4289505d1d8212c09167280e2efbe257f8fbe7c0 | 1,269 | py | Python | django_modules/home/forms.py | Mehdi6/djangoModules | b6e8fc578933675d0d087e87e1bdc99d12f440c1 | [
"MIT"
] | null | null | null | django_modules/home/forms.py | Mehdi6/djangoModules | b6e8fc578933675d0d087e87e1bdc99d12f440c1 | [
"MIT"
] | null | null | null | django_modules/home/forms.py | Mehdi6/djangoModules | b6e8fc578933675d0d087e87e1bdc99d12f440c1 | [
"MIT"
] | null | null | null | from django import forms
from .models import Contact
from django.core.mail import EmailMessage
from django.conf import settings
class ContactForm(forms.Form):
name = forms.CharField(required=True, min_length=3, max_length=50, label='Name', widget=forms.TextInput(attrs={'placeholder': 'Name'}))
email = for... | 52.875 | 150 | 0.666667 |
e18e025d49122b2c18067565af8a4e0ef569e2e6 | 972 | py | Python | src/cdumay_rest_client/client.py | cdumay/cdumay-rest-client | ba0c997c418a88a096c030a2892595904a49b817 | [
"Apache-2.0"
] | null | null | null | src/cdumay_rest_client/client.py | cdumay/cdumay-rest-client | ba0c997c418a88a096c030a2892595904a49b817 | [
"Apache-2.0"
] | null | null | null | src/cdumay_rest_client/client.py | cdumay/cdumay-rest-client | ba0c997c418a88a096c030a2892595904a49b817 | [
"Apache-2.0"
] | 1 | 2018-01-12T15:27:27.000Z | 2018-01-12T15:27:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. codeauthor:: Cédric Dumay <cedric.dumay@gmail.com>
"""
import json
import logging
from cdumay_http_client.client import HttpClient
logger = logging.getLogger(__name__)
class RESTClient(HttpClient):
"""RestClient"""
def __init__(self, server, timeout=No... | 25.578947 | 76 | 0.635802 |
98492bd36d6ec868d291aa5e0150c43cadf6c115 | 631 | py | Python | frappe_renovation_docsync/__init__.py | mainul94/frappe_renovation_docsync | 5d49655b373cdd891e594feed6825952e0b7e089 | [
"MIT"
] | null | null | null | frappe_renovation_docsync/__init__.py | mainul94/frappe_renovation_docsync | 5d49655b373cdd891e594feed6825952e0b7e089 | [
"MIT"
] | null | null | null | frappe_renovation_docsync/__init__.py | mainul94/frappe_renovation_docsync | 5d49655b373cdd891e594feed6825952e0b7e089 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.0.1'
# Patches
import frappe.event_streaming.doctype.event_producer.event_producer
from frappe.event_streaming.doctype.event_producer.event_producer import EventProducer
from frappe_renovation_docsync.utils.event_producer import get_requ... | 48.538462 | 99 | 0.868463 |
a14a57f02d6fb6ee2048149ab284a23c420fcf48 | 1,381 | py | Python | api/views.py | darlannakamura/secompp-2018 | 1dd7edef642f56769a1c606ca3de566429f0d39c | [
"MIT",
"Unlicense"
] | null | null | null | api/views.py | darlannakamura/secompp-2018 | 1dd7edef642f56769a1c606ca3de566429f0d39c | [
"MIT",
"Unlicense"
] | null | null | null | api/views.py | darlannakamura/secompp-2018 | 1dd7edef642f56769a1c606ca3de566429f0d39c | [
"MIT",
"Unlicense"
] | null | null | null | from rest_framework import generics
from rest_framework import mixins
from blog.models import Post
from rest_framework import permissions
from api.serializers import PostSerializer
from api.permissions import IsAuthorOrReadOnly
from rest_framework.permissions import IsAuthenticatedOrReadOnly
class PostList(generics.Li... | 36.342105 | 78 | 0.714699 |
1532dcd4b5c644e5378fe5ae0193b0cac8aecdb3 | 2,413 | py | Python | lib/medloaders/covid_ct_dataset.py | McMasterAI/RadiologyandAI-MedicalZooPytorch | 606a1654f08b8bae7c265608694d55fecc1001ed | [
"MIT"
] | 995 | 2019-07-23T11:34:22.000Z | 2022-03-30T21:10:52.000Z | lib/medloaders/covid_ct_dataset.py | pyushkevich/MedicalZooPytorch | c6831d8ddebfbc1b33c04f8cec0d01c2ceb828f6 | [
"MIT"
] | 18 | 2020-04-27T03:38:22.000Z | 2022-01-18T20:55:20.000Z | lib/medloaders/covid_ct_dataset.py | pyushkevich/MedicalZooPytorch | c6831d8ddebfbc1b33c04f8cec0d01c2ceb828f6 | [
"MIT"
] | 209 | 2019-08-21T13:41:13.000Z | 2022-03-30T08:01:52.000Z | import os
import torch
from torch.utils.data import Dataset
from lib.utils.covid_utils import read_txt
from PIL import Image
import torchvision.transforms as transforms
class CovidCTDataset(Dataset):
def __init__(self,mode, root_dir, txt_COVID, txt_NonCOVID, transform=None):
"""
Args:
... | 30.1625 | 119 | 0.5661 |
9cba9eae7ae64b8752071a584a4e0870153f0f7f | 5,555 | py | Python | ciphey/languageCheckerMod/dictionaryChecker.py | decalage2/Ciphey | ebe22af0a2ab5c21aaaa3913f8ff20e10149ca9e | [
"MIT"
] | 1 | 2020-10-28T18:37:23.000Z | 2020-10-28T18:37:23.000Z | ciphey/languageCheckerMod/dictionaryChecker.py | decalage2/Ciphey | ebe22af0a2ab5c21aaaa3913f8ff20e10149ca9e | [
"MIT"
] | null | null | null | ciphey/languageCheckerMod/dictionaryChecker.py | decalage2/Ciphey | ebe22af0a2ab5c21aaaa3913f8ff20e10149ca9e | [
"MIT"
] | 1 | 2021-09-18T13:21:00.000Z | 2021-09-18T13:21:00.000Z | import string
import os
import sys
from loguru import logger
import cipheydists
sys.path.append("..")
try:
import ciphey.mathsHelper as mh
except ModuleNotFoundError:
import mathsHelper as mh
class dictionaryChecker:
"""
Class designed to confirm whether something is **language**... | 35.382166 | 117 | 0.590999 |
70dc138daeeff711e87ee3bc28a66d178d6c3f01 | 4,325 | py | Python | app/src/Poem_On_a_topic.py | dgw0015/AI-Backend | 0b377504585bf807171569cece382e5a140b2142 | [
"Apache-2.0"
] | null | null | null | app/src/Poem_On_a_topic.py | dgw0015/AI-Backend | 0b377504585bf807171569cece382e5a140b2142 | [
"Apache-2.0"
] | null | null | null | app/src/Poem_On_a_topic.py | dgw0015/AI-Backend | 0b377504585bf807171569cece382e5a140b2142 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# Load data
import io
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from IPython import get_ipython
sns.set(context='talk', style='ticks')
get_ipython().run_line_magic('matplotlib', 'inline')
# In[50]:
# Read text file ... | 25 | 117 | 0.648786 |
ab0ffe46af397d359ef1163e7015786500dc42d3 | 2,357 | py | Python | SpiderForCollege/spiders/city.py | Rafael-Luo/spider-college | 20869fbd916db199273bbf84310593c5a593d2cb | [
"MIT"
] | 2 | 2021-03-17T16:08:19.000Z | 2021-05-23T11:12:02.000Z | SpiderForCollege/spiders/city.py | Rafael-Luo/spider-college | 20869fbd916db199273bbf84310593c5a593d2cb | [
"MIT"
] | null | null | null | SpiderForCollege/spiders/city.py | Rafael-Luo/spider-college | 20869fbd916db199273bbf84310593c5a593d2cb | [
"MIT"
] | 2 | 2020-05-18T18:32:33.000Z | 2021-06-26T07:37:14.000Z | # 获取省份及链接
import re
from multiprocessing.dummy import Pool
import requests
from bs4 import BeautifulSoup
from SpiderForCollege.db.DBUtil import DBUtil
pro_link = []
def get_provice(url):
web_data = requests.get(url, headers=header)
soup = BeautifulSoup(web_data.content, 'lxml')
provice_link = soup.select... | 31.851351 | 103 | 0.540518 |
6d4d41bca05d724ee8cca6308cd1327e3fb11464 | 106,236 | py | Python | tests/exchange/test_IbetExchange.py | BoostryJP/ibet-SmartContract | dc3f73a708ef145e7200ce58fce4e8171e21d3c2 | [
"Apache-2.0"
] | 10 | 2021-06-12T08:43:50.000Z | 2022-02-17T14:24:48.000Z | tests/exchange/test_IbetExchange.py | BoostryJP/ibet-SmartContract | dc3f73a708ef145e7200ce58fce4e8171e21d3c2 | [
"Apache-2.0"
] | 44 | 2021-04-11T06:43:10.000Z | 2022-03-30T12:42:32.000Z | tests/exchange/test_IbetExchange.py | BoostryJP/ibet-SmartContract | dc3f73a708ef145e7200ce58fce4e8171e21d3c2 | [
"Apache-2.0"
] | 1 | 2022-03-09T07:27:57.000Z | 2022-03-09T07:27:57.000Z | """
Copyright BOOSTRY Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distr... | 27.949487 | 113 | 0.52021 |
b6c6cb7d24d753390113f278f3d9a4eb0a34afed | 150 | py | Python | Grundgeruest/urls.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | Grundgeruest/urls.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | Grundgeruest/urls.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = 'Grundgeruest'
urlpatterns = [
url(r'^$', views.index, name='index'),
]
| 16.666667 | 43 | 0.64 |
f202ce2a09fb4c8f112002ad0407840ebdc2baab | 139,734 | py | Python | emcc.py | yishengjiang99/emscripten | add7cf2f0b76abb20460f0742c5402ca9b46f8d8 | [
"MIT"
] | null | null | null | emcc.py | yishengjiang99/emscripten | add7cf2f0b76abb20460f0742c5402ca9b46f8d8 | [
"MIT"
] | null | null | null | emcc.py | yishengjiang99/emscripten | add7cf2f0b76abb20460f0742c5402ca9b46f8d8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2011 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""emcc - compiler helper script
=============... | 42.21571 | 379 | 0.689131 |
77bc5a300cbe4ae8a95e8478cac759ce85b445bf | 11,501 | py | Python | python/tvm/relay/backend/contrib/ethosu/te/convolution.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1 | 2022-01-29T21:05:36.000Z | 2022-01-29T21:05:36.000Z | python/tvm/relay/backend/contrib/ethosu/te/convolution.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/backend/contrib/ethosu/te/convolution.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1 | 2022-03-02T16:24:54.000Z | 2022-03-02T16:24:54.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... | 33.727273 | 99 | 0.628554 |
3e43d40eff0e879910697be7edf94938f33f1711 | 15,919 | py | Python | poem/core/data_utils_test.py | wondercha/google-research | 1c3d958e8f99aad52d48a0665bc5e8446ad87d8d | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | poem/core/data_utils_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 7 | 2021-11-10T19:44:38.000Z | 2022-02-10T06:48:39.000Z | poem/core/data_utils_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 44.46648 | 80 | 0.410579 |
98ae178c95ca0c677f003d6f8bea1e64063a7edb | 1,611 | py | Python | zappa_sentry/__init__.py | jneves/zappa-sentry | d521c95de77c5be9a492c2c4e3df2a4be030195f | [
"MIT"
] | 27 | 2018-02-25T13:43:14.000Z | 2022-03-09T23:39:12.000Z | zappa_sentry/__init__.py | jneves/zappa-sentry | d521c95de77c5be9a492c2c4e3df2a4be030195f | [
"MIT"
] | 8 | 2018-03-15T12:05:52.000Z | 2021-02-02T22:16:43.000Z | zappa_sentry/__init__.py | jneves/zappa-sentry | d521c95de77c5be9a492c2c4e3df2a4be030195f | [
"MIT"
] | 3 | 2018-09-25T08:51:21.000Z | 2020-05-19T14:33:03.000Z | # -*- coding: utf-8 -*-
from configparser import ConfigParser
import json
import os
import sentry_sdk
from sentry_sdk import capture_exception, configure_scope
def unhandled_exceptions(e, event, context):
"Exception handler reports exceptions to sentry but does not capture them."
sentry_config = ConfigParser... | 31.588235 | 79 | 0.639354 |
95fceb09137691d3e856dabc97931276bde12f99 | 1,956 | py | Python | blog/views.py | tawhidularefindcc/test-profilewebapp | 834c3f76bccf46ad98db36cca09657c4fa25178f | [
"MIT"
] | null | null | null | blog/views.py | tawhidularefindcc/test-profilewebapp | 834c3f76bccf46ad98db36cca09657c4fa25178f | [
"MIT"
] | null | null | null | blog/views.py | tawhidularefindcc/test-profilewebapp | 834c3f76bccf46ad98db36cca09657c4fa25178f | [
"MIT"
] | null | null | null | from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from .models import Post
def home(request):
c... | 27.942857 | 89 | 0.686605 |
1ca2f45739d13a0f8ac3388566800c18d28990c6 | 18,061 | py | Python | tests/providers/google/cloud/operators/test_vision.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 5 | 2020-07-17T07:33:58.000Z | 2022-03-02T06:23:47.000Z | tests/providers/google/cloud/operators/test_vision.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 7 | 2020-06-03T14:55:17.000Z | 2021-12-30T00:01:50.000Z | tests/providers/google/cloud/operators/test_vision.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 12 | 2020-01-09T14:02:39.000Z | 2022-01-24T07:18:51.000Z | # -*- 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
#... | 42.798578 | 108 | 0.701678 |
7f748ede3247db2ff3481069e8c83c66c5fee907 | 699 | py | Python | AoC20/day_18/a.py | a-recknagel/AoC20 | 7aa0013dc745bdc0ad357e1168b212bd065fd092 | [
"MIT"
] | null | null | null | AoC20/day_18/a.py | a-recknagel/AoC20 | 7aa0013dc745bdc0ad357e1168b212bd065fd092 | [
"MIT"
] | null | null | null | AoC20/day_18/a.py | a-recknagel/AoC20 | 7aa0013dc745bdc0ad357e1168b212bd065fd092 | [
"MIT"
] | null | null | null | import re
from AoC20.day_18 import data as data
class Int:
def __init__(self, val):
self.val = val
def __add__(self, other):
return Int(self.val + other.val)
def __sub__(self, other):
return Int(self.val * other.val)
def __repr__(self):
return str(self.val)
def so... | 21.84375 | 83 | 0.575107 |
5a04b48333b2ff589ea59c281ab212bf202ad72c | 1,586 | py | Python | .mywaflib/waflib/Tools/suncxx.py | nkuhlen/log-transform-kernel-density | 377e9196b95cfdc2d53db50796a030eb5d0f019a | [
"BSD-3-Clause"
] | 2 | 2016-05-15T19:20:55.000Z | 2016-07-04T18:38:20.000Z | .mywaflib/waflib/Tools/suncxx.py | michaelkilchenmann/Quantitative_Economic_History | c64b5ad877eb995629d4b31f8a8500e7565a953a | [
"BSD-3-Clause"
] | null | null | null | .mywaflib/waflib/Tools/suncxx.py | michaelkilchenmann/Quantitative_Economic_History | c64b5ad877eb995629d4b31f8a8500e7565a953a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Ralf Habacker, 2006 (rh)
from waflib.Tools import ccroot, ar
from waflib.Configure import conf
@conf
def find_sxx(conf):
"""
Detect the sun C++ compiler
"""
v = conf.env
cc = conf.find_program(['CC', 'c++'], var='CXX')
try:
conf.cmd_and_... | 22.985507 | 65 | 0.579445 |
f255e348e1d0b5cf3085bdb50e3a6d31c933e75a | 1,995 | py | Python | type_utils.py | chao-ji/np-auto-diff | 4b21a8895755072f8e0390ce4cc96b17308f8a90 | [
"MIT"
] | 2 | 2021-03-07T09:43:38.000Z | 2021-09-09T21:20:19.000Z | type_utils.py | chao-ji/reverse-mode-auto-differentiation | 4b21a8895755072f8e0390ce4cc96b17308f8a90 | [
"MIT"
] | null | null | null | type_utils.py | chao-ji/reverse-mode-auto-differentiation | 4b21a8895755072f8e0390ce4cc96b17308f8a90 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Chao Ji
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... | 43.369565 | 80 | 0.690226 |
b279acf4f3f562dc142d1088a83f8f18c31529d9 | 1,874 | py | Python | modules/tools/record_parse_save/parse_lidar.py | zhouyao4321/apollo | fe34840f78dc0e9c92850a805eede0ac2e512295 | [
"Apache-2.0"
] | 1 | 2020-04-24T06:14:14.000Z | 2020-04-24T06:14:14.000Z | modules/tools/record_parse_save/parse_lidar.py | Geonhee-LEE/apollo | 3ceaec8843ffe0fb8e821089b2e4708eaf1fa455 | [
"Apache-2.0"
] | 2 | 2018-09-10T03:13:39.000Z | 2018-10-15T16:31:14.000Z | modules/tools/record_parse_save/parse_lidar.py | Geonhee-LEE/apollo | 3ceaec8843ffe0fb8e821089b2e4708eaf1fa455 | [
"Apache-2.0"
] | 3 | 2018-02-03T04:56:22.000Z | 2018-09-14T10:50:53.000Z | #!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... | 28.393939 | 79 | 0.628068 |
8f99be59a22f5a53ab57c30a9600bd9a2b1fd246 | 1,443 | py | Python | htmlclean.py | eyepod101/datagen | 25b13058f641fca1892232b1d968fdd4dbf7d62f | [
"MIT"
] | null | null | null | htmlclean.py | eyepod101/datagen | 25b13058f641fca1892232b1d968fdd4dbf7d62f | [
"MIT"
] | null | null | null | htmlclean.py | eyepod101/datagen | 25b13058f641fca1892232b1d968fdd4dbf7d62f | [
"MIT"
] | null | null | null | import re
import os
import shutil
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-id", "--inputdir", required=True, help="Input existing directory that contains all original html files.")
parser.add_argument("-od", "--outputdir", required=True, help="Output a new directory that will contain al... | 26.236364 | 129 | 0.595981 |
6768ce035c3447bfad7ce3f4942296779ab33896 | 11,767 | py | Python | release/stubs.min/System/Windows/Media/Animation_parts/CharAnimationBase.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Media/Animation_parts/CharAnimationBase.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Media/Animation_parts/CharAnimationBase.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class CharAnimationBase(AnimationTimeline, ISealable, IAnimatable, IResource):
""" Abstract class that,when implemented,animates a System.Char value. """
def AllocateClock(self, *args):
"""
AllocateClock(self: AnimationTimeline) -> Clock
Creates a System.Windows.Media.Animation.Clock... | 26.988532 | 221 | 0.700263 |
ace4b74bfd2238fbfea109cd688bd811d3161e19 | 1,197 | py | Python | setup.py | olxbr/kong-config-builder | 69dc8040eca449aba4557d0d89e96e2bfdbd4721 | [
"MIT"
] | 1 | 2020-06-16T03:10:42.000Z | 2020-06-16T03:10:42.000Z | setup.py | olxbr/kong-config-builder | 69dc8040eca449aba4557d0d89e96e2bfdbd4721 | [
"MIT"
] | 2 | 2020-06-19T18:52:29.000Z | 2020-08-03T19:48:03.000Z | setup.py | olxbr/kong-config-builder | 69dc8040eca449aba4557d0d89e96e2bfdbd4721 | [
"MIT"
] | 1 | 2021-04-09T20:51:56.000Z | 2021-04-09T20:51:56.000Z | from setuptools import setup, find_packages
libs = ["aws"]
extras = {"all": []}
with open("requirements.txt") as reqs:
requirements = reqs.read().split("\n")
for lib in libs:
with open(f"requirements_{lib}.txt") as reqs:
extras[lib] = reqs.read().split("\n")
extras["all"] = extras["all"] + ex... | 31.5 | 83 | 0.668338 |
75aeadb6cd9205bf2e334ca4ed5f71050d81f75e | 191 | py | Python | dblue_stats/version.py | dblueai/dblue-stats | 6830602271f6992fe6e06e6e307e4caed676fc0e | [
"Apache-2.0"
] | 2 | 2020-06-07T07:59:38.000Z | 2020-06-09T14:55:26.000Z | dblue_stats/version.py | dblueai/dblue-stats | 6830602271f6992fe6e06e6e307e4caed676fc0e | [
"Apache-2.0"
] | 2 | 2020-06-05T12:04:30.000Z | 2021-06-02T02:02:34.000Z | dblue_stats/version.py | dblueai/dblue-stats | 6830602271f6992fe6e06e6e307e4caed676fc0e | [
"Apache-2.0"
] | null | null | null | import os
from dblue_stats.config import PROJECT_ROOT
version_file = os.path.join(PROJECT_ROOT, "configs", "version.txt")
with open(version_file, 'r') as f:
VERSION = f.read().strip()
| 21.222222 | 67 | 0.727749 |
8437467a1f2ecdecd4ce27250ce27f17ab7bf241 | 1,363 | py | Python | framework/utils.py | sensoraCloud/BanditsFramework | d6c0b577f87dd86a7ab4785a52fed4a7ac258c8e | [
"BSD-3-Clause"
] | 1 | 2019-12-01T15:26:06.000Z | 2019-12-01T15:26:06.000Z | framework/utils.py | sensoraCloud/BanditsFramework | d6c0b577f87dd86a7ab4785a52fed4a7ac258c8e | [
"BSD-3-Clause"
] | null | null | null | framework/utils.py | sensoraCloud/BanditsFramework | d6c0b577f87dd86a7ab4785a52fed4a7ac258c8e | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import random
import string
import numpy as np
from voucher_opt.logger import log
def print_header(heading):
log.info(heading)
log.info('=' * 50)
def print_footer():
log.info('=' * 50)
def random_str(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choi... | 27.816327 | 110 | 0.711665 |
f1f9c173de17d184f359eaf57a0e1216777761e2 | 1,892 | py | Python | enrolled/net-intro-CS2105/ass/ass-2/otto/Alice.py | plty/nus | 3d75b6d1c54022a42edbc15317507ddc988a7231 | [
"MIT"
] | null | null | null | enrolled/net-intro-CS2105/ass/ass-2/otto/Alice.py | plty/nus | 3d75b6d1c54022a42edbc15317507ddc988a7231 | [
"MIT"
] | null | null | null | enrolled/net-intro-CS2105/ass/ass-2/otto/Alice.py | plty/nus | 3d75b6d1c54022a42edbc15317507ddc988a7231 | [
"MIT"
] | null | null | null | import time
from functools import partial
from socket import *
from threading import Thread
from zlib import crc32
import sys
MAX_PACKET_SIZE = 64
ANY_HOST = ''
def to_int(b):
return int.from_bytes(b, byteorder='big')
class Server:
def __init__(self, port):
self.start = 0
self.port = port
... | 27.823529 | 86 | 0.600951 |
cdcc1443708bfe5832dc33e1ef8cbb6defcce54a | 58,015 | py | Python | hs_access_control/tests/test_provenance_function.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_access_control/tests/test_provenance_function.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_access_control/tests/test_provenance_function.py | tommac7/hydroshare | 87c4543a55f98103d2614bf4c47f7904c3f9c029 | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | from django.test import TestCase
from django.contrib.auth.models import Group
from hs_access_control.models import UserResourceProvenance, UserResourcePrivilege, \
GroupResourceProvenance, GroupResourcePrivilege, \
UserGroupProvenance, UserGroupPrivilege, \
PrivilegeCodes
from hs_core import hydroshare
fr... | 35.833848 | 93 | 0.576506 |
046f0712888238deafeb4ffd656e9aeb4bf33d87 | 1,238 | py | Python | test/test_persist.py | davidhwyllie/findNeighbour4 | d42e10711e59e93ebf0e798fbb1598929f662c9c | [
"MIT"
] | null | null | null | test/test_persist.py | davidhwyllie/findNeighbour4 | d42e10711e59e93ebf0e798fbb1598929f662c9c | [
"MIT"
] | 14 | 2021-11-26T14:43:25.000Z | 2022-03-22T00:39:17.000Z | test/test_persist.py | davidhwyllie/findNeighbour4 | d42e10711e59e93ebf0e798fbb1598929f662c9c | [
"MIT"
] | null | null | null | """ tests Persistence class, which returns either a
monogo or rdbms based fn3persistence object.
"""
import unittest
from findn.persistence import Persistence
from findn.mongoStore import fn3persistence
from findn.rdbmsstore import fn3persistence_r
class Test_Persistence(unittest.TestCase):
"""tests persis... | 33.459459 | 87 | 0.648627 |
c0d80d6a9f747552b13241511d90ebd641a00d52 | 24,381 | py | Python | python/maya/site-packages/pymel-1.0.3/maintenance/stubs.py | CountZer0/PipelineConstructionSet | 0aa73a8a63c72989b2d1c677efd78dad4388d335 | [
"BSD-3-Clause"
] | 21 | 2015-04-27T05:01:36.000Z | 2021-11-22T13:45:14.000Z | python/maya/site-packages/pymel-1.0.3/maintenance/stubs.py | 0xb1dd1e/PipelineConstructionSet | 621349da1b6d1437e95d0c9e48ee9f36d59f19fd | [
"BSD-3-Clause"
] | null | null | null | python/maya/site-packages/pymel-1.0.3/maintenance/stubs.py | 0xb1dd1e/PipelineConstructionSet | 621349da1b6d1437e95d0c9e48ee9f36d59f19fd | [
"BSD-3-Clause"
] | 7 | 2015-04-11T11:37:19.000Z | 2020-05-22T09:49:04.000Z | from pydoc import * #@UnusedWildImport
import pydoc, sys, pprint #@Reimport
import __builtin__
import os #@Reimport
import pkgutil #@Reimport
builtins = set(__builtin__.__dict__.values())
# for the sake of stubtest, don't importy anything pymel/maya at module level
#import pym... | 40.034483 | 137 | 0.532136 |
deaf935c751b80c2e49989bf9bdf1f168d3aa904 | 6,610 | py | Python | fractalis/data/controller.py | thehyve/Fractalis | 5591112e5bc994eea5baf3d28caa7e5dfee85a57 | [
"Apache-2.0"
] | null | null | null | fractalis/data/controller.py | thehyve/Fractalis | 5591112e5bc994eea5baf3d28caa7e5dfee85a57 | [
"Apache-2.0"
] | 6 | 2018-11-02T10:00:04.000Z | 2021-09-13T14:15:36.000Z | fractalis/data/controller.py | thehyve/Fractalis | 5591112e5bc994eea5baf3d28caa7e5dfee85a57 | [
"Apache-2.0"
] | 1 | 2018-10-22T08:12:00.000Z | 2018-10-22T08:12:00.000Z | """The /data controller. Please refer to doc/api for more information."""
import json
import logging
from typing import Tuple, Union
from uuid import UUID
from flask import Blueprint, session, request, jsonify, Response
from fractalis import celery, redis
from fractalis.authorization import authorized
from fractalis... | 40.304878 | 79 | 0.66823 |
4b0ce87cf4b738c3cc7bd7bc0aea39b7af534687 | 2,079 | py | Python | tests/contrib/djangorestframework/test_djangorestframework.py | tophatmonocle/dd-trace-py | 7db12f1c398c07cd5baf91c571aed672dbb6496d | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/djangorestframework/test_djangorestframework.py | tophatmonocle/dd-trace-py | 7db12f1c398c07cd5baf91c571aed672dbb6496d | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/djangorestframework/test_djangorestframework.py | tophatmonocle/dd-trace-py | 7db12f1c398c07cd5baf91c571aed672dbb6496d | [
"BSD-3-Clause"
] | null | null | null | import django
from django.apps import apps
from nose.tools import ok_, eq_
from unittest import skipIf
from tests.contrib.django.utils import DjangoTraceTestCase
@skipIf(django.VERSION < (1, 10), 'requires django version >= 1.10')
class RestFrameworkTest(DjangoTraceTestCase):
def setUp(self):
super(RestFr... | 33.532258 | 85 | 0.645503 |
382aa8d4df63d72d6b215d860563b364ea64cdf7 | 1,452 | py | Python | MTandHJ/p34.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | MTandHJ/p34.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | MTandHJ/p34.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null |
from typing import List
from base import version
class Solution:
@version("36ms, 15.8mb")
def searchRange(self, nums: List[int], target: int) -> List[int]:
ans = [-1, -1]
if not len(nums):
return ans
l, r = 0, len(nums)
while l < r:
m = l + (r - l)... | 23.419355 | 69 | 0.353994 |
609ae867db6fa476a9cb52a7107f9a638ca7f0d5 | 535 | py | Python | rotnet/rotnet.py | ZJCV/RotNet | bc3598acaad3895b7455add301194c3e7d60c5a4 | [
"Apache-2.0"
] | 7 | 2021-03-23T16:07:48.000Z | 2021-12-21T15:38:21.000Z | rotnet/rotnet.py | ZJCV/RotNet | bc3598acaad3895b7455add301194c3e7d60c5a4 | [
"Apache-2.0"
] | 9 | 2021-03-23T16:00:59.000Z | 2022-02-18T15:32:16.000Z | rotnet/rotnet.py | ZJCV/RotNet | bc3598acaad3895b7455add301194c3e7d60c5a4 | [
"Apache-2.0"
] | 6 | 2021-06-23T07:42:07.000Z | 2021-11-26T13:16:04.000Z | # -*- coding: utf-8 -*-
"""
@date: 2021/3/15 下午4:25
@file: rotnet.py
@author: zj
@description:
"""
config_file = 'configs/mbv3_small_se_hsigmoid_fmnist_224_e100.yaml'
import torch
from zcls.config import cfg
from zcls.model.recognizers.build import build_recognizer
def rotnet(pretrained=False, **kwargs):
cfg.... | 22.291667 | 67 | 0.721495 |
1c879158f0cd6ac6c8110835ee188665a34d1472 | 5,737 | py | Python | SlideServer.py | cjchirag7/SlideLoader | 74aa4aa7c05b8c76814569c7325b92890c8e18cb | [
"BSD-3-Clause"
] | null | null | null | SlideServer.py | cjchirag7/SlideLoader | 74aa4aa7c05b8c76814569c7325b92890c8e18cb | [
"BSD-3-Clause"
] | null | null | null | SlideServer.py | cjchirag7/SlideLoader | 74aa4aa7c05b8c76814569c7325b92890c8e18cb | [
"BSD-3-Clause"
] | null | null | null | import base64
import json
import os
import random
import shutil
import string
import sys
import pyvips
import flask
import flask_cors
import openslide
from werkzeug.utils import secure_filename
import dev_utils
try:
from io import BytesIO
except ImportError:
from cStringIO import StringIO as BytesIO
app = fl... | 37.496732 | 199 | 0.662541 |
3f9e3f15d46eea06a5ebf7bfe5351199f789b4a8 | 3,494 | py | Python | armada_command/command_dockyard.py | firesoft/armada | 245115fcf21d988db5da71f18b3123479de5f2c1 | [
"Apache-2.0"
] | null | null | null | armada_command/command_dockyard.py | firesoft/armada | 245115fcf21d988db5da71f18b3123479de5f2c1 | [
"Apache-2.0"
] | null | null | null | armada_command/command_dockyard.py | firesoft/armada | 245115fcf21d988db5da71f18b3123479de5f2c1 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from armada_command.armada_utils import print_err, print_table
from armada_command.dockyard import alias
from armada_command.dockyard.alias import print_http_dockyard_unavailability_warning
from armada_command.dockyard.dockyard import dockyard_factory, DockyardFactoryException, Do... | 42.096386 | 115 | 0.747853 |
8e33c1fc3074544bc5bf07d94c110c60efe8fdab | 395 | py | Python | compileio/asgi.py | unownone/Online_Compiler | b10f147f25210c4daad987a8cee30f5185e2d332 | [
"MIT"
] | 2 | 2021-07-23T14:01:14.000Z | 2021-07-23T14:47:08.000Z | compileio/asgi.py | unownone/Online_Compiler | b10f147f25210c4daad987a8cee30f5185e2d332 | [
"MIT"
] | null | null | null | compileio/asgi.py | unownone/Online_Compiler | b10f147f25210c4daad987a8cee30f5185e2d332 | [
"MIT"
] | 1 | 2021-11-01T06:12:44.000Z | 2021-11-01T06:12:44.000Z | """
ASGI config for compileio project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
50e51bddced908231d1cadef0abe1ae69e87cad2 | 292 | py | Python | scrapy_test/scrapy_test/pipelines.py | czl0325/suningbook_scrapy | 50458c3e7108fcc42132aaba13b29e9a6b8b659b | [
"Apache-2.0"
] | 2 | 2021-03-26T05:18:44.000Z | 2021-03-31T14:14:11.000Z | scrapy_test/scrapy_test/pipelines.py | czl0325/suningbook_scrapy | 50458c3e7108fcc42132aaba13b29e9a6b8b659b | [
"Apache-2.0"
] | 1 | 2021-08-31T08:44:49.000Z | 2021-08-31T08:44:49.000Z | scrapy_test/scrapy_test/pipelines.py | czl0325/suningbook_scrapy | 50458c3e7108fcc42132aaba13b29e9a6b8b659b | [
"Apache-2.0"
] | 1 | 2021-03-26T05:18:46.000Z | 2021-03-26T05:18:46.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
class ScrapyTestPipeline(object):
def process_item(self, item, spider):
return item
| 24.333333 | 66 | 0.715753 |
1bd507090dc843d5192abbf4b80122af877137d0 | 4,539 | py | Python | pastepwn/analyzers/tests/emailpasswordpairanalyzer_test.py | robotboyfriend/pastepwn | ca6dd87afd053b5032857eb0615a947c3b9dfad9 | [
"MIT"
] | 113 | 2018-09-06T22:14:52.000Z | 2022-02-17T01:32:29.000Z | pastepwn/analyzers/tests/emailpasswordpairanalyzer_test.py | robotboyfriend/pastepwn | ca6dd87afd053b5032857eb0615a947c3b9dfad9 | [
"MIT"
] | 199 | 2018-09-15T22:17:58.000Z | 2022-01-23T23:45:09.000Z | pastepwn/analyzers/tests/emailpasswordpairanalyzer_test.py | robotboyfriend/pastepwn | ca6dd87afd053b5032857eb0615a947c3b9dfad9 | [
"MIT"
] | 88 | 2018-09-09T13:02:06.000Z | 2022-01-23T22:56:09.000Z | # -*- coding: utf-8 -*-
import unittest
from unittest import mock
from pastepwn.analyzers.emailpasswordpairanalyzer import EmailPasswordPairAnalyzer
class TestEmailPasswordPairAnalyzer(unittest.TestCase):
def setUp(self):
self.paste = mock.Mock()
def test_positive(self):
"""Test single match... | 40.168142 | 139 | 0.649042 |
64c23121b9356b636e9e6c1557b1d8f26f3bb4d4 | 17,456 | py | Python | blender/arm/logicnode/arm_nodes.py | SunDaw/armory | 84663bc981a26287cbac0aa60d73b139a0308b78 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/arm_nodes.py | SunDaw/armory | 84663bc981a26287cbac0aa60d73b139a0308b78 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/arm_nodes.py | SunDaw/armory | 84663bc981a26287cbac0aa60d73b139a0308b78 | [
"Zlib"
] | null | null | null | import itertools
from collections import OrderedDict
from typing import Any, Generator, List, Optional, Type, Dict
from typing import OrderedDict as ODict # Prevent naming conflicts
import bpy.types
from bpy.props import *
from nodeitems_utils import NodeItem
# Pass NodeReplacment forward to individual node modules ... | 37.62069 | 150 | 0.68412 |
638c462b3f387ba03a8ac9c251f8e8cb3b3397b5 | 7,308 | py | Python | RL_brain.py | TissueC/DQN-mountain-car | 6a9c3b271c79579a966bf91f2995b0e31fc59f17 | [
"MIT"
] | null | null | null | RL_brain.py | TissueC/DQN-mountain-car | 6a9c3b271c79579a966bf91f2995b0e31fc59f17 | [
"MIT"
] | null | null | null | RL_brain.py | TissueC/DQN-mountain-car | 6a9c3b271c79579a966bf91f2995b0e31fc59f17 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
# Deep Q Network off-policy
class DeepQNetwork:
def __init__(
self,
n_actions,
n_features,
learning_rate=0.01,
reward_decay=0.9,
e_greedy=0.9,
replace_target_iter=500,
memory_... | 42.988235 | 117 | 0.613027 |
0b55ad849d5bb331da2a4c5ee95359b4b760b608 | 473 | py | Python | setup.py | greyltc/pywrap | 07f85fc5d1c05a56d4121c9daa369e842b1c5ac3 | [
"Apache-2.0"
] | 1 | 2018-09-11T00:46:10.000Z | 2018-09-11T00:46:10.000Z | setup.py | CadQuery/cpp-py-bindgen | 66e7376d3a27444393fc99acbdbef40bbc7031ae | [
"Apache-2.0"
] | null | null | null | setup.py | CadQuery/cpp-py-bindgen | 66e7376d3a27444393fc99acbdbef40bbc7031ae | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='pywrap',
version="0.1dev",
entry_points={'console_scripts': 'pywrap = bindgen.__main__:main'},
packages=['bindgen'],
include_package_data = True,
install_requires=[
'click',
'logzero',
'path',
'clang',
'toml',
... | 18.92 | 71 | 0.501057 |
f0e65c626f36a15c41863aa26aa4997515ae1ba0 | 4,413 | py | Python | website/util/sanitize.py | erichilarysmithsr/osf.io | c92f7994ec26642f5ca2ead8248536f6855a6d17 | [
"Apache-2.0"
] | null | null | null | website/util/sanitize.py | erichilarysmithsr/osf.io | c92f7994ec26642f5ca2ead8248536f6855a6d17 | [
"Apache-2.0"
] | 7 | 2021-03-02T01:33:58.000Z | 2022-03-03T23:18:17.000Z | website/util/sanitize.py | erichilarysmithsr/osf.io | c92f7994ec26642f5ca2ead8248536f6855a6d17 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import collections
import json
import bleach
def strip_html(unclean, tags=None):
"""Sanitize a string, removing (as opposed to escaping) HTML tags
:param unclean: A string to be stripped of HTML tags
:return: stripped string
:rtype: str
"""
if not tags:
tags ... | 31.521429 | 117 | 0.673918 |
5afdaecfd3deae62e17b704d472032f8ee43591f | 1,437 | py | Python | src/app/addr_modify.py | jack139/fair | fe0ff64f8edbd794c3fb951ab6af420054e9e585 | [
"BSD-3-Clause"
] | 1 | 2019-07-16T09:46:39.000Z | 2019-07-16T09:46:39.000Z | src/app/addr_modify.py | jack139/fair | fe0ff64f8edbd794c3fb951ab6af420054e9e585 | [
"BSD-3-Clause"
] | null | null | null | src/app/addr_modify.py | jack139/fair | fe0ff64f8edbd794c3fb951ab6af420054e9e585 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import web, json, time
from config import setting
import app_helper
db = setting.db_web
url = ('/app/addr_modify')
# 修改收货地址
class handler:
def POST(self):
web.header('Content-Type', 'application/json')
param = web.input(app_id='', session='', addr_id='', na... | 25.210526 | 89 | 0.60682 |
21b7c3e58634d91a092fe4ffddb4194990d56179 | 228 | py | Python | hands/system_management/doctype/supplier_evaluation_template/test_supplier_evaluation_template.py | gchartas/hands | 480032a6399ee4730585f85469a048b2c3fa6163 | [
"MIT"
] | null | null | null | hands/system_management/doctype/supplier_evaluation_template/test_supplier_evaluation_template.py | gchartas/hands | 480032a6399ee4730585f85469a048b2c3fa6163 | [
"MIT"
] | null | null | null | hands/system_management/doctype/supplier_evaluation_template/test_supplier_evaluation_template.py | gchartas/hands | 480032a6399ee4730585f85469a048b2c3fa6163 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, EngLandGR and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestSupplierEvaluationTemplate(unittest.TestCase):
pass
| 20.727273 | 56 | 0.780702 |
63704136645501997e12d527d47ab80a98b11e14 | 1,464 | py | Python | SpeedPunk.roboFontExt/lib/SpeedPunkTool.py | yanone/speedpunk | d92c147dd269168f5ca046aa3687d4ca7d63782b | [
"Apache-2.0"
] | 41 | 2019-12-01T21:04:05.000Z | 2021-11-14T18:13:06.000Z | SpeedPunk.roboFontExt/lib/SpeedPunkTool.py | yanone/speedpunk | d92c147dd269168f5ca046aa3687d4ca7d63782b | [
"Apache-2.0"
] | 7 | 2019-12-17T14:36:55.000Z | 2022-02-10T18:23:40.000Z | SpeedPunk.roboFontExt/lib/SpeedPunkTool.py | yanone/speedpunk | d92c147dd269168f5ca046aa3687d4ca7d63782b | [
"Apache-2.0"
] | 5 | 2019-12-21T15:27:35.000Z | 2021-04-29T18:33:30.000Z | ##########################################################################################
#
# Speed Punk
# Visualisation tool of outline curvature for font editors.
#
# Distributed under Apache 2.0 license
#
##########################################################################################
import traceback
f... | 24.813559 | 113 | 0.588115 |
6924f5894d43e4c793cc0ea4522ac03cd4fbaaaa | 268 | py | Python | python/dazl/ledger/config/exc.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/ledger/config/exc.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | python/dazl/ledger/config/exc.py | DACH-NY/dazl-client | 56c8b1be047415b2bcb35b6558de4a780a402458 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
__all__ = ["ConfigError", "ConfigWarning"]
class ConfigError(ValueError):
pass
class ConfigWarning(Warning):
pass
| 20.615385 | 102 | 0.742537 |
0efe60be64e69ce3cd9c038ad240a0a19dbe365c | 117,230 | py | Python | postman/tests.py | Boondockers-Welcome/django-postman | 22818ea019ffaa28014f4a7d5b3365720ccdeb6b | [
"BSD-3-Clause"
] | null | null | null | postman/tests.py | Boondockers-Welcome/django-postman | 22818ea019ffaa28014f4a7d5b3365720ccdeb6b | [
"BSD-3-Clause"
] | null | null | null | postman/tests.py | Boondockers-Welcome/django-postman | 22818ea019ffaa28014f4a7d5b3365720ccdeb6b | [
"BSD-3-Clause"
] | null | null | null | """
Test suite.
- Do not put 'mailer' in INSTALLED_APPS, it disturbs the emails counting.
- Make sure these templates are accessible:
registration/login.html
base.html
404.html
To have a fast test session, set a minimal configuration as:
DATABASES = {
'default': {
'ENGINE': 'django.db.backend... | 50.748918 | 153 | 0.654918 |
51dbc2fb6ecaf4002210863b43d73efd54f41d43 | 12,390 | py | Python | scipy/linalg/_expm_frechet.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | 2 | 2020-06-20T14:11:14.000Z | 2020-10-12T07:11:36.000Z | scipy/linalg/_expm_frechet.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | null | null | null | scipy/linalg/_expm_frechet.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | null | null | null | """Frechet derivative of the matrix exponential."""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
__all__ = ['expm_frechet', 'expm_cond']
def expm_frechet(A, E, method=None, compute_expm=True, check_finite=True):
"""
Frechet derivative of the matrix ... | 30.072816 | 79 | 0.559403 |
a52434b282ffea2344e3110751288ba0c6972587 | 590 | py | Python | examples/pylab_examples/agg_buffer_to_array.py | SoftwareDev/mat-plot-lib | abaf94859d5ef6e653a4d8a7ce2c59cea1724a57 | [
"MIT",
"BSD-3-Clause"
] | 16 | 2016-06-14T19:45:35.000Z | 2020-11-30T19:02:58.000Z | lib/mpl_examples/pylab_examples/agg_buffer_to_array.py | yingkailiang/matplotlib | 255a79b106c98c1904489afe6a754e4d943179d6 | [
"MIT",
"BSD-3-Clause"
] | 7 | 2015-05-08T19:36:25.000Z | 2015-06-30T15:32:17.000Z | lib/mpl_examples/pylab_examples/agg_buffer_to_array.py | yingkailiang/matplotlib | 255a79b106c98c1904489afe6a754e4d943179d6 | [
"MIT",
"BSD-3-Clause"
] | 6 | 2015-06-05T03:34:06.000Z | 2022-01-25T09:07:10.000Z | import matplotlib.pyplot as plt
import numpy as np
# make an agg figure
fig, ax = plt.subplots()
ax.plot([1,2,3])
ax.set_title('a simple figure')
fig.canvas.draw()
# grab the pixel buffer and dump it into a numpy array
buf = fig.canvas.buffer_rgba()
l, b, w, h = fig.bbox.bounds
# The array needs to be copied, because... | 25.652174 | 61 | 0.722034 |
f841f0b32cb8b2d2ead57e6972cabbb050084401 | 3,221 | py | Python | tests/test_update_association_compare.py | flying-sheep/goatools | 1e3a74faa17cbdeef02550c7ddf17b65cf47d34a | [
"BSD-2-Clause"
] | 477 | 2015-02-10T06:54:42.000Z | 2022-03-15T12:36:11.000Z | tests/test_update_association_compare.py | flying-sheep/goatools | 1e3a74faa17cbdeef02550c7ddf17b65cf47d34a | [
"BSD-2-Clause"
] | 174 | 2015-02-05T18:11:14.000Z | 2022-03-29T10:24:19.000Z | tests/test_update_association_compare.py | flying-sheep/goatools | 1e3a74faa17cbdeef02550c7ddf17b65cf47d34a | [
"BSD-2-Clause"
] | 202 | 2015-01-21T12:29:23.000Z | 2022-03-01T13:26:05.000Z | #!/usr/bin/env python
"""Compare new propagate counts function with original function. Test assc results is same."""
__copyright__ = "Copyright (C) 2016-present, DV Klopfenstein, H Tang, All rights reserved."
__author__ = "DV Klopfenstein"
import os
from os.path import join
from sys import stdout
import timeit
from g... | 39.280488 | 96 | 0.696678 |
a3038c6b4e6235de5e044619a10c1f889ade84b1 | 786 | py | Python | editing/lightweight/rules/__init__.py | pulp-platform/quantlib | bff5351f937c7dfd88e1ae44a146a257beca0585 | [
"Apache-2.0"
] | null | null | null | editing/lightweight/rules/__init__.py | pulp-platform/quantlib | bff5351f937c7dfd88e1ae44a146a257beca0585 | [
"Apache-2.0"
] | null | null | null | editing/lightweight/rules/__init__.py | pulp-platform/quantlib | bff5351f937c7dfd88e1ae44a146a257beca0585 | [
"Apache-2.0"
] | 1 | 2022-01-02T10:10:46.000Z | 2022-01-02T10:10:46.000Z | #
# __init__.py
#
# Author(s):
# Matteo Spallanzani <spmatteo@iis.ee.ethz.ch>
#
# Copyright (c) 2020-2021 ETH Zurich.
#
# 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.apach... | 28.071429 | 74 | 0.74173 |
2e1a0cfb468961f0005428b783937b011c778212 | 8,119 | py | Python | ClemBot.Bot/bot/cogs/random_cog/random_cog.py | Iapetus-11/ClemBot | ec32c4491e988b934d3a14fc4709726af6be4e02 | [
"MIT"
] | null | null | null | ClemBot.Bot/bot/cogs/random_cog/random_cog.py | Iapetus-11/ClemBot | ec32c4491e988b934d3a14fc4709726af6be4e02 | [
"MIT"
] | null | null | null | ClemBot.Bot/bot/cogs/random_cog/random_cog.py | Iapetus-11/ClemBot | ec32c4491e988b934d3a14fc4709726af6be4e02 | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
import random
import time
import typing
from datetime import datetime
import aiohttp
import discord
import discord.ext.commands as commands
import bot.extensions as ext
from bot.consts import Colors
from bot.messaging.events import Events
from bot.utils.converters import Dura... | 38.117371 | 141 | 0.582215 |
634ba3bdcdd9d0f4bee23d72496bf79df0ba0a34 | 19,860 | py | Python | sql/query_privileges.py | hujingguang/Archery | 819c77745fe7f70899dfbe3ead013d0b0caf00be | [
"Apache-2.0"
] | 1 | 2019-11-12T08:32:01.000Z | 2019-11-12T08:32:01.000Z | sql/query_privileges.py | hujingguang/Archery | 819c77745fe7f70899dfbe3ead013d0b0caf00be | [
"Apache-2.0"
] | 1 | 2021-06-10T22:04:38.000Z | 2021-06-10T22:04:38.000Z | sql/query_privileges.py | hujingguang/Archery | 819c77745fe7f70899dfbe3ead013d0b0caf00be | [
"Apache-2.0"
] | 1 | 2020-09-23T05:43:34.000Z | 2020-09-23T05:43:34.000Z | # -*- coding: UTF-8 -*-
"""
@author: hhyo
@license: Apache Licence
@file: query_privileges.py
@time: 2019/03/24
"""
import logging
import datetime
import re
import traceback
import simplejson as json
from django.contrib.auth.decorators import permission_required
from django.db import transaction
from django.db.models... | 37.330827 | 120 | 0.642095 |
0d99fea6f98bbab78299b21a188a76390bbf9391 | 37,112 | py | Python | third_party/catapult/dashboard/dashboard/start_try_job_test.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 1 | 2020-09-15T08:43:34.000Z | 2020-09-15T08:43:34.000Z | third_party/catapult/dashboard/dashboard/start_try_job_test.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | third_party/catapult/dashboard/dashboard/start_try_job_test.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import json
import unittest
import mock
import webapp2
import webtest
from google.appengine.ext import ndb
from dashboard import can_bisect
... | 35.143939 | 155 | 0.622305 |
87036fec380d6dd77cfb803bba9064346f638e1c | 30,290 | py | Python | dask/dataframe/shuffle.py | galipremsagar/dask | 134182e05009dbb20bd8e59ccf8bf771e5d4399a | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/shuffle.py | galipremsagar/dask | 134182e05009dbb20bd8e59ccf8bf771e5d4399a | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/shuffle.py | galipremsagar/dask | 134182e05009dbb20bd8e59ccf8bf771e5d4399a | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import logging
import math
import shutil
import tempfile
import uuid
import numpy as np
import pandas as pd
import tlz as toolz
from .. import base, config
from ..base import compute, compute_as_if_collection, is_dask_collection, tokenize
from ..highlevelgraph import HighLevelGraph
from ..layers imp... | 32.18916 | 96 | 0.628557 |
dfb14d8354450b350266f91e750cb32769110763 | 7,468 | py | Python | geotrek/common/tests/test_admin.py | GeotrekCE/Geotrek | c1393925c1940ac795ab7fc04819cd8c78bc79fb | [
"BSD-2-Clause"
] | null | null | null | geotrek/common/tests/test_admin.py | GeotrekCE/Geotrek | c1393925c1940ac795ab7fc04819cd8c78bc79fb | [
"BSD-2-Clause"
] | null | null | null | geotrek/common/tests/test_admin.py | GeotrekCE/Geotrek | c1393925c1940ac795ab7fc04819cd8c78bc79fb | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, override_settings
from django.urls import reverse
from tempfile import TemporaryDirectory
from geotrek.common.models import Attachment, FileType, Theme
from geotrek.common.tests.factories impor... | 44.718563 | 156 | 0.625736 |
c94c453248cbee7c7cd06236e9b92ec358e8cf82 | 61,931 | py | Python | tests/calc/test_calc_tools.py | khintz/MetPy | d485069a275fa6de90f3b5b15f49cf9befc21745 | [
"BSD-3-Clause"
] | null | null | null | tests/calc/test_calc_tools.py | khintz/MetPy | d485069a275fa6de90f3b5b15f49cf9befc21745 | [
"BSD-3-Clause"
] | null | null | null | tests/calc/test_calc_tools.py | khintz/MetPy | d485069a275fa6de90f3b5b15f49cf9befc21745 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2016,2017,2018,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `tools` module."""
from collections import namedtuple
import cartopy.crs as ccrs
import numpy as np
import numpy.ma as ma
import pandas as pd
import pyte... | 40.932584 | 94 | 0.617623 |
6e4035d43b78f892e0a8a060903de554dd822cfa | 4,025 | py | Python | tools/fuchsia/fidl/gen_response_file.py | beare/engine | 35ee8bde43a8effdcb8cec1120855c7f97e9da9c | [
"BSD-3-Clause"
] | 4 | 2018-12-31T14:20:26.000Z | 2019-08-06T10:44:39.000Z | tools/fuchsia/fidl/gen_response_file.py | beare/engine | 35ee8bde43a8effdcb8cec1120855c7f97e9da9c | [
"BSD-3-Clause"
] | 2 | 2020-03-20T07:27:42.000Z | 2021-01-05T07:09:27.000Z | tools/fuchsia/fidl/gen_response_file.py | beare/engine | 35ee8bde43a8effdcb8cec1120855c7f97e9da9c | [
"BSD-3-Clause"
] | 4 | 2020-09-18T10:09:17.000Z | 2020-11-27T05:42:32.000Z | #!/usr/bin/env python3.8
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import string
import sys
def read_libraries(libraries_path):
with open(libraries_path) as f:
... | 32.723577 | 76 | 0.652422 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.