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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e981c832b18fefb820a4ad2210a6419e8c67d3a | 13,129 | py | Python | heat/db/api.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | heat/db/api.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | heat/db/api.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | #
# 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
# ... | 30.964623 | 78 | 0.69396 |
f5553f7742cea0988b799b25614a8a7db8f847a8 | 691 | py | Python | Python web/test_cgi.py | Vendriix/Stuff | 4ac80bae3c3136e83cf05e4cef043c4d8939bef8 | [
"Unlicense"
] | null | null | null | Python web/test_cgi.py | Vendriix/Stuff | 4ac80bae3c3136e83cf05e4cef043c4d8939bef8 | [
"Unlicense"
] | null | null | null | Python web/test_cgi.py | Vendriix/Stuff | 4ac80bae3c3136e83cf05e4cef043c4d8939bef8 | [
"Unlicense"
] | null | null | null | import os
import cgi
import json
import cgitb
cgitb.enable(1,None,5,"text")
import pprint
pp = pprint.PrettyPrinter(indent=4)
fields = cgi.FieldStorage()
print "Content-type: text/html"
print
print "<title>Test CGI</title>"
print "<p>Hello World!</p>"
print "<pre>"
#pp.pprint(fields.value)
#pp.pprin... | 19.194444 | 75 | 0.670043 |
6fb5932f2b64aab81c9e93c4e86b020644e0e70a | 361 | py | Python | feeds/templatetags/feeds.py | isergart/gradient | 837d882f5ab07f2a9847d0212698cdc2d9312125 | [
"MIT"
] | null | null | null | feeds/templatetags/feeds.py | isergart/gradient | 837d882f5ab07f2a9847d0212698cdc2d9312125 | [
"MIT"
] | null | null | null | feeds/templatetags/feeds.py | isergart/gradient | 837d882f5ab07f2a9847d0212698cdc2d9312125 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django import template
from ..models import *
register = template.Library()
@register.inclusion_tag('feeds/tpl_news.html')
def news():
news = Post.objects.all()
return {'news': news}
@register.inclusion_tag('feeds/tpl_project.html')
def project():
projects = Project.objects... | 20.055556 | 49 | 0.686981 |
3b0d223a02d43b1c144b0603bee285df37d2f0a9 | 2,023 | py | Python | __main__.py | Axelandre42/garry-travis | 701dc3e977a904aef279e0da7d9ab46855b8da48 | [
"MIT"
] | null | null | null | __main__.py | Axelandre42/garry-travis | 701dc3e977a904aef279e0da7d9ab46855b8da48 | [
"MIT"
] | 9 | 2021-08-09T20:17:37.000Z | 2022-03-25T20:16:58.000Z | __main__.py | Axelandre42/garry-travis | 701dc3e977a904aef279e0da7d9ab46855b8da48 | [
"MIT"
] | null | null | null | import os
import platform
import signal
from discord.ext import tasks
from dotenv import load_dotenv
import discord
import sys
import logging.handlers
import mysql.connector
import utils
import commands
import ticker
logger = logging.getLogger('garry-travis')
def init_loggers():
logger.setLevel(logging.INFO)
... | 28.492958 | 107 | 0.683144 |
0a3018183859a182914802d0d2d129e53b4c72a5 | 1,426 | py | Python | setup.py | ElissonRodrigues/mimetypes-magic | 9ffcb6913752ad06815bccf2cda2d4a9e1e16bea | [
"MIT"
] | null | null | null | setup.py | ElissonRodrigues/mimetypes-magic | 9ffcb6913752ad06815bccf2cda2d4a9e1e16bea | [
"MIT"
] | null | null | null | setup.py | ElissonRodrigues/mimetypes-magic | 9ffcb6913752ad06815bccf2cda2d4a9e1e16bea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
import io
import os
def read(file_name):
"""Read a text file and return the content as a string."""
with io.open(os.path.join(os.path.dirname(__file__), file_name),
encoding='utf-8') as f:
return f.read()
setuptools.set... | 31 | 73 | 0.597475 |
b896e4b6c688c41ffbd92a9b02ee4bf15ac6ce35 | 17,984 | py | Python | census2text2010.py | ikding/census-parser | 3b736af83fcd8000ffda8eab49567617fb37deb1 | [
"0BSD"
] | 1 | 2018-05-20T01:45:21.000Z | 2018-05-20T01:45:21.000Z | census2text2010.py | ikding/census-parser | 3b736af83fcd8000ffda8eab49567617fb37deb1 | [
"0BSD"
] | null | null | null | census2text2010.py | ikding/census-parser | 3b736af83fcd8000ffda8eab49567617fb37deb1 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
""" Convert remote U.S. Census 2010 data to local tab-separated text files.
Run with --help flag for usage instructions.
"""
from sys import stdout, stderr, argv
from os import SEEK_SET, SEEK_CUR, SEEK_END
from time import time
from csv import reader, DictWriter, DictReader
from os.path import b... | 40.32287 | 230 | 0.58274 |
a5d1deae246a3b49a729b067b844be49269d261e | 2,706 | py | Python | uuoskit/test_helper.py | uuosio/python-contract-demos | 7d56ba371f2115b0ab895fca3e71092c2523f25d | [
"MIT"
] | 2 | 2020-12-08T13:15:06.000Z | 2020-12-29T10:06:44.000Z | uuoskit/test_helper.py | uuosio/python-contract-demos | 7d56ba371f2115b0ab895fca3e71092c2523f25d | [
"MIT"
] | null | null | null | uuoskit/test_helper.py | uuosio/python-contract-demos | 7d56ba371f2115b0ab895fca3e71092c2523f25d | [
"MIT"
] | null | null | null | load_code = None
run = None
from . import config
from . import wallet
test_account1 = 'helloworld11'
test_account2 = 'helloworld12'
def init(network='EOS_TESTNET', deploy_type=1):
#def init(network='UUOS_TESTNET', deploy_type=1):
global test_account1
global test_account2
config.network = network
wal... | 27.333333 | 84 | 0.656319 |
1b7e02dab029f134a7d52b5e961793e246f1a837 | 458 | py | Python | Class and Statick Methods/04_gym/project/subscription.py | milenpenev/SoftUni-OOP | 90f730cb37713f7ca93b1c0ecd0d12aa351247d2 | [
"MIT"
] | null | null | null | Class and Statick Methods/04_gym/project/subscription.py | milenpenev/SoftUni-OOP | 90f730cb37713f7ca93b1c0ecd0d12aa351247d2 | [
"MIT"
] | null | null | null | Class and Statick Methods/04_gym/project/subscription.py | milenpenev/SoftUni-OOP | 90f730cb37713f7ca93b1c0ecd0d12aa351247d2 | [
"MIT"
] | null | null | null | class Subscription:
id = 1
def __init__(self, date, customer_id, trainer_id, exercise_id):
self.date = date
self.customer_id = customer_id
self.trainer_id = trainer_id
self.exercise_id = exercise_id
self.id = Subscription.id
Subscription.id += 1
def __repr__... | 25.444444 | 67 | 0.633188 |
703a47071871a4a0cd940debf272d06bb9efa744 | 816 | py | Python | source/OCRlab_2.py | Hairaa-1026/HCI-course-project | 8c80daf4ec248fd057868582204de0248f415c52 | [
"MIT"
] | null | null | null | source/OCRlab_2.py | Hairaa-1026/HCI-course-project | 8c80daf4ec248fd057868582204de0248f415c52 | [
"MIT"
] | null | null | null | source/OCRlab_2.py | Hairaa-1026/HCI-course-project | 8c80daf4ec248fd057868582204de0248f415c52 | [
"MIT"
] | null | null | null | from aip import AipOcr
"""APPID AK SK """
APP_ID = '22849136'
API_KEY = 'tMuFasuy6juP1oYyNxU1vsu3'
SECRET_KEY = 'UPD9kEe5PNR3eNantpF7GyfsmmG5ZTKp'
client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
def get_file_content(filepath):
with open(filepath, 'rb') as fp:
return fp.read()
path = r'../data/ocr/'
L = [... | 28.137931 | 66 | 0.644608 |
583c67033d8df0ab7508c15a290df3c92ad91073 | 1,406 | py | Python | utils/processors/tokenization.py | sy-wada/blue_benchmark_with_transformers | fbf6236db5a4fb7affde94a05a5c875cc5ee948b | [
"Apache-2.0"
] | 17 | 2020-05-18T06:40:26.000Z | 2022-03-23T08:34:27.000Z | utils/processors/tokenization.py | sy-wada/blue_benchmark_with_transformers | fbf6236db5a4fb7affde94a05a5c875cc5ee948b | [
"Apache-2.0"
] | 3 | 2020-05-18T23:24:13.000Z | 2021-05-27T07:12:14.000Z | utils/processors/tokenization.py | sy-wada/blue_benchmark_with_transformers | fbf6236db5a4fb7affde94a05a5c875cc5ee948b | [
"Apache-2.0"
] | 2 | 2020-05-18T20:26:15.000Z | 2021-11-09T14:21:11.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 39.055556 | 86 | 0.673542 |
c4897e210d5c2ffb90ffd5d5e176d2f2ec1daf70 | 16,130 | py | Python | official/benchmark/keras_cifar_benchmark.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | official/benchmark/keras_cifar_benchmark.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | official/benchmark/keras_cifar_benchmark.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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/LICENSE-2.0
#
# Unless required by... | 34.989154 | 81 | 0.701612 |
028dfbf40481e6124bb8ca326c255392b11dbd93 | 23,329 | py | Python | acct_mgr/model.py | SpamExperts/AccountManagerPlugin | 7c9676fbe656da899de36117ca0987bc775adcdd | [
"Beerware"
] | 1 | 2017-06-17T13:02:52.000Z | 2017-06-17T13:02:52.000Z | acct_mgr/model.py | SpamExperts/AccountManagerPlugin | 7c9676fbe656da899de36117ca0987bc775adcdd | [
"Beerware"
] | null | null | null | acct_mgr/model.py | SpamExperts/AccountManagerPlugin | 7c9676fbe656da899de36117ca0987bc775adcdd | [
"Beerware"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Steffen Hoffmann <hoff.st@web.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Steffen Hoffmann <hoff.st@web.de>
import re
from trac.core import Trac... | 36.113003 | 83 | 0.526041 |
ef76c204d8df10b32e6a4619fd8d066e6a88a7ce | 2,783 | py | Python | modules/auto_split/compiler/tensorflow_compiler.py | sophon-ai-algo/sophon-inference | f923413b76615e265af28fd1dd2b43e5eb303dcd | [
"Apache-2.0"
] | 18 | 2020-02-21T03:06:33.000Z | 2022-03-21T03:41:56.000Z | modules/auto_split/compiler/tensorflow_compiler.py | sophon-ai-algo/sophon-inference | f923413b76615e265af28fd1dd2b43e5eb303dcd | [
"Apache-2.0"
] | null | null | null | modules/auto_split/compiler/tensorflow_compiler.py | sophon-ai-algo/sophon-inference | f923413b76615e265af28fd1dd2b43e5eb303dcd | [
"Apache-2.0"
] | 6 | 2020-07-10T08:55:38.000Z | 2021-12-28T01:36:04.000Z | """ Copyright 2016-2022 by Bitmain Technologies 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 applica... | 37.608108 | 80 | 0.654689 |
9a4867738e58685a7a048b32590f4bdb562de4b9 | 11,201 | py | Python | data_helper.py | ShimShim46/HFT-CNN | c068db94dffbcbfab0406e29d81abcb4eb399458 | [
"MIT"
] | 99 | 2018-10-19T12:52:22.000Z | 2022-02-26T13:16:14.000Z | data_helper.py | CharlotteSean/HFT-CNN | c068db94dffbcbfab0406e29d81abcb4eb399458 | [
"MIT"
] | 2 | 2019-06-19T11:01:38.000Z | 2020-07-22T09:50:36.000Z | data_helper.py | CharlotteSean/HFT-CNN | c068db94dffbcbfab0406e29d81abcb4eb399458 | [
"MIT"
] | 23 | 2019-01-26T14:47:25.000Z | 2022-02-26T13:16:17.000Z | import os
import pdb
import pickle
import re
from collections import defaultdict
from itertools import chain
import chakin
import numpy as np
import scipy.sparse as sp
from gensim.models import KeyedVectors
from gensim.models.wrappers.fasttext import FastText
from sklearn.metrics import classification_report, f1_score... | 41.485185 | 165 | 0.600482 |
a2ec94cdb2a9686dc60c25af7cf916f930172b8e | 7,306 | py | Python | plot_templates_manju.py | Matammanjunath/template_codes | 606e127cd0f2da2499c972a65a76ddb51e0a6ebf | [
"MIT"
] | null | null | null | plot_templates_manju.py | Matammanjunath/template_codes | 606e127cd0f2da2499c972a65a76ddb51e0a6ebf | [
"MIT"
] | 1 | 2021-12-05T06:23:22.000Z | 2021-12-05T06:23:22.000Z | plot_templates_manju.py | Matammanjunath/template_codes | 606e127cd0f2da2499c972a65a76ddb51e0a6ebf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Dec 4 20:39:23 2021
@author: MMatam
"""
import matplotlib.pyplot as plt
#https://matplotlib.org/stable/gallery/color/named_colors.html
import matplotlib.colors as mcolors
def oscilloscope_plot(df,x='x',y=['y1','y2'],xlbl = ['xlabel','xuni'],
ylbl = [... | 40.588889 | 133 | 0.525185 |
404365de1232f3e257d98b1365a64b7cd1f1774c | 156 | py | Python | create_view.py | mediaProduct2017/logs-analysis | 337d562e210227af4014ff66d66e1517f33c0b94 | [
"MIT"
] | null | null | null | create_view.py | mediaProduct2017/logs-analysis | 337d562e210227af4014ff66d66e1517f33c0b94 | [
"MIT"
] | null | null | null | create_view.py | mediaProduct2017/logs-analysis | 337d562e210227af4014ff66d66e1517f33c0b94 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# coding: utf-8
from reporting import Reporting
DBNAME = 'news'
analyst = Reporting(DBNAME)
analyst.create_view()
analyst.close()
| 14.181818 | 31 | 0.74359 |
421e1015965a228894eb70ba1dce2eaf5dad86e6 | 45 | py | Python | python/testData/intentions/SpecifyTypeInPy3AnnotationsIntentionTest/caretOnParamUsage_after.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/intentions/SpecifyTypeInPy3AnnotationsIntentionTest/caretOnParamUsage_after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/intentions/SpecifyTypeInPy3AnnotationsIntentionTest/caretOnParamUsage_after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def foo(var: object):
print(var)
pass | 15 | 21 | 0.6 |
1d6986d82a0835101dd9cd16acc12291c8f1d442 | 621 | py | Python | oops_fhir/r4/value_set/performer_role_codes.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/performer_role_codes.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/performer_role_codes.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.performer_role_codes import (
PerformerRoleCodes as PerformerRoleCodes_,
)
__all__ = ["PerformerRoleCodes"]
_resource = _ValueSet.parse_file(Path(__file__).wit... | 20.032258 | 69 | 0.745572 |
cc9d648b49cf8ea9cdb2485f16bd318bf8695125 | 642 | py | Python | icevision/utils/indexable_dict.py | ai-fast-track/mantisshrimp | cc6d6a4a048f6ddda2782b6593dcd6b083a673e4 | [
"Apache-2.0"
] | 580 | 2020-09-10T06:29:57.000Z | 2022-03-29T19:34:54.000Z | icevision/utils/indexable_dict.py | ai-fast-track/mantisshrimp | cc6d6a4a048f6ddda2782b6593dcd6b083a673e4 | [
"Apache-2.0"
] | 691 | 2020-09-05T03:08:34.000Z | 2022-03-31T23:47:06.000Z | icevision/utils/indexable_dict.py | lgvaz/mantisshrimp2 | 743cb7df0dae7eb1331fc2bb66fc9ca09db496cd | [
"Apache-2.0"
] | 105 | 2020-09-09T10:41:35.000Z | 2022-03-25T17:16:49.000Z | __all__ = ["IndexableDict"]
import collections
class IndexableDictValuesView(collections.abc.ValuesView):
def __getitem__(self, index):
return self._mapping._list[index]
class IndexableDict(collections.UserDict):
def __init__(self, *args, **kwargs):
self._list = []
super().__init__(... | 24.692308 | 58 | 0.67134 |
72bfe63994be1ef8cd27e49130f0d572993b3184 | 4,553 | py | Python | tests/api/api/test_functions.py | daniels290813/mlrun | c95d90c3b4ce78d9b71456333ccd201f932d60ea | [
"Apache-2.0"
] | null | null | null | tests/api/api/test_functions.py | daniels290813/mlrun | c95d90c3b4ce78d9b71456333ccd201f932d60ea | [
"Apache-2.0"
] | null | null | null | tests/api/api/test_functions.py | daniels290813/mlrun | c95d90c3b4ce78d9b71456333ccd201f932d60ea | [
"Apache-2.0"
] | null | null | null | import asyncio
import unittest.mock
from http import HTTPStatus
import httpx
import kubernetes.client.rest
import pytest
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
import mlrun.api.api.endpoints.functions
import mlrun.api.crud
import mlrun.api.schemas
import mlrun.api.utils.singleton... | 31.4 | 120 | 0.62662 |
24dba23a08e6bb051fd55cb73b94c70b11f3fab9 | 3,558 | py | Python | tests/features/steps/basics.py | Lreus/python-behave | d8eb530185ee28d0288028f506d6ff29b2d81cd9 | [
"MIT"
] | null | null | null | tests/features/steps/basics.py | Lreus/python-behave | d8eb530185ee28d0288028f506d6ff29b2d81cd9 | [
"MIT"
] | null | null | null | tests/features/steps/basics.py | Lreus/python-behave | d8eb530185ee28d0288028f506d6ff29b2d81cd9 | [
"MIT"
] | null | null | null | from behave import *
"""basics.py
Commented test examples based on behave documentation
"""
@given('we have behave installed')
def empty_method(context):
"""
Even if it may not be used, context argument is required for step
implementation methods. It is an instance of behave.runner.Context
""... | 29.404959 | 86 | 0.669477 |
4a72aec50a8a2b122b84a75f027457fa16ecfc64 | 489 | py | Python | setup.py | olinger/flask_accepts | c1bba213531e614129391f7ea8c45b0198600e6d | [
"BSD-3-Clause"
] | null | null | null | setup.py | olinger/flask_accepts | c1bba213531e614129391f7ea8c45b0198600e6d | [
"BSD-3-Clause"
] | null | null | null | setup.py | olinger/flask_accepts | c1bba213531e614129391f7ea8c45b0198600e6d | [
"BSD-3-Clause"
] | null | null | null | # Copyright Alan (AJ) Pryor, Jr. 2018
from setuptools import setup, find_packages
setup(
name="flask_accepts",
author='Alan "AJ" Pryor, Jr.',
author_email="apryor6@gmail.com",
version="0.17.6",
description="Easy, opinionated Flask input/output handling with Flask-restx and Marshmallow",
... | 25.736842 | 98 | 0.621677 |
ad61915ab8850f4b64e0906f44cd769dc70c452f | 8,527 | py | Python | api/anubis/utils/http/decorators.py | synoet/Anubis | 051888a88e37c67e5e772245604c79ceb4db8764 | [
"MIT"
] | 2 | 2022-02-24T17:39:27.000Z | 2022-02-25T02:14:06.000Z | api/anubis/utils/http/decorators.py | synoet/Anubis | 051888a88e37c67e5e772245604c79ceb4db8764 | [
"MIT"
] | null | null | null | api/anubis/utils/http/decorators.py | synoet/Anubis | 051888a88e37c67e5e772245604c79ceb4db8764 | [
"MIT"
] | null | null | null | from functools import wraps
from typing import Union, List, Tuple
from flask import request
from anubis.utils.auth import current_user
from anubis.utils.data import jsonify, _verify_data_shape
from anubis.utils.exceptions import AuthenticationError
from anubis.utils.http.https import error_response
def load_from_id... | 35.381743 | 100 | 0.574059 |
2fe6ee9b5fa830be2c92a078f217497e478392dd | 372 | py | Python | djangoapp/api/serializers.py | kevinha298/microservice | 4de46929a802afa7997436c781338532be6c2cb9 | [
"MIT"
] | null | null | null | djangoapp/api/serializers.py | kevinha298/microservice | 4de46929a802afa7997436c781338532be6c2cb9 | [
"MIT"
] | null | null | null | djangoapp/api/serializers.py | kevinha298/microservice | 4de46929a802afa7997436c781338532be6c2cb9 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from api.models import Member
class MemberSerializer(serializers.ModelSerializer):
mrn = serializers.IntegerField(required=False)
name = serializers.CharField(required=False)
dob = serializers.DateField(required=False)
class Meta:
model = Member
# ... | 31 | 52 | 0.712366 |
e1229a3da8083df90a3aba45d210fe85bca452cc | 17,284 | py | Python | teste.py | pedralmeida22/IA-Bomberman | 548cf3e6c1c138698854fd1d9e22274d9d086fb0 | [
"MIT"
] | null | null | null | teste.py | pedralmeida22/IA-Bomberman | 548cf3e6c1c138698854fd1d9e22274d9d086fb0 | [
"MIT"
] | null | null | null | teste.py | pedralmeida22/IA-Bomberman | 548cf3e6c1c138698854fd1d9e22274d9d086fb0 | [
"MIT"
] | 1 | 2020-01-13T19:57:29.000Z | 2020-01-13T19:57:29.000Z | import sys
import json
import asyncio
import websockets
import getpass
import os
from defs2 import *
from mapa import Map
from Node import *
from path import *
from bomb import *
async def agent_loop(server_address="localhost:8000", agent_name="student"):
async with websockets.connect(f"ws://{server_address}/pla... | 43.86802 | 146 | 0.418132 |
8af21b960366ed26d414023a78b547a11a3f367f | 1,228 | py | Python | pyranges/methods/call.py | jergosh/pyranges | a401fd5bf1f6aa1a2546354a22d81e8c59a82114 | [
"MIT"
] | null | null | null | pyranges/methods/call.py | jergosh/pyranges | a401fd5bf1f6aa1a2546354a22d81e8c59a82114 | [
"MIT"
] | null | null | null | pyranges/methods/call.py | jergosh/pyranges | a401fd5bf1f6aa1a2546354a22d81e8c59a82114 | [
"MIT"
] | null | null | null | import pandas as pd
import pyranges as pr
def _handle_eval_return(self, result, col, as_pyranges, subset):
"""Handle return from eval.
If col is set, add/update cols. If subset is True, use return series to subset PyRanges.
Otherwise return PyRanges or dict of data."""
if as_pyranges:
if not... | 27.288889 | 99 | 0.611564 |
1d9c39ebb7c4d3cf927baf68fe18879e8876d01c | 2,431 | py | Python | tensorflow_datasets/testing/__init__.py | kmh4321/datasets | 286d7a8a5eb3e073f18f8fee4f774bafc23fb445 | [
"Apache-2.0"
] | 14 | 2019-03-30T02:11:29.000Z | 2021-11-16T12:06:32.000Z | tensorflow_datasets/testing/__init__.py | kmh4321/datasets | 286d7a8a5eb3e073f18f8fee4f774bafc23fb445 | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/testing/__init__.py | kmh4321/datasets | 286d7a8a5eb3e073f18f8fee4f774bafc23fb445 | [
"Apache-2.0"
] | 10 | 2019-03-31T08:35:29.000Z | 2021-09-01T06:28:43.000Z | # coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... | 44.2 | 86 | 0.816125 |
7a28f34470415037666a90e90e9029e28b4c6fec | 2,239 | py | Python | flask_app/app.py | FancyFun/dogflask | 255f7c19d2741b9c3b2e5cc24cac2748be3d6305 | [
"MIT"
] | null | null | null | flask_app/app.py | FancyFun/dogflask | 255f7c19d2741b9c3b2e5cc24cac2748be3d6305 | [
"MIT"
] | null | null | null | flask_app/app.py | FancyFun/dogflask | 255f7c19d2741b9c3b2e5cc24cac2748be3d6305 | [
"MIT"
] | 1 | 2020-09-18T03:13:11.000Z | 2020-09-18T03:13:11.000Z | from flask import Flask, render_template, request
import requests
from flask_sqlalchemy import SQLAlchemy
def create_app():
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///Dog.sqlite3'
app.config['SQLALCHEMY_TRACK_MODIFCATIONS'] = False
DB.init_app(app)
@app.route('/'... | 28.341772 | 80 | 0.608307 |
46a4b6fcf9d3d83250af7953b1345e401870ade4 | 317 | py | Python | sp/quadratic.py | Breccia/s-py | 4fc5fcd0efbfcaa6574a81ee922c1083ed0ef57d | [
"MIT"
] | null | null | null | sp/quadratic.py | Breccia/s-py | 4fc5fcd0efbfcaa6574a81ee922c1083ed0ef57d | [
"MIT"
] | null | null | null | sp/quadratic.py | Breccia/s-py | 4fc5fcd0efbfcaa6574a81ee922c1083ed0ef57d | [
"MIT"
] | null | null | null | #!/usr/local/anaconda3/bin/python
import matplotlib.pylab as plt
# 0 = -(x**2) -2x - 1
def plot_quad():
x = []
y = []
for i in range(-50, 50):
x.append(i)
y.append(+(i ** 2) + (2*(i**1)) + 1)
plt.plot(x, y, marker='*')
plt.show()
if __name__ == '__main__':
plot_quad()
| 14.409091 | 44 | 0.495268 |
c1e9c1289b265e9394990044c232149cc9d30651 | 1,477 | py | Python | bot.py | changapuzharamanan/message-view-counter-bot | 40cca3ab354b30e4191edab565fa6645f6691024 | [
"Unlicense"
] | null | null | null | bot.py | changapuzharamanan/message-view-counter-bot | 40cca3ab354b30e4191edab565fa6645f6691024 | [
"Unlicense"
] | null | null | null | bot.py | changapuzharamanan/message-view-counter-bot | 40cca3ab354b30e4191edab565fa6645f6691024 | [
"Unlicense"
] | null | null | null | from pyrogram import Client, filters
from pyrogram.types import Message, Poll, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
import os
api_id = int(environ.get("API_ID"))
api_hash = environ.get("API_HASH")
token = environ.get("TOKEN")
app = Client(':memory:', api_id, api_hash, bot_token=token)
non_anony... | 36.925 | 275 | 0.761002 |
fa448a649f65e4e85832c6895840a50221c8d87d | 14,750 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/terraform.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/terraform.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/terraform.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ryan Scott Brown <ryansb@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | 37.341772 | 158 | 0.659593 |
e81c30fbe3d8e0f136d77c98305e1a8cc2ed7660 | 3,004 | py | Python | sample.py | Changyoon-Lee/stockauto | 5029b95d8055d6780b9e902109c4ae43525d7b49 | [
"MIT"
] | 1 | 2020-12-18T13:52:39.000Z | 2020-12-18T13:52:39.000Z | sample.py | Changyoon-Lee/stockauto | 5029b95d8055d6780b9e902109c4ae43525d7b49 | [
"MIT"
] | null | null | null | sample.py | Changyoon-Lee/stockauto | 5029b95d8055d6780b9e902109c4ae43525d7b49 | [
"MIT"
] | null | null | null | import pythoncom
from PyQt5.QtWidgets import *
import win32com.client
import win32event
g_objCodeMgr = win32com.client.Dispatch('CpUtil.CpCodeMgr')
StopEvent = win32event.CreateEvent(None, 0, 0, None)
class CpEvent:
def set_params(self, client, name, caller):
self.client = client # CP 실시간 통신 object... | 30.969072 | 83 | 0.592876 |
f78c04b18a3db96eb00d7c5881a78d62cc9495f2 | 3,413 | py | Python | customization/aws_secrets.py | wahabakhtar/aws-limit-monitor | 76e2ed0def21061d66d62fdcf74b0bcf0e8793a0 | [
"Apache-2.0"
] | null | null | null | customization/aws_secrets.py | wahabakhtar/aws-limit-monitor | 76e2ed0def21061d66d62fdcf74b0bcf0e8793a0 | [
"Apache-2.0"
] | null | null | null | customization/aws_secrets.py | wahabakhtar/aws-limit-monitor | 76e2ed0def21061d66d62fdcf74b0bcf0e8793a0 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2020 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 accompanying this... | 42.6625 | 118 | 0.655142 |
e95821821e104616204fb900acce987d0377b5f5 | 936 | py | Python | personal_portfolio/urls.py | aminyaraghi/portfolio | dabef787f36eb80563b6a0246a55d3495b126cb5 | [
"MIT"
] | null | null | null | personal_portfolio/urls.py | aminyaraghi/portfolio | dabef787f36eb80563b6a0246a55d3495b126cb5 | [
"MIT"
] | null | null | null | personal_portfolio/urls.py | aminyaraghi/portfolio | dabef787f36eb80563b6a0246a55d3495b126cb5 | [
"MIT"
] | null | null | null | """personal_portfolio URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 34.666667 | 77 | 0.712607 |
5a451a4c359b1049f65a0c073265c9c130a8dfd9 | 4,247 | py | Python | brave/evaluate/evaluate_video_embedding.py | deepmind/brave | 0ae20d9afcf6b1fa4d31d70c906d711901b56e9c | [
"Apache-2.0"
] | 26 | 2021-10-14T19:06:56.000Z | 2022-03-02T18:22:45.000Z | brave/evaluate/evaluate_video_embedding.py | deepmind/brave | 0ae20d9afcf6b1fa4d31d70c906d711901b56e9c | [
"Apache-2.0"
] | 1 | 2022-01-31T23:23:31.000Z | 2022-02-08T01:07:15.000Z | brave/evaluate/evaluate_video_embedding.py | deepmind/brave | 0ae20d9afcf6b1fa4d31d70c906d711901b56e9c | [
"Apache-2.0"
] | 1 | 2022-02-04T10:54:53.000Z | 2022-02-04T10:54:53.000Z | # Copyright 2021 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 agree... | 33.976 | 80 | 0.768778 |
9be9ed9d7497e74a9e18a64f93b2d98a6e9f5ebf | 91 | py | Python | tests/test_A001220.py | danielsimonney/oeis | 16c1dd6e058e49b629f695acb82ec55dd5f052f9 | [
"MIT"
] | null | null | null | tests/test_A001220.py | danielsimonney/oeis | 16c1dd6e058e49b629f695acb82ec55dd5f052f9 | [
"MIT"
] | null | null | null | tests/test_A001220.py | danielsimonney/oeis | 16c1dd6e058e49b629f695acb82ec55dd5f052f9 | [
"MIT"
] | null | null | null | from oeis import A001220
def test_A001220():
assert A001220(limit=2) == [1093, 3511]
| 15.166667 | 43 | 0.692308 |
a038817ef91d3f8b36a9876a743338ba1967fea0 | 11,007 | py | Python | SpectralClustering/src/clustering.py | efikalti/computational-intelligence | 1d5e3ebd0648e1b0d25dea42c1e4d16ce872489b | [
"MIT"
] | null | null | null | SpectralClustering/src/clustering.py | efikalti/computational-intelligence | 1d5e3ebd0648e1b0d25dea42c1e4d16ce872489b | [
"MIT"
] | null | null | null | SpectralClustering/src/clustering.py | efikalti/computational-intelligence | 1d5e3ebd0648e1b0d25dea42c1e4d16ce872489b | [
"MIT"
] | null | null | null | import logging
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn import cluster
from sklearn.manifold import LocallyLinearEmbedding
from sklearn.neighbors import radius_neighbors_graph
from scipy.sparse import csgraph
class Cluster:
"""
... | 37.185811 | 167 | 0.605615 |
1ae6f40eda2bb4a1ef579c903301fd86a1de34ce | 1,194 | py | Python | src/worker/tool_config_parser.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | 1 | 2019-06-17T17:01:17.000Z | 2019-06-17T17:01:17.000Z | src/worker/tool_config_parser.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | 7 | 2021-02-08T20:46:15.000Z | 2021-09-08T02:12:59.000Z | src/worker/tool_config_parser.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | null | null | null | import os
import configparser
from exceptions.configuration_exception import ConfigurationException
from helpers import Singleton
from worker.copytool.rsync import Rsync
from worker.copytool.shiftc import Shiftc
from worker.copytool.tar import Tar
class ToolConfigParser(metaclass=Singleton):
def __init__(self, ... | 33.166667 | 113 | 0.665829 |
736337aed35889c16430019dba47a5129e73c668 | 3,667 | py | Python | ta_assistant_django/settings.py | HelloYeew/ta_assistant_django | c72af9ae260c917d4835892811240894602ac454 | [
"MIT"
] | null | null | null | ta_assistant_django/settings.py | HelloYeew/ta_assistant_django | c72af9ae260c917d4835892811240894602ac454 | [
"MIT"
] | null | null | null | ta_assistant_django/settings.py | HelloYeew/ta_assistant_django | c72af9ae260c917d4835892811240894602ac454 | [
"MIT"
] | null | null | null | """
Django settings for ta_assistant_django project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
... | 26.381295 | 96 | 0.705481 |
e5d12f9ee0bd93ad5f0bf96abd979868752582f2 | 1,236 | py | Python | httpserver/__init__.py | evinlort/http-server | 7db0637da7afbdb3736e595c431477c5242320a9 | [
"MIT"
] | null | null | null | httpserver/__init__.py | evinlort/http-server | 7db0637da7afbdb3736e595c431477c5242320a9 | [
"MIT"
] | null | null | null | httpserver/__init__.py | evinlort/http-server | 7db0637da7afbdb3736e595c431477c5242320a9 | [
"MIT"
] | null | null | null | import os
import httpserver.server.server as srv
class Server:
def __init__(self, *, port: int = 8080, router: str = "router/web", controllers: str = "controllers"):
self._port = int(port)
self._router = router
self.__router_check()
self.__folder_check(controllers)
self._c... | 26.869565 | 106 | 0.596278 |
e36da741e759ed69596dbafa050fa61b41b9ac18 | 2,614 | py | Python | grammaranalyzer.py | JVMartin/grammar-analyzer | c6316b10cac6185e7986ae321e2ca3806bf654e5 | [
"MIT"
] | null | null | null | grammaranalyzer.py | JVMartin/grammar-analyzer | c6316b10cac6185e7986ae321e2ca3806bf654e5 | [
"MIT"
] | null | null | null | grammaranalyzer.py | JVMartin/grammar-analyzer | c6316b10cac6185e7986ae321e2ca3806bf654e5 | [
"MIT"
] | null | null | null | """
A class used to test strings against a given grammar to see if the grammar
can generate the string.
An instance of GrammarAnalyzer is initialized with a passed Grammar object
and is capable of testing that grammar against test strings (input strings)
using the test_string method.
"""
class GrammarAnalyzer:
def ... | 25.378641 | 75 | 0.685539 |
0e6f8bbfab88586b7d3300c4ea107623af500be0 | 3,022 | py | Python | joker/cmds/start_funcs.py | PuNkYsHuNgRy/joker-blockchain | e49d6b9aa46e6097e216561bd7563b50519aae13 | [
"Apache-2.0"
] | 4 | 2022-03-04T06:08:15.000Z | 2022-03-17T19:14:22.000Z | joker/cmds/start_funcs.py | zcomputerwiz/joker-blockchain | 72cf94708acd49e0cbcc63c74d5ddb1e1045b8a5 | [
"Apache-2.0"
] | 1 | 2022-03-29T13:20:11.000Z | 2022-03-29T13:20:11.000Z | joker/cmds/start_funcs.py | zcomputerwiz/joker-blockchain | 72cf94708acd49e0cbcc63c74d5ddb1e1045b8a5 | [
"Apache-2.0"
] | 3 | 2022-03-10T22:26:44.000Z | 2022-03-15T08:46:15.000Z | import asyncio
import os
import subprocess
import sys
from pathlib import Path
from typing import Optional
from joker.cmds.passphrase_funcs import get_current_passphrase
from joker.daemon.client import DaemonProxy, connect_to_daemon_and_validate
from joker.util.keychain import Keychain, KeyringMaxUnlockAttempts
from ... | 35.139535 | 103 | 0.650232 |
ca63d64884bc09dee95fdf8523f1f35a66109176 | 11,642 | py | Python | spyder/plugins/projects/widgets/projectexplorer.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 7,956 | 2015-02-17T01:19:09.000Z | 2022-03-31T21:52:15.000Z | spyder/plugins/projects/widgets/projectexplorer.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 16,326 | 2015-02-16T23:15:21.000Z | 2022-03-31T23:34:34.000Z | spyder/plugins/projects/widgets/projectexplorer.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 1,918 | 2015-02-20T19:26:26.000Z | 2022-03-31T19:03:25.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Project Explorer"""
# pylint: disable=C0103
# Standard library imports
from __future__ import print_function
import os
import os.path as osp
impo... | 33.454023 | 80 | 0.519584 |
39b6f99f14ad91d5ca90da7b9cbe3767b06371b9 | 19,593 | py | Python | onnx_coreml/converter.py | yukihiko/onnx-coreml | 08aeb7246fbebad3beeeeef68d861012d232f856 | [
"MIT"
] | 1 | 2019-11-25T16:38:01.000Z | 2019-11-25T16:38:01.000Z | onnx_coreml/converter.py | yukihiko/onnx-coreml | 08aeb7246fbebad3beeeeef68d861012d232f856 | [
"MIT"
] | null | null | null | onnx_coreml/converter.py | yukihiko/onnx-coreml | 08aeb7246fbebad3beeeeef68d861012d232f856 | [
"MIT"
] | 1 | 2019-06-09T06:19:01.000Z | 2019-06-09T06:19:01.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from typing import Text, Union, Optional, Dict, Any, Iterable, Sequence, Callable, List
from ._shapeinference import infer_shapes_and_types
import onnx
import numpy as np... | 40.232033 | 177 | 0.600163 |
5ee43517ff055edae0a64407edc3c96addab22f3 | 328 | py | Python | session-7/file_read.py | ssxrgio/2018-19-PNE-practices | f73ed67cb676a2ffffdf7a5a3ddc4c9fa7902ee0 | [
"Apache-2.0"
] | null | null | null | session-7/file_read.py | ssxrgio/2018-19-PNE-practices | f73ed67cb676a2ffffdf7a5a3ddc4c9fa7902ee0 | [
"Apache-2.0"
] | null | null | null | session-7/file_read.py | ssxrgio/2018-19-PNE-practices | f73ed67cb676a2ffffdf7a5a3ddc4c9fa7902ee0 | [
"Apache-2.0"
] | null | null | null | # Example of reading a file located in our local file system.
name = 'mynotes.txt'
# Opening the file
file = open(name, 'r')
print('File opened: {}'.format(file.name)) # Name is an attribute that stores the name of the file opened.
contents = file.read()
print('The file contents are: {}'.format(contents))
file.c... | 19.294118 | 106 | 0.698171 |
ac5b0b9319084310c8c7d8e9f68b54f2705aa1b9 | 1,668 | py | Python | setup.py | jtlai0921/template-remover | de963f221612f57d4982fbc779acd21302c7b817 | [
"Apache-2.0"
] | 4 | 2015-07-30T12:23:11.000Z | 2019-02-08T14:59:07.000Z | setup.py | jtlai0921/template-remover | de963f221612f57d4982fbc779acd21302c7b817 | [
"Apache-2.0"
] | 2 | 2015-07-30T12:34:21.000Z | 2019-02-13T09:53:24.000Z | setup.py | jtlai0921/template-remover | de963f221612f57d4982fbc779acd21302c7b817 | [
"Apache-2.0"
] | 2 | 2019-03-10T12:25:16.000Z | 2020-05-29T08:02:47.000Z | # Copyright 2014 Deezer (http://www.deezer.com)
#
# 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... | 37.066667 | 74 | 0.667866 |
fb086015e077a605675a63dda41e6c8de85a1129 | 1,487 | py | Python | coursera_algorithms/dynamic1.py | violetcodes/act-dumb | ced310fa3f9e784c425ae9b013abc1ea601eba24 | [
"Apache-2.0"
] | null | null | null | coursera_algorithms/dynamic1.py | violetcodes/act-dumb | ced310fa3f9e784c425ae9b013abc1ea601eba24 | [
"Apache-2.0"
] | null | null | null | coursera_algorithms/dynamic1.py | violetcodes/act-dumb | ced310fa3f9e784c425ae9b013abc1ea601eba24 | [
"Apache-2.0"
] | null | null | null | def tester_decorator(name_of_function, params=None):
def dec(f):
def fn(*args):
print(f'testing {name_of_function} with follwoing parameters')
for i, arg in (zip(params, args) if params is not None else enumerate(args)):
print(f'arg -> {i}: {arg}')
... | 28.056604 | 91 | 0.551446 |
8b2e5d1127dd36d235aed3a117ac8f3e03fc6681 | 1,642 | py | Python | demo_cmsplugin_zinnia/urls.py | HiddenClever/cmsplugin-zinnia | cf3e066b2923eb3bcec91527cea7bef7580c97d6 | [
"BSD-3-Clause"
] | null | null | null | demo_cmsplugin_zinnia/urls.py | HiddenClever/cmsplugin-zinnia | cf3e066b2923eb3bcec91527cea7bef7580c97d6 | [
"BSD-3-Clause"
] | null | null | null | demo_cmsplugin_zinnia/urls.py | HiddenClever/cmsplugin-zinnia | cf3e066b2923eb3bcec91527cea7bef7580c97d6 | [
"BSD-3-Clause"
] | null | null | null | """Urls for the cmsplugin_zinnia demo"""
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url
from django.conf.urls import include
from django.conf.urls import patterns
from zinnia.sitemaps import TagSitemap
from zinnia.sitemaps import EntrySitemap
from zinnia.sitemaps imp... | 27.830508 | 65 | 0.681486 |
a3fecfcd35d21ee1012ffe01a5f15f144d2b469b | 11,614 | py | Python | common-mk/platform2_unittest.py | strassek/chromiumos-platform2 | 12c953f41f48b8a6b0bd1c181d09bdb1de38325c | [
"BSD-3-Clause"
] | 4 | 2020-07-24T06:54:16.000Z | 2021-06-16T17:13:53.000Z | common-mk/platform2_unittest.py | strassek/chromiumos-platform2 | 12c953f41f48b8a6b0bd1c181d09bdb1de38325c | [
"BSD-3-Clause"
] | 1 | 2021-04-02T17:35:07.000Z | 2021-04-02T17:35:07.000Z | common-mk/platform2_unittest.py | strassek/chromiumos-platform2 | 12c953f41f48b8a6b0bd1c181d09bdb1de38325c | [
"BSD-3-Clause"
] | 1 | 2020-11-04T22:31:45.000Z | 2020-11-04T22:31:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for platform2.py"""
from __future__ import print_function
import os
import sys
import mock... | 33.566474 | 80 | 0.573101 |
26b54deadf5cacfec185878bc3432567b4009224 | 4,313 | py | Python | bsp/air640w/rtt/rtconfig.py | pengxxxxx/LuatOS | dc163e7dc2d5230901b7ce57566d662d1954546e | [
"MIT"
] | 217 | 2019-12-29T15:52:46.000Z | 2022-03-29T05:44:29.000Z | bsp/air640w/rtt/rtconfig.py | zhangyinpeng/LuatOS | 7543d59cbfe0fbb9c9ba1c3a0b506660c783367a | [
"MIT"
] | 64 | 2019-12-30T05:50:04.000Z | 2022-03-06T03:48:56.000Z | bsp/air640w/rtt/rtconfig.py | zhangyinpeng/LuatOS | 7543d59cbfe0fbb9c9ba1c3a0b506660c783367a | [
"MIT"
] | 59 | 2020-01-09T03:46:01.000Z | 2022-03-27T03:17:36.000Z | import os
import sys
# toolchains options
ARCH='arm'
CPU='cortex-m3'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcer... | 30.160839 | 247 | 0.595641 |
06a5a46a22876d2e1b8758216dcfeab297fed7ae | 442 | py | Python | joe_username/generate.py | shreyas44/joe-username | add4ef5d44948401e2dd096ff9a73df456548c44 | [
"MIT"
] | null | null | null | joe_username/generate.py | shreyas44/joe-username | add4ef5d44948401e2dd096ff9a73df456548c44 | [
"MIT"
] | null | null | null | joe_username/generate.py | shreyas44/joe-username | add4ef5d44948401e2dd096ff9a73df456548c44 | [
"MIT"
] | null | null | null | import random
JOES_DICTIONARY = ["right", "awesome", "interesting", "cool"]
def generate(max_limit=4):
try:
max_limit = int(max_limit)
if max_limit <= 0:
raise ValueError
except ValueError:
raise ValueError("Make sure you enter an integer greater than 0")
word = ""
for i in range(ma... | 18.416667 | 69 | 0.662896 |
df994e7169033b102835ead4076633bc68549336 | 4,705 | py | Python | mll/recv_models/rnn_hierarchical_model.py | asappresearch/compositional-inductive-bias | 2c67713306ec6591f397ca252f915c3edc5a794f | [
"MIT"
] | 2 | 2021-07-09T16:32:00.000Z | 2022-03-21T17:32:39.000Z | mll/recv_models/rnn_hierarchical_model.py | asappresearch/compositional-inductive-bias | 2c67713306ec6591f397ca252f915c3edc5a794f | [
"MIT"
] | null | null | null | mll/recv_models/rnn_hierarchical_model.py | asappresearch/compositional-inductive-bias | 2c67713306ec6591f397ca252f915c3edc5a794f | [
"MIT"
] | 1 | 2021-07-09T16:32:02.000Z | 2021-07-09T16:32:02.000Z | import torch
from torch import nn
from ulfs import nn_modules
from mll.darts_cell import DGReceiverCell, DGSenderCell
class RNNHierEncoder(nn.Module):
def __init__(
self, embedding_size, rnn_type
):
self.rnn_type = rnn_type
self.embedding_size = embedding_size
super().__i... | 38.565574 | 108 | 0.61084 |
8492af4dcee6ff2c4611b3c18acdfe1e8fe4dab6 | 954 | py | Python | Detection/scripts/rename_mover_new_data.py | Final-Six-SIH2020/Detection-and-Classification | d02074fa4e5ba455e011ffd5081cc3428245c4d8 | [
"MIT"
] | 1 | 2021-04-30T05:33:39.000Z | 2021-04-30T05:33:39.000Z | Detection/scripts/rename_mover_new_data.py | Final-Six-SIH2020/Detection-and-Classification | d02074fa4e5ba455e011ffd5081cc3428245c4d8 | [
"MIT"
] | 1 | 2020-07-27T16:25:00.000Z | 2020-07-27T16:28:08.000Z | Detection/scripts/rename_mover_new_data.py | Final-Six-SIH2020/Detection-and-Classification | d02074fa4e5ba455e011ffd5081cc3428245c4d8 | [
"MIT"
] | null | null | null | import os
import shutil
import os.path as P
BASE_FOLDER = 'kaggle_dataset'
DST_FOLDER = 'kaggle_renamed'
if P.isdir(DST_FOLDER):
shutil.rmtree(DST_FOLDER)
os.makedirs(DST_FOLDER)
xml_files = [P.join(BASE_FOLDER, file)
for file in os.listdir(BASE_FOLDER) if file.endswith('.xml')]
missing = []
img_... | 24.461538 | 74 | 0.669811 |
4139952f6e41e157cb48005765c678971a5da01e | 4,383 | py | Python | contrib/seeds/generate-seeds.py | gothcoin/coin | d8812caf6d04884eade5f8d52b556a0282875fa9 | [
"MIT"
] | 2 | 2021-05-16T07:29:34.000Z | 2021-05-17T12:41:48.000Z | contrib/seeds/generate-seeds.py | gothcoin/coin | d8812caf6d04884eade5f8d52b556a0282875fa9 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | gothcoin/coin | d8812caf6d04884eade5f8d52b556a0282875fa9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.307143 | 99 | 0.583619 |
193455097ec6538e72e1e47238ce4794adb6aea0 | 935 | py | Python | src/genie/libs/parser/junos/tests/ShowServicesAccountingAggregationTemplate/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/junos/tests/ShowServicesAccountingAggregationTemplate/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/junos/tests/ShowServicesAccountingAggregationTemplate/cli/equal/golden_output_1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
"services-accounting-information": {
"flow-aggregate-template-detail": {
"flow-aggregate-template-detail-ipv4": {
"detail-entry": [{
"source-address": "10.120.202.64",
"destination-address": "10.169.14.158",
... | 35.961538 | 59 | 0.37861 |
4c5f3b30b3cc634772659ed40127d394c4f38ab5 | 1,909 | py | Python | test/units/plugins/terminal/test_slxos.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | test/units/plugins/terminal/test_slxos.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | test/units/plugins/terminal/test_slxos.py | Container-Projects/ansible-provider-docs | 100b695b0b0c4d8d08af362069557ffc735d0d7e | [
"PSF-2.0",
"BSD-2-Clause",
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #
# (c) 2018 Extreme Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ans... | 31.816667 | 83 | 0.718177 |
6cbb5b951a26e1e7bf3ed5976a518c42db080fc1 | 3,122 | py | Python | data/p2DJ/New/program/qiskit/simulator/startQiskit238.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/simulator/startQiskit238.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/simulator/startQiskit238.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=11
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... | 28.642202 | 82 | 0.626842 |
6f02d403e4a364c3f41cf60321de96b0f9424f0f | 537 | py | Python | src/handlers/static_files.py | nhardy/py-js-web-scaffold | adf3e3ada0b21cdb9620676de795579107442dd7 | [
"MIT"
] | null | null | null | src/handlers/static_files.py | nhardy/py-js-web-scaffold | adf3e3ada0b21cdb9620676de795579107442dd7 | [
"MIT"
] | null | null | null | src/handlers/static_files.py | nhardy/py-js-web-scaffold | adf3e3ada0b21cdb9620676de795579107442dd7 | [
"MIT"
] | null | null | null | import mimetypes
import tornado.web
class StaticFileHandler(tornado.web.StaticFileHandler):
def get_content_type(self):
mime, encoding = mimetypes.guess_type(self.absolute_path)
if mime is not None:
return mime
elif self.absolute_path.endswith('.ttf'):
return 'application/x-font-ttf'
e... | 26.85 | 61 | 0.715084 |
a6d3a1958272279fb0b4957c733d4d1eb07d81a3 | 32,085 | py | Python | python/ccxt/coinex.py | wadaxofficial/ccxt | 765aaa4cd83c1e2dc75717d49b50a55ac4dc0487 | [
"MIT"
] | null | null | null | python/ccxt/coinex.py | wadaxofficial/ccxt | 765aaa4cd83c1e2dc75717d49b50a55ac4dc0487 | [
"MIT"
] | 5 | 2020-07-17T06:15:25.000Z | 2021-05-09T03:07:57.000Z | python/ccxt/coinex.py | wadaxofficial/ccxt | 765aaa4cd83c1e2dc75717d49b50a55ac4dc0487 | [
"MIT"
] | null | null | null | # -*- 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
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | 38.656627 | 465 | 0.467602 |
d77cd8ce948d69db216239d323730b616e09c769 | 5,868 | py | Python | g_lyrics_funcs.py | donniebishop/genius_lyrics | 41124a0512f65a0074a4784421c44ab88dba3aee | [
"MIT"
] | 5 | 2016-05-04T18:53:13.000Z | 2017-09-05T14:53:27.000Z | g_lyrics_funcs.py | donniebishop/genius_lyrics | 41124a0512f65a0074a4784421c44ab88dba3aee | [
"MIT"
] | 2 | 2016-05-04T16:11:05.000Z | 2018-09-02T17:32:31.000Z | g_lyrics_funcs.py | donniebishop/genius_lyrics | 41124a0512f65a0074a4784421c44ab88dba3aee | [
"MIT"
] | 4 | 2016-06-11T17:49:40.000Z | 2020-04-28T18:24:26.000Z | #!/usr/bin/env python
import six
import lxml
import requests
import subprocess
from bs4 import BeautifulSoup
# Header uses client Authorization Token from api.genius.com. As such,
# it is only allowed to request read-only endpoints from the API,
# With that explained, I'm including it here. Mostly because I don't kno... | 36.447205 | 110 | 0.619973 |
605d1bdb44e8b15bda8e74841c61a2093e024a4b | 9,120 | py | Python | docs/source/conf.py | hjelmn/Lmod | 563407ec0e6fdd03904949c1715e073a7ae00929 | [
"MIT"
] | null | null | null | docs/source/conf.py | hjelmn/Lmod | 563407ec0e6fdd03904949c1715e073a7ae00929 | [
"MIT"
] | null | null | null | docs/source/conf.py | hjelmn/Lmod | 563407ec0e6fdd03904949c1715e073a7ae00929 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Lmod documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 25 22:52:04 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 32 | 79 | 0.716776 |
bbaf0e228b1639eccdb936680f41c5a53e5e30af | 852 | py | Python | swayblur/paths.py | ForgottenUmbrella/swayblur | aab0c0bd4a5b49ae84a8540a4e3c6a7c1beeea25 | [
"MIT"
] | 7 | 2021-11-25T15:29:51.000Z | 2022-01-09T17:19:28.000Z | swayblur/paths.py | ForgottenUmbrella/swayblur | aab0c0bd4a5b49ae84a8540a4e3c6a7c1beeea25 | [
"MIT"
] | 14 | 2021-11-10T06:24:09.000Z | 2022-03-07T16:11:49.000Z | swayblur/paths.py | ForgottenUmbrella/swayblur | aab0c0bd4a5b49ae84a8540a4e3c6a7c1beeea25 | [
"MIT"
] | 2 | 2021-11-25T19:00:01.000Z | 2022-02-07T09:49:12.000Z | import pathlib
import shutil
DEFAULT_OGURI_DIR = pathlib.Path.home() / '.config/oguri/config'
CACHE_DIR = pathlib.Path.home() / '.cache/swayblur'
CACHE_VALIDATION_FILE = CACHE_DIR / 'settings.json'
# create the cache dir if it doesn't exist
def createCache() -> None:
CACHE_DIR.mkdir(parents=True, exist_ok=True)
... | 30.428571 | 67 | 0.70892 |
e59e988675e797298f863a8cf9ce37066b99c739 | 955 | py | Python | Course3/Lab4/validations.py | zulfauzio/it-cert-automation-practice | 223f36612336ac14815d54d2734e81db5c8dc26a | [
"Apache-2.0"
] | null | null | null | Course3/Lab4/validations.py | zulfauzio/it-cert-automation-practice | 223f36612336ac14815d54d2734e81db5c8dc26a | [
"Apache-2.0"
] | null | null | null | Course3/Lab4/validations.py | zulfauzio/it-cert-automation-practice | 223f36612336ac14815d54d2734e81db5c8dc26a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import re
def validate_user(username, minlen):
"""Checks if the received username matches the required conditions."""
if type(username) != str:
raise TypeError("username must be a string")
if minlen < 1:
raise ValueError("minlen must be at least 1")
# Userna... | 32.931034 | 74 | 0.660733 |
9ca5b255c3e12db5b3426c3508a510d34e086c5a | 6,371 | py | Python | kubernetes/client/models/v1_azure_file_persistent_volume_source.py | dix000p/kubernetes-client-python | 22e473e02883aca1058606092c86311f02f42be2 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_azure_file_persistent_volume_source.py | dix000p/kubernetes-client-python | 22e473e02883aca1058606092c86311f02f42be2 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_azure_file_persistent_volume_source.py | dix000p/kubernetes-client-python | 22e473e02883aca1058606092c86311f02f42be2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | 29.910798 | 115 | 0.615288 |
af6a62d24262d77aeaf3b40a374b65bd86be194e | 11,351 | py | Python | venv/Lib/site-packages/neo4j/work/result.py | KwanYu/Airbnb-Backend | 61b4c89f891378181447fc251fa0d1c2c5f435de | [
"MIT"
] | null | null | null | venv/Lib/site-packages/neo4j/work/result.py | KwanYu/Airbnb-Backend | 61b4c89f891378181447fc251fa0d1c2c5f435de | [
"MIT"
] | null | null | null | venv/Lib/site-packages/neo4j/work/result.py | KwanYu/Airbnb-Backend | 61b4c89f891378181447fc251fa0d1c2c5f435de | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2020 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... | 34.926154 | 133 | 0.609109 |
efa091874534951823848189c8e26401c3dbf4cd | 8,072 | py | Python | homeassistant/components/isy994/climate.py | jonasjeeliasson/core | 0301706fc631ad1f2cd2532667ba9dfe2f856198 | [
"Apache-2.0"
] | 1 | 2021-04-29T06:51:10.000Z | 2021-04-29T06:51:10.000Z | homeassistant/components/isy994/climate.py | jonasjeeliasson/core | 0301706fc631ad1f2cd2532667ba9dfe2f856198 | [
"Apache-2.0"
] | 46 | 2021-01-06T07:05:22.000Z | 2022-03-31T06:05:25.000Z | homeassistant/components/isy994/climate.py | krzkowalczyk/home-assistant | 513685bbeacca2c758d3ca33b337da3b7e72dd1d | [
"Apache-2.0"
] | 2 | 2020-06-03T20:24:39.000Z | 2020-06-06T19:52:09.000Z | """Support for Insteon Thermostats via ISY994 Platform."""
from __future__ import annotations
from typing import Callable
from pyisy.constants import (
CMD_CLIMATE_FAN_SETTING,
CMD_CLIMATE_MODE,
PROP_HEAT_COOL_STATE,
PROP_HUMIDITY,
PROP_SETPOINT_COOL,
PROP_SETPOINT_HEAT,
PROP_UOM,
PROT... | 33.355372 | 84 | 0.66774 |
0efdbc4375b945d219f46b71493c01f6446f4945 | 7,381 | py | Python | geofound/damping.py | eng-tools/geofound | b59e720cc0ca62c2999adca27cd66c45ae000828 | [
"MIT"
] | 12 | 2017-12-16T10:15:57.000Z | 2022-01-23T03:55:59.000Z | geofound/damping.py | eng-tools/geofound | b59e720cc0ca62c2999adca27cd66c45ae000828 | [
"MIT"
] | 2 | 2018-01-29T16:28:38.000Z | 2021-04-20T22:50:46.000Z | geofound/damping.py | eng-tools/geofound | b59e720cc0ca62c2999adca27cd66c45ae000828 | [
"MIT"
] | 9 | 2018-02-09T17:20:55.000Z | 2021-11-09T02:15:16.000Z | from geofound import tables_of_dyn_coefficients as tdc
import numpy as np
_pi = 3.14159265359
def calc_vert_via_gazetas_1991(sl, fd, a0, f_contact=1.0, saturated=False):
v_s = sl.get_shear_vel(saturated=saturated)
v_la = 3.4 / (_pi * (1 - sl.poissons_ratio)) * v_s
if saturated:
rho = sl.unit_sat_... | 33.55 | 98 | 0.599919 |
91c08ad014e28071d4dd5db1b27d3d3d3241c366 | 4,638 | py | Python | scripts/study_case/ID_15/train.py | kzbnb/numerical_bugs | bc22e72bcc06df6ce7889a25e0aeed027bde910b | [
"Apache-2.0"
] | 8 | 2021-06-30T06:55:14.000Z | 2022-03-18T01:57:14.000Z | scripts/study_case/ID_15/train.py | kzbnb/numerical_bugs | bc22e72bcc06df6ce7889a25e0aeed027bde910b | [
"Apache-2.0"
] | 1 | 2021-06-30T03:08:15.000Z | 2021-06-30T03:08:15.000Z | scripts/study_case/ID_15/train.py | kzbnb/numerical_bugs | bc22e72bcc06df6ce7889a25e0aeed027bde910b | [
"Apache-2.0"
] | 2 | 2021-11-17T11:19:48.000Z | 2021-11-18T03:05:58.000Z | import time
import numpy as np
import sys
sys.path.append("/data")
import tensorflow as tf
from scripts.study_case.ID_15.data import *
from scripts.study_case.ID_15.model import *
from scripts.study_case.ID_15.utils import *
np.random.seed(0)
# Data
tf.app.flags.DEFINE_string('input', '/data/scripts/study_case/ID_15/... | 44.171429 | 182 | 0.668823 |
7d1317473531e4738d543cf0a45c0f079ef206c7 | 5,534 | py | Python | python/paddle/fluid/tests/unittests/test_cuda_graph.py | 2742195759/Paddle | ce034db1834af85539b22ab68492df9972ff3e69 | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/fluid/tests/unittests/test_cuda_graph.py | 2742195759/Paddle | ce034db1834af85539b22ab68492df9972ff3e69 | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/fluid/tests/unittests/test_cuda_graph.py | 2742195759/Paddle | ce034db1834af85539b22ab68492df9972ff3e69 | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # Copyright (c) 2021 PaddlePaddle 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/LICENSE-2.0
#
# Unless required by ap... | 37.391892 | 80 | 0.599205 |
4b6d7e77251522ebf72c347c8c77897c5a45606d | 1,644 | py | Python | test/test_sparql/sparql/ConstructTests/Test10_22.py | renefritze/rdfextras | 44ccf3ba1ccfc0e0c434146b98a5e236021da56d | [
"BSD-3-Clause"
] | null | null | null | test/test_sparql/sparql/ConstructTests/Test10_22.py | renefritze/rdfextras | 44ccf3ba1ccfc0e0c434146b98a5e236021da56d | [
"BSD-3-Clause"
] | null | null | null | test/test_sparql/sparql/ConstructTests/Test10_22.py | renefritze/rdfextras | 44ccf3ba1ccfc0e0c434146b98a5e236021da56d | [
"BSD-3-Clause"
] | null | null | null | #!/d/Bin/Python/python.exe
# -*- coding: utf-8 -*-
#
#
# $Date: 2005/04/02 07:30:02 $, by $Author: ivan $, $Revision: 1.1 $
#
from testSPARQL import ns_rdf
from testSPARQL import ns_rdfs
from testSPARQL import ns_dc0
from testSPARQL import ns_foaf
from testSPARQL import ns_ns
from testSPARQL import ns_book
from testSP... | 31.615385 | 135 | 0.676399 |
2edec0ee5f05beef50eee7d784690e0d55e4ed19 | 1,796 | py | Python | vitrage/storage/__init__.py | soda-research/vitrage | 8f912a97e8e8350429b37b11f8fbd2341e5997d8 | [
"Apache-2.0"
] | null | null | null | vitrage/storage/__init__.py | soda-research/vitrage | 8f912a97e8e8350429b37b11f8fbd2341e5997d8 | [
"Apache-2.0"
] | null | null | null | vitrage/storage/__init__.py | soda-research/vitrage | 8f912a97e8e8350429b37b11f8fbd2341e5997d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 - Nokia
#
# 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... | 29.933333 | 77 | 0.711024 |
9ac6ea180ffbcd237b1fc9c9efd48c570042199c | 1,093 | py | Python | tests/test_force_series.py | lahwaacz/tvnamer | 3d67701e39f4368cad96004c25d96e1b10638806 | [
"Unlicense"
] | null | null | null | tests/test_force_series.py | lahwaacz/tvnamer | 3d67701e39f4368cad96004c25d96e1b10638806 | [
"Unlicense"
] | null | null | null | tests/test_force_series.py | lahwaacz/tvnamer | 3d67701e39f4368cad96004c25d96e1b10638806 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
"""Test ability to set the series name by series id
"""
from functional_runner import run_tvnamer, verify_out_data
from nose.plugins.attrib import attr
@attr("functional")
def test_series_id():
"""Test --series-id argument
"""
conf = """
{"batch": true}
"""
out_data =... | 22.306122 | 66 | 0.614822 |
2e17649054fe847d4d5efb2c1481ecf619c4e912 | 8,140 | py | Python | examples/demonstration/tensorflow_asr/models/keras/contextnet.py | o74589055/tf_asr | 1801a035d15253fd25df4f9541457dd635f6d10d | [
"Apache-2.0"
] | 1 | 2021-03-20T09:21:49.000Z | 2021-03-20T09:21:49.000Z | examples/demonstration/tensorflow_asr/models/keras/contextnet.py | o74589055/tf_asr | 1801a035d15253fd25df4f9541457dd635f6d10d | [
"Apache-2.0"
] | null | null | null | examples/demonstration/tensorflow_asr/models/keras/contextnet.py | o74589055/tf_asr | 1801a035d15253fd25df4f9541457dd635f6d10d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huy Le Nguyen (@usimarit)
#
# 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 t... | 47.602339 | 124 | 0.634521 |
5f923f69d777a8b80a1338d94b774f7a839aa5a3 | 12,421 | py | Python | azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-07-23T08:59:24.000Z | 2018-07-23T08:59:24.000Z | azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | null | null | null | azure-mgmt-sql/azure/mgmt/sql/operations/database_vulnerability_assessments_operations.py | jmalobicky/azure-sdk-for-python | 61234a3d83f8fb481d1dd2386e54e888864878fd | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 49.486056 | 234 | 0.686257 |
2883312d494a895571df61aae1ec93c7ecbfbcfe | 583 | py | Python | data/test/python/2883312d494a895571df61aae1ec93c7ecbfbcfeAddOnceEventDispatch.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/2883312d494a895571df61aae1ec93c7ecbfbcfeAddOnceEventDispatch.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/2883312d494a895571df61aae1ec93c7ecbfbcfeAddOnceEventDispatch.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | # -*- coding: utf-8 -*-
from Libs.EventHandle.EventDispatch import EventDispatch;
'''
@brief 事件回调函数只能添加一次
'''
class AddOnceEventDispatch(EventDispatch):
def __init__(self, eventId_ = 0):
super(AddOnceEventDispatch, self).__init__(eventId_);
self.mTypeId = "AddOnceEventDispatch";
... | 26.5 | 85 | 0.701544 |
8fc6353a08f313eba2d0efd1f82d0ef829097c9a | 4,555 | py | Python | cohesity_management_sdk/models/snapshot_copy_archival_policy.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/snapshot_copy_archival_policy.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/snapshot_copy_archival_policy.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.archival_target
class SnapshotCopyArchivalPolicy(object):
"""Implementation of the 'Snapshot Copy Archival Policy.' model.
Specifies settings for copying Snapshots External Targets (such as AWS or
Tape). This al... | 42.971698 | 158 | 0.653128 |
74b559a84c5740e4b06851ede90510e390c688cd | 883 | py | Python | app/__init__.py | bgigous/flask-labs-project3 | 7764c52207e80121486c35aef406d780404accce | [
"MIT"
] | null | null | null | app/__init__.py | bgigous/flask-labs-project3 | 7764c52207e80121486c35aef406d780404accce | [
"MIT"
] | null | null | null | app/__init__.py | bgigous/flask-labs-project3 | 7764c52207e80121486c35aef406d780404accce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Flask
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
from config import config
db = SQLAlchemy()
migrate = Migrate()
login_manager = LoginManager()
login_manager.session_protection = "strong"
login_manager.log... | 21.536585 | 62 | 0.757644 |
6a6fa6222cfc2128be6d5120f07de8a257fe276b | 939 | py | Python | cancat/vstruct/constants/__init__.py | TomSomerville/CanCatFork | 3a3f684c794fd93daa722992b727fd9522b89ae6 | [
"BSD-2-Clause"
] | 146 | 2015-04-28T16:13:39.000Z | 2022-03-20T23:39:42.000Z | cancat/vstruct/constants/__init__.py | TomSomerville/CanCatFork | 3a3f684c794fd93daa722992b727fd9522b89ae6 | [
"BSD-2-Clause"
] | 18 | 2016-10-21T14:40:10.000Z | 2022-01-08T01:44:19.000Z | cancat/vstruct/constants/__init__.py | TomSomerville/CanCatFork | 3a3f684c794fd93daa722992b727fd9522b89ae6 | [
"BSD-2-Clause"
] | 37 | 2015-06-22T11:45:00.000Z | 2022-02-09T05:30:24.000Z |
class VSConstResolver:
def __init__(self):
self.rev_lookup = {}
self.const_lookup = {}
def clearAll(self):
self.rev_lookup = {}
self.const_lookup = {}
def addModule(self, mod):
for name in dir(mod):
val = getattr(mod, name)
if type(val) not ... | 25.378378 | 56 | 0.529286 |
348c8c1e4d3e990fd92abab7292a0e154457d83b | 410 | py | Python | template/mod_corh-suite2.py | Bafomet666/Bigbro | ae41c1f48b38e28e3e688cfe02ad5152147521f4 | [
"BSD-2-Clause"
] | 48 | 2020-10-10T17:09:23.000Z | 2022-03-22T10:42:16.000Z | template/mod_corh-suite2.py | Bafomet666/Bigbro | ae41c1f48b38e28e3e688cfe02ad5152147521f4 | [
"BSD-2-Clause"
] | 3 | 2021-01-15T06:07:41.000Z | 2022-02-11T09:50:53.000Z | template/mod_corh-suite2.py | Bafomet666/Bigbro | ae41c1f48b38e28e3e688cfe02ad5152147521f4 | [
"BSD-2-Clause"
] | 12 | 2020-10-16T22:48:16.000Z | 2021-11-16T01:06:10.000Z | #!/usr/bin/env python3
R = '\033[31m' # red
G = '\033[32m' # green
C = '\033[36m' # cyan
W = '\033[0m' # white
redirect = input(G + '[+]' + C + ' Запустить ? yes / no : ' + W)
with open('template/corh-suite2/js/location_temp.js', 'r') as js:
reader = js.read()
update = reader.replace('REDIRECT_URL', redirect)
wit... | 27.333333 | 67 | 0.631707 |
4108379a794f2449cb1f2a20d1aa34d0cad7cf13 | 5,157 | py | Python | templates/cbs-tools/scripts/fas_perms_to_koji.py | CentOS/ansible-role-kojihub | 6421d5ac81f0f86223e57eaecd93231ff798ebbd | [
"MIT"
] | null | null | null | templates/cbs-tools/scripts/fas_perms_to_koji.py | CentOS/ansible-role-kojihub | 6421d5ac81f0f86223e57eaecd93231ff798ebbd | [
"MIT"
] | 7 | 2020-03-20T14:29:14.000Z | 2021-06-01T16:24:38.000Z | templates/cbs-tools/scripts/fas_perms_to_koji.py | CentOS/ansible-role-kojihub | 6421d5ac81f0f86223e57eaecd93231ff798ebbd | [
"MIT"
] | 5 | 2020-03-20T14:16:31.000Z | 2021-06-01T16:07:45.000Z | #!/usr/bin/env python3
# Copyright (c) 2015, Thomas Oulevey <thomas.oulevey@cern.ch>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above co... | 37.100719 | 93 | 0.675199 |
761477cd2c8d4711f0f61a2caee826f927df49d1 | 1,420 | py | Python | py/sqlclient.py | phil155/IDS_IoT | e79172a33db36ca08c7807fe2b439b78543c8126 | [
"MIT"
] | null | null | null | py/sqlclient.py | phil155/IDS_IoT | e79172a33db36ca08c7807fe2b439b78543c8126 | [
"MIT"
] | null | null | null | py/sqlclient.py | phil155/IDS_IoT | e79172a33db36ca08c7807fe2b439b78543c8126 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import time
import json
from constants import *
from crate.client import connect
def count_rows(cursor, devaddr):
cursor.execute(f"SELECT count(*) FROM {TABLE_SENSORS} WHERE devaddr = {devaddr}")
return cursor.fetchall()
def main(a):
connection = connect(NODEURL)
cursor =... | 25.818182 | 114 | 0.547183 |
2e00b768f8b79bbaf7662ab151b803a3c1bafea6 | 3,006 | py | Python | Train/train.py | Mythologyli/Take-out-Customer-Service-Robot | fbbabfcc4d32826148cd9681eed6ae1fa635607a | [
"MIT"
] | null | null | null | Train/train.py | Mythologyli/Take-out-Customer-Service-Robot | fbbabfcc4d32826148cd9681eed6ae1fa635607a | [
"MIT"
] | null | null | null | Train/train.py | Mythologyli/Take-out-Customer-Service-Robot | fbbabfcc4d32826148cd9681eed6ae1fa635607a | [
"MIT"
] | null | null | null | import jieba
import numpy as np
import pandas as pd
import jieba.analyse
import tensorflow.keras as keras
from keras.callbacks import History
from keras.models import Sequential
from keras.layers import Embedding
from keras.layers import Conv1D
from keras.layers import MaxPooling1D
from keras.layers import LSTM
from ke... | 29.470588 | 78 | 0.634398 |
7ab02c6e4913053b9c0ee42d1b80491840cd7712 | 611 | py | Python | nnfs/optimizers.py | tblut/NNFS | 75320c546043bc74f368a7a6edcd8bb70aa90dc4 | [
"MIT"
] | null | null | null | nnfs/optimizers.py | tblut/NNFS | 75320c546043bc74f368a7a6edcd8bb70aa90dc4 | [
"MIT"
] | null | null | null | nnfs/optimizers.py | tblut/NNFS | 75320c546043bc74f368a7a6edcd8bb70aa90dc4 | [
"MIT"
] | null | null | null | import numpy as np
class SGD:
def __init__(self, lr=0.01, momentum=0.0):
self.lr = lr
self.momentum = momentum
self.v = None
def apply_gradients(self, parameters):
if self.momentum > 0.0:
if not self.v:
self.v = [np.zeros(p.shape) for p in parameter... | 30.55 | 84 | 0.543372 |
840f0a94ca3277b8e4ad00335c99911be217b828 | 8,060 | py | Python | InvenTree/part/test_views.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | null | null | null | InvenTree/part/test_views.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | 8 | 2020-06-06T01:14:46.000Z | 2022-03-12T00:14:35.000Z | InvenTree/part/test_views.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | null | null | null | """ Unit tests for Part Views (see views.py) """
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
from .models import Part
class PartViewTestCase(TestCase):
fixtures = [
'category',
'part',
'bom',
'location',
... | 34.152542 | 133 | 0.655459 |
7976b4f7c5209ee6c8a8839f3e86a77958333d08 | 29,107 | py | Python | sphinx/builders/_epub_base.py | shimizukawa/sphinx | 359fc3c7998e057bdb7884f20f5745efd53da49a | [
"BSD-2-Clause"
] | null | null | null | sphinx/builders/_epub_base.py | shimizukawa/sphinx | 359fc3c7998e057bdb7884f20f5745efd53da49a | [
"BSD-2-Clause"
] | null | null | null | sphinx/builders/_epub_base.py | shimizukawa/sphinx | 359fc3c7998e057bdb7884f20f5745efd53da49a | [
"BSD-2-Clause"
] | null | null | null | """
sphinx.builders._epub_base
~~~~~~~~~~~~~~~~~~~~~~~~~~
Base class of epub2/epub3 builders.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import html
import os
import re
from os import path
from typing import Any, Dict, List, NamedT... | 41.228045 | 106 | 0.567114 |
884f536139f04a72743d0e389f5e4a32de8b8aa9 | 7,293 | py | Python | sumo/tools/build/checkAuthors.py | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | null | null | null | sumo/tools/build/checkAuthors.py | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | null | null | null | sumo/tools/build/checkAuthors.py | iltempe/osmosi | c0f54ecdbb7c7b5602d587768617d0dc50f1d75d | [
"MIT"
] | 2 | 2017-12-14T16:41:59.000Z | 2020-10-16T17:51:27.000Z | #!/usr/bin/env python
"""
@file checkAuthors.py
@author Michael Behrisch
@author Daniel Krajzewicz
@date 2011-11-07
@version $Id$
Checks authors for all files.
SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
Copyright (C) 2011-2017 DLR (http://www.dlr.de/) and contributors
This file is part of SU... | 35.75 | 98 | 0.529686 |
6b44095ceb94a4c308c4dcb98f9d027afeec8bd7 | 4,166 | py | Python | bead_cli/web/graphviz.py | krisztianfekete/lib | 180527203b8dadd0e1acd9c6f73be1887b61bc44 | [
"Unlicense"
] | 1 | 2017-01-26T07:42:13.000Z | 2017-01-26T07:42:13.000Z | bead_cli/web/graphviz.py | e3krisztian/bead | 180527203b8dadd0e1acd9c6f73be1887b61bc44 | [
"Unlicense"
] | 21 | 2017-02-16T13:49:06.000Z | 2021-11-20T21:38:45.000Z | bead_cli/web/graphviz.py | ceumicrodata/bead | 180527203b8dadd0e1acd9c6f73be1887b61bc44 | [
"Unlicense"
] | 1 | 2016-10-25T22:09:53.000Z | 2016-10-25T22:09:53.000Z | import html
from .freshness import Freshness
DOT_GRAPH_TEMPLATE = """\
digraph {{
layout=dot
rankdir="LR"
pad="1"
// pack/packmode removes edge labels, see https://gitlab.com/graphviz/graphviz/issues/1616
// re-enable for possibly prettier output if the above issue is solved
// pack="true"
// packmode="... | 28.731034 | 98 | 0.587854 |
1e480325cd1a27a64aa6fdfdba753b9541297eeb | 2,503 | py | Python | bird2board/bird2board.py | ihuston/bird2board | 2bffadf5e5fe95c5d67d38f084efc714fd92c8fe | [
"MIT"
] | 2 | 2022-03-25T18:24:04.000Z | 2022-03-25T18:36:24.000Z | bird2board/bird2board.py | ihuston/bird2board | 2bffadf5e5fe95c5d67d38f084efc714fd92c8fe | [
"MIT"
] | 21 | 2021-05-31T19:30:50.000Z | 2021-06-29T20:30:16.000Z | bird2board/bird2board.py | ihuston/bird2board | 2bffadf5e5fe95c5d67d38f084efc714fd92c8fe | [
"MIT"
] | null | null | null | import logging
import pathlib
import requests
from bird2board import Pinboard, Twitter
class Bird2Board:
def __init__(self, pinboard_token, replace=False, shared=False, toread=False):
self.pinboard = Pinboard(auth_token=pinboard_token, replace=replace, shared=shared, toread=toread)
self.twitter... | 39.109375 | 106 | 0.590491 |
159b1e6060bebde6da8d7f0d61a6ee3d1c27e093 | 11,913 | py | Python | object_detection.py | mochaccino-latte/ur5-ros-control | ad4e107d726a8f8d7822aadc3e7a04b0b79bf17f | [
"Apache-2.0"
] | null | null | null | object_detection.py | mochaccino-latte/ur5-ros-control | ad4e107d726a8f8d7822aadc3e7a04b0b79bf17f | [
"Apache-2.0"
] | null | null | null | object_detection.py | mochaccino-latte/ur5-ros-control | ad4e107d726a8f8d7822aadc3e7a04b0b79bf17f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
import sys
# sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import cv2
import time
import math
import numpy as np
import matplotlib.pyplot as plt
import pyrealsense2 as rs
from openpyxl import Workbook
# from universal_robot_kinematics import invKine
# from forward_kinematics imp... | 53.421525 | 170 | 0.558717 |
de7b4e9eeb3928be867fe66ca0ed9a3851930d95 | 2,359 | py | Python | tests/test_cfg_paths.py | FRIARGREG/PROJ-WORKSHOPS | 0568c1307b15aca7e428ef455ed2b7c798aad906 | [
"MIT"
] | null | null | null | tests/test_cfg_paths.py | FRIARGREG/PROJ-WORKSHOPS | 0568c1307b15aca7e428ef455ed2b7c798aad906 | [
"MIT"
] | null | null | null | tests/test_cfg_paths.py | FRIARGREG/PROJ-WORKSHOPS | 0568c1307b15aca7e428ef455ed2b7c798aad906 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test the cfg_load.paths module."""
# core modules
import unittest
from copy import deepcopy
try:
from unittest.mock import patch
except ImportError: # Python 2.7
from mock import patch
# internal modules
import cfg_load.paths
class PathsTest(unittest.TestCa... | 36.292308 | 75 | 0.616363 |
81f3e6c61b8b103c0baef752cd04ca810e4a8e0b | 4,904 | py | Python | ietf/liaisons/migrations/0002_schema_changes.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-11-20T03:40:40.000Z | 2021-11-20T03:40:42.000Z | ietf/liaisons/migrations/0002_schema_changes.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/liaisons/migrations/0002_schema_changes.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('group', '0003_auto_20150304_0743'),
('person', '0001_initial'),
('doc', '0002_auto_20141222_1749'),
('name', '0007_po... | 39.548387 | 114 | 0.579119 |
20c1cc4296501e7b9b9f5f5ed694230c41a91e38 | 9,909 | py | Python | src/main/resources/org/broadinstitute/hellbender/tools/copynumber/case_denoising_calling.py | sunboy0523/gatk | f06971ac0824ad7da38b878334df377c30457a23 | [
"BSD-3-Clause"
] | 1,273 | 2015-10-13T18:11:50.000Z | 2022-03-28T09:25:13.000Z | src/main/resources/org/broadinstitute/hellbender/tools/copynumber/case_denoising_calling.py | sunboy0523/gatk | f06971ac0824ad7da38b878334df377c30457a23 | [
"BSD-3-Clause"
] | 6,471 | 2015-10-08T02:31:06.000Z | 2022-03-31T17:55:25.000Z | src/main/resources/org/broadinstitute/hellbender/tools/copynumber/case_denoising_calling.py | sunboy0523/gatk | f06971ac0824ad7da38b878334df377c30457a23 | [
"BSD-3-Clause"
] | 598 | 2015-10-14T19:16:14.000Z | 2022-03-29T10:03:03.000Z | import os
import sys
# set theano flags
user_theano_flags = os.environ.get("THEANO_FLAGS")
default_theano_flags = "device=cpu,floatX=float64,optimizer=fast_run,compute_test_value=ignore," + \
"openmp=true,blas.ldflags=-lmkl_rt,openmp_elemwise_minsize=10"
theano_flags = default_theano_flags + (""... | 41.634454 | 118 | 0.701383 |
384aaf1a9fd0e95755f410308f3967c8724d43c1 | 13,760 | py | Python | remoting/webapp/build-webapp.py | MIPS/external-chromium_org | e31b3128a419654fd14003d6117caa8da32697e7 | [
"BSD-3-Clause"
] | 2 | 2018-11-24T07:58:44.000Z | 2019-02-22T21:02:46.000Z | remoting/webapp/build-webapp.py | carlosavignano/android_external_chromium_org | 2b5652f7889ccad0fbdb1d52b04bad4c23769547 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | remoting/webapp/build-webapp.py | carlosavignano/android_external_chromium_org | 2b5652f7889ccad0fbdb1d52b04bad4c23769547 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2017-07-31T19:09:52.000Z | 2019-01-04T18:48:50.000Z | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Creates a directory with with the unpacked contents of the remoting webapp.
The directory will contain a copy-of or a link-to t... | 41.445783 | 80 | 0.689317 |
2a52a2db5a7368533be352d027b234798307aaee | 14,433 | py | Python | src/sage/plot/polygon.py | robertwb/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/plot/polygon.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/plot/polygon.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | """
Polygons
"""
#*****************************************************************************
# Copyright (C) 2006 Alex Clemesha <clemesha@gmail.com>,
# William Stein <wstein@gmail.com>,
# 2008 Mike Hansen <mhansen@gmail.com>,
#
# Distributed under the terms of the ... | 33.487239 | 117 | 0.56059 |
56edd11a768ec784e8c4fd36a6b1d2fdf298487d | 33,546 | py | Python | lizard/lizard_c.py | pec27/lizard | 5bfd0dae3b02c0c12eb72b71b6ef2b47ae0c83dd | [
"MIT"
] | 1 | 2019-07-09T13:21:47.000Z | 2019-07-09T13:21:47.000Z | lizard/lizard_c.py | pec27/lizard | 5bfd0dae3b02c0c12eb72b71b6ef2b47ae0c83dd | [
"MIT"
] | null | null | null | lizard/lizard_c.py | pec27/lizard | 5bfd0dae3b02c0c12eb72b71b6ef2b47ae0c83dd | [
"MIT"
] | 2 | 2018-11-06T12:52:45.000Z | 2021-02-04T16:10:11.000Z | """
Module for interfacing to the C-library (liblizard.so)
"""
from __future__ import print_function, division, absolute_import
# Note *dont* import unicode_literals since we require the ndpointer flags to
# be the default string types in both python 2 and 3 respectively
from numpy.ctypeslib import ndpointer
from nump... | 36.50272 | 219 | 0.663626 |
f776fc7eaf9422868ac563d329e1fdaed77a1395 | 2,427 | py | Python | api.py | htcr/deeplab-pytorch | 8cea35415112fefb6a886d0d98ab64350ed09601 | [
"MIT"
] | null | null | null | api.py | htcr/deeplab-pytorch | 8cea35415112fefb6a886d0d98ab64350ed09601 | [
"MIT"
] | null | null | null | api.py | htcr/deeplab-pytorch | 8cea35415112fefb6a886d0d98ab64350ed09601 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import os
import os.path as osp
import torch
import yaml
from addict import Dict
import matplotlib.pyplot as plt
from .libs.models import *
from .libs.utils import DenseCRF
from demo import preprocessing, inference
class DeepLabV2Masker(object):
def __init__(self, crf=True):
... | 29.962963 | 114 | 0.589205 |
141075135cad1b2e253211658c0a0b228ac00137 | 1,028 | py | Python | tests/test_extra_links.py | David-Le-Nir/sphinxcontrib-needs | fe809445505fa1e9bf5963eab1d6283dad405e92 | [
"MIT"
] | 90 | 2016-11-30T21:23:10.000Z | 2022-01-11T16:33:56.000Z | tests/test_extra_links.py | David-Le-Nir/sphinxcontrib-needs | fe809445505fa1e9bf5963eab1d6283dad405e92 | [
"MIT"
] | 359 | 2016-12-02T14:53:44.000Z | 2022-03-31T11:59:03.000Z | tests/test_extra_links.py | David-Le-Nir/sphinxcontrib-needs | fe809445505fa1e9bf5963eab1d6283dad405e92 | [
"MIT"
] | 25 | 2018-06-20T18:56:13.000Z | 2022-03-25T06:11:40.000Z | from pathlib import Path
from sphinx_testing import with_app
@with_app(buildername="html", srcdir="doc_test/doc_extra_links")
def test_extra_links_html(app, status, warning):
app.build()
html = Path(app.outdir, "index.html").read_text()
assert "TEST_001" in html
assert "tested by" in html
assert ... | 33.16129 | 89 | 0.720817 |
fd3d8c4675e54e4597418b10fd10de5d8fd3dd0e | 1,463 | py | Python | django/server/views.py | 5u3it/observability-boilerplate1 | b6f41c7395491d6f9b3bd5b301e70431539e98a4 | [
"MIT"
] | null | null | null | django/server/views.py | 5u3it/observability-boilerplate1 | b6f41c7395491d6f9b3bd5b301e70431539e98a4 | [
"MIT"
] | null | null | null | django/server/views.py | 5u3it/observability-boilerplate1 | b6f41c7395491d6f9b3bd5b301e70431539e98a4 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
# import opentracing
import requests
from py_zipkin.zipkin import zipkin_span
# Create your views here.
def http_transport(encoded_span):
# The collector expects a thrift-encoded list of spans. Instead of
... | 32.511111 | 106 | 0.708817 |
f8d949201f96cb37f7dcd21e366522d4667e3fb8 | 6,227 | py | Python | ant_environments/ant_reacher_3_levels/agent.py | erick-alv/Hierarchical-Actor-Critc-HAC- | a01ea24665d1442872c7f829701ed390d2cc560e | [
"MIT"
] | null | null | null | ant_environments/ant_reacher_3_levels/agent.py | erick-alv/Hierarchical-Actor-Critc-HAC- | a01ea24665d1442872c7f829701ed390d2cc560e | [
"MIT"
] | null | null | null | ant_environments/ant_reacher_3_levels/agent.py | erick-alv/Hierarchical-Actor-Critc-HAC- | a01ea24665d1442872c7f829701ed390d2cc560e | [
"MIT"
] | null | null | null | import numpy as np
from layer import Layer
from environment import Environment
import pickle as cpickle
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
import pickle as cpickle
# Below class instantiates an agent
class Agent():
def __init__(self,FLAGS, env, agent_params):
self.FLAGS =... | 37.287425 | 192 | 0.654408 |
1c0600daed121325593c2b840c862bd773fc3f7a | 2,321 | py | Python | pytest-embedded-arduino/pytest_embedded_arduino/app.py | espressif/pytest-embedded | 14077e64d3dfa74c03dcbcd1775fc994ba3e4928 | [
"MIT"
] | 12 | 2021-06-07T11:39:30.000Z | 2022-03-07T18:42:04.000Z | pytest-embedded-arduino/pytest_embedded_arduino/app.py | espressif/pytest-embedded | 14077e64d3dfa74c03dcbcd1775fc994ba3e4928 | [
"MIT"
] | 30 | 2021-08-10T10:27:41.000Z | 2022-03-25T08:08:29.000Z | pytest-embedded-arduino/pytest_embedded_arduino/app.py | espressif/pytest-embedded | 14077e64d3dfa74c03dcbcd1775fc994ba3e4928 | [
"MIT"
] | 6 | 2021-11-16T13:10:45.000Z | 2022-03-31T10:51:29.000Z | import json
import os
from typing import List, Optional, Tuple
from pytest_embedded.app import App
class ArduinoApp(App):
"""
Arduino App class
Attributes:
app_path (str): Application path.
build_dir (str): Build directory.
sketch (str): Sketch name.
fqbn (str): Fully Qua... | 36.265625 | 120 | 0.619561 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.