hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
065fbb502531c7230d8daf8073c2d311a0f8ba2c | 6,068 | py | Python | networkx/readwrite/tests/test_graph6.py | 0ddoes/networkx | b79768389070c5533a5ae21afce15dd06cd2cff0 | [
"BSD-3-Clause"
] | null | null | null | networkx/readwrite/tests/test_graph6.py | 0ddoes/networkx | b79768389070c5533a5ae21afce15dd06cd2cff0 | [
"BSD-3-Clause"
] | null | null | null | networkx/readwrite/tests/test_graph6.py | 0ddoes/networkx | b79768389070c5533a5ae21afce15dd06cd2cff0 | [
"BSD-3-Clause"
] | null | null | null | from io import BytesIO
import tempfile
import pytest
import networkx as nx
import networkx.readwrite.graph6 as g6
from networkx.utils import nodes_equal, edges_equal
class TestGraph6Utils:
def test_n_data_n_conversion(self):
for i in [0, 1, 42, 62, 63, 64, 258047, 258048, 7744773, 68719476735]:
... | 35.905325 | 83 | 0.580916 |
afb6e8a80c1761a925dc3e32e79e45b9167c5afe | 1,010 | py | Python | development/offlinifyDocs/offlinify_docs.py | digitalbuddha/androidx | 03a8f7cfffc74435a23aeae0084ed2f3b84728fd | [
"Apache-2.0"
] | 2 | 2021-01-20T07:27:37.000Z | 2021-05-28T14:32:42.000Z | development/offlinifyDocs/offlinify_docs.py | digitalbuddha/androidx | 03a8f7cfffc74435a23aeae0084ed2f3b84728fd | [
"Apache-2.0"
] | null | null | null | development/offlinifyDocs/offlinify_docs.py | digitalbuddha/androidx | 03a8f7cfffc74435a23aeae0084ed2f3b84728fd | [
"Apache-2.0"
] | 1 | 2021-04-11T13:58:44.000Z | 2021-04-11T13:58:44.000Z | #!/usr/bin/python3
import argparse
from pathlib import Path
import re
import shutil
import sys
REPLACEMENT_REGEX = r'^\{\% setvar book_path.*\%\}\n\{\%.*\%\}$'
STYLE_TEMPLATE = '<link rel="stylesheet" href="%s">'
def relative_style(html_file):
return '../' * str(html_file).count('/') + 'style.css'
def main(arg... | 28.055556 | 70 | 0.70297 |
e83cade91a0706c0f10e86d65163ddbbdf458272 | 7,848 | py | Python | src/obfuscapk/util.py | StriveMario/Obfuscapk | 2b15194eb7cd91c94b04ec7cd2eb4ed2499149f3 | [
"MIT"
] | null | null | null | src/obfuscapk/util.py | StriveMario/Obfuscapk | 2b15194eb7cd91c94b04ec7cd2eb4ed2499149f3 | [
"MIT"
] | null | null | null | src/obfuscapk/util.py | StriveMario/Obfuscapk | 2b15194eb7cd91c94b04ec7cd2eb4ed2499149f3 | [
"MIT"
] | 1 | 2021-12-15T10:50:14.000Z | 2021-12-15T10:50:14.000Z | #!/usr/bin/env python3.7
# coding: utf-8
import itertools
import logging
import os
import random
import re
import string
from fileinput import FileInput
from hashlib import md5, sha256
from typing import List
from tqdm import tqdm
logger = logging.getLogger(__name__)
# A seed to be used for random operations.
rando... | 39.837563 | 111 | 0.58397 |
d3fb7fd3b0de37eb182258e247de7269c2dd2272 | 783 | py | Python | app/v/habit/model/historyHabitMdl.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | app/v/habit/model/historyHabitMdl.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | app/v/habit/model/historyHabitMdl.py | jhbez/focus | c2825abad0bb552d05a921f5888e66b92bfdb14a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 ProjectV 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 requi... | 35.590909 | 74 | 0.729246 |
75fd4e7a9564433d4ff1ca75207d43346ec32c9e | 178 | py | Python | ndarray/shape.py | Hupengyu/Paddle_learning | 0ac1e2ad32e41ac87bbb19e4535a4bc253ca9b0f | [
"Apache-2.0"
] | 1 | 2021-08-02T01:51:35.000Z | 2021-08-02T01:51:35.000Z | ndarray/shape.py | Hupengyu/Paddle_learning | 0ac1e2ad32e41ac87bbb19e4535a4bc253ca9b0f | [
"Apache-2.0"
] | 1 | 2021-11-03T08:58:30.000Z | 2021-11-03T08:58:30.000Z | ndarray/shape.py | Hupengyu/Paddle_learning | 0ac1e2ad32e41ac87bbb19e4535a4bc253ca9b0f | [
"Apache-2.0"
] | null | null | null | import numpy as np
# 手动填写一个
a = [1, 2, 3, 4, 5, 6, 7, 8]
a = np.array(a)
print(a)
b = a.reshape(-1, 2)
print(b)
# 随机生成一个
# b = np.random.randint(0, 10, (2, 3)) # 两行三列,元素从0到10
| 14.833333 | 54 | 0.561798 |
ae31c6302439e2240601bdd0cd5cc25c78aef468 | 4,445 | py | Python | Turn/game/utilites.py | hobbitsyfeet/Turn2.0 | 7173f43b879bfc2e7ddeb6e733bb03d81c3e47ef | [
"MIT"
] | null | null | null | Turn/game/utilites.py | hobbitsyfeet/Turn2.0 | 7173f43b879bfc2e7ddeb6e733bb03d81c3e47ef | [
"MIT"
] | null | null | null | Turn/game/utilites.py | hobbitsyfeet/Turn2.0 | 7173f43b879bfc2e7ddeb6e733bb03d81c3e47ef | [
"MIT"
] | null | null | null | import numpy as np
from os import listdir
from os.path import isfile, join
#Helper Functions
def parse_input(filename, first_line=False):
file = open(filename, 'r')
if first_line is False:
next(file) #skip first line. This is used for user
parsed_lines = []
lines = [line.rstrip() for... | 32.210145 | 121 | 0.564004 |
9d63bb6d8d3307c238f52a342ac40d61b5d6a1b0 | 73,961 | py | Python | main.py | dustyweasel/silicatewastes | 4bb17251969ef2fea5b96b261a7300c771ad5eda | [
"MIT"
] | null | null | null | main.py | dustyweasel/silicatewastes | 4bb17251969ef2fea5b96b261a7300c771ad5eda | [
"MIT"
] | null | null | null | main.py | dustyweasel/silicatewastes | 4bb17251969ef2fea5b96b261a7300c771ad5eda | [
"MIT"
] | null | null | null | #ALTER TABLE sink
#ADD avg_rating float;
#also user avg_rating
#also user sum_ruting? nah, not yet
from flask import Flask, request, redirect, url_for, render_template, session, flash
from flask_sqlalchemy import SQLAlchemy
from flask import send_from_directory
import os
import yagmail
import string
import random
fro... | 42.047186 | 103 | 0.508606 |
f347a5f2f599714686f32dcbbf47ff4322dfcda6 | 1,408 | py | Python | OA/OAtoken/views.py | CircularWorld/AutoOffice | 052b95e094ed8790abb9bf22683006d8f3307ee4 | [
"Apache-2.0"
] | null | null | null | OA/OAtoken/views.py | CircularWorld/AutoOffice | 052b95e094ed8790abb9bf22683006d8f3307ee4 | [
"Apache-2.0"
] | null | null | null | OA/OAtoken/views.py | CircularWorld/AutoOffice | 052b95e094ed8790abb9bf22683006d8f3307ee4 | [
"Apache-2.0"
] | null | null | null | from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.views import View
import json
from user.models import UserProfile
import hashlib
import time
import jwt
from django.conf import settings
# error code :10200~10299
# Create your views here.
class TokenView(View):
def ... | 33.52381 | 94 | 0.645597 |
0f27a2464d567e561f5df1cad47918d1069a1ba4 | 201,041 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/operations/_app_service_environments_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/operations/_app_service_environments_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2021_01_15/operations/_app_service_environments_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.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 may ... | 51.482971 | 273 | 0.657831 |
2232d0659cf05b58b294c6eba38463947b24e228 | 9,703 | py | Python | ML_MMI_TL/GM_ML_Kaggle_TL_500_epochs_MMI_64_Frozen_Layer_NewKaggle.py | gmurashova/MLWA | f42660cd4423bb1222b7f69daf96201d52e5309b | [
"MIT"
] | null | null | null | ML_MMI_TL/GM_ML_Kaggle_TL_500_epochs_MMI_64_Frozen_Layer_NewKaggle.py | gmurashova/MLWA | f42660cd4423bb1222b7f69daf96201d52e5309b | [
"MIT"
] | 2 | 2021-08-13T12:40:35.000Z | 2021-08-14T00:04:20.000Z | ML_MMI_TL/GM_ML_Kaggle_TL_500_epochs_MMI_64_Frozen_Layer_NewKaggle.py | colbrydi/MLWA | c4e7a250c9155ad0f3c06a170233f366b3efe9dc | [
"MIT"
] | 1 | 2021-08-16T14:46:56.000Z | 2021-08-16T14:46:56.000Z | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
# TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
# matplotlib.use('agg')
import numpy as np
import pandas as pd
import os#
from t... | 38.351779 | 297 | 0.648665 |
44e3eb8dc9d77db5e289cf9131ed1acc68ad3eb4 | 3,145 | py | Python | cobweb/scrapyLearn/mycrawlspider/mycrawlspider/settings.py | ljm516/python-repo | a1071cbf4e4a021cc1ccd902edd4a60246ea4fcc | [
"Apache-2.0"
] | null | null | null | cobweb/scrapyLearn/mycrawlspider/mycrawlspider/settings.py | ljm516/python-repo | a1071cbf4e4a021cc1ccd902edd4a60246ea4fcc | [
"Apache-2.0"
] | 6 | 2020-03-24T16:48:36.000Z | 2022-02-11T03:42:50.000Z | cobweb/scrapyLearn/mycrawlspider/mycrawlspider/settings.py | ljm516/python-repo | a1071cbf4e4a021cc1ccd902edd4a60246ea4fcc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Scrapy settings for mycrawlspider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://doc.scrapy.org/en/latest/topics/settings.html
# https://doc.scrapy.org/en/latest... | 34.56044 | 102 | 0.779014 |
dcce9a882b00db6093bc1646eab2e3c0c3baaa18 | 16,506 | py | Python | generator/templates/idf.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 19 | 2015-12-08T23:33:51.000Z | 2022-01-31T04:41:10.000Z | generator/templates/idf.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 2 | 2019-10-04T10:57:00.000Z | 2021-10-01T06:46:17.000Z | generator/templates/idf.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 7 | 2015-11-04T02:25:01.000Z | 2021-12-08T03:14:28.000Z | #!/usr/bin/python
"""
WARNING: This is an automatically generated file.
It is based on a modified Energy+.idd specification file.
Do not expect (yet) that it actually works!
Generation date: {{ generation_date}}
"""
import six
import re
import logging
import pyidf
import datetime
from collections import OrderedDict
... | 42.651163 | 126 | 0.352478 |
0751180cdd865b62aab42d0307fb3da1ddc5c6ae | 2,814 | py | Python | tests/test-server-disable-authentication.py | discentem/ghostunnel | 6e58c75c8762fe371c1134e89dd55033a6d577a4 | [
"Apache-2.0"
] | 1,118 | 2015-10-15T16:33:51.000Z | 2020-07-25T11:38:00.000Z | tests/test-server-disable-authentication.py | discentem/ghostunnel | 6e58c75c8762fe371c1134e89dd55033a6d577a4 | [
"Apache-2.0"
] | 239 | 2015-10-13T01:15:16.000Z | 2020-07-17T06:09:50.000Z | tests/test-server-disable-authentication.py | discentem/ghostunnel | 6e58c75c8762fe371c1134e89dd55033a6d577a4 | [
"Apache-2.0"
] | 175 | 2015-11-12T04:09:52.000Z | 2020-07-08T16:04:33.000Z | #!/usr/bin/env python3
"""
Ensures client1 can connect but that clients with ou=client2 or ca=other_root can't connect.
"""
from common import LOCALHOST, RootCert, STATUS_PORT, SocketPair, TcpServer, TlsClient, print_ok, run_ghostunnel, terminate
import ssl
if __name__ == "__main__":
ghostunnel = None
try:
... | 39.633803 | 122 | 0.569296 |
ab3f73fe3dafdc90d153d97ad76206abbc1f9bd3 | 3,107 | py | Python | hooks/post_gen_project.py | SterlingPeet/cookiecutter-fprime-component | 56f6198c0b58471412ce9ded540b8f47b14c74c7 | [
"MIT"
] | 1 | 2021-12-16T22:14:27.000Z | 2021-12-16T22:14:27.000Z | hooks/post_gen_project.py | SterlingPeet/cookiecutter-fprime-component | 56f6198c0b58471412ce9ded540b8f47b14c74c7 | [
"MIT"
] | 7 | 2020-08-19T01:40:08.000Z | 2020-09-18T19:41:00.000Z | hooks/post_gen_project.py | SterlingPeet/cookiecutter-fprime-component | 56f6198c0b58471412ce9ded540b8f47b14c74c7 | [
"MIT"
] | null | null | null | from __future__ import print_function
import datetime
import os
# import shutil
# import subprocess
# import sys
from os.path import join
try:
from click.termui import secho
except ImportError:
warn = print
else:
def warn(text):
for line in text.splitlines():
secho(line, fg="white", bg... | 34.910112 | 142 | 0.599292 |
4c3a4bfa32840950c7cfff164ab4986a89f73d41 | 35 | py | Python | wakatime/packages/certifi/__main__.py | mikrfe/wakatime | af1ea5825bd597d51fe86bf4e68766da7efb077e | [
"BSD-3-Clause"
] | null | null | null | wakatime/packages/certifi/__main__.py | mikrfe/wakatime | af1ea5825bd597d51fe86bf4e68766da7efb077e | [
"BSD-3-Clause"
] | null | null | null | wakatime/packages/certifi/__main__.py | mikrfe/wakatime | af1ea5825bd597d51fe86bf4e68766da7efb077e | [
"BSD-3-Clause"
] | null | null | null | from . import where
print(where())
| 11.666667 | 19 | 0.714286 |
6324a637ece1cfc038a19edf53df36292045bc64 | 7,322 | py | Python | lms/models/solutions.py | ron-huberfeld/lms | a0737d2c68c2cd52e55e73c9d6d31c3aa6d11012 | [
"BSD-3-Clause"
] | 85 | 2020-03-21T18:52:57.000Z | 2022-03-22T06:33:38.000Z | lms/models/solutions.py | ron-huberfeld/lms | a0737d2c68c2cd52e55e73c9d6d31c3aa6d11012 | [
"BSD-3-Clause"
] | 210 | 2020-03-21T22:44:57.000Z | 2022-01-06T22:47:50.000Z | lms/models/solutions.py | ron-huberfeld/lms | a0737d2c68c2cd52e55e73c9d6d31c3aa6d11012 | [
"BSD-3-Clause"
] | 27 | 2020-03-31T13:57:33.000Z | 2022-03-06T15:57:32.000Z | from io import BytesIO
import os
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
from zipfile import ZipFile
from flask_babel import gettext as _ # type: ignore
from flask_login import current_user # type: ignore
from playhouse.shortcuts import model_to_dict # type: ignore
from lms.e... | 34.055814 | 78 | 0.660475 |
c53a1923b403829c188697bda39c0f54465e252c | 26,048 | py | Python | lndmanage/lib/node.py | 3nprob/lndmanage | 57d52ca32d7be3ff816851307d73389281b2a5db | [
"MIT"
] | null | null | null | lndmanage/lib/node.py | 3nprob/lndmanage | 57d52ca32d7be3ff816851307d73389281b2a5db | [
"MIT"
] | null | null | null | lndmanage/lib/node.py | 3nprob/lndmanage | 57d52ca32d7be3ff816851307d73389281b2a5db | [
"MIT"
] | null | null | null | import os
import codecs
import time
import datetime
import statistics
from collections import OrderedDict
import grpc
from grpc._channel import _Rendezvous
from google.protobuf.json_format import MessageToDict
import lndmanage.grpc_compiled.rpc_pb2 as lnd
import lndmanage.grpc_compiled.rpc_pb2_grpc as lndrpc
import... | 37.805515 | 98 | 0.605267 |
f004936bdb5321febf571cdcf21528bc4831c060 | 6,995 | py | Python | src/nanolex.py | dendenxu/compiler | 064406fa4d31a580b638228b69de7a8c9a0d280a | [
"MIT"
] | null | null | null | src/nanolex.py | dendenxu/compiler | 064406fa4d31a580b638228b69de7a8c9a0d280a | [
"MIT"
] | null | null | null | src/nanolex.py | dendenxu/compiler | 064406fa4d31a580b638228b69de7a8c9a0d280a | [
"MIT"
] | 1 | 2021-06-17T10:31:03.000Z | 2021-06-17T10:31:03.000Z | import sys
from ply import lex
from termcolor import colored
class NanoLexer():
""" A lexer for the Nano C language. After building it, set the
input text with input(), and call token() to get new
tokens.
"""
def __init__(self):
""" Create a new Lexer
Builds the lexer... | 25.811808 | 108 | 0.530665 |
d9c4d0d27f92dd939705ee96b918d6329ac71100 | 5,980 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/matchcriteria_0cfbf8546f5ee9d503c47b3a37bded66.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/matchcriteria_0cfbf8546f5ee9d503c47b3a37bded66.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/matchcriteria_0cfbf8546f5ee9d503c47b3a37bded66.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... | 34.367816 | 173 | 0.651839 |
bcb6a48debd84206447636ba47582f98349be14d | 1,299 | py | Python | Geometry/Point.py | xvzezi/cd2d-python | fcbb1d3acd2a8bc0168129fccac8480f8e749268 | [
"MIT"
] | null | null | null | Geometry/Point.py | xvzezi/cd2d-python | fcbb1d3acd2a8bc0168129fccac8480f8e749268 | [
"MIT"
] | null | null | null | Geometry/Point.py | xvzezi/cd2d-python | fcbb1d3acd2a8bc0168129fccac8480f8e749268 | [
"MIT"
] | null | null | null | # coding=utf-8
###########################
# file: Rect.py
# date: 2021-7-25
# author: Sturmfy
# desc: Basic definition of Round things
# version:
# 2021-7-25 init design
###########################
import sys
sys.path.append("..")
from .Shape import Shape
from Grid import Grid
import numpy as np
class Point(Sha... | 25.470588 | 64 | 0.558122 |
3eec9d6c873c173ada4222ba9f4bd31cc024d407 | 16,173 | py | Python | resnet20_cifar10.py | vovamedentsiy/mpdnn | 9d5966a95a27c8c9037c46cbc50d91fe8d387c1e | [
"MIT"
] | null | null | null | resnet20_cifar10.py | vovamedentsiy/mpdnn | 9d5966a95a27c8c9037c46cbc50d91fe8d387c1e | [
"MIT"
] | 1 | 2021-03-26T07:53:19.000Z | 2021-03-26T14:47:23.000Z | resnet20_cifar10.py | vovamedentsiy/mpdnn | 9d5966a95a27c8c9037c46cbc50d91fe8d387c1e | [
"MIT"
] | null | null | null | import torch
import torchvision
from artemis.fileman.local_dir import get_local_dir, get_local_path
from artemis.general.display import CaptureStdOut
from sacred import Experiment
from tensorboardX import SummaryWriter
from torch.optim.lr_scheduler import LambdaLR, ReduceLROnPlateau
from torch.utils.data import Subse... | 37.699301 | 308 | 0.582452 |
196d2f7b10e51fe4060fc4f61a4bc3ffd594b1df | 11,966 | py | Python | modules/tools/svm_nodes_creator.py | stonewell/learn-curve | fa712bc3d553c7600ef9f403506faaf410358e41 | [
"MIT"
] | null | null | null | modules/tools/svm_nodes_creator.py | stonewell/learn-curve | fa712bc3d553c7600ef9f403506faaf410358e41 | [
"MIT"
] | null | null | null | modules/tools/svm_nodes_creator.py | stonewell/learn-curve | fa712bc3d553c7600ef9f403506faaf410358e41 | [
"MIT"
] | null | null | null | import collections
import core.nodes_manager
import core.nodes.kdj_node
import core.nodes.macd_node
import core.nodes.k_line_node
import core.nodes.osc_node
import core.nodes.basic_node
def create_nodes_k_line(nm, from_name, capacity):
node_names = []
node_names.append(core.nodes.k_line_node.create_k_line_nod... | 37.161491 | 110 | 0.751295 |
3e6ae0779aeb8894cb1ce7e4593be123ec7e4a78 | 1,065 | py | Python | portscanner.py | ausaafnabi/Security-Utilities | cf5e59814fbdcf81d75c3cc705ba3c871b961668 | [
"MIT"
] | null | null | null | portscanner.py | ausaafnabi/Security-Utilities | cf5e59814fbdcf81d75c3cc705ba3c871b961668 | [
"MIT"
] | null | null | null | portscanner.py | ausaafnabi/Security-Utilities | cf5e59814fbdcf81d75c3cc705ba3c871b961668 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import socket
import subprocess
import sys
from datetime import datetime
subprocess.call('clear',shell=True)
remoteServer = input("Enter a remote host to scan : ")
remoteServerIP = socket.gethostbyname(remoteServer)
#Printing a nice banner with information on which host we are about to scan
p... | 23.152174 | 75 | 0.701408 |
a35d27d7491b5b5379bb7e10be348b18a9635171 | 6,266 | py | Python | google_places_tool.py | helixhacks1/PikminDecorPredictor | a4047bea860ebe81f504013fe1c72b1322e7ba59 | [
"MIT"
] | null | null | null | google_places_tool.py | helixhacks1/PikminDecorPredictor | a4047bea860ebe81f504013fe1c72b1322e7ba59 | [
"MIT"
] | null | null | null | google_places_tool.py | helixhacks1/PikminDecorPredictor | a4047bea860ebe81f504013fe1c72b1322e7ba59 | [
"MIT"
] | null | null | null | import requests
import urllib.parse
import json
import os.path
import pickle
from decor_to_tag_mapping import google_places_decors_to_tags
from prediction import Prediction
from dataset import Dataset
from ratelimiter import RateLimiter
class GooglePlacesTool:
def __init__(self, api_key):
self.api_key = ap... | 41.223684 | 126 | 0.610118 |
64ffa1d1c8b19628fcd96d9fcffa08224db38a10 | 35,540 | py | Python | supersqlite/third_party/_apsw/setup.py | plasticity-admin/supersqlite | d74da749c6fa5df021df3968b854b9a59f829e17 | [
"MIT"
] | 687 | 2018-11-22T13:06:32.000Z | 2022-03-22T10:54:49.000Z | supersqlite/third_party/_apsw/setup.py | plasticity-admin/supersqlite | d74da749c6fa5df021df3968b854b9a59f829e17 | [
"MIT"
] | 7 | 2019-08-23T22:59:32.000Z | 2021-11-10T16:56:38.000Z | supersqlite/third_party/_apsw/setup.py | plasticity-admin/supersqlite | d74da749c6fa5df021df3968b854b9a59f829e17 | [
"MIT"
] | 28 | 2019-08-23T17:22:31.000Z | 2022-02-21T13:13:42.000Z | #!/usr/bin/env python
# See the accompanying LICENSE file.
import os
import sys
import shlex
import glob
import re
import time
import zipfile
import tarfile
try:
if not os.environ.get("APSW_FORCE_DISTUTILS"):
from setuptools import setup, Extension, Command
else:
raise ImportError()
except Im... | 39.054945 | 193 | 0.549859 |
b4e0c5d3fa6ac72422ca8605d3fa939fc47bf77f | 4,168 | py | Python | mime/scene/collision.py | rjgpinel/mime-release | 26a850c4ba5b702b86d068995614163338fb01df | [
"MIT"
] | 13 | 2020-06-24T10:52:28.000Z | 2021-07-23T03:05:27.000Z | mime/scene/collision.py | rjgpinel/mime-release | 26a850c4ba5b702b86d068995614163338fb01df | [
"MIT"
] | 1 | 2020-08-18T12:45:15.000Z | 2020-08-18T12:45:15.000Z | mime/scene/collision.py | rjgpinel/mime-release | 26a850c4ba5b702b86d068995614163338fb01df | [
"MIT"
] | 3 | 2020-09-09T18:17:46.000Z | 2021-09-06T09:43:45.000Z | import pybullet as pb
from . import body
from . import link
def get_contact_points(body_or_link_a, body_or_link_b=None):
""" Returns the contact points computed during the most recent
call to stepSimulation. """
client_id = body_or_link_a.client_id
kwargs = {}
kwargs.update(_compute_args(body... | 33.612903 | 89 | 0.669626 |
05201656a11164fd09e82b073d6ba25b74dd56ff | 14,665 | py | Python | pysmsd/http/wsgiserver.py | sizzlelab/pysmsd | b670018fb421229591784faacdc19ec95d49f907 | [
"MIT"
] | 1 | 2017-09-02T06:48:02.000Z | 2017-09-02T06:48:02.000Z | pysmsd/http/wsgiserver.py | sizzlelab/pysmsd | b670018fb421229591784faacdc19ec95d49f907 | [
"MIT"
] | null | null | null | pysmsd/http/wsgiserver.py | sizzlelab/pysmsd | b670018fb421229591784faacdc19ec95d49f907 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# pysmsd.http.wsgiserver
#
# Copyright 2010 Helsinki Institute for Information Technology
# and the authors.
#
# Authors: Jani Turunen <jani.turunen@hiit.fi>
# Konrad Markus <konrad.markus@hiit.fi>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of... | 45.262346 | 239 | 0.556631 |
b8ff4b04f8239f0493f98212c9f048e4f6795ee9 | 379 | py | Python | 007_10001stPrime.py | joetache4/ProjectEuler | f101e927d73dbafa11af1b208992bf0d830c88b1 | [
"MIT"
] | null | null | null | 007_10001stPrime.py | joetache4/ProjectEuler | f101e927d73dbafa11af1b208992bf0d830c88b1 | [
"MIT"
] | null | null | null | 007_10001stPrime.py | joetache4/ProjectEuler | f101e927d73dbafa11af1b208992bf0d830c88b1 | [
"MIT"
] | null | null | null | '''
Joe Walter
difficulty: 5%
run time: 0:00
answer: 104743
***
007 10001st Prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10001st prime number?
'''
from itertools import count
from lib.num import is_prime
n = 0
for p in count(2):
if... | 13.535714 | 100 | 0.654354 |
5883a87567cdfde67e178b409893abe77885333d | 103 | py | Python | tools/pyshaka/util/Functional.py | wayneclub/Subtitle-Downloader | 4ab1e7ab075593d4245867996b0766efc5aa418a | [
"MIT"
] | 57 | 2021-12-05T02:31:51.000Z | 2022-03-31T03:36:26.000Z | tools/pyshaka/util/Functional.py | wayneclub/Subtitle-Downloader | 4ab1e7ab075593d4245867996b0766efc5aa418a | [
"MIT"
] | 25 | 2021-12-08T09:16:30.000Z | 2022-03-31T11:09:10.000Z | tools/pyshaka/util/Functional.py | wayneclub/Subtitle-Downloader | 4ab1e7ab075593d4245867996b0766efc5aa418a | [
"MIT"
] | 17 | 2021-12-01T03:11:41.000Z | 2022-03-26T15:22:35.000Z | class Functional:
@staticmethod
def isNotNull(value) -> bool:
return value is not None | 20.6 | 33 | 0.660194 |
2e2435bd65796a59a03295a98c82839128af73ef | 2,901 | py | Python | meme.py | LEGEND-LX/PYTHONBOT.py.pkg | 897b05528990acf76fbb2a05538429cd5d178733 | [
"CC0-1.0"
] | 2 | 2021-09-09T06:50:21.000Z | 2021-10-01T16:59:30.000Z | meme.py | LEGEND-LX/PYTHONBOT.py.pkg | 897b05528990acf76fbb2a05538429cd5d178733 | [
"CC0-1.0"
] | null | null | null | meme.py | LEGEND-LX/PYTHONBOT.py.pkg | 897b05528990acf76fbb2a05538429cd5d178733 | [
"CC0-1.0"
] | null | null | null | """
Memes Plugin for Userbot
usage = .meme someCharacter //default delay will be 3
By : - @Zero_cool7870
"""
from telethon import events
import asyncio
import os
import sys
from userbot.utils import admin_cmd
@bot.on(admin_cmd(pattern=r"meme"))
async def meme(event):
if event.fwd_from:
return
memeV... | 33.732558 | 91 | 0.637022 |
73072d7393c458b388632efa812505fd6467cdaf | 1,697 | py | Python | utils/config.py | slothfulxtx/simple-faster-rcnn-pytorch | 0f6dc5290ef893654cd9197ec250a2ae0bb4ade1 | [
"MIT"
] | null | null | null | utils/config.py | slothfulxtx/simple-faster-rcnn-pytorch | 0f6dc5290ef893654cd9197ec250a2ae0bb4ade1 | [
"MIT"
] | null | null | null | utils/config.py | slothfulxtx/simple-faster-rcnn-pytorch | 0f6dc5290ef893654cd9197ec250a2ae0bb4ade1 | [
"MIT"
] | null | null | null | from pprint import pprint
class Config:
"""
超参数,这里列出的是默认值,使用命令行可以对这些参数值进行覆盖
"""
debug = False
# data
s3d_data_dir = ''
voc_data_dir = '/home/tianxing/datasets/VOCdevkit/VOC2007/'
min_size = 600 # image resize
max_size = 1000 # image resize
num_workers = 8
test_num_worker... | 23.246575 | 79 | 0.583382 |
ff06a530cbf010e632cf143b7c77495383a193f3 | 6,204 | py | Python | common/data.py | yancz1989/lr_semi | 9cdfbabd3388b62fe9e76885d9f47ec9953790c1 | [
"MIT"
] | 2 | 2017-08-24T05:02:52.000Z | 2017-08-24T05:30:17.000Z | common/data.py | yancz1989/lr_semi | 9cdfbabd3388b62fe9e76885d9f47ec9953790c1 | [
"MIT"
] | null | null | null | common/data.py | yancz1989/lr_semi | 9cdfbabd3388b62fe9e76885d9f47ec9953790c1 | [
"MIT"
] | null | null | null | import mxnet as mx
import random
from mxnet.io import DataBatch, DataIter
import numpy as np
def add_data_args(parser):
data = parser.add_argument_group('Data', 'the input images')
data.add_argument('--data-train', type=str, help='the training data')
data.add_argument('--data-val', type=str, help='the validatio... | 37.373494 | 103 | 0.647485 |
64312c6fb4e156abf2977a8ed63ea71fe0548e87 | 8,907 | py | Python | rdkit/Chem/UnitTestSurf.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 1,609 | 2015-01-05T02:41:13.000Z | 2022-03-30T21:57:24.000Z | rdkit/Chem/UnitTestSurf.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 3,412 | 2015-01-06T12:13:33.000Z | 2022-03-31T17:25:41.000Z | rdkit/Chem/UnitTestSurf.py | bp-kelley/rdkit | e0de7c9622ce73894b1e7d9568532f6d5638058a | [
"BSD-3-Clause"
] | 811 | 2015-01-11T03:33:48.000Z | 2022-03-28T11:57:49.000Z | #
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""
unit testing code for ca... | 34.929412 | 99 | 0.666779 |
dacf667f32204916a80abbadf3b7e28f93ecb91e | 24,274 | py | Python | haiku/_src/base.py | joaogui1/dm-haiku | 662c8efdea11902ac44aac9fd385aca4d96fd6e9 | [
"Apache-2.0"
] | null | null | null | haiku/_src/base.py | joaogui1/dm-haiku | 662c8efdea11902ac44aac9fd385aca4d96fd6e9 | [
"Apache-2.0"
] | null | null | null | haiku/_src/base.py | joaogui1/dm-haiku | 662c8efdea11902ac44aac9fd385aca4d96fd6e9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 DeepMind Technologies Limited. 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 ... | 31.443005 | 80 | 0.682953 |
1527dd372e92925a7a442814dd7b7ddbd056c5b3 | 4,882 | py | Python | scikits/gpu/framebuffer.py | stefanv/scikits.gpu | d57a676e16ed576a255a1a4cae64d8c019f0e8fb | [
"MIT"
] | 4 | 2016-05-08T21:41:10.000Z | 2021-09-13T18:32:28.000Z | scikits/gpu/framebuffer.py | stefanv/scikits.gpu | d57a676e16ed576a255a1a4cae64d8c019f0e8fb | [
"MIT"
] | null | null | null | scikits/gpu/framebuffer.py | stefanv/scikits.gpu | d57a676e16ed576a255a1a4cae64d8c019f0e8fb | [
"MIT"
] | null | null | null | """Framebuffer object.
This module is based on code which is
Copyright (c) 2009, Richard Jones
and is released under the MIT license. See LICENSE.txt for more detail.
"""
__all__ = ['Framebuffer']
from pyglet import gl, image
import ctypes
from scikits.gpu.config import require_extension, MAX_COLOR_ATTACHMENTS
... | 30.5125 | 78 | 0.582958 |
0d5000b78e32a287d958b30a1cb01ea271752804 | 9,918 | py | Python | rotamer/topology/residue_sidechains.py | khs26/rotamer | 6f4ee3a9d3fcbe3b6a4669e87ce1b1e0c4b40d8f | [
"MIT"
] | 1 | 2020-12-14T20:42:52.000Z | 2020-12-14T20:42:52.000Z | rotamer/topology/residue_sidechains.py | khs26/rotamer_library | 6f4ee3a9d3fcbe3b6a4669e87ce1b1e0c4b40d8f | [
"MIT"
] | null | null | null | rotamer/topology/residue_sidechains.py | khs26/rotamer_library | 6f4ee3a9d3fcbe3b6a4669e87ce1b1e0c4b40d8f | [
"MIT"
] | null | null | null | import networkx as nx
"""
Defines residue sidechains, atom graphs and dihedral definitions for residues.
"""
def add_hydrogens(graph, number_dict):
""" Adds hydrogens to heavy atoms in a sidechain graph.
:param graph: sidechain graph
:param number_dict: dictionary of number of hydrogens per heavy atom
... | 28.915452 | 107 | 0.433454 |
7ef06c38ab84f1a20c81c802df2a8cb4bc067645 | 6,173 | py | Python | src/sparseml/pytorch/base.py | kevinaer/sparseml | 067bb3e1e9ea35930eb7a105eac4864f9145678a | [
"Apache-2.0"
] | 2 | 2021-07-04T07:29:48.000Z | 2021-08-17T05:59:40.000Z | src/sparseml/pytorch/base.py | kevinaer/sparseml | 067bb3e1e9ea35930eb7a105eac4864f9145678a | [
"Apache-2.0"
] | null | null | null | src/sparseml/pytorch/base.py | kevinaer/sparseml | 067bb3e1e9ea35930eb7a105eac4864f9145678a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 - present / Neuralmagic, 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 b... | 34.294444 | 88 | 0.713267 |
c96cff6da5119cba12c6ab42c6c5c1b441dc7915 | 28,047 | py | Python | InvenTree/part/api.py | amishHammer/InvenTree | fc54a9d195d0ffa2308b9333e6fc376adde753d7 | [
"MIT"
] | null | null | null | InvenTree/part/api.py | amishHammer/InvenTree | fc54a9d195d0ffa2308b9333e6fc376adde753d7 | [
"MIT"
] | null | null | null | InvenTree/part/api.py | amishHammer/InvenTree | fc54a9d195d0ffa2308b9333e6fc376adde753d7 | [
"MIT"
] | null | null | null | """
Provides a JSON API for the Part app
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_filters.rest_framework import DjangoFilterBackend
from django.http import JsonResponse
from django.db.models import Q, F, Count, Prefetch, Sum
from rest_framework import status
from rest_framework... | 30.552288 | 138 | 0.623097 |
97859ed128b13bf2196e5a269f6695cc46bcb613 | 886 | py | Python | ding/policy/__init__.py | lichuminglcm/DI-engine | e9052f195d231a9875afb053ba815c6341857571 | [
"Apache-2.0"
] | null | null | null | ding/policy/__init__.py | lichuminglcm/DI-engine | e9052f195d231a9875afb053ba815c6341857571 | [
"Apache-2.0"
] | null | null | null | ding/policy/__init__.py | lichuminglcm/DI-engine | e9052f195d231a9875afb053ba815c6341857571 | [
"Apache-2.0"
] | null | null | null | from .base_policy import Policy, CommandModePolicy, create_policy, get_policy_cls
from .dqn import DQNPolicy
from .iqn import IQNPolicy
from .qrdqn import QRDQNPolicy
from .c51 import C51Policy
from .rainbow import RainbowDQNPolicy
from .ddpg import DDPGPolicy
from .d4pg import D4PGPolicy
from .td3 import TD3Policy
fro... | 27.6875 | 81 | 0.832957 |
f66789a26d5044d1714fc4fc07851fb69e37292b | 1,742 | py | Python | tests/models.py | chaitin/django-pg-timepart | 129f5ddd11c61f855b97e558159dd067a15ca18d | [
"MIT"
] | 152 | 2019-02-05T03:50:11.000Z | 2019-04-25T11:27:30.000Z | tests/models.py | chaitin/django-pg-partitioning | 129f5ddd11c61f855b97e558159dd067a15ca18d | [
"MIT"
] | 6 | 2019-07-25T23:46:54.000Z | 2021-11-25T05:25:52.000Z | tests/models.py | chaitin/django-pg-timepart | 129f5ddd11c61f855b97e558159dd067a15ca18d | [
"MIT"
] | 17 | 2019-02-06T10:03:14.000Z | 2019-03-26T07:43:44.000Z | from django.contrib.postgres.indexes import BrinIndex
from django.db import models
from django.utils import timezone
from pg_partitioning.constants import PeriodType
from pg_partitioning.decorators import ListPartitioning, TimeRangePartitioning
@TimeRangePartitioning(partition_key="timestamp", default_period=PeriodT... | 36.291667 | 152 | 0.762342 |
b097c64b13beecf18a8cea5c20142c287bd83cc1 | 4,196 | py | Python | test/functional/interface_bitcoin_cli.py | lihuanghai/bitcoin | 624da15f8c55219f4ca3e0877a17799990299504 | [
"MIT"
] | 3 | 2021-11-15T14:58:10.000Z | 2021-11-17T09:59:42.000Z | test/functional/interface_bitcoin_cli.py | lihuanghai/bitcoin | 624da15f8c55219f4ca3e0877a17799990299504 | [
"MIT"
] | 1 | 2017-01-08T20:32:43.000Z | 2017-01-08T20:32:43.000Z | test/functional/interface_bitcoin_cli.py | lihuanghai/bitcoin | 624da15f8c55219f4ca3e0877a17799990299504 | [
"MIT"
] | 1 | 2019-09-02T00:49:46.000Z | 2019-09-02T00:49:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoin-cli"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util ... | 55.946667 | 160 | 0.705434 |
338d862b5c1d8ba44dbcd28332cdb8fb4b55112d | 152,901 | py | Python | modules/s3/s3filter.py | aeturnum/new_eden | 01b603b2797dc5b3fa82d9ae32c23016c07c0f44 | [
"MIT"
] | null | null | null | modules/s3/s3filter.py | aeturnum/new_eden | 01b603b2797dc5b3fa82d9ae32c23016c07c0f44 | [
"MIT"
] | null | null | null | modules/s3/s3filter.py | aeturnum/new_eden | 01b603b2797dc5b3fa82d9ae32c23016c07c0f44 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Framework for filtered REST requests
@copyright: 2013-2019 (c) Sahana Software Foundation
@license: MIT
@requires: U{B{I{gluon}} <http://web2py.com>}
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documenta... | 36.959391 | 145 | 0.475497 |
f42968b2e1a0c9299f19502b3786313322a23194 | 3,014 | py | Python | Surf-Mac/genjson.py | jobpassion/Surf | 42109301ed01b9fa333cd7ebd4d68bfe870fe0e0 | [
"BSD-3-Clause"
] | 63 | 2016-05-19T02:39:05.000Z | 2022-01-23T15:06:52.000Z | Surf-Mac/genjson.py | jobpassion/Surf | 42109301ed01b9fa333cd7ebd4d68bfe870fe0e0 | [
"BSD-3-Clause"
] | 2 | 2018-08-13T03:45:17.000Z | 2019-10-10T10:06:07.000Z | Surf-Mac/genjson.py | jobpassion/Surf | 42109301ed01b9fa333cd7ebd4d68bfe870fe0e0 | [
"BSD-3-Clause"
] | 23 | 2016-05-19T01:28:08.000Z | 2020-04-27T07:53:42.000Z | #!/usr/bin/env python
#coding=utf-8
import json
import sys
import re
config = {}
General = {}
Proxy = {}
Rule = {}
DOMAINKEYWORD = {}
DOMAINSUFFIX = {}
IPCIDR = {}
def fread(file):
dict = {}
i = 0
for line in file:
i = i+ 1
print ++i
if re.match('#', line):
print "# and pass"
continue
if re.match('... | 20.930556 | 49 | 0.56503 |
0760e4873b7994a81bcf5101f671f20e1a7f51d7 | 14,174 | py | Python | mmdet/models/losses/iou_loss.py | VDIGPKU/OPANAS | 873ff09a65d3253ce8351e54880a642517f7e8b5 | [
"Apache-2.0"
] | 39 | 2021-03-31T21:15:48.000Z | 2022-03-30T03:34:14.000Z | mmdet/models/losses/iou_loss.py | VDIGPKU/OPANAS | 873ff09a65d3253ce8351e54880a642517f7e8b5 | [
"Apache-2.0"
] | 8 | 2021-04-06T07:58:03.000Z | 2022-01-11T17:10:51.000Z | mmdet/models/losses/iou_loss.py | VDIGPKU/OPANAS | 873ff09a65d3253ce8351e54880a642517f7e8b5 | [
"Apache-2.0"
] | 4 | 2021-04-06T03:28:56.000Z | 2022-03-06T19:57:50.000Z | import math
import torch
import torch.nn as nn
from mmdet.core import bbox_overlaps
from ..builder import LOSSES
from .utils import weighted_loss
@weighted_loss
def iou_loss(pred, target, eps=1e-6):
"""IoU loss.
Computing the IoU loss between a set of predicted bboxes and target bboxes.
The loss is cal... | 32.14059 | 79 | 0.546705 |
424464f49796d3dfc74fa1816448eec202a1d824 | 9,509 | py | Python | openwisp_users/api/views.py | Aryamanz29/openwisp-users | 9ac518d071c69ad09a7dd18e27571e5060baaae9 | [
"BSD-3-Clause"
] | null | null | null | openwisp_users/api/views.py | Aryamanz29/openwisp-users | 9ac518d071c69ad09a7dd18e27571e5060baaae9 | [
"BSD-3-Clause"
] | 1 | 2022-01-24T16:44:03.000Z | 2022-01-24T16:44:03.000Z | openwisp_users/api/views.py | Aryamanz29/openwisp-users | 9ac518d071c69ad09a7dd18e27571e5060baaae9 | [
"BSD-3-Clause"
] | null | null | null | from allauth.account.models import EmailAddress
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from drf_yasg.utils import swagger_auto_schema
from rest_framework import pagination
from rest_framework.authentication... | 33.960714 | 87 | 0.706489 |
d99fe827843f15d2658abd43384ce056ea2d6e60 | 1,877 | py | Python | preprocessing/madtwinnet/modules/twin_rnn_dec.py | ddcas/singing-language-identification | d104419b196d56d4de37cff47c32e88e28c58690 | [
"MIT"
] | null | null | null | preprocessing/madtwinnet/modules/twin_rnn_dec.py | ddcas/singing-language-identification | d104419b196d56d4de37cff47c32e88e28c58690 | [
"MIT"
] | null | null | null | preprocessing/madtwinnet/modules/twin_rnn_dec.py | ddcas/singing-language-identification | d104419b196d56d4de37cff47c32e88e28c58690 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The RNN dec of the Masker.
"""
import torch
from torch.nn import Module, GRUCell
from torch.nn.init import xavier_normal_, orthogonal_
__author__ = ['Konstantinos Drossos -- TUT', 'Stylianos Mimilakis -- Fraunhofer IDMT']
__docformat__ = 'reStructuredText'
__all__ = [... | 28.439394 | 89 | 0.635589 |
98a8c8a548adf3d9c5dc88e29aa951d69ecce7ed | 4,501 | py | Python | openstack/tests/unit/database/v1/test_instance.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/database/v1/test_instance.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/database/v1/test_instance.py | NeCTAR-RC/openstacksdk | 60a24f6c4717a1f9a0e545c9a07e68afaedc5a27 | [
"Apache-2.0"
] | 1 | 2020-07-21T02:18:23.000Z | 2020-07-21T02:18:23.000Z | # 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
# distributed under t... | 34.623077 | 75 | 0.62475 |
12df743df84d27ddd6c07a8f01368c4f60c7044a | 3,647 | py | Python | tests/grammar/test_grammar.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | 1 | 2020-07-04T01:47:26.000Z | 2020-07-04T01:47:26.000Z | tests/grammar/test_grammar.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | tests/grammar/test_grammar.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | import re
import textwrap
import hypothesis
import hypothesis.strategies as st
import pytest
from hypothesis import HealthCheck, assume, given
from hypothesis.extra.lark import LarkStrategy
from tests.grammar.conftest import get_lark_grammar
from vyper.ast import Module, parse_to_ast
def test_basic_grammar(lark_gra... | 33.154545 | 99 | 0.661914 |
20edbebc6b324f58c7354916e408fe75e8ba9b1a | 11,557 | py | Python | day_9_part_2.py | Korred/advent_of_code_2016 | 8b6e9b51569bf75da9b0fc56cc9e7c1c4dddeb5e | [
"MIT"
] | null | null | null | day_9_part_2.py | Korred/advent_of_code_2016 | 8b6e9b51569bf75da9b0fc56cc9e7c1c4dddeb5e | [
"MIT"
] | null | null | null | day_9_part_2.py | Korred/advent_of_code_2016 | 8b6e9b51569bf75da9b0fc56cc9e7c1c4dddeb5e | [
"MIT"
] | null | null | null | import re
def unzip_len(file):
curr_pos, cnt = 0, 0
marker = re.compile(r'\(([\d]+)x([\d]+)\)')
while(True):
m = marker.search(file, curr_pos)
if m:
sub_cnt, rep_cnt = map(int, (m.group(1), m.group(2)))
cnt += len(file[curr_pos:m.start()]) + (unzip_len(file[m.end():m.... | 679.823529 | 11,050 | 0.832569 |
bb8a333361efa71ec4b0f60eb1ec86c10c422c8a | 3,297 | py | Python | lib/python3.8/site-packages/ansible_collections/openstack/cloud/plugins/modules/os_keystone_federation_protocol_info.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/openstack/cloud/plugins/modules/os_keystone_federation_protocol_info.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | lib/python3.8/site-packages/ansible_collections/openstack/cloud/plugins/modules/os_keystone_federation_protocol_info.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = '''
---
module: keystone_federation_protocol_info
short_description: get information about federation Protocols
author: OpenStack Ansible SIG
description:
- Get ... | 29.702703 | 107 | 0.70549 |
fe2b906555a8279a6bf835e2444dc4d611a3f43b | 24,129 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_network_security_groups_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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 may ... | 49.242857 | 211 | 0.666459 |
657e476dfc2fcefeee70d6e8705d4b13b2068031 | 11,649 | py | Python | MetamorphicTests/all_mutants/sales_forecasting_file/123.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/123.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | null | null | null | MetamorphicTests/all_mutants/sales_forecasting_file/123.py | anuragbms/Sales-forecasting-with-RNNs | 22b4639ecbb48381af53326ace94a3538201b586 | [
"Apache-2.0"
] | 1 | 2022-02-06T14:59:43.000Z | 2022-02-06T14:59:43.000Z | def gen_mutants():
import tensorflow as tf
import pandas
import numpy as np
DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv'
DATAFILE_VALIDATE = 'mock_kaggle_edit_... | 31.230563 | 232 | 0.629668 |
cb70fc5515aafb95670c006999ecc1c53a0b7c3f | 17,927 | py | Python | homeassistant/components/tuya/climate.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/tuya/climate.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/tuya/climate.py | marecabo/home-assistant | e33774a61e7fcc88aff752dfa4618dd26a746872 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for Tuya Climate."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from tuya_iot import TuyaDevice, TuyaDeviceManager
from homeassistant.components.climate import ClimateEntity, ClimateEntityDescription
from homeassistant.components.climate.const import (
... | 36.660532 | 89 | 0.631059 |
7001ad1d8991d739b928c4b43524325204838953 | 820 | py | Python | apps/base/migrations/0003_news.py | gilberdev/hotelsaratoga | f6f93e3408555daa84d68c6d1a85f4189f4110af | [
"MIT"
] | null | null | null | apps/base/migrations/0003_news.py | gilberdev/hotelsaratoga | f6f93e3408555daa84d68c6d1a85f4189f4110af | [
"MIT"
] | null | null | null | apps/base/migrations/0003_news.py | gilberdev/hotelsaratoga | f6f93e3408555daa84d68c6d1a85f4189f4110af | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0002_auto_20151210_2105'),
]
operations = [
migrations.CreateModel(
name='News',
fields=[
... | 30.37037 | 114 | 0.559756 |
986405d22b1eb6ea7c2b65ec14955a21467807cc | 27,683 | py | Python | zproject/prod_settings_template.py | luisogandob/zulip | f6667b8e80b4658b8d2a5ae6b3f0c9d6eac4a2d6 | [
"Apache-2.0"
] | 1 | 2020-04-07T13:58:05.000Z | 2020-04-07T13:58:05.000Z | zproject/prod_settings_template.py | luisogandob/zulip | f6667b8e80b4658b8d2a5ae6b3f0c9d6eac4a2d6 | [
"Apache-2.0"
] | 1 | 2020-07-15T21:20:34.000Z | 2020-07-15T21:23:47.000Z | zproject/prod_settings_template.py | luisogandob/zulip | f6667b8e80b4658b8d2a5ae6b3f0c9d6eac4a2d6 | [
"Apache-2.0"
] | 3 | 2020-07-06T22:58:27.000Z | 2020-07-10T15:51:46.000Z | from typing import Any, Dict, Tuple
################################################################
# Zulip Server settings.
#
# This file controls settings that affect the whole Zulip server.
# See our documentation at:
# https://zulip.readthedocs.io/en/latest/production/settings.html
#
# For developer documentati... | 41.817221 | 102 | 0.749449 |
c5428f9a7d7dc6efc2d5effa89421ea90a262bdb | 22,733 | py | Python | unfurl/tests/test_cli.py | cybercur4/unfurl | 39ba274ae50c64c176da5df45ca0cfe03eeb67a1 | [
"MIT"
] | 1 | 2022-01-15T07:17:36.000Z | 2022-01-15T07:17:36.000Z | tests/test_cli.py | Md-Danish-eng/unfurl | a081657afbd1128e58f95d75ed8cdbdfff2dfe3f | [
"MIT"
] | null | null | null | tests/test_cli.py | Md-Danish-eng/unfurl | a081657afbd1128e58f95d75ed8cdbdfff2dfe3f | [
"MIT"
] | null | null | null | import os
import traceback
import unittest
from collections.abc import MutableSequence
import six
import unfurl
from click.testing import CliRunner
from unfurl.__main__ import _args, cli
from unfurl.configurator import Configurator
from unfurl.localenv import LocalEnv, Project
from unfurl.util import sensitive_list, Un... | 37.4514 | 107 | 0.5386 |
0f9a39910d46cc4d3ae2f370ecb5fa8d8f4bc77c | 584 | py | Python | tor_async_couchdb/model.py | simonsdave/tor-async-couchdb | 286b0acaca636f5e937b159d56db573973cd17a1 | [
"MIT"
] | 1 | 2019-01-27T21:07:14.000Z | 2019-01-27T21:07:14.000Z | tor_async_couchdb/model.py | simonsdave/tor-async-couchdb | 286b0acaca636f5e937b159d56db573973cd17a1 | [
"MIT"
] | 5 | 2015-04-22T17:52:07.000Z | 2017-05-16T01:56:45.000Z | tor_async_couchdb/model.py | simonsdave/tor-async-couchdb | 286b0acaca636f5e937b159d56db573973cd17a1 | [
"MIT"
] | 2 | 2015-05-04T20:19:46.000Z | 2016-05-30T09:59:59.000Z | class Model(object):
"""Abstract base class for all models."""
def __init__(self, *args, **kwargs):
object.__init__(self)
doc = kwargs.get('doc', None)
if doc is not None:
self._id = doc.get('_id', None)
self._rev = doc.get('_rev', None)
else:
... | 26.545455 | 48 | 0.501712 |
ab69e6689667b8245ab607ab20a3b8e118c1e53b | 4,493 | py | Python | test/functional/rpc_merkle_blocks.py | BradVer/Titan | 69aa5de8e9cdc8b843f11a7fed3a9defe4d9ae22 | [
"MIT"
] | 7 | 2019-04-04T01:15:13.000Z | 2021-11-11T08:19:23.000Z | test/functional/rpc_merkle_blocks.py | BradVer/Titan | 69aa5de8e9cdc8b843f11a7fed3a9defe4d9ae22 | [
"MIT"
] | 3 | 2019-10-16T18:02:29.000Z | 2020-08-18T14:57:45.000Z | test/functional/rpc_merkle_blocks.py | BradVer/Titan | 69aa5de8e9cdc8b843f11a7fed3a9defe4d9ae22 | [
"MIT"
] | 23 | 2019-04-18T05:07:49.000Z | 2021-10-03T04:51:20.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017 The Raven Core developers
# Copyright (c) 2018 The Titancoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test gettx... | 52.244186 | 142 | 0.688404 |
cd57264dbdd45a7fd531390f45836d41c6cbb144 | 7,105 | py | Python | python/tvm/topi/nn/conv3d_transpose.py | jacobpostman/incubator-tvm | fdef79d317d455eb5c9e9e86feb97416eb594690 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 4 | 2019-05-08T04:46:07.000Z | 2019-11-11T19:43:04.000Z | python/tvm/topi/nn/conv3d_transpose.py | minminsun/incubator-tvm | 02643d39798c6ec28348235d36d8da626f50d9dd | [
"Apache-2.0"
] | 2 | 2020-09-14T09:18:25.000Z | 2020-09-24T03:28:18.000Z | python/tvm/topi/nn/conv3d_transpose.py | minminsun/incubator-tvm | 02643d39798c6ec28348235d36d8da626f50d9dd | [
"Apache-2.0"
] | 2 | 2019-08-08T01:48:03.000Z | 2019-09-27T06:49:16.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... | 40.369318 | 100 | 0.65095 |
56f2edbda38e39ba3ad57650ec46b9327d7231b9 | 13,653 | py | Python | holoviews/plotting/mpl/seaborn.py | stonebig/holoviews | d5270c30dd1af38a785452aeac2fbabbe528e892 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/mpl/seaborn.py | stonebig/holoviews | d5270c30dd1af38a785452aeac2fbabbe528e892 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/mpl/seaborn.py | stonebig/holoviews | d5270c30dd1af38a785452aeac2fbabbe528e892 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import matplotlib.pyplot as plt
try:
import seaborn.apionly as sns
except:
sns = None
import param
from ...interface.pandas import DFrame, DataFrameView
from ...interface.seaborn import Regression, TimeSeries, Bivariate, Distribution
from ...interface.seaborn import DF... | 41.247734 | 99 | 0.546693 |
804b80af240a51613e5a5329fde4a018177b8f58 | 1,788 | py | Python | utils/golden_section_search.py | phzwart/camxs | d6387e4517fa4891f0e5cdf461a6ab3d27fd0d0b | [
"BSD-3-Clause-LBNL"
] | null | null | null | utils/golden_section_search.py | phzwart/camxs | d6387e4517fa4891f0e5cdf461a6ab3d27fd0d0b | [
"BSD-3-Clause-LBNL"
] | null | null | null | utils/golden_section_search.py | phzwart/camxs | d6387e4517fa4891f0e5cdf461a6ab3d27fd0d0b | [
"BSD-3-Clause-LBNL"
] | null | null | null | import sys
def print_progress_dots(out,ii,n_monitor=10,width=80,offset=5, is_final=False):
if ii-1 == 0:
print >> out," "*offset+"Starting search"
if (ii-1)%width==0:
print >>out,"\n"+offset*" ",
if (ii-1)%n_monitor==0:
print >>out, ".",
out.flush()
if is_final:
print >> out
print >> o... | 24.833333 | 104 | 0.595078 |
0ab8ee8c950c7600ef4a6897d03166f6e6d5ba50 | 1,398 | py | Python | planet/admin.py | nakagami/planetplanet | c2148166b41260ca00c5a917d9923bde44c3c5c6 | [
"MIT"
] | 4 | 2018-02-05T16:08:59.000Z | 2021-05-16T15:17:35.000Z | planet/admin.py | nakagami/planetplanet | c2148166b41260ca00c5a917d9923bde44c3c5c6 | [
"MIT"
] | null | null | null | planet/admin.py | nakagami/planetplanet | c2148166b41260ca00c5a917d9923bde44c3c5c6 | [
"MIT"
] | 1 | 2020-01-19T17:15:10.000Z | 2020-01-19T17:15:10.000Z | ##############################################################################
# Copyright (c) 2010 Hajime Nakagami <nakagami@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | 49.928571 | 79 | 0.735336 |
44051d636dbe9387babd0b3c092d3a65405cafdd | 776 | py | Python | conman/redirects/migrations/0002_urlredirect.py | Ian-Foote/django-conman | 8505a39806f4a62fb11666a4d53c64c443968e36 | [
"BSD-2-Clause"
] | 2 | 2019-07-02T04:55:37.000Z | 2019-12-16T15:11:19.000Z | conman/redirects/migrations/0002_urlredirect.py | Ian-Foote/django-conman | 8505a39806f4a62fb11666a4d53c64c443968e36 | [
"BSD-2-Clause"
] | null | null | null | conman/redirects/migrations/0002_urlredirect.py | Ian-Foote/django-conman | 8505a39806f4a62fb11666a4d53c64c443968e36 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('routes', '0003_add_validators'),
('redirects', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 27.714286 | 143 | 0.55799 |
bea56c23cfeba4e690d85e29b5e05cd58d93941b | 70,378 | py | Python | airflow/providers/google/cloud/operators/dataproc.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | airflow/providers/google/cloud/operators/dataproc.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 1 | 2019-05-14T14:32:40.000Z | 2019-05-14T14:32:40.000Z | airflow/providers/google/cloud/operators/dataproc.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 41.156725 | 150 | 0.642033 |
f986e623962b1fc84eb5238f0f042028c81962a5 | 12,296 | py | Python | tf-lstm-crf-batch/train.py | adapt-sjtu/novelner | a8f54ffe3360a4fdfa4b154a6668e74459a61ec3 | [
"Apache-2.0"
] | 8 | 2017-06-08T09:48:25.000Z | 2020-07-09T10:51:36.000Z | tf-lstm-crf-batch/train.py | adapt-sjtu/novelner | a8f54ffe3360a4fdfa4b154a6668e74459a61ec3 | [
"Apache-2.0"
] | 1 | 2018-07-07T12:38:25.000Z | 2018-07-07T12:38:25.000Z | tf-lstm-crf-batch/train.py | adapt-sjtu/novelner | a8f54ffe3360a4fdfa4b154a6668e74459a61ec3 | [
"Apache-2.0"
] | 4 | 2018-01-13T01:37:51.000Z | 2019-08-05T12:25:32.000Z | #!/usr/bin/env python
import os
import datetime
import numpy as np
import optparse
from collections import OrderedDict
from utils import create_input_batch
import loader
from utils import models_path, models_saver_path, evaluate
from loader import word_mapping, char_mapping, tag_mapping
from loader import prepare_dat... | 38.186335 | 205 | 0.635166 |
1907f6547ba0aaf3cbc0ead8857a9678ae9893a2 | 5,859 | py | Python | examples/matplotlib/example1_mpl.py | bsipocz/ginga | 766995b47851661dece5739297544864de35a486 | [
"BSD-3-Clause"
] | null | null | null | examples/matplotlib/example1_mpl.py | bsipocz/ginga | 766995b47851661dece5739297544864de35a486 | [
"BSD-3-Clause"
] | null | null | null | examples/matplotlib/example1_mpl.py | bsipocz/ginga | 766995b47851661dece5739297544864de35a486 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
#
# example1_mpl.py -- Simple, configurable FITS viewer using a matplotlib
# QtAgg backend for Ginga and embedded in a Qt program.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD li... | 29.892857 | 82 | 0.587302 |
0b98ca13c2bf4b0c06452f10d0f87b47862a74b8 | 3,916 | py | Python | extraPackages/pyzmq-17.1.2/zmqversion.py | dolboBobo/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 130 | 2018-02-03T10:25:54.000Z | 2022-03-25T22:27:22.000Z | extraPackages/pyzmq-17.1.2/zmqversion.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 9 | 2018-12-14T07:31:42.000Z | 2020-12-09T20:29:28.000Z | extraPackages/pyzmq-17.1.2/zmqversion.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | """A simply script to scrape zmq.h for the zeromq version.
This is similar to the version.sh script in a zeromq source dir, but
it searches for an installed header, rather than in the current dir.
"""
# Copyright (c) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from __future__ import wi... | 32.633333 | 105 | 0.615935 |
653be7cd2b13b306c4a99d5461a8054228369dcd | 1,076 | py | Python | curso-python/CursoemVideo/desafio056.py | matheusbus/Curso-Python-3-Mundo-01 | 1517905319b906f3e03263c335f93f2b8567f7a2 | [
"MIT"
] | null | null | null | curso-python/CursoemVideo/desafio056.py | matheusbus/Curso-Python-3-Mundo-01 | 1517905319b906f3e03263c335f93f2b8567f7a2 | [
"MIT"
] | null | null | null | curso-python/CursoemVideo/desafio056.py | matheusbus/Curso-Python-3-Mundo-01 | 1517905319b906f3e03263c335f93f2b8567f7a2 | [
"MIT"
] | null | null | null | # Desenvolva um programa que leia o nome, idade e sexo de QUATRO pessoas.
# No final mostre:
# - A média de idade do grupo;
# - Qual é o nome do homem mais velho;
# - Quantas mulheres tem menos de 20 anos.
np = 1
idades = 0
ihmv = 0
qmm = 0
for c in range(1, 5):
print('==== {}° PESSOA ===='.format(c))
nome = s... | 32.606061 | 84 | 0.613383 |
1071eb6c70bfbd131f02e0eaada59f116a081502 | 10,305 | py | Python | improver_tests/metadata/test_amend.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver_tests/metadata/test_amend.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver_tests/metadata/test_amend.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 41.552419 | 88 | 0.677244 |
0c613541329f30ec5e9597016452b594b8512847 | 1,508 | py | Python | tensorboard_plugin/tensorboard_plugin_fairness_indicators/demo.py | kevinrobinson/fairness-indicators | c25719613529a1974b354e581311e6a55a68f8b7 | [
"Apache-2.0"
] | 248 | 2019-09-30T23:05:30.000Z | 2022-03-25T03:20:53.000Z | tensorboard_plugin/tensorboard_plugin_fairness_indicators/demo.py | kevinrobinson/fairness-indicators | c25719613529a1974b354e581311e6a55a68f8b7 | [
"Apache-2.0"
] | 147 | 2020-01-09T23:55:48.000Z | 2022-03-23T21:24:04.000Z | tensorboard_plugin/tensorboard_plugin_fairness_indicators/demo.py | kevinrobinson/fairness-indicators | c25719613529a1974b354e581311e6a55a68f8b7 | [
"Apache-2.0"
] | 87 | 2019-11-06T14:53:46.000Z | 2022-03-07T19:40:29.000Z | # Copyright 2019 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 applica... | 31.416667 | 80 | 0.72679 |
f30a16a56fdca9f09f2da611e8076c017ca529a1 | 1,604 | py | Python | packages/jet_bridge_base/jet_bridge_base/serializers/model_description.py | F2210/jet-bridge | 72b1af5cd7df585a4026d65170d3607f8cdf6bea | [
"MIT"
] | null | null | null | packages/jet_bridge_base/jet_bridge_base/serializers/model_description.py | F2210/jet-bridge | 72b1af5cd7df585a4026d65170d3607f8cdf6bea | [
"MIT"
] | null | null | null | packages/jet_bridge_base/jet_bridge_base/serializers/model_description.py | F2210/jet-bridge | 72b1af5cd7df585a4026d65170d3607f8cdf6bea | [
"MIT"
] | null | null | null | from jet_bridge_base import fields as fields_
from jet_bridge_base.serializers.serializer import Serializer
class ModelDescriptionFieldSerializer(Serializer):
name = fields_.CharField()
db_column = fields_.CharField()
field = fields_.CharField()
db_field = fields_.CharField()
filterable = fields_.... | 38.190476 | 63 | 0.758105 |
6cba9a868cd2c88eadd7da1e836019cf2483b0b6 | 38,987 | py | Python | bot/TabletopBot.py | jjcf89/Tabletop-Bot | 242aadda8c50a751cdef1615ce4cdd769b588400 | [
"MIT"
] | null | null | null | bot/TabletopBot.py | jjcf89/Tabletop-Bot | 242aadda8c50a751cdef1615ce4cdd769b588400 | [
"MIT"
] | null | null | null | bot/TabletopBot.py | jjcf89/Tabletop-Bot | 242aadda8c50a751cdef1615ce4cdd769b588400 | [
"MIT"
] | null | null | null | import asyncio
import configparser
import html
import re
import os
from datetime import datetime, timedelta
import discord
import requests
from aiohttp.errors import ClientOSError
from bs4 import BeautifulSoup
from sqlalchemy import func, desc
from .models.Messages import Message
from .Base import Sessi... | 43.463768 | 120 | 0.596147 |
40664c83c2fe612e93614866c7132f681fb47917 | 23,198 | py | Python | improver/utilities/cube_manipulation.py | VictoriaLouiseS/improver | 86470bff973e21fbd5f24e26047871ad3bc2f3db | [
"BSD-3-Clause"
] | null | null | null | improver/utilities/cube_manipulation.py | VictoriaLouiseS/improver | 86470bff973e21fbd5f24e26047871ad3bc2f3db | [
"BSD-3-Clause"
] | 3 | 2020-04-25T12:55:42.000Z | 2020-07-23T11:50:46.000Z | improver/utilities/cube_manipulation.py | Kat-90/improver | a5c31be3430df429ae38e7c16e267fcbc2af1858 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2020 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 36.998405 | 86 | 0.625054 |
f50a75fc4dbce05b976da7d8cd0b1ba4bdb4dc62 | 2,653 | py | Python | myshop/settings.py | Slohn/myshop | 4e5034dc3b1561773060319f16628d44910c4a20 | [
"MIT"
] | null | null | null | myshop/settings.py | Slohn/myshop | 4e5034dc3b1561773060319f16628d44910c4a20 | [
"MIT"
] | null | null | null | myshop/settings.py | Slohn/myshop | 4e5034dc3b1561773060319f16628d44910c4a20 | [
"MIT"
] | null | null | null |
import os
s: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '-g2(q&=rgat-q-%uvi^k1@p!*^ouvzt4o^mf&8j+*vunxvgzxa'
DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
... | 21.569106 | 91 | 0.660761 |
c4038d8aadf59f507a5ede8a0feb3a500cf6c62d | 5,753 | py | Python | wg.py | numbbbbb/llkwg | 73b824a4f6d9c69ce375a6c8940b6de9f29c4a29 | [
"Xnet",
"X11"
] | 1 | 2015-01-02T01:52:58.000Z | 2015-01-02T01:52:58.000Z | wg.py | numbbbbb/llkwg | 73b824a4f6d9c69ce375a6c8940b6de9f29c4a29 | [
"Xnet",
"X11"
] | null | null | null | wg.py | numbbbbb/llkwg | 73b824a4f6d9c69ce375a6c8940b6de9f29c4a29 | [
"Xnet",
"X11"
] | null | null | null | #coding:UTF-8
import itertools, operator, time, sys, threading,os
import ctypes, win32con, ctypes.wintypes, win32gui
import autopy, Image, ImageGrab
import random
L, T = 5, 28
fx, fy = L+11, T+155
EXIT = False
START = False
standard = {}
matches = {}
finishgrab = 0
startclick = False
notmatch = True
las... | 35.95625 | 99 | 0.481488 |
46b7ee76cc78a1500bafbda6e4fde8d2c3475be7 | 393 | py | Python | musicapi/asgi.py | H-M-Khalid-Mahmud/JioSaavn_API | f706ea0662d8d46941938d74ec90d27cfc668c20 | [
"BSD-3-Clause"
] | 17 | 2020-12-16T15:35:44.000Z | 2022-03-21T12:36:52.000Z | musicapi/asgi.py | H-M-Khalid-Mahmud/JioSaavn_API | f706ea0662d8d46941938d74ec90d27cfc668c20 | [
"BSD-3-Clause"
] | 3 | 2021-08-06T08:47:00.000Z | 2022-03-31T08:20:07.000Z | musicapi/asgi.py | H-M-Khalid-Mahmud/JioSaavn_API | f706ea0662d8d46941938d74ec90d27cfc668c20 | [
"BSD-3-Clause"
] | 12 | 2021-01-31T04:16:53.000Z | 2022-03-21T12:37:00.000Z | """
ASGI config for musicapi 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.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
8e4e8fc833d8558382c501cfe8e6de63f65d2a0b | 72 | py | Python | jacdac/bit_radio/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-15T21:30:36.000Z | 2022-02-15T21:30:36.000Z | jacdac/bit_radio/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | null | null | null | jacdac/bit_radio/__init__.py | microsoft/jacdac-python | 712ad5559e29065f5eccb5dbfe029c039132df5a | [
"MIT"
] | 1 | 2022-02-08T19:32:45.000Z | 2022-02-08T19:32:45.000Z | # Autogenerated file.
from .client import BitRadioClient # type: ignore
| 24 | 49 | 0.791667 |
daaab09580c7409d032dca4ac8303f4c9e6f543d | 2,810 | py | Python | src/rubrix/server/tasks/api.py | davidkartchner/rubrix | 33faa006d7498a806a9fd594036d4a42c7d70da2 | [
"Apache-2.0"
] | 1 | 2022-01-06T09:05:06.000Z | 2022-01-06T09:05:06.000Z | src/rubrix/server/tasks/api.py | davidkartchner/rubrix | 33faa006d7498a806a9fd594036d4a42c7d70da2 | [
"Apache-2.0"
] | null | null | null | src/rubrix/server/tasks/api.py | davidkartchner/rubrix | 33faa006d7498a806a9fd594036d4a42c7d70da2 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021-present, the Recognai S.L. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 35.56962 | 87 | 0.813879 |
baa43e5b9d5c2dc2878341b172bc623f16433697 | 15,666 | py | Python | python/pyspark/testing/pandasutils.py | ILuffZhe/spark | 4bc6e19dde0eae5d100b7bfdfcf22e719fd59cb5 | [
"Apache-2.0"
] | 1 | 2022-02-09T19:02:18.000Z | 2022-02-09T19:02:18.000Z | python/pyspark/testing/pandasutils.py | ArvinZheng/spark | b30a080398ba1092093ea3bbd62bdb3a3ce8de03 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2018-06-14T11:15:27.000Z | 2019-01-27T12:11:23.000Z | python/pyspark/testing/pandasutils.py | ArvinZheng/spark | b30a080398ba1092093ea3bbd62bdb3a3ce8de03 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-09-19T22:04:32.000Z | 2021-09-19T22:04:32.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 us... | 40.48062 | 100 | 0.591727 |
f4eb1013f46c57a3095d003dc024fa3d57ae2cdf | 1,624 | py | Python | chemml/models/classification/svm/svm.py | ZHENTAN007/Chem-Graph-Kernel-Machine | 963fdad2d0d6f2bfd962778caee0591b44ecbdcd | [
"MIT"
] | 7 | 2021-02-28T11:44:12.000Z | 2021-12-13T07:17:05.000Z | aims/ml/mgk/models/classification/svm/svm.py | Xiangyan93/AIMS | 1d0d6de03ef79d3cbfe2cd244f12c41d18acb61d | [
"MIT"
] | 2 | 2021-05-13T14:08:48.000Z | 2021-06-14T12:28:20.000Z | aims/ml/mgk/models/classification/svm/svm.py | Xiangyan93/AIMS | 1d0d6de03ef79d3cbfe2cd244f12c41d18acb61d | [
"MIT"
] | 4 | 2021-03-05T08:20:47.000Z | 2021-12-13T07:17:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import numpy as np
from sklearn.svm import SVC
class SVMClassifier(SVC):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._SVC = SVC(*args, **kwargs)
@property
def kernel_(self):
return self._SVC.... | 29.527273 | 72 | 0.519089 |
bbe4d0718ef051955ac735014050e9d60b499e2e | 195 | py | Python | settings/__init__.py | idan/pypostbin | 61dd1c0960e8fb6e4460a5623971cbbc78a55ee7 | [
"BSD-3-Clause"
] | 2 | 2015-11-05T08:51:42.000Z | 2016-03-01T22:13:25.000Z | settings/__init__.py | idan/pypostbin | 61dd1c0960e8fb6e4460a5623971cbbc78a55ee7 | [
"BSD-3-Clause"
] | null | null | null | settings/__init__.py | idan/pypostbin | 61dd1c0960e8fb6e4460a5623971cbbc78a55ee7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import os
if 'EPIO' in os.environ:
from .epio import *
else:
try:
from .local import *
except ImportError:
from .base import *
| 17.727273 | 38 | 0.651282 |
8cfcca3f67ff0a162da3e1292b0f14c83dd176f3 | 1,126 | py | Python | tareas/1/ChibrasLuis/funProf.py | Guadalupe-Moreno/sistop-2019-1 | fc537d7aafc3f81a2758a624a614b91a734620cf | [
"CC-BY-4.0"
] | 1 | 2018-09-27T09:39:26.000Z | 2018-09-27T09:39:26.000Z | tareas/1/ChibrasLuis/funProf.py | Guadalupe-Moreno/sistop-2019-1 | fc537d7aafc3f81a2758a624a614b91a734620cf | [
"CC-BY-4.0"
] | 46 | 2018-08-13T16:18:22.000Z | 2018-11-25T04:39:34.000Z | tareas/1/ChibrasLuis/funProf.py | Guadalupe-Moreno/sistop-2019-1 | fc537d7aafc3f81a2758a624a614b91a734620cf | [
"CC-BY-4.0"
] | 24 | 2018-08-12T23:15:54.000Z | 2018-08-30T07:01:05.000Z |
from threading import Semaphore, Thread
from time import sleep
from random import random,choice
def Asesoria(id_estudiante, cubiculo, profesor):
print("\tllego el Estudiante %d" % id_estudiante)
sleep(random())
cubiculo.acquire() # semáforo que permite regular que solo 3 alumnos estén dentro del cubículo
p... | 26.809524 | 127 | 0.72913 |
642ef22906327f2c0df6757ae55b9fc1af6e28d8 | 10,657 | py | Python | plotting.py | FionaLapp/theGame | d8072414d63685205f06f30dd0d5341b8dd30e49 | [
"Apache-2.0"
] | null | null | null | plotting.py | FionaLapp/theGame | d8072414d63685205f06f30dd0d5341b8dd30e49 | [
"Apache-2.0"
] | null | null | null | plotting.py | FionaLapp/theGame | d8072414d63685205f06f30dd0d5341b8dd30e49 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 27 11:19:45 2021
@author: Fiona
"""
import the_game
import numpy as np
import matplotlib.pyplot as plt
import game_logging
import plotting_constants as c
import os
# importing cProfile
import cProfile #to check what takes longest
NUMBER_OF_GAMES = 100
# #%% make plots ... | 49.337963 | 204 | 0.666416 |
a037b5569b8e5047a0764c1c9add39019d90c897 | 2,943 | py | Python | game/agent/doc_rep_module.py | laddie132/MD3 | 3df45918e33437e9a2309f7965f34f3a75621059 | [
"MIT"
] | 6 | 2021-02-07T03:20:29.000Z | 2021-04-09T03:34:51.000Z | game/agent/doc_rep_module.py | laddie132/MD3 | 3df45918e33437e9a2309f7965f34f3a75621059 | [
"MIT"
] | null | null | null | game/agent/doc_rep_module.py | laddie132/MD3 | 3df45918e33437e9a2309f7965f34f3a75621059 | [
"MIT"
] | 1 | 2021-12-14T15:42:40.000Z | 2021-12-14T15:42:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Han"
__email__ = "liuhan132@foxmail.com"
import os
import logging
import torch
from game.models import DocRepPTTrainModel, DocRepPTTestModel
from utils.functions import save_model, load_checkpoint_parameters
logger = logging.getLogger(__name__)
class DocR... | 37.730769 | 99 | 0.616718 |
c847e6210fb8bab76cd2a2bfb7fe9d09a99c656e | 5,743 | py | Python | histomicstk/deeplab/model_test.py | SarderLab/HistomicsTK_PodoSighter | 9a75302f645bfb3dfd9688d247388c9948f4eadb | [
"Apache-2.0"
] | null | null | null | histomicstk/deeplab/model_test.py | SarderLab/HistomicsTK_PodoSighter | 9a75302f645bfb3dfd9688d247388c9948f4eadb | [
"Apache-2.0"
] | null | null | null | histomicstk/deeplab/model_test.py | SarderLab/HistomicsTK_PodoSighter | 9a75302f645bfb3dfd9688d247388c9948f4eadb | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# 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
#
#... | 35.89375 | 87 | 0.648964 |
53b7c81ff89765d9555a0b56e8b6cb0862e23469 | 3,501 | py | Python | nova/tests/test_ipv6.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-02-21T19:19:11.000Z | 2020-02-21T19:19:11.000Z | nova/tests/test_ipv6.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | null | null | null | nova/tests/test_ipv6.py | bopopescu/nova_audit | 1cd2901802f82d39411adfa04cf2f432ff3bf280 | [
"Apache-2.0"
] | 1 | 2020-07-24T09:15:58.000Z | 2020-07-24T09:15:58.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 OpenStack Foundation
#
# 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/L... | 38.472527 | 78 | 0.586975 |
756c2be762cca0cfa7716518f1bb7d3882b0261f | 1,303 | py | Python | setup_exe.py | moonbot/storyTime | 262c90a527e5e86b9181b515efc86c78b1213b84 | [
"BSD-3-Clause"
] | 1 | 2015-12-02T02:25:49.000Z | 2015-12-02T02:25:49.000Z | setup_exe.py | moonbot/storyTime | 262c90a527e5e86b9181b515efc86c78b1213b84 | [
"BSD-3-Clause"
] | null | null | null | setup_exe.py | moonbot/storyTime | 262c90a527e5e86b9181b515efc86c78b1213b84 | [
"BSD-3-Clause"
] | null | null | null | from distutils.core import setup
import py2exe
import os
import sys
import shutil
import fnmatch
pyDir = os.path.dirname(sys.executable)
pysideDir = os.path.join(pyDir, 'Lib/site-packages/PySide')
qtconf = '[PATHS]\nBinaries=.\nPlugins=plugins'
ico = 'storyTime/images/StoryTime.ico'
uiDir = 'storyTime/views'
uiFiles ... | 27.145833 | 89 | 0.634689 |
4f7154d2f1ea93174ea21745215120bca62fbc80 | 1,817 | py | Python | images/tests.py | imalexianne/Gallery | 97e77ff43fd10495e9c709a918db849874223b65 | [
"MIT"
] | null | null | null | images/tests.py | imalexianne/Gallery | 97e77ff43fd10495e9c709a918db849874223b65 | [
"MIT"
] | null | null | null | images/tests.py | imalexianne/Gallery | 97e77ff43fd10495e9c709a918db849874223b65 | [
"MIT"
] | null | null | null | from django.test import TestCase
from .models import Image,Location,Category
# Create your tests here.
class ImageTestClass(TestCase):
# # Set up method
# def setUp(self):
# self.james= Editor(first_name = 'James', last_name ='Muriuki', email ='james@moringaschool.com')
# # Testing instance
... | 28.84127 | 115 | 0.623555 |
7390160f921017bdf6b94832a562a1e43a22ea65 | 6,377 | py | Python | smqtk_descriptors/interfaces/descriptor_set.py | bardkw/SMQTK-Descriptors | 21b449a64f4e19588c5e10e8ffe63473c7891610 | [
"BSD-3-Clause"
] | 2 | 2021-03-16T15:02:14.000Z | 2021-03-16T15:49:28.000Z | smqtk_descriptors/interfaces/descriptor_set.py | bardkw/SMQTK-Descriptors | 21b449a64f4e19588c5e10e8ffe63473c7891610 | [
"BSD-3-Clause"
] | 13 | 2021-03-15T17:06:03.000Z | 2022-02-09T20:42:07.000Z | smqtk_descriptors/interfaces/descriptor_set.py | bardkw/SMQTK-Descriptors | 21b449a64f4e19588c5e10e8ffe63473c7891610 | [
"BSD-3-Clause"
] | 2 | 2021-03-22T14:41:00.000Z | 2021-11-04T13:34:04.000Z | import abc
from typing import Hashable, Iterable, Iterator, List, Optional, Tuple
from warnings import warn
import numpy as np
from smqtk_core import Configurable, Pluggable
from smqtk_descriptors import DescriptorElement
class DescriptorSet (Configurable, Pluggable):
"""
Index of descriptors, keyed and quer... | 32.702564 | 93 | 0.65846 |
f457f25bd99d71d2c7199ef73954639db3b2f121 | 6,430 | py | Python | kubernetes/client/models/v1_list_meta.py | scele/kubernetes-client-python | 9e982cbdb5f19dc1a3935a75bdd92288f3b807fb | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_list_meta.py | scele/kubernetes-client-python | 9e982cbdb5f19dc1a3935a75bdd92288f3b807fb | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_list_meta.py | scele/kubernetes-client-python | 9e982cbdb5f19dc1a3935a75bdd92288f3b807fb | [
"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.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | 35.136612 | 523 | 0.632815 |
65f002a8de2c5ba95cf0e213874f17d2c563de43 | 1,236 | py | Python | tests/test_mnemonic_generation.py | NachE/seedsigner | 43abe96f2f2191a3a42c72704a4df8cab5f8e440 | [
"MIT"
] | 245 | 2020-12-14T15:26:25.000Z | 2022-03-31T19:57:08.000Z | tests/test_mnemonic_generation.py | btcpuertorico/seedsigner | 9750c927bb8a3363d4c607d037a877221a5ffc95 | [
"MIT"
] | 119 | 2020-12-15T18:55:28.000Z | 2022-03-30T19:28:54.000Z | tests/test_mnemonic_generation.py | btcpuertorico/seedsigner | 9750c927bb8a3363d4c607d037a877221a5ffc95 | [
"MIT"
] | 69 | 2020-12-25T17:48:50.000Z | 2022-03-31T22:27:03.000Z | import random
from embit import bip39
from seedsigner.helpers import mnemonic_generation
def test_dice_rolls():
""" Given 99 random dice rolls, the resulting mnemonic should be valid. """
dice_rolls = ""
for i in range(0, 99):
# Do not need truly rigorous random for this test
dice_rolls ... | 37.454545 | 168 | 0.741909 |
29084f920ba4c5048f67511b0cc211c712fd5e34 | 1,435 | py | Python | setup.py | nelsonguillerm7/django-tracing | 3ff51a4cb97ab8462ae4d9bae5b58ed5c8961f97 | [
"MIT"
] | null | null | null | setup.py | nelsonguillerm7/django-tracing | 3ff51a4cb97ab8462ae4d9bae5b58ed5c8961f97 | [
"MIT"
] | null | null | null | setup.py | nelsonguillerm7/django-tracing | 3ff51a4cb97ab8462ae4d9bae5b58ed5c8961f97 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="django-tracing", # Replace with your own username
version="1.0.5",
author="Denis Siavichay",
author_email="dbsiavichay@gmail.com",
description="A Django app for tracing changes in models",... | 35.875 | 61 | 0.6 |
dd5657525aaa9841b42dd9978bd8d345158101f9 | 2,353 | py | Python | services/catalog/src/simcore_service_catalog/db/repositories/dags.py | Surfict/osparc-simcore | 1e0b89574ec17ecb089674f9e5daa83d624430c8 | [
"MIT"
] | null | null | null | services/catalog/src/simcore_service_catalog/db/repositories/dags.py | Surfict/osparc-simcore | 1e0b89574ec17ecb089674f9e5daa83d624430c8 | [
"MIT"
] | 16 | 2021-10-04T20:31:52.000Z | 2022-03-14T04:31:25.000Z | services/catalog/src/simcore_service_catalog/db/repositories/dags.py | Surfict/osparc-simcore | 1e0b89574ec17ecb089674f9e5daa83d624430c8 | [
"MIT"
] | null | null | null | import json
from typing import List, Optional
import sqlalchemy as sa
from aiopg.sa.result import RowProxy
from ...models.domain.dag import DAGAtDB
from ...models.schemas.dag import DAGIn
from ..tables import dags
from ._base import BaseRepository
class DAGsRepository(BaseRepository):
async def list_dags(self) ... | 35.119403 | 76 | 0.560561 |
113ef95de02915923dade242c664e7a4d9365bf8 | 21,546 | py | Python | solo/cli/key.py | trustcrypto/solo-python | 786034139fcbe57e997449bfbc25f1f3d868ad95 | [
"Apache-2.0",
"MIT"
] | null | null | null | solo/cli/key.py | trustcrypto/solo-python | 786034139fcbe57e997449bfbc25f1f3d868ad95 | [
"Apache-2.0",
"MIT"
] | null | null | null | solo/cli/key.py | trustcrypto/solo-python | 786034139fcbe57e997449bfbc25f1f3d868ad95 | [
"Apache-2.0",
"MIT"
] | 3 | 2021-01-12T05:42:15.000Z | 2021-11-20T16:14:38.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 SoloKeys Developers
#
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
# http://opensource.org/licenses/MIT>, at your option. This file may not be
# copied, modified, or distribute... | 33.456522 | 153 | 0.640676 |
762c6672036235e177c2ee3ea43fde9c1f91981c | 26,079 | py | Python | lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py | adrn/matplotlib | 7a9f2347a3b1c1efaef6e547930661a547c20ef2 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py | adrn/matplotlib | 7a9f2347a3b1c1efaef6e547930661a547c20ef2 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py | adrn/matplotlib | 7a9f2347a3b1c1efaef6e547930661a547c20ef2 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """
An experimental support for curvilinear grid.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import six
from six.moves import zip
from itertools import chain
from .grid_finder import GridFinder
from .axislines import AxisArtistHelper, GridHelperBase
from .axis_artist imp... | 33.693798 | 90 | 0.563902 |
690b9b78645bbd8f7bfc33d48ec78e43d253dad5 | 32,372 | py | Python | arviz/stats/density_utils.py | nhtsai/arviz | c3a972547209a0163828de7636adfd93763342b1 | [
"Apache-2.0"
] | null | null | null | arviz/stats/density_utils.py | nhtsai/arviz | c3a972547209a0163828de7636adfd93763342b1 | [
"Apache-2.0"
] | null | null | null | arviz/stats/density_utils.py | nhtsai/arviz | c3a972547209a0163828de7636adfd93763342b1 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=invalid-name,too-many-lines
"""Density estimation functions for ArviZ."""
import warnings
import numpy as np
from scipy.fftpack import fft
from scipy.optimize import brentq
from scipy.signal import convolve, convolve2d, gaussian # pylint: disable=no-name-in-module
from scipy.sparse import coo_matrix... | 32.019782 | 100 | 0.61788 |
3bb9c99bd75b3ad102895c0aa26b7441ef923fa3 | 4,800 | py | Python | geneticalg/helper/selection.py | nickinack/Genesis | 1e3c76460855001ec626eaf6e4e2f63e7acfe2ae | [
"MIT"
] | 3 | 2020-12-07T13:30:49.000Z | 2020-12-07T13:33:36.000Z | geneticalg/helper/selection.py | nickinack/Library | 1e3c76460855001ec626eaf6e4e2f63e7acfe2ae | [
"MIT"
] | 4 | 2020-10-18T04:26:43.000Z | 2020-11-16T06:06:07.000Z | geneticalg/helper/selection.py | nickinack/Library | 1e3c76460855001ec626eaf6e4e2f63e7acfe2ae | [
"MIT"
] | 5 | 2020-10-07T17:11:27.000Z | 2020-11-23T19:00:58.000Z | """Defines all the available selection methods"""
import numpy as np
import random
from .misc import binSearch, makeWheel
import sys
import math
def proportional_roulette_wheel(population, N):
""" Performs roulette wheel selection:
every individual can become a parent with a
probability which is proportio... | 28.742515 | 103 | 0.660417 |
64fb0f6fa7e7173a03ebbd9e555071f421cd51b4 | 2,961 | py | Python | src/unicon/plugins/ironware/service_implementation.py | TestingBytes/unicon.plugins | 0600956d805deb4fd790aa3ef591c5d659e85de1 | [
"Apache-2.0"
] | 18 | 2019-11-23T23:14:53.000Z | 2022-01-10T01:17:08.000Z | src/unicon/plugins/ironware/service_implementation.py | TestingBytes/unicon.plugins | 0600956d805deb4fd790aa3ef591c5d659e85de1 | [
"Apache-2.0"
] | 12 | 2020-11-09T20:39:25.000Z | 2022-03-22T12:46:59.000Z | src/unicon/plugins/ironware/service_implementation.py | TestingBytes/unicon.plugins | 0600956d805deb4fd790aa3ef591c5d659e85de1 | [
"Apache-2.0"
] | 32 | 2020-02-12T15:42:22.000Z | 2022-03-15T16:42:10.000Z | """
Module:
unicon.plugins.ironware.service_implementation
Author:
James Di Trapani <james@ditrapani.com.au> - https://github.com/jamesditrapani
Description:
This subpackage defines services specific to the Ironware NOS
"""
from unicon.bases.routers.services import BaseService
from unicon.plugins.generic... | 30.525773 | 81 | 0.624451 |
38a6899bdd18bdd3c953ad7be3099ddbace54b5f | 17,386 | py | Python | venv/lib/python3.8/site-packages/ansible_collections/infoblox/nios_modules/plugins/modules/nios_member.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/infoblox/nios_modules/plugins/modules/nios_member.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/infoblox/nios_modules/plugins/modules/nios_member.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2018-2019 Red Hat, Inc.
# Copyright (c) 2020 Infoblox, Inc.
# 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
DOCUMENTATION = '''
---
module: nios_member
a... | 30.184028 | 151 | 0.602151 |
f2e1b0c32ddbeb5a1a244135c466be0d78f084d8 | 18,820 | py | Python | qutip/wigner.py | arnelg/qutip | 781856e8f41254884844f9c1c9e76f2a1f4e78ed | [
"BSD-3-Clause"
] | 1 | 2019-03-14T13:35:05.000Z | 2019-03-14T13:35:05.000Z | qutip/wigner.py | arnelg/qutip | 781856e8f41254884844f9c1c9e76f2a1f4e78ed | [
"BSD-3-Clause"
] | null | null | null | qutip/wigner.py | arnelg/qutip | 781856e8f41254884844f9c1c9e76f2a1f4e78ed | [
"BSD-3-Clause"
] | 1 | 2020-11-20T16:40:52.000Z | 2020-11-20T16:40:52.000Z | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | 32.226027 | 92 | 0.545749 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.