hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f701c8ef1deceba47a5c1182c16f3b55f0c6f6ff | 85,881 | py | Python | src/jack.py | zynthian/jackclient-python | e86ee6e82af707bfb34bfac4d53ef3c5f665f65b | [
"MIT"
] | null | null | null | src/jack.py | zynthian/jackclient-python | e86ee6e82af707bfb34bfac4d53ef3c5f665f65b | [
"MIT"
] | null | null | null | src/jack.py | zynthian/jackclient-python | e86ee6e82af707bfb34bfac4d53ef3c5f665f65b | [
"MIT"
] | 1 | 2022-01-10T12:36:53.000Z | 2022-01-10T12:36:53.000Z | # Copyright (c) 2014-2015 Matthias Geier
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish,... | 34.741505 | 97 | 0.616958 |
__version__ = '0.4.3'
from ctypes.util import find_library as _find_library
import errno as _errno
import platform as _platform
import warnings as _warnings
from _jack import ffi as _ffi
if _platform.system() == 'Windows':
if _platform.architecture()[0] == '64bit':
_libname = _find_li... | true | true |
f701c97318788c77594229bcd305aa762690af71 | 15,444 | py | Python | yaxil/bids/__init__.py | AMP-SCZ/yaxil | 13ec90df8565930702c9f173182dcaec8e8734e2 | [
"BSD-3-Clause"
] | null | null | null | yaxil/bids/__init__.py | AMP-SCZ/yaxil | 13ec90df8565930702c9f173182dcaec8e8734e2 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T01:05:42.000Z | 2022-01-05T18:22:39.000Z | yaxil/bids/__init__.py | AMP-SCZ/yaxil | 13ec90df8565930702c9f173182dcaec8e8734e2 | [
"BSD-3-Clause"
] | null | null | null | import re
import os
import glob
import json
import string
import logging
import subprocess as sp
import yaxil.commons as commons
logger = logging.getLogger(__name__)
# bids legal characters for sub, ses, and task
legal = re.compile('[^a-zA-Z0-9]')
def bids_from_config(yaxil_session, scans_metadata, config, out_base)... | 38.80402 | 101 | 0.559959 | import re
import os
import glob
import json
import string
import logging
import subprocess as sp
import yaxil.commons as commons
logger = logging.getLogger(__name__)
legal = re.compile('[^a-zA-Z0-9]')
def bids_from_config(yaxil_session, scans_metadata, config, out_base):
_item = next(iter(scans_metadata))
... | true | true |
f701c99be4ff76447f67b9cbb2dd1f257ff3916e | 30,823 | py | Python | yahoo_fin/stock_info.py | rokdd/yahoo_fin | da55c89582bc8e858131581da1bd380d19d68bf2 | [
"MIT"
] | null | null | null | yahoo_fin/stock_info.py | rokdd/yahoo_fin | da55c89582bc8e858131581da1bd380d19d68bf2 | [
"MIT"
] | null | null | null | yahoo_fin/stock_info.py | rokdd/yahoo_fin | da55c89582bc8e858131581da1bd380d19d68bf2 | [
"MIT"
] | null | null | null | import requests
import pandas as pd
import ftplib
import io
import re
import json
import datetime
try:
from requests_html import HTMLSession
except Exception:
print("""Warning - Certain functionality
requires requests_html, which is not installed.
Install ... | 29.666025 | 179 | 0.58677 | import requests
import pandas as pd
import ftplib
import io
import re
import json
import datetime
try:
from requests_html import HTMLSession
except Exception:
print("""Warning - Certain functionality
requires requests_html, which is not installed.
Install ... | true | true |
f701caa049f13a466bcf42bb60f125bec4bf7b7c | 18 | py | Python | mc/__init__.py | munasaber/djlib | 2066353ff718a6fe30dd8897f635ac0f4616b948 | [
"MIT"
] | null | null | null | mc/__init__.py | munasaber/djlib | 2066353ff718a6fe30dd8897f635ac0f4616b948 | [
"MIT"
] | null | null | null | mc/__init__.py | munasaber/djlib | 2066353ff718a6fe30dd8897f635ac0f4616b948 | [
"MIT"
] | null | null | null | from .mc import *
| 9 | 17 | 0.666667 | from .mc import *
| true | true |
f701cacdb2d327f91c1bbc2baa9f7012220e3c96 | 218 | py | Python | somebox/common/pathtool.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | 4 | 2017-12-25T10:36:15.000Z | 2018-01-01T10:42:34.000Z | somebox/common/pathtool.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | null | null | null | somebox/common/pathtool.py | ipkn/somebox | 1fedaa07236402269b8ad10dc9563f3d90aaead1 | [
"MIT"
] | null | null | null | import os
def find_base(p, bases):
for base_name, base_path in bases.items():
r = os.path.relpath(p, base_path)
if r and (r == '.' or r[0] != '.'):
return base_name, r
return None
| 21.8 | 46 | 0.550459 | import os
def find_base(p, bases):
for base_name, base_path in bases.items():
r = os.path.relpath(p, base_path)
if r and (r == '.' or r[0] != '.'):
return base_name, r
return None
| true | true |
f701cb9ade8c6b90ec926940c886e49ad6ab15a3 | 1,534 | py | Python | kinder/lambda_funcs.py | 42B/krampus | 738f00652abc93302db5b1205ab3ba45f2507463 | [
"MIT"
] | 54 | 2018-07-16T02:33:10.000Z | 2022-03-31T07:57:06.000Z | kinder/lambda_funcs.py | 42B/krampus | 738f00652abc93302db5b1205ab3ba45f2507463 | [
"MIT"
] | 12 | 2018-07-12T17:02:54.000Z | 2019-03-06T03:34:28.000Z | kinder/lambda_funcs.py | 42B/krampus | 738f00652abc93302db5b1205ab3ba45f2507463 | [
"MIT"
] | 10 | 2018-07-03T16:35:28.000Z | 2022-02-19T12:27:09.000Z | ###############################################################################
# Lambda kinder class
###############################################################################
# lambda is actionable dot ru
###############################################################################
# TODO:
####################... | 40.368421 | 106 | 0.470013 | true | true | |
f701cc90df7c8af6299601fb9178eb9a859c130c | 307 | py | Python | codigos/Cap02/ex2.1.py | skunkworksdev/Ifes_Algoritmo | 458ef73a304573c12b45d8afae38e13ae0f3354f | [
"MIT"
] | null | null | null | codigos/Cap02/ex2.1.py | skunkworksdev/Ifes_Algoritmo | 458ef73a304573c12b45d8afae38e13ae0f3354f | [
"MIT"
] | null | null | null | codigos/Cap02/ex2.1.py | skunkworksdev/Ifes_Algoritmo | 458ef73a304573c12b45d8afae38e13ae0f3354f | [
"MIT"
] | null | null | null | T = float(input("Entre com a temperatura que está agora: "))
if T >= 26.0 and T <= 36.0:
print("A temperatura está boa")
elif T > 36.0:
print("A temperatura está quente\n Tome bastante líquido")
elif T >= 15.0 and T < 26.0:
print("A temperatura está agradável")
else:
print("A temperatura esta fria")
| 27.909091 | 60 | 0.680782 | T = float(input("Entre com a temperatura que está agora: "))
if T >= 26.0 and T <= 36.0:
print("A temperatura está boa")
elif T > 36.0:
print("A temperatura está quente\n Tome bastante líquido")
elif T >= 15.0 and T < 26.0:
print("A temperatura está agradável")
else:
print("A temperatura esta fria")
| true | true |
f701cca3686904209fe1073f6449348e9c1f82a1 | 7,163 | py | Python | theano/sparse/sandbox/sp2.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | 1 | 2020-12-30T19:12:52.000Z | 2020-12-30T19:12:52.000Z | theano/sparse/sandbox/sp2.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | null | null | null | theano/sparse/sandbox/sp2.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import scipy.sparse
import theano
from theano import gof, tensor
from theano.gof.op import Op
from theano.sparse.basic import (
Remove0,
SparseType,
_is_sparse,
as_sparse_variable,
remove0,
)
# Also for compatibility
from theano.tensor import discrete_dtypes, float_dtypes
# Pr... | 32.265766 | 85 | 0.620969 | import numpy as np
import scipy.sparse
import theano
from theano import gof, tensor
from theano.gof.op import Op
from theano.sparse.basic import (
Remove0,
SparseType,
_is_sparse,
as_sparse_variable,
remove0,
)
from theano.tensor import discrete_dtypes, float_dtypes
# the perform() method twi... | true | true |
f701ccda92c2322adfba38a2ac93489f41755a14 | 400 | py | Python | getDoc/wsgi.py | srijannnd/GetDoc-API | 33ba87f0941f7a8e4b83a4fa85ec83a52b57e3d0 | [
"MIT"
] | null | null | null | getDoc/wsgi.py | srijannnd/GetDoc-API | 33ba87f0941f7a8e4b83a4fa85ec83a52b57e3d0 | [
"MIT"
] | null | null | null | getDoc/wsgi.py | srijannnd/GetDoc-API | 33ba87f0941f7a8e4b83a4fa85ec83a52b57e3d0 | [
"MIT"
] | null | null | null | """
WSGI config for getDoc project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 23.529412 | 78 | 0.7875 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'getDoc.settings.production')
application = get_wsgi_application()
| true | true |
f701cdf08acc2234f9c12d8d349622d596e0778f | 526 | py | Python | d2/poker/main.py | blurgyy/summer2019 | 62e5530c74fb77721768f984b3cfbd67c28595ba | [
"Apache-2.0"
] | 3 | 2019-09-06T01:13:56.000Z | 2020-03-18T03:10:53.000Z | d2/poker/main.py | blurgyy/summer2019 | 62e5530c74fb77721768f984b3cfbd67c28595ba | [
"Apache-2.0"
] | null | null | null | d2/poker/main.py | blurgyy/summer2019 | 62e5530c74fb77721768f984b3cfbd67c28595ba | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import deck
while(True):
p = deck.Deck()
p.shuffle()
pai = p.deal(5)
# assert len(pai) == 5, "??????"
del p
pai.sort(key=lambda x:x.figure)
x = True
for i in range(1, len(pai)):
if(pai[i].suit == pai[i-1].suit and (pai[i].figure == pai[i-1].figure + 1 or pai[i... | 21.916667 | 132 | 0.471483 |
import deck
while(True):
p = deck.Deck()
p.shuffle()
pai = p.deal(5)
del p
pai.sort(key=lambda x:x.figure)
x = True
for i in range(1, len(pai)):
if(pai[i].suit == pai[i-1].suit and (pai[i].figure == pai[i-1].figure + 1 or pai[i].figure == 10 and pai[i-1].figure == 1)):
... | true | true |
f701ce4be73d3f3af3e6256b3bb71ac213ac3103 | 4,318 | py | Python | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | eliot/dask.py | chenl/eliot | 8469e98aee19b3bd210515487ca48d9ec97aac6d | [
"Apache-2.0"
] | null | null | null | """Support for Eliot tracing with Dask computations."""
from pyrsistent import PClass, field
from dask import compute, optimize
from dask.core import toposort, get_dependencies
from . import start_action, current_action, Action, Message
class _RunWithEliotContext(PClass):
"""
Run a callable within an Eliot ... | 31.064748 | 79 | 0.629458 |
from pyrsistent import PClass, field
from dask import compute, optimize
from dask.core import toposort, get_dependencies
from . import start_action, current_action, Action, Message
class _RunWithEliotContext(PClass):
task_id = field(type=str)
func = field()
key = field(type=str)
dependencies = fie... | true | true |
f701cf88425ad59561c2f13828995c8ac4ce256c | 4,582 | py | Python | earo/event.py | meso5533/Laky-Earo | 67fa4f2b45596fc3dcfe1b6a54e12202e62cd860 | [
"Apache-2.0"
] | 1 | 2021-12-22T14:21:42.000Z | 2021-12-22T14:21:42.000Z | earo/event.py | Everley1993/Laky-Earo | 67fa4f2b45596fc3dcfe1b6a54e12202e62cd860 | [
"Apache-2.0"
] | null | null | null | earo/event.py | Everley1993/Laky-Earo | 67fa4f2b45596fc3dcfe1b6a54e12202e62cd860 | [
"Apache-2.0"
] | 1 | 2021-12-22T14:21:43.000Z | 2021-12-22T14:21:43.000Z | #!/usr/bin/python
# -*- coding:utf-8 -*-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Copyright 2016 Everley #
# #
# Licensed under the Apache License,... | 30.751678 | 87 | 0.494326 | true | true | |
f701cfcda0e7aeba57d87044b5234012ec3d46b3 | 4,184 | py | Python | dataloaders/combine_dbs.py | ZurMaD/DeepGrabCut-PyTorch | 13d9e81e6e438ad3394fb3a78aca26c2cc63c825 | [
"MIT"
] | 244 | 2018-06-16T07:52:56.000Z | 2022-03-12T21:45:30.000Z | dataloaders/combine_dbs.py | ZurMaD/DeepGrabCut-PyTorch | 13d9e81e6e438ad3394fb3a78aca26c2cc63c825 | [
"MIT"
] | 7 | 2018-08-21T13:08:06.000Z | 2021-08-25T04:04:59.000Z | dataloaders/combine_dbs.py | ZurMaD/DeepGrabCut-PyTorch | 13d9e81e6e438ad3394fb3a78aca26c2cc63c825 | [
"MIT"
] | 60 | 2018-07-26T15:47:10.000Z | 2022-01-02T13:59:56.000Z | import torch.utils.data as data
class CombineDBs(data.Dataset):
def __init__(self, dataloaders, excluded=None):
self.dataloaders = dataloaders
self.excluded = excluded
self.im_ids = []
# Combine object lists
for dl in dataloaders:
for elem in dl.im_ids:
... | 37.693694 | 121 | 0.580784 | import torch.utils.data as data
class CombineDBs(data.Dataset):
def __init__(self, dataloaders, excluded=None):
self.dataloaders = dataloaders
self.excluded = excluded
self.im_ids = []
for dl in dataloaders:
for elem in dl.im_ids:
if elem not i... | true | true |
f701d212f8744c7d1aa2560a5c9e1bb4b4483b75 | 3,913 | py | Python | teabot-slack/teabot.py | Emelieh21/brand-new-kettle-hack | 36a28b4953801c321ba7d11811bc22cbfe7c9d62 | [
"Unlicense"
] | 2 | 2017-04-03T22:57:15.000Z | 2017-04-03T22:59:57.000Z | teabot-slack/teabot.py | Emelieh21/brand-new-kettle-hack | 36a28b4953801c321ba7d11811bc22cbfe7c9d62 | [
"Unlicense"
] | null | null | null | teabot-slack/teabot.py | Emelieh21/brand-new-kettle-hack | 36a28b4953801c321ba7d11811bc22cbfe7c9d62 | [
"Unlicense"
] | null | null | null | import os
import time
from slackclient import SlackClient
import requests
import json
# starterbot's ID as an environment variable
BOT_ID = "<YOUR_BOT_ID>"
# constants
AT_BOT = "<@" + BOT_ID + ">"
MAKE_TEA_COMMAND = "make tea"
STOP_BOILING_COMMAND = "stop boiling"
# instantiate Slack & Twilio clients
slack_client = ... | 42.532609 | 116 | 0.661641 | import os
import time
from slackclient import SlackClient
import requests
import json
BOT_ID = "<YOUR_BOT_ID>"
# constants
AT_BOT = "<@" + BOT_ID + ">"
MAKE_TEA_COMMAND = "make tea"
STOP_BOILING_COMMAND = "stop boiling"
# instantiate Slack & Twilio clients
slack_client = SlackClient('<YOUR_SLACK_API_TOKEN>')
header... | false | true |
f701d45f0c4e24fdc3dba6acf4d40a703353740b | 7,254 | py | Python | autoload/vital/__vim_gista__/Web/API/github.py | lambdalisue/vim-gista | c046de1b9d4cf97ff6f80cf3bdbb75b1094f2aaf | [
"MIT"
] | 158 | 2015-01-07T14:32:12.000Z | 2022-03-23T04:17:40.000Z | vim/plugins/vim-gista/autoload/vital/__vim_gista__/Web/API/github.py | Raymond-yn/dotfiles | b1745ff62f4285785877a2c04d93ce8fa2775964 | [
"MIT"
] | 41 | 2015-01-29T13:50:39.000Z | 2021-02-22T14:11:15.000Z | autoload/vital/_github_auth/Web/API/github.py | momo-lab/github_auth.vim | 8e2e7b61d705368699d50ddff8150bea8dc166c9 | [
"MIT"
] | 10 | 2015-01-29T12:57:43.000Z | 2021-06-20T09:39:31.000Z | try:
import vim
except ImportError:
raise ImportError(
'"vim" is not available. This module require to be loaded from Vim.'
)
#
# NOTE
# Vim use a global namespace for python/python3 so define a unique name
# function and write a code inside of the function to prevent conflicts.
#
def _vim_vit... | 34.056338 | 78 | 0.560656 | try:
import vim
except ImportError:
raise ImportError(
'"vim" is not available. This module require to be loaded from Vim.'
)
def _vim_vital_web_api_github_main():
import re
import sys
import ssl
import collections
from itertools import chain
from threading import Lock... | true | true |
f701d5cc91a7627c4c17ffe3d7d861dcaa962752 | 900 | py | Python | scanner.py | xaviercho/port_scanner | c83891782c4d37524b9bf1face1165c7ae0b6820 | [
"MIT"
] | null | null | null | scanner.py | xaviercho/port_scanner | c83891782c4d37524b9bf1face1165c7ae0b6820 | [
"MIT"
] | null | null | null | scanner.py | xaviercho/port_scanner | c83891782c4d37524b9bf1face1165c7ae0b6820 | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
import socket
from datetime import datetime
#Defining our target
if len (sys.argv) == 2:
target=socket.gethostbyname(sys.argv[1]) #translate hostname to IPv4
else:
print("invalid amount of arguments.")
print("Syntax: python3 scanner.py <ip>")
#add a pretty banner
print("-" * 50)
print("... | 21.428571 | 69 | 0.703333 |
import sys
import socket
from datetime import datetime
if len (sys.argv) == 2:
target=socket.gethostbyname(sys.argv[1])
else:
print("invalid amount of arguments.")
print("Syntax: python3 scanner.py <ip>")
print("-" * 50)
print("Scanning target " + target)
print("Time started: " +str(datetime.now()))
print("-... | true | true |
f701d60a5f3be60144083a87cbb8236ccd34114a | 5,308 | py | Python | lib/pwiki/OsAbstract.py | ckolumbus/WikidPad.svn | 8f03c1105a8144c9a82e392ab7f32e263c533775 | [
"Apache-2.0"
] | 2 | 2019-02-24T08:53:20.000Z | 2019-09-25T02:11:17.000Z | lib/pwiki/OsAbstract.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | null | null | null | lib/pwiki/OsAbstract.py | jho1965us/WikidPad_fork_from_butscher | 559a16859ab5e77620f017356caa22fe65554192 | [
"Apache-2.0"
] | null | null | null | """
OS abstraction
"""
import os, shutil, os.path, re, traceback
import wx
from . import SystemInfo
from .StringOps import mbcsEnc, urlQuote, pathnameFromUrl, pathEnc
# import WindowsHacks
try:
import WindowsHacks
except:
if SystemInfo.isWindows():
traceback.print_exc()
Window... | 30.505747 | 82 | 0.646948 |
import os, shutil, os.path, re, traceback
import wx
from . import SystemInfo
from .StringOps import mbcsEnc, urlQuote, pathnameFromUrl, pathEnc
try:
import WindowsHacks
except:
if SystemInfo.isWindows():
traceback.print_exc()
WindowsHacks = None
try:
import GtkHacks
exce... | true | true |
f701d647f8fe822a2a2729383c44109685c2195f | 13,630 | py | Python | sdk/python/pulumi_azure/apimanagement/policy.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 109 | 2018-06-18T00:19:44.000Z | 2022-02-20T05:32:57.000Z | sdk/python/pulumi_azure/apimanagement/policy.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 663 | 2018-06-18T21:08:46.000Z | 2022-03-31T20:10:11.000Z | sdk/python/pulumi_azure/apimanagement/policy.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-07-19T22:37:38.000Z | 2022-03-14T10:56:26.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 44.110032 | 316 | 0.65818 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['PolicyArgs', 'Policy']
@pulumi.input_type
class PolicyArgs:
def __init__(__self__, *,
api_management_id: pulumi.Input[str],
... | true | true |
f701d7618a85844aeb01cd94452ad9a35deb367d | 3,321 | py | Python | backend/backend/settings.py | gabrielacham/e-store | 03118b04a37d2e32c89a576427734bd02a8c46fd | [
"MIT"
] | null | null | null | backend/backend/settings.py | gabrielacham/e-store | 03118b04a37d2e32c89a576427734bd02a8c46fd | [
"MIT"
] | null | null | null | backend/backend/settings.py | gabrielacham/e-store | 03118b04a37d2e32c89a576427734bd02a8c46fd | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 2.2.13.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 25.351145 | 91 | 0.696778 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'q-)uruwrq0lgi+fp=do3(nbh)$o_+fr4qzp5w&_n5$lq0$*ywx'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f701d79de132b4a6cd7e54e5a411a0f1e7ea9253 | 6,198 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_connections_response.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_connections_response.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_connections_response.py | gregmbi/polyaxon | 8f24089fa9cb5df28fc7b70aec27d6d23ee81e8d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 27.546667 | 86 | 0.592449 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1ListConnectionsResponse(object):
openapi_types = {
"count": "int",
"results": "list[V1ConnectionResponse]",
"previous": "str",
"next": "str",
}
attribut... | true | true |
f701d83453f612268763a247855c8cdd1e3ec468 | 1,393 | py | Python | test/sca/test_edit.py | scrambler-crypto/pyecsca | 491abfb548455669abd470382a48dcd07b2eda87 | [
"MIT"
] | null | null | null | test/sca/test_edit.py | scrambler-crypto/pyecsca | 491abfb548455669abd470382a48dcd07b2eda87 | [
"MIT"
] | null | null | null | test/sca/test_edit.py | scrambler-crypto/pyecsca | 491abfb548455669abd470382a48dcd07b2eda87 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
from pyecsca.sca import Trace, trim, reverse, pad
class EditTests(TestCase):
def setUp(self):
self._trace = Trace(np.array([10, 20, 30, 40, 50], dtype=np.dtype("i1")))
def test_trim(self):
result = trim(self._trace, 2)
self.assertIsN... | 33.97561 | 97 | 0.585068 | from unittest import TestCase
import numpy as np
from pyecsca.sca import Trace, trim, reverse, pad
class EditTests(TestCase):
def setUp(self):
self._trace = Trace(np.array([10, 20, 30, 40, 50], dtype=np.dtype("i1")))
def test_trim(self):
result = trim(self._trace, 2)
self.assertIsN... | true | true |
f701d83c8c0491098011e98966490d3b6a659777 | 21,807 | py | Python | venv/Lib/site-packages/shiboken2/files.dir/shibokensupport/signature/mapping.py | gabistoian/Hide-Text-in-image | 88b5ef0bd2bcb0e222cfbc7abf6ac2b869f72ec5 | [
"X11"
] | null | null | null | venv/Lib/site-packages/shiboken2/files.dir/shibokensupport/signature/mapping.py | gabistoian/Hide-Text-in-image | 88b5ef0bd2bcb0e222cfbc7abf6ac2b869f72ec5 | [
"X11"
] | null | null | null | venv/Lib/site-packages/shiboken2/files.dir/shibokensupport/signature/mapping.py | gabistoian/Hide-Text-in-image | 88b5ef0bd2bcb0e222cfbc7abf6ac2b869f72ec5 | [
"X11"
] | null | null | null | #############################################################################
##
## Copyright (C) 2019 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of Qt for Python.
##
## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may us... | 32.941088 | 107 | 0.647315 | "PyDate": datetime.date,
"sample.bool": bool,
"sample.char": int,
"sample.double": float,
"sample.int": int,
"sample.ObjectType": object,
"sample.OddBool": bool,
"sample.Photon.TemplateBase[Photon.DuplicatorType]": sample.Photon.ValueDuplicator,
"sampl... | true | true |
f701d937456c45c6727a342282dc55e55803f41c | 1,747 | py | Python | pyqt_ui.py | hacker-h/pyusb-keyboard-alike | ce892fbd8dac5ad72af628c993a3e12c076485d6 | [
"MIT"
] | 47 | 2015-02-09T11:39:03.000Z | 2022-03-29T00:55:21.000Z | pyqt_ui.py | hacker-h/pyusb-keyboard-alike | ce892fbd8dac5ad72af628c993a3e12c076485d6 | [
"MIT"
] | 12 | 2015-03-03T21:13:28.000Z | 2021-10-02T18:05:18.000Z | pyqt_ui.py | hacker-h/pyusb-keyboard-alike | ce892fbd8dac5ad72af628c993a3e12c076485d6 | [
"MIT"
] | 23 | 2015-02-19T13:46:32.000Z | 2021-07-31T18:57:55.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_example.ui'
#
# Created: Sun May 18 03:45:55 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | 36.395833 | 105 | 0.718947 |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _enc... | true | true |
f701d938aba4d8300cacab21080c0e69d8ac18c8 | 2,597 | py | Python | day05.py | spgill/AdventOfCode2021 | 58218062d64de12dac9761a30a1f9762d9a9ab6e | [
"MIT"
] | null | null | null | day05.py | spgill/AdventOfCode2021 | 58218062d64de12dac9761a30a1f9762d9a9ab6e | [
"MIT"
] | null | null | null | day05.py | spgill/AdventOfCode2021 | 58218062d64de12dac9761a30a1f9762d9a9ab6e | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
### stdlib imports
import pathlib
### local imports
import utils
@utils.part1
def part1(puzzleInput: str):
# Parse the coordinate pairs from the puzzle input
coordList = [
[
tuple(int(coord) for coord in pair.split(","))
for pair in line.split(" -> ")
... | 32.4625 | 99 | 0.58298 |
put: str):
coordList = [
[
tuple(int(coord) for coord in pair.split(","))
for pair in line.split(" -> ")
]
for line in puzzleInput.strip().splitlines()
]
part1Grid: dict[tuple[int, int], int] = {}
part2Grid: dict[tuple[int, int], int] = {}
... | true | true |
f701d957a50072dc59b5c2758115c26fdfc2caf8 | 2,245 | py | Python | database/api/ticket.py | aprilsanchez/ictf-framework | 2d37b5632b8ca8a4d90a9d84d689a023d19033cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | database/api/ticket.py | aprilsanchez/ictf-framework | 2d37b5632b8ca8a4d90a9d84d689a023d19033cf | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2022-01-13T03:58:43.000Z | 2022-03-12T01:01:29.000Z | database/api/ticket.py | aprilsanchez/ictf-framework | 2d37b5632b8ca8a4d90a9d84d689a023d19033cf | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from flask import request, abort, jsonify
from . import app, mysql
from utils import requires_auth
@requires_auth
@app.route("/tickets/add", methods=['POST'])
def submit_ticket():
team_id = request.form.get("team_id")
subject = request.form.get("sub... | 28.0625 | 96 | 0.628508 |
import json
from flask import request, abort, jsonify
from . import app, mysql
from utils import requires_auth
@requires_auth
@app.route("/tickets/add", methods=['POST'])
def submit_ticket():
team_id = request.form.get("team_id")
subject = request.form.get("subject")
msg = request.form.get("message")... | true | true |
f701da916352cb9069d9c0e76375bee26e2ffece | 3,959 | py | Python | quark/plugin_modules/routes.py | Cerberus98/quark | 53848e357a1b4d5d23f565963f22115d8997e38f | [
"Apache-2.0"
] | null | null | null | quark/plugin_modules/routes.py | Cerberus98/quark | 53848e357a1b4d5d23f565963f22115d8997e38f | [
"Apache-2.0"
] | null | null | null | quark/plugin_modules/routes.py | Cerberus98/quark | 53848e357a1b4d5d23f565963f22115d8997e38f | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Openstack Foundation
# 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 requ... | 40.397959 | 78 | 0.674665 |
import netaddr
from neutron.common import exceptions
from neutron import quota
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from quark import allocation_pool
from quark.db import api as db_api
from quark.db import models as db_models
from quark impor... | true | true |
f701da983fde9db5d64162d83f52c871e82c9ed0 | 17,783 | py | Python | rootfs/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_legendre.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | null | null | null | rootfs/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_legendre.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | null | null | null | rootfs/usr/lib/python3/dist-packages/numpy/polynomial/tests/test_legendre.py | kappaIO-Dev/kappaIO-sdk-armhf-crosscompile | 66fc5fc21e6235f7a3be72a7ccac68e2224b7fb2 | [
"MIT"
] | null | null | null | """Tests for legendre module.
"""
import numpy as np
import numpy.polynomial.legendre as leg
import numpy.polynomial.polynomial as poly
from numpy.testing import *
P0 = np.array([ 1])
P1 = np.array([ 0, 1])
P2 = np.array([-1, 0, 3])/2
P3 = np.array([ 0, -3, 0, 5])/2
P4 = np.array([ 3, 0, -30, 0, 35... | 33.053903 | 75 | 0.506495 |
import numpy as np
import numpy.polynomial.legendre as leg
import numpy.polynomial.polynomial as poly
from numpy.testing import *
P0 = np.array([ 1])
P1 = np.array([ 0, 1])
P2 = np.array([-1, 0, 3])/2
P3 = np.array([ 0, -3, 0, 5])/2
P4 = np.array([ 3, 0, -30, 0, 35])/8
P5 = np.array([ 0, 15, 0, ... | true | true |
f701dacd676f4efb3f3647cf1a9e39a5a8d89d55 | 3,508 | py | Python | google/ads/googleads/v6/services/services/google_ads_field_service/pagers.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/google_ads_field_service/pagers.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/services/services/google_ads_field_service/pagers.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.549451 | 101 | 0.691847 |
from typing import Any, Callable, Iterable, Sequence, Tuple
from google.ads.googleads.v6.resources.types import google_ads_field
from google.ads.googleads.v6.services.types import google_ads_field_service
class SearchGoogleAdsFieldsPager:
def __init__(
self,
method: Callable[
... | true | true |
f701dad2f113506e9b75c3b55da16c8042f59e05 | 869 | py | Python | torchmetrics/functional/audio/__init__.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 1 | 2021-09-14T23:34:48.000Z | 2021-09-14T23:34:48.000Z | torchmetrics/functional/audio/__init__.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 1 | 2021-10-16T05:02:56.000Z | 2021-12-15T07:02:17.000Z | torchmetrics/functional/audio/__init__.py | gagan3012/metrics | 5a2388ccaa97cc3608b1fa28879f77436434a6d6 | [
"Apache-2.0"
] | 2 | 2021-10-16T05:02:43.000Z | 2022-02-10T16:01:52.000Z | # Copyright The PyTorch Lightning 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 by applicable law or agreed to i... | 48.277778 | 78 | 0.779056 |
from torchmetrics.functional.audio.pit import pit, pit_permutate
from torchmetrics.functional.audio.si_sdr import si_sdr
from torchmetrics.functional.audio.si_snr import si_snr
from torchmetrics.functional.audio.snr import snr
| true | true |
f701dbb60581a894fa82d654ad38824ba276b7a5 | 4,113 | py | Python | model/seg_models/pspnet.py | AceCoooool/segmentation | 2f4d5ac193cab580eb8ba789e79db6dadcfecfd0 | [
"MIT"
] | 2 | 2019-06-08T13:09:08.000Z | 2020-09-21T04:03:09.000Z | model/seg_models/pspnet.py | AceCoooool/segmentation | 2f4d5ac193cab580eb8ba789e79db6dadcfecfd0 | [
"MIT"
] | 2 | 2019-05-20T11:56:02.000Z | 2019-06-02T13:22:55.000Z | model/seg_models/pspnet.py | AceCoooool/segmentation | 2f4d5ac193cab580eb8ba789e79db6dadcfecfd0 | [
"MIT"
] | 1 | 2020-09-22T03:55:39.000Z | 2020-09-22T03:55:39.000Z | """Pyramid Scene Parsing Network"""
import os
import torch
from torch import nn
import torch.nn.functional as F
from model.seg_models.segbase import SegBaseModel
from model.module.basic import _FCNHead
__all__ = ['PSPNet', 'get_psp',
'get_psp_resnet101_voc',
'get_psp_resnet101_citys']
# head
d... | 36.39823 | 106 | 0.644299 | import os
import torch
from torch import nn
import torch.nn.functional as F
from model.seg_models.segbase import SegBaseModel
from model.module.basic import _FCNHead
__all__ = ['PSPNet', 'get_psp',
'get_psp_resnet101_voc',
'get_psp_resnet101_citys']
def _PSP1x1Conv(in_channels, out_channels):... | true | true |
f701dc4aceb91f10edb6c0bfa86f3db68e475953 | 14,857 | py | Python | mechanicalsoup/stateful_browser.py | timgates42/MechanicalSoup | 0b04e8b9aed3a3e5160ac89081e2c270598c2f09 | [
"MIT"
] | null | null | null | mechanicalsoup/stateful_browser.py | timgates42/MechanicalSoup | 0b04e8b9aed3a3e5160ac89081e2c270598c2f09 | [
"MIT"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | mechanicalsoup/stateful_browser.py | timgates42/MechanicalSoup | 0b04e8b9aed3a3e5160ac89081e2c270598c2f09 | [
"MIT"
] | null | null | null | from __future__ import print_function
from six.moves import urllib
from .browser import Browser
from .utils import LinkNotFoundError
from .form import Form
import sys
import re
import bs4
class _BrowserState:
def __init__(self, page=None, url=None, form=None, request=None):
self.page = page
self.... | 39.408488 | 97 | 0.609006 | from __future__ import print_function
from six.moves import urllib
from .browser import Browser
from .utils import LinkNotFoundError
from .form import Form
import sys
import re
import bs4
class _BrowserState:
def __init__(self, page=None, url=None, form=None, request=None):
self.page = page
self.... | true | true |
f701dd00d32a4f319dc0dfd776cf299128e400bf | 781 | py | Python | authDemo/python/mongo_sandbox.py | borro0/Remote-BatterlylessSensorTestbed | caea8bd9490d55f86de31761b1cc8712b3ebf06d | [
"MIT"
] | null | null | null | authDemo/python/mongo_sandbox.py | borro0/Remote-BatterlylessSensorTestbed | caea8bd9490d55f86de31761b1cc8712b3ebf06d | [
"MIT"
] | null | null | null | authDemo/python/mongo_sandbox.py | borro0/Remote-BatterlylessSensorTestbed | caea8bd9490d55f86de31761b1cc8712b3ebf06d | [
"MIT"
] | null | null | null | from pymongo import MongoClient
from bson.objectid import ObjectId
import pprint
client = MongoClient()
db = client.auth_demo
collection = db.users
#myquery = {"local": {"testRuns": {"$elemMatch": {"_id": ObjectId("5c6c119e5724c9272ca7266d")}}}}
#myquery = {"local": {"testRuns": {"date": "20190219"}}}
#myquery = {"l... | 30.038462 | 97 | 0.699104 | from pymongo import MongoClient
from bson.objectid import ObjectId
import pprint
client = MongoClient()
db = client.auth_demo
collection = db.users
myquery = {"testRuns._id" : ObjectId('5c6d70ce5e0ee62337b47db3')}
newvalues = { "$set": { "local.testRuns.$.status": "done" } }
collection.update_one(myquery, ... | true | true |
f701dd084a73bcb11656e05d04be88875e0a57a1 | 184 | py | Python | ps2/test_Lect7.py | John-L-Jones-IV/6.0001 | e58620b7fd59aa369c6d75071311d2930b669d8e | [
"MIT"
] | null | null | null | ps2/test_Lect7.py | John-L-Jones-IV/6.0001 | e58620b7fd59aa369c6d75071311d2930b669d8e | [
"MIT"
] | null | null | null | ps2/test_Lect7.py | John-L-Jones-IV/6.0001 | e58620b7fd59aa369c6d75071311d2930b669d8e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from Lect7 import *
def test_abs():
""" Unit test for abs() """
failure = False
if not failure:
print('SUCESS')
print('Testing abs()...')
test_abs()
| 15.333333 | 29 | 0.619565 |
from Lect7 import *
def test_abs():
failure = False
if not failure:
print('SUCESS')
print('Testing abs()...')
test_abs()
| true | true |
f701dd49ac9a00d4f3244b00c3f11b44a7310995 | 7,545 | py | Python | nipy/io/imageformats/header_ufuncs.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | 1 | 2015-08-22T16:14:45.000Z | 2015-08-22T16:14:45.000Z | nipy/io/imageformats/header_ufuncs.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | null | null | null | nipy/io/imageformats/header_ufuncs.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | null | null | null | ''' Ufunc-like functions operating on Analyze headers '''
import numpy as np
from volumeutils import array_from_file, array_to_file, \
HeaderDataError, HeaderTypeError, \
calculate_scale, can_cast
def read_unscaled_data(hdr, fileobj):
''' Read raw (unscaled) data from ``fileobj``
Parameters
----... | 32.521552 | 95 | 0.616302 | ''' Ufunc-like functions operating on Analyze headers '''
import numpy as np
from volumeutils import array_from_file, array_to_file, \
HeaderDataError, HeaderTypeError, \
calculate_scale, can_cast
def read_unscaled_data(hdr, fileobj):
''' Read raw (unscaled) data from ``fileobj``
Parameters
----... | false | true |
f701de2c1d23a64551fa8d5ea8b116d1515678bb | 1,407 | py | Python | generator.py | akshay482/Discord-Token-Bruteforcer-Helper | b51845b145f8de867eb9e5ee152829803d104807 | [
"MIT"
] | 7 | 2021-05-17T22:36:39.000Z | 2021-11-29T13:00:28.000Z | generator.py | akshay482/Discord-Token-Bruteforcer-Helper | b51845b145f8de867eb9e5ee152829803d104807 | [
"MIT"
] | 4 | 2021-03-11T22:52:47.000Z | 2022-03-18T20:10:57.000Z | generator.py | akshay482/Discord-Token-Bruteforcer-Helper | b51845b145f8de867eb9e5ee152829803d104807 | [
"MIT"
] | 21 | 2021-03-21T13:07:12.000Z | 2022-03-27T14:50:33.000Z | import ctypes, os, threading, strgen, base64
tokenid = "4030200023"
class Discord:
def __init__(self):
self.regularExpression = ".([a-zA-Z0-9]{6})\.([a-zA-Z0-9]{27})" # This is the regular expression for discord.
self.generated = 0
def generate(self):
discordToken = strgen.S... | 34.317073 | 118 | 0.618337 | import ctypes, os, threading, strgen, base64
tokenid = "4030200023"
class Discord:
def __init__(self):
self.regularExpression = ".([a-zA-Z0-9]{6})\.([a-zA-Z0-9]{27})"
self.generated = 0
def generate(self):
discordToken = strgen.StringGenerator(self.regularExpression).render(... | true | true |
f701de88c351c8b4d1ced5a28d63e4d979a67525 | 164 | py | Python | library/forms.py | Elcaveman/Universias | 252a4bdaabbaa723d5afa9a070efd33c5d37ec87 | [
"MIT"
] | null | null | null | library/forms.py | Elcaveman/Universias | 252a4bdaabbaa723d5afa9a070efd33c5d37ec87 | [
"MIT"
] | 8 | 2021-03-19T03:06:36.000Z | 2022-01-13T02:41:19.000Z | library/forms.py | Elcaveman/Universias | 252a4bdaabbaa723d5afa9a070efd33c5d37ec87 | [
"MIT"
] | null | null | null | from django import forms
from .models import Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
exclude = ('timestamp' ,'owner')
| 16.4 | 40 | 0.652439 | from django import forms
from .models import Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
exclude = ('timestamp' ,'owner')
| true | true |
f701df068b2f136d27f5c1dacf5a101cbdf4bc52 | 2,388 | py | Python | search_tool.py | PabloEmidio/Findout-in-Comment | d57fab1e9333290366619f3fb0542708af53234c | [
"MIT"
] | 7 | 2021-05-28T11:23:10.000Z | 2021-11-16T11:09:18.000Z | search_tool.py | PabloEmidio/Findout-in-Comment | d57fab1e9333290366619f3fb0542708af53234c | [
"MIT"
] | null | null | null | search_tool.py | PabloEmidio/Findout-in-Comment | d57fab1e9333290366619f3fb0542708af53234c | [
"MIT"
] | 1 | 2021-08-02T02:45:08.000Z | 2021-08-02T02:45:08.000Z | import parsel, requests, asyncio, re
from typing import List
class InComment:
def __init__(self, optional_words: List[str]=[], remove_words: List[str]=[]) -> None:
self.might_sensitive_words = [
'user',
'password',
'import',
'login',
'.php',
... | 37.904762 | 125 | 0.567839 | import parsel, requests, asyncio, re
from typing import List
class InComment:
def __init__(self, optional_words: List[str]=[], remove_words: List[str]=[]) -> None:
self.might_sensitive_words = [
'user',
'password',
'import',
'login',
'.php',
... | true | true |
f701df2d6c3bb3e37f1bcdb97765f18418e63e7b | 2,302 | py | Python | homeassistant/components/supervisord/sensor.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/supervisord/sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/supervisord/sensor.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Sensor for Supervisord process status."""
import logging
import xmlrpc.client
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_URL
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
ATTR... | 28.775 | 86 | 0.662467 | import logging
import xmlrpc.client
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_URL
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
ATTR_DESCRIPTION = "description"
ATTR_GROUP = "gr... | true | true |
f701df6b7161b3abc24aeed5c7a185b8b3c69e8c | 2,342 | py | Python | app/api/routes/transfer.py | cPoolChia/ChiaAutoplotter-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | 7 | 2021-06-01T09:20:34.000Z | 2021-10-12T07:24:04.000Z | app/api/routes/transfer.py | cPoolChia/ChiaFarmerManager-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | null | null | null | app/api/routes/transfer.py | cPoolChia/ChiaFarmerManager-Backend | 8d875c1f846df395ddc76e3d84b36da45ad4d557 | [
"MIT"
] | 1 | 2021-05-31T13:08:14.000Z | 2021-05-31T13:08:14.000Z | from app.schemas import filtration
from typing import Any
from uuid import UUID, uuid4
import celery
from datetime import datetime, timedelta
from app import crud, models, schemas
from app.celery import celery as celery_app
from app.api import deps
from app.core.config import settings
from app.utils import auth
from a... | 37.174603 | 86 | 0.727583 | from app.schemas import filtration
from typing import Any
from uuid import UUID, uuid4
import celery
from datetime import datetime, timedelta
from app import crud, models, schemas
from app.celery import celery as celery_app
from app.api import deps
from app.core.config import settings
from app.utils import auth
from a... | true | true |
f701dfb05b4e2b1468d4835338476d9029415eab | 1,686 | py | Python | src/get_5_five_letter_words.py | Masa-Shin/make-4-five-letter-words-without-repetition | 102de6a0eaaaa59086e351b7af44861ad63dcce6 | [
"MIT"
] | 3 | 2022-02-02T22:15:27.000Z | 2022-02-04T13:01:00.000Z | src/get_5_five_letter_words.py | Masa-Shin/make-4-five-letter-words-without-repetition- | 102de6a0eaaaa59086e351b7af44861ad63dcce6 | [
"MIT"
] | null | null | null | src/get_5_five_letter_words.py | Masa-Shin/make-4-five-letter-words-without-repetition- | 102de6a0eaaaa59086e351b7af44861ad63dcce6 | [
"MIT"
] | 1 | 2022-02-17T20:46:41.000Z | 2022-02-17T20:46:41.000Z | import re
import time
import json
import numpy as np
from collections import Counter
from utilities.utilities import VOWELS, LETTERS, get_vowel_count, get_available_words, log_list
start = time.time()
# 正解単語リストを開く
with open('data/answer-word-list.txt', mode='r') as f:
answer_word_list = f.read().split('\n')
# 入力... | 31.222222 | 95 | 0.675563 | import re
import time
import json
import numpy as np
from collections import Counter
from utilities.utilities import VOWELS, LETTERS, get_vowel_count, get_available_words, log_list
start = time.time()
with open('data/answer-word-list.txt', mode='r') as f:
answer_word_list = f.read().split('\n')
with open('data... | true | true |
f701dfdb741a6485ded2f00f3d7adc9bb8d37b17 | 8,773 | py | Python | homeassistant/components/glances/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/glances/sensor.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/glances/sensor.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Support gathering system information of hosts which are running glances."""
import logging
from homeassistant.const import CONF_NAME, STATE_UNAVAILABLE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from ... | 37.978355 | 84 | 0.493788 | import logging
from homeassistant.const import CONF_NAME, STATE_UNAVAILABLE
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import DATA_UPDATED, DOMAIN, SENSOR_TYPES
_LOGGER = logging.getLogger(_... | true | true |
f701e02276ef30939ff185d5969b6d129bfad693 | 13,265 | py | Python | bot.py | gsheppar/codec-dashboard | 232b1a9cae289f22aea52db423932846f6b11d95 | [
"MIT"
] | 13 | 2018-07-03T07:14:24.000Z | 2022-02-22T06:39:16.000Z | bot.py | gsheppar/codec-dashboard | 232b1a9cae289f22aea52db423932846f6b11d95 | [
"MIT"
] | null | null | null | bot.py | gsheppar/codec-dashboard | 232b1a9cae289f22aea52db423932846f6b11d95 | [
"MIT"
] | 3 | 2017-08-30T14:20:40.000Z | 2019-11-21T19:58:06.000Z | import csv
import datetime
import json
import os
import smtplib
import threading
from flask import request, make_response, Flask, render_template
import config
from codec.actions import get_status, send_survey, send_register, get_last, get_sip, get_people, get_loss, get_diag, send_dial
#############################... | 38.33815 | 228 | 0.567132 | import csv
import datetime
import json
import os
import smtplib
import threading
from flask import request, make_response, Flask, render_template
import config
from codec.actions import get_status, send_survey, send_register, get_last, get_sip, get_people, get_loss, get_diag, send_dial
check_surveyfile()
su... | false | true |
f701e15de95b18608b398cedc0243f079d79d203 | 8,082 | py | Python | dvc/external_repo.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | null | null | null | dvc/external_repo.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 81 | 2021-04-13T08:02:09.000Z | 2022-03-30T16:10:17.000Z | dvc/external_repo.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 2 | 2021-06-14T19:12:25.000Z | 2021-06-14T19:12:29.000Z | import logging
import os
import tempfile
import threading
from contextlib import contextmanager
from typing import Dict
from funcy import retry, wrap_with
from dvc.exceptions import (
FileMissingError,
NoOutputInExternalRepoError,
NoRemoteInExternalRepoError,
NotDvcRepoError,
OutputNotFoundError,
... | 30.730038 | 78 | 0.607152 | import logging
import os
import tempfile
import threading
from contextlib import contextmanager
from typing import Dict
from funcy import retry, wrap_with
from dvc.exceptions import (
FileMissingError,
NoOutputInExternalRepoError,
NoRemoteInExternalRepoError,
NotDvcRepoError,
OutputNotFoundError,
... | true | true |
f701e16a8bd60c349e5ada9ef3d576de5a949a72 | 366 | py | Python | app/account/urls.py | GeoffMahugu/django-blog-backend | f77b8ebda4267f30757ebedd531c485a16cbf9c3 | [
"MIT"
] | null | null | null | app/account/urls.py | GeoffMahugu/django-blog-backend | f77b8ebda4267f30757ebedd531c485a16cbf9c3 | [
"MIT"
] | null | null | null | app/account/urls.py | GeoffMahugu/django-blog-backend | f77b8ebda4267f30757ebedd531c485a16cbf9c3 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import AuthorSignupView, AuthorList, AuthorDetailView
urlpatterns = [
url(r'^$', AuthorList.as_view(), name='author-list'),
url(r'^(?P<pk>\d+)/$', AuthorDetailView, name='author-rud'),
url(r'^signup/... | 36.6 | 65 | 0.726776 | from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from .views import AuthorSignupView, AuthorList, AuthorDetailView
urlpatterns = [
url(r'^$', AuthorList.as_view(), name='author-list'),
url(r'^(?P<pk>\d+)/$', AuthorDetailView, name='author-rud'),
url(r'^signup/... | true | true |
f701e246974e360051eafba0655fea735ddd49d1 | 4,012 | py | Python | tests/test_modeler.py | joanvaquer/SDV | 83e4fdf0ff72e6c5b72cfc8c6ec9584dbd34de28 | [
"MIT"
] | null | null | null | tests/test_modeler.py | joanvaquer/SDV | 83e4fdf0ff72e6c5b72cfc8c6ec9584dbd34de28 | [
"MIT"
] | null | null | null | tests/test_modeler.py | joanvaquer/SDV | 83e4fdf0ff72e6c5b72cfc8c6ec9584dbd34de28 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import Mock, call
import pandas as pd
from sdv.metadata import Metadata
from sdv.modeler import Modeler
from sdv.models.base import SDVModel
from sdv.models.copulas import GaussianCopula
class TestModeler(TestCase):
def test___init__default(self):
"""Tes... | 34.886957 | 94 | 0.620887 | from unittest import TestCase
from unittest.mock import Mock, call
import pandas as pd
from sdv.metadata import Metadata
from sdv.modeler import Modeler
from sdv.models.base import SDVModel
from sdv.models.copulas import GaussianCopula
class TestModeler(TestCase):
def test___init__default(self):
... | true | true |
f701e2724db3063e715cbb18755d4cc1f682a147 | 404 | py | Python | project2/tests/q2_1_3.py | DrRossTaylor/intro-DS-Assignments | 88f0747b89869cae4e4227e6f3a936f0f1583937 | [
"CC0-1.0"
] | null | null | null | project2/tests/q2_1_3.py | DrRossTaylor/intro-DS-Assignments | 88f0747b89869cae4e4227e6f3a936f0f1583937 | [
"CC0-1.0"
] | null | null | null | project2/tests/q2_1_3.py | DrRossTaylor/intro-DS-Assignments | 88f0747b89869cae4e4227e6f3a936f0f1583937 | [
"CC0-1.0"
] | null | null | null | test = {
'name': 'q2_1_3',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> np.isclose(distance_from_batman_returns('titanic'), 0.0023550202650824965)
True
""",
'hidden': False,
'locked': False
}
],
'scored':... | 17.565217 | 88 | 0.398515 | test = {
'name': 'q2_1_3',
'points': 1,
'suites': [
{
'cases': [
{
'code': r"""
>>> np.isclose(distance_from_batman_returns('titanic'), 0.0023550202650824965)
True
""",
'hidden': False,
'locked': False
}
],
'scored':... | true | true |
f701e5714469931c76e895573715c567623da2a7 | 13,446 | py | Python | tests.py | vishalsodani/deal | da3b06da2f7c463431fd5d674b9762133e9296a3 | [
"MIT"
] | null | null | null | tests.py | vishalsodani/deal | da3b06da2f7c463431fd5d674b9762133e9296a3 | [
"MIT"
] | null | null | null | tests.py | vishalsodani/deal | da3b06da2f7c463431fd5d674b9762133e9296a3 | [
"MIT"
] | null | null | null | import unittest
from typing import NoReturn
import marshmallow
import urllib3
import vaa
import deal
import pytest
class TestPreDeal:
@pytest.mark.parametrize('correct,incorrect', [(1, -1), (2, -2), (3, -3), (5, -5), (7, -7), (11, -11)])
def test_pre_contract_fulfilled(self, correct, incorrect):
fun... | 28.487288 | 109 | 0.562175 | import unittest
from typing import NoReturn
import marshmallow
import urllib3
import vaa
import deal
import pytest
class TestPreDeal:
@pytest.mark.parametrize('correct,incorrect', [(1, -1), (2, -2), (3, -3), (5, -5), (7, -7), (11, -11)])
def test_pre_contract_fulfilled(self, correct, incorrect):
fun... | true | true |
f701e5ba1cf40d87257e9a32a37af0b6e506bd69 | 5,565 | py | Python | pykeyatome/client.py | jugla/pyKeyAtome | 2ea833f54f95c15279254565e912e4036869b139 | [
"MIT"
] | 1 | 2021-12-21T23:08:58.000Z | 2021-12-21T23:08:58.000Z | pykeyatome/client.py | jugla/pyKeyAtome | 2ea833f54f95c15279254565e912e4036869b139 | [
"MIT"
] | 1 | 2022-01-26T21:40:34.000Z | 2022-01-27T01:10:43.000Z | pykeyatome/client.py | jugla/pyKeyAtome | 2ea833f54f95c15279254565e912e4036869b139 | [
"MIT"
] | null | null | null | """Class client for atome protocol."""
import json
import logging
import requests
import simplejson
from fake_useragent import UserAgent
# export const
DAILY_PERIOD_TYPE = "day"
WEEKLY_PERIOD_TYPE = "week"
MONTHLY_PERIOD_TYPE = "month"
YEARLY_PERIOD_TYPE = "year"
# internal const
COOKIE_NAME = "PHPSESSID"
API_BASE_... | 27.825 | 109 | 0.554537 | import json
import logging
import requests
import simplejson
from fake_useragent import UserAgent
DAILY_PERIOD_TYPE = "day"
WEEKLY_PERIOD_TYPE = "week"
MONTHLY_PERIOD_TYPE = "month"
YEARLY_PERIOD_TYPE = "year"
COOKIE_NAME = "PHPSESSID"
API_BASE_URI = "https://esoftlink.esoftthings.com"
API_ENDPOINT_LOGIN = "/api/... | true | true |
f701e753de84fad7ebd01a4470ae510c0c88bfb2 | 870 | py | Python | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin.mock/packages/when-directives-false/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class WhenDirectivesFalse(Package):
"""Package that tests False when specs on directives."""
... | 33.461538 | 84 | 0.697701 |
from spack import *
class WhenDirectivesFalse(Package):
homepage = "http://www.example.com"
url = "http://www.example.com/example-1.0.tar.gz"
version('1.0', '0123456789abcdef0123456789abcdef')
patch('https://example.com/foo.patch',
sha256='abcd1234abcd1234abcd1234abcd1234abcd1234abcd... | true | true |
f701e9169b162fe7563cb382ae08c1a558adaba4 | 1,100 | py | Python | cache.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 2 | 2019-10-31T15:18:06.000Z | 2021-02-13T00:14:07.000Z | cache.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 1 | 2019-10-21T21:23:02.000Z | 2019-10-21T21:23:02.000Z | cache.py | greerviau/HackUMass | 25ef2ea9fecbe4bbfa91f0a9f32bd9f2703a176a | [
"MIT"
] | 3 | 2020-01-20T21:46:10.000Z | 2021-05-27T09:49:54.000Z | import numpy as np
import math
class Cache():
def __init__(self, max_size=10):
self.cache = []
self.size = 0
self.max_size=max_size
def add(self, element):
self.cache.append(element)
self.size+=1
if self.size > self.max_size:
del self.cache[0]
... | 21.153846 | 52 | 0.564545 | import numpy as np
import math
class Cache():
def __init__(self, max_size=10):
self.cache = []
self.size = 0
self.max_size=max_size
def add(self, element):
self.cache.append(element)
self.size+=1
if self.size > self.max_size:
del self.cache[0]
... | true | true |
f701e93ad73088654fd6b538457d54c52ecec092 | 22,885 | py | Python | Src/Scripts/generate_exceptions.py | 0xFireball/exascript2 | f6c69ac41f8fa1e5e9e42a677717e85b9ff9d0c3 | [
"Apache-2.0"
] | null | null | null | Src/Scripts/generate_exceptions.py | 0xFireball/exascript2 | f6c69ac41f8fa1e5e9e42a677717e85b9ff9d0c3 | [
"Apache-2.0"
] | null | null | null | Src/Scripts/generate_exceptions.py | 0xFireball/exascript2 | f6c69ac41f8fa1e5e9e42a677717e85b9ff9d0c3 | [
"Apache-2.0"
] | 1 | 2019-09-18T05:37:46.000Z | 2019-09-18T05:37:46.000Z | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | 45.678643 | 224 | 0.590387 | ),
),
ExceptionInfo('SyntaxError', 'Microsoft.Scripting.SyntaxErrorException', None, ('text', 'print_file_and_line', 'filename', 'lineno', 'offset', 'msg'), (
ExceptionInfo('IndentationError', 'IronPyt... | true | true |
f701e9411422a12eaa72972194de87ab9163810c | 27,768 | py | Python | dask/array/tests/test_slicing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2018-12-29T13:47:40.000Z | 2018-12-29T13:47:49.000Z | dask/array/tests/test_slicing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2019-03-19T22:19:04.000Z | 2019-03-26T19:04:00.000Z | dask/array/tests/test_slicing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 1 | 2021-11-05T10:06:27.000Z | 2021-11-05T10:06:27.000Z | import itertools
from operator import getitem
import pytest
from toolz import merge
np = pytest.importorskip('numpy')
import dask
import dask.array as da
from dask.array.slicing import (_sanitize_index_element, _slice_1d,
new_blockdim, sanitize_index, slice_array,
... | 33.334934 | 97 | 0.509327 | import itertools
from operator import getitem
import pytest
from toolz import merge
np = pytest.importorskip('numpy')
import dask
import dask.array as da
from dask.array.slicing import (_sanitize_index_element, _slice_1d,
new_blockdim, sanitize_index, slice_array,
... | true | true |
f701e9533dc1976894d91db2b7c579ad252ba370 | 4,438 | py | Python | zag/examples/distance_calculator.py | ToolsForHumans/taskflow | ce13d65e70213cb50ef19a714581997793b4e5fb | [
"Apache-2.0"
] | 1 | 2018-11-06T16:17:21.000Z | 2018-11-06T16:17:21.000Z | zag/examples/distance_calculator.py | ToolsForHumans/zag | ce13d65e70213cb50ef19a714581997793b4e5fb | [
"Apache-2.0"
] | 45 | 2018-11-07T21:35:55.000Z | 2021-01-08T06:26:50.000Z | zag/examples/distance_calculator.py | ToolsForHumans/taskflow | ce13d65e70213cb50ef19a714581997793b4e5fb | [
"Apache-2.0"
] | 3 | 2018-11-05T16:07:45.000Z | 2019-09-01T07:52:16.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
#
# 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/... | 40.345455 | 78 | 0.557008 |
import collections
import math
import os
import sys
top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
os.pardir,
os.pardir))
sys.path.insert(0, top_dir)
from zag import engines
from zag.patterns import linear... | true | true |
f701eae7d9153c4940a9de47ed79a004e74e6560 | 33,232 | py | Python | correlcalc/antpcf.py | rohinkumar/CorrelCalc | d7887448af8d3dc3170c00c0aae6ee2561b8a3d5 | [
"MIT"
] | null | null | null | correlcalc/antpcf.py | rohinkumar/CorrelCalc | d7887448af8d3dc3170c00c0aae6ee2561b8a3d5 | [
"MIT"
] | null | null | null | correlcalc/antpcf.py | rohinkumar/CorrelCalc | d7887448af8d3dc3170c00c0aae6ee2561b8a3d5 | [
"MIT"
] | null | null | null | __author__ = 'Rohin Kumar Y'
# Calculate anisotropic 2pCF
from tpcf import *
import scipy as sp
# antpcf(dat,datR,bins,parmetric,permetric) returns numpy 2d array DD, RR, DR correl
# poserr(xi,DD) returns (1.0+xi)/np.sqrt(DD)
def atpcf(datfile, binspar, binsper, **kwargs):
"""Main function to calculate anisotro... | 41.748744 | 401 | 0.604327 | __author__ = 'Rohin Kumar Y'
from tpcf import *
import scipy as sp
def atpcf(datfile, binspar, binsper, **kwargs):
global binsparv
global binsperv
global maxrad
global dat
global datR
global Nd
global Nr
DD = DR = RD = RR = np.zeros((len(binspar)-1, len(binsper)-1))
weigh... | true | true |
f701eb659d29808c9a1f074f5e5d862a3df1c0a1 | 4,076 | py | Python | tests/test_resource_synchronization.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | 6 | 2019-11-14T08:12:08.000Z | 2021-04-08T11:13:35.000Z | tests/test_resource_synchronization.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | 16 | 2019-06-25T16:44:13.000Z | 2022-02-15T18:05:28.000Z | tests/test_resource_synchronization.py | TUDelft-CITG/Hydraulic-Infrastructure-Realisation | c5888ef8f8bd1676536e268701dbb974e6f87c40 | [
"MIT"
] | 8 | 2019-07-03T08:28:26.000Z | 2021-07-12T08:11:53.000Z | """Test package."""
import shapely.geometry
import simpy
import openclsim.core as core
import openclsim.model as model
from .test_utils import assert_log
def test_test_resource_synchronization():
"""Test resource Synchronization."""
simulation_start = 0
my_env = simpy.Environment(initial_time=simulati... | 25.63522 | 82 | 0.569676 |
import shapely.geometry
import simpy
import openclsim.core as core
import openclsim.model as model
from .test_utils import assert_log
def test_test_resource_synchronization():
simulation_start = 0
my_env = simpy.Environment(initial_time=simulation_start)
registry = {}
Site = type(
"Site",... | true | true |
f701ebc777f0e75bb15805fc60c334c03e73cfd1 | 590 | py | Python | Hello-producer/producer.py | mydevground/ApacheKafkaPython | 96da0e5d0294a9823776f9622fca6a3b46ff06bb | [
"MIT"
] | 5 | 2021-06-06T13:25:47.000Z | 2022-01-16T15:48:22.000Z | Hello-producer/producer.py | mydevground/ApacheKafkaPython | 96da0e5d0294a9823776f9622fca6a3b46ff06bb | [
"MIT"
] | null | null | null | Hello-producer/producer.py | mydevground/ApacheKafkaPython | 96da0e5d0294a9823776f9622fca6a3b46ff06bb | [
"MIT"
] | 2 | 2021-09-21T17:34:18.000Z | 2021-10-01T21:40:10.000Z | from confluent_kafka import Producer
import socket
if __name__ == '__main__':
print("Starting Kafka Producer")
producer_config = {'client.id': socket.gethostname(),
'bootstrap.servers': 'localhost:9092'}
print("Creating Producer")
producer = Producer(producer_config)
print... | 28.095238 | 96 | 0.640678 | from confluent_kafka import Producer
import socket
if __name__ == '__main__':
print("Starting Kafka Producer")
producer_config = {'client.id': socket.gethostname(),
'bootstrap.servers': 'localhost:9092'}
print("Creating Producer")
producer = Producer(producer_config)
print... | true | true |
f701ec8d1673c733a95290013d8b9a3737b4b8a1 | 35,290 | py | Python | pytests/security/SecretsMgmtTests.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | pytests/security/SecretsMgmtTests.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | pytests/security/SecretsMgmtTests.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | from membase.api.rest_client import RestConnection, RestHelper
import urllib.request, urllib.parse, urllib.error
import json
from remote.remote_util import RemoteMachineShellConnection, RemoteMachineHelper
from newupgradebasetest import NewUpgradeBaseTest
from security.auditmain import audit
import subprocess
import so... | 58.330579 | 144 | 0.662992 | from membase.api.rest_client import RestConnection, RestHelper
import urllib.request, urllib.parse, urllib.error
import json
from remote.remote_util import RemoteMachineShellConnection, RemoteMachineHelper
from newupgradebasetest import NewUpgradeBaseTest
from security.auditmain import audit
import subprocess
import so... | true | true |
f701ece674622dd3e1e9f5d4513a6d4ada63ad22 | 246 | py | Python | test_app/urls.py | arielcalzadadeveloper/django-test-app | c304d3be20f0280405229635fc01bce6f5732383 | [
"MIT"
] | null | null | null | test_app/urls.py | arielcalzadadeveloper/django-test-app | c304d3be20f0280405229635fc01bce6f5732383 | [
"MIT"
] | null | null | null | test_app/urls.py | arielcalzadadeveloper/django-test-app | c304d3be20f0280405229635fc01bce6f5732383 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from test_app.views.home import Home
from test_app.views.ajax import Ajax
app_name = "test_app"
urlpatterns = [
url(regex=r"^$", view=Home, name="home"),
url(regex=r"^ajax$", view=Ajax, name="ajax"),
]
| 20.5 | 49 | 0.691057 | from django.conf.urls import url
from test_app.views.home import Home
from test_app.views.ajax import Ajax
app_name = "test_app"
urlpatterns = [
url(regex=r"^$", view=Home, name="home"),
url(regex=r"^ajax$", view=Ajax, name="ajax"),
]
| true | true |
f701ed7fcc38600056f8b02f2241a501d702625b | 598 | py | Python | watchmen/common/security/algorithm/algorithm_date.py | Insurance-Metrics-Measure-Advisory/watchman-data-connector | 8ecab0c5b28174f1611e51deba8d94a42f53d51d | [
"MIT"
] | 125 | 2021-03-13T07:39:46.000Z | 2022-02-28T03:14:17.000Z | pipeline/common/security/algorithm/algorithm_date.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | null | null | null | pipeline/common/security/algorithm/algorithm_date.py | Indexical-Metrics-Measure-Advisory/watchmen-pipeline-engine | fb39695d2f7a1c5212a3871b04c4a8a9f03ee16e | [
"MIT"
] | 17 | 2021-03-13T07:31:58.000Z | 2021-05-20T09:38:02.000Z | import arrow
def __mask_day(date_str):
return date_str[:8] + "**"
def __mask_month(date_str):
return date_str[:5] + "**" + date_str[7:]
def encrypt_day(value_, params=None):
date = arrow.get(value_)
date_str = date.format('YYYY-MM-DD')
return __mask_day(date_str)
def encrypt_month(value_, pa... | 21.357143 | 45 | 0.685619 | import arrow
def __mask_day(date_str):
return date_str[:8] + "**"
def __mask_month(date_str):
return date_str[:5] + "**" + date_str[7:]
def encrypt_day(value_, params=None):
date = arrow.get(value_)
date_str = date.format('YYYY-MM-DD')
return __mask_day(date_str)
def encrypt_month(value_, pa... | true | true |
f701ee0891de92a9e4c2d1f4a5f6b50e45dc2dab | 1,048 | py | Python | bot.py | ijoosong/pycascadediscordbot | 2a04bc021165c5310d65428332862a4852009d92 | [
"MIT"
] | 1 | 2022-02-05T18:37:59.000Z | 2022-02-05T18:37:59.000Z | bot.py | ijoosong/pycascadediscordbot | 2a04bc021165c5310d65428332862a4852009d92 | [
"MIT"
] | null | null | null | bot.py | ijoosong/pycascadediscordbot | 2a04bc021165c5310d65428332862a4852009d92 | [
"MIT"
] | null | null | null | import discord
import config
import requests
client = discord.Client()
@client.event
async def on_ready():
for guild_id in client.guilds:
if guild_id.name == config.DISCORD_GUILD_NAME:
break
print(
f'{client.user} is connected to {guild_id.name}(id: {guild_id.id})'
... | 32.75 | 109 | 0.666031 | import discord
import config
import requests
client = discord.Client()
@client.event
async def on_ready():
for guild_id in client.guilds:
if guild_id.name == config.DISCORD_GUILD_NAME:
break
print(
f'{client.user} is connected to {guild_id.name}(id: {guild_id.id})'
... | true | true |
f701f070e1babd894c04e750b2e0413d9f6581a5 | 779 | py | Python | deskbookingsystem42/users/migrations/0002_auto_20210907_1827.py | rollinger/deskbooking42 | bb032148fce9f36ac3ac8e57a59783a394d5c17c | [
"MIT"
] | 1 | 2021-09-03T19:01:16.000Z | 2021-09-03T19:01:16.000Z | deskbookingsystem42/users/migrations/0002_auto_20210907_1827.py | rollinger/deskbooking42 | bb032148fce9f36ac3ac8e57a59783a394d5c17c | [
"MIT"
] | 1 | 2022-03-30T18:21:27.000Z | 2022-03-30T18:21:27.000Z | deskbookingsystem42/users/migrations/0002_auto_20210907_1827.py | rollinger/deskbooking42 | bb032148fce9f36ac3ac8e57a59783a394d5c17c | [
"MIT"
] | 1 | 2021-09-05T13:45:05.000Z | 2021-09-05T13:45:05.000Z | # Generated by Django 3.1.13 on 2021-09-07 16:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Role',
fie... | 28.851852 | 122 | 0.591784 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Role',
fields=[
('id', models.AutoField(au... | true | true |
f701f0b73b4b02efa8588306921412084c0c3993 | 4,217 | py | Python | kittycad/api/file/create_file_conversion.py | KittyCAD/kittycad.py | 7f7460d366dbd55fce50e5faa4a032b62e4baae4 | [
"MIT"
] | 1 | 2022-02-06T05:07:25.000Z | 2022-02-06T05:07:25.000Z | kittycad/api/file/create_file_conversion.py | KittyCAD/kittycad.py | 7f7460d366dbd55fce50e5faa4a032b62e4baae4 | [
"MIT"
] | 7 | 2022-02-04T11:29:25.000Z | 2022-03-07T01:37:26.000Z | kittycad/api/file/create_file_conversion.py | KittyCAD/kittycad.py | 7f7460d366dbd55fce50e5faa4a032b62e4baae4 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...models.file_conversion_output_format import FileConversionOutputFormat
from ...models.file_conversion_sourc... | 31.237037 | 239 | 0.77235 | from typing import Any, Dict, Optional, Union, cast
import httpx
from ...client import Client
from ...models.file_conversion_with_output import FileConversionWithOutput
from ...models.error import Error
from ...models.file_conversion_output_format import FileConversionOutputFormat
from ...models.file_conversion_sourc... | true | true |
f701f15d445c5d00ebc440579ff2c5e6d88fda23 | 428 | py | Python | students/k3343/laboratory_works/Zhabrovets_Ekaterina/laboratory_work_1/workshops/migrations/0007_workshop_name.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3343/laboratory_works/Zhabrovets_Ekaterina/laboratory_work_1/workshops/migrations/0007_workshop_name.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3343/laboratory_works/Zhabrovets_Ekaterina/laboratory_work_1/workshops/migrations/0007_workshop_name.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | # Generated by Django 3.0.5 on 2020-04-14 19:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0006_auto_20200414_2235'),
]
operations = [
migrations.AddField(
model_name='workshop',
name='name',
... | 22.526316 | 92 | 0.614486 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0006_auto_20200414_2235'),
]
operations = [
migrations.AddField(
model_name='workshop',
name='name',
field=models.CharField(default='kkkk'... | true | true |
f701f1abff83536a090c2e94d28527084e8c64b6 | 64,646 | py | Python | tests/admin_widgets/tests.py | ronpad/django | 312174f9730cd594980de58e6b9db32cbdebf4ba | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2020-09-11T10:43:58.000Z | 2021-03-04T15:31:40.000Z | tests/admin_widgets/tests.py | fabioruicci/django | 6efc35b4fe3009666e56a60af0675d7d532bf4ff | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | null | null | null | tests/admin_widgets/tests.py | fabioruicci/django | 6efc35b4fe3009666e56a60af0675d7d532bf4ff | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2021-07-19T08:16:56.000Z | 2021-07-19T08:16:56.000Z | import gettext
import os
import re
from datetime import datetime, timedelta
from importlib import import_module
import pytz
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.tests import AdminSeleniumTestCase
f... | 44.522039 | 119 | 0.63891 | import gettext
import os
import re
from datetime import datetime, timedelta
from importlib import import_module
import pytz
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import widgets
from django.contrib.admin.tests import AdminSeleniumTestCase
f... | true | true |
f701f1d7ecfbfea55fbc17179f0299931e6d1dd5 | 11,669 | py | Python | extra/tsfresh_examples/tsfresh/feature_selection/feature_selector.py | davidcrowland/layer_vb_tagging | 83865d67b7a931a9eff4ba6fd4d033b2219225f1 | [
"MIT"
] | null | null | null | extra/tsfresh_examples/tsfresh/feature_selection/feature_selector.py | davidcrowland/layer_vb_tagging | 83865d67b7a931a9eff4ba6fd4d033b2219225f1 | [
"MIT"
] | null | null | null | extra/tsfresh_examples/tsfresh/feature_selection/feature_selector.py | davidcrowland/layer_vb_tagging | 83865d67b7a931a9eff4ba6fd4d033b2219225f1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
"""
Contains a feature selection method that evaluates the importance of the different extracted features. To do so,
for ev... | 41.824373 | 119 | 0.675208 |
from __future__ import absolute_import, division, print_function
from functools import partial
from builtins import zip
from builtins import range
import os
import numpy as np
import pandas as pd
import logging
from multiprocessing import Pool
from tsfresh.feature_selection.significance_tests import target_binary... | true | true |
f701f1faed6d0b007d0b45d55a30e12c9f632cc2 | 7,403 | py | Python | docs/conf.py | coordt/django-faq | 1aa924ee5806dd8611fcf4a83ec46182b191ab60 | [
"BSD-3-Clause"
] | 1 | 2019-06-14T15:29:49.000Z | 2019-06-14T15:29:49.000Z | docs/conf.py | natgeosociety/django-faq | 1aa924ee5806dd8611fcf4a83ec46182b191ab60 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | natgeosociety/django-faq | 1aa924ee5806dd8611fcf4a83ec46182b191ab60 | [
"BSD-3-Clause"
] | 1 | 2016-05-05T21:56:37.000Z | 2016-05-05T21:56:37.000Z | # -*- coding: utf-8 -*-
#
# django-faq documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 17 13:09:21 2011.
#
# 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.
#
# ... | 32.612335 | 80 | 0.717142 |
import sys, os
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
intersphinx_mapping = {
'python': ('http://python.readthedocs.org/en/latest/', None),
'django': ('http://django.readthedocs.org/en/latest/', None),
'sphinx': ('http://sphinx.readthedocs.org/en/latest/', None),
... | true | true |
f701f30df1fc51076dcd0f5de3aeec82d2c612ae | 7,050 | py | Python | Statistical Methods and Data Analysis/Module 2 Assignment/venv/lib/python3.8/site-packages/matplotlib/tests/test_backends_interactive.py | ZohaibZ/DataScience | ba06c724293f8674375827bdf2d4f42d32788ebb | [
"MIT"
] | 9 | 2021-04-12T16:11:38.000Z | 2022-03-18T09:03:58.000Z | Statistical Methods and Data Analysis/Module 2 Assignment/venv/lib/python3.8/site-packages/matplotlib/tests/test_backends_interactive.py | ZohaibZ/DataScience | ba06c724293f8674375827bdf2d4f42d32788ebb | [
"MIT"
] | 21 | 2021-04-13T01:17:40.000Z | 2022-03-11T16:06:50.000Z | Statistical Methods and Data Analysis/Module 2 Assignment/venv/lib/python3.8/site-packages/matplotlib/tests/test_backends_interactive.py | ZohaibZ/DataScience | ba06c724293f8674375827bdf2d4f42d32788ebb | [
"MIT"
] | 2 | 2020-09-10T10:24:52.000Z | 2021-01-05T21:54:51.000Z | import importlib
import importlib.util
import json
import os
import signal
import subprocess
import sys
import time
import urllib.request
import pytest
import matplotlib as mpl
# Minimal smoke-testing of the backends for which the dependencies are
# PyPI-installable on CI. They are not available for all tested Pyt... | 36.340206 | 79 | 0.650355 | import importlib
import importlib.util
import json
import os
import signal
import subprocess
import sys
import time
import urllib.request
import pytest
import matplotlib as mpl
def _get_testable_interactive_backends():
backends = []
for deps, backend in [
(["cairo", "gi"], "gtk3agg"),
... | true | true |
f701f37a4174ee79bfb8e774f9a1ee876fc707d0 | 1,077 | py | Python | tests/settings.py | chefgonpachi/MISO | cf2109550be7e7ed6740ff736b1e1778dffaab9b | [
"Apache-2.0"
] | 80 | 2020-11-30T00:25:51.000Z | 2022-03-15T12:02:37.000Z | brownie/tests/settings.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 8 | 2021-09-01T17:33:57.000Z | 2022-02-25T20:11:27.000Z | brownie/tests/settings.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 30 | 2020-11-30T00:25:57.000Z | 2022-01-09T06:01:27.000Z | TENPOW18 = 10 ** 18
TENPOW6 = 10 ** 6
ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
ETH_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
AUCTION_TOKENS = 10000 * TENPOW18
AUCTION_TIME = 50000
AUCTION_START_PRICE = 100 * TENPOW18
AUCTION_RESERVE = 0.001 * TENPOW18
AUCTION_MINIMUM_COMMITMENT = 10 * ... | 24.477273 | 59 | 0.793872 | TENPOW18 = 10 ** 18
TENPOW6 = 10 ** 6
ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
ETH_ADDRESS = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
AUCTION_TOKENS = 10000 * TENPOW18
AUCTION_TIME = 50000
AUCTION_START_PRICE = 100 * TENPOW18
AUCTION_RESERVE = 0.001 * TENPOW18
AUCTION_MINIMUM_COMMITMENT = 10 * ... | true | true |
f701f391b62bbe8b77e06a6851b313415c5310ce | 9,763 | py | Python | google/cloud/servicecontrol_v1/services/quota_controller/async_client.py | parthea/python-service-control | 94c7fc51a5f84fe5c11d35ef6b7bd64462fa6b41 | [
"Apache-2.0"
] | null | null | null | google/cloud/servicecontrol_v1/services/quota_controller/async_client.py | parthea/python-service-control | 94c7fc51a5f84fe5c11d35ef6b7bd64462fa6b41 | [
"Apache-2.0"
] | null | null | null | google/cloud/servicecontrol_v1/services/quota_controller/async_client.py | parthea/python-service-control | 94c7fc51a5f84fe5c11d35ef6b7bd64462fa6b41 | [
"Apache-2.0"
] | 1 | 2021-04-21T11:34:34.000Z | 2021-04-21T11:34:34.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.342975 | 154 | 0.693434 |
from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources
import google.api_core.client_options as ClientOptions
from google.api_core import exceptions
from google.api_core import gapic_v1
from google.api_core import... | true | true |
f701f47df818f2b9c8dc438e57bfeecedf6e1d89 | 9,208 | py | Python | octopus/platforms/EOS/wasm.py | ZarvisD/octopus | 3e238721fccfec69a69a1635b8a0dc485e525e69 | [
"MIT"
] | 2 | 2019-01-19T07:12:02.000Z | 2021-08-14T13:23:37.000Z | octopus/platforms/EOS/wasm.py | ZarvisD/octopus | 3e238721fccfec69a69a1635b8a0dc485e525e69 | [
"MIT"
] | null | null | null | octopus/platforms/EOS/wasm.py | ZarvisD/octopus | 3e238721fccfec69a69a1635b8a0dc485e525e69 | [
"MIT"
] | 1 | 2019-01-19T07:12:05.000Z | 2019-01-19T07:12:05.000Z | # extract from:
# * https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md
# * https://webassembly.github.io/spec/core/binary/instructions.html
# * https://github.com/athre0z/wasm/blob/master/wasm/opcodes.py
from wasm.immtypes import *
from wasm.opcodes import INSN_ENTER_BLOCK, INSN_LEAVE_BLOCK, INSN_BRAN... | 42.43318 | 100 | 0.484796 |
from wasm.immtypes import *
from wasm.opcodes import INSN_ENTER_BLOCK, INSN_LEAVE_BLOCK, INSN_BRANCH, INSN_NO_FLOW
_table = {
0x00: ('unreachable', None, INSN_NO_FLOW, 0, 0, ''),
0x01: ('nop', None, 0, 0, 0, ''),
0x02: ('block', BlockImm(), INSN_ENTER_BLOCK, 0, 0, ''),
0x03: ('loop', BlockImm... | true | true |
f701f57a6d66a5162c4485e2059098ca7ddc59f7 | 49,207 | py | Python | tests/core_type/test_introspection.py | jhgg/graphql-py | 47ad2ca029954423e4b13f5b4ef84f788e865f6f | [
"MIT"
] | 1 | 2021-04-28T21:35:02.000Z | 2021-04-28T21:35:02.000Z | tests/core_type/test_introspection.py | jhgg/graphql-py | 47ad2ca029954423e4b13f5b4ef84f788e865f6f | [
"MIT"
] | null | null | null | tests/core_type/test_introspection.py | jhgg/graphql-py | 47ad2ca029954423e4b13f5b4ef84f788e865f6f | [
"MIT"
] | null | null | null | import json
from pytest import raises
from graphql.core import graphql
from graphql.core.error import format_error
from graphql.core.language.location import SourceLocation
from graphql.core.language.parser import parse
from graphql.core.execution import execute
from graphql.core.type import (
GraphQLSchema,
Gr... | 58.440618 | 133 | 0.25285 | import json
from pytest import raises
from graphql.core import graphql
from graphql.core.error import format_error
from graphql.core.language.location import SourceLocation
from graphql.core.language.parser import parse
from graphql.core.execution import execute
from graphql.core.type import (
GraphQLSchema,
Gr... | true | true |
f701f5da9daa45c173263130bee6d726af6e96a9 | 8,044 | py | Python | apps/meetup/views.py | VladimirFilonov/moscowdjango | e1e97139f0bff2d8a0f8b41f219e0416a4733d5e | [
"BSD-3-Clause"
] | 10 | 2015-10-01T18:41:50.000Z | 2020-11-26T14:00:54.000Z | apps/meetup/views.py | VladimirFilonov/moscowdjango | e1e97139f0bff2d8a0f8b41f219e0416a4733d5e | [
"BSD-3-Clause"
] | 33 | 2016-01-13T08:52:54.000Z | 2022-01-13T00:34:23.000Z | apps/meetup/views.py | VladimirFilonov/moscowdjango | e1e97139f0bff2d8a0f8b41f219e0416a4733d5e | [
"BSD-3-Clause"
] | 4 | 2015-10-04T12:35:03.000Z | 2021-06-15T05:57:10.000Z | # coding=utf-8
import os
import sys
import django
from django.core.urlresolvers import reverse
from django.db import DatabaseError
from django.db.models import Count
from django.http import HttpResponse, Http404
from django.shortcuts import redirect, get_object_or_404
from django.utils import six
from django.views.gen... | 32.435484 | 95 | 0.632645 |
import os
import sys
import django
from django.core.urlresolvers import reverse
from django.db import DatabaseError
from django.db.models import Count
from django.http import HttpResponse, Http404
from django.shortcuts import redirect, get_object_or_404
from django.utils import six
from django.views.generic.base impo... | true | true |
f701f680ba8554ccbd354efc16483113776c0acd | 197 | py | Python | codewars/7kyu/doha22/repeater/test.py | doha22/Training_one | 0cd7cf86c7da0f6175834146296b763d1841766b | [
"MIT"
] | null | null | null | codewars/7kyu/doha22/repeater/test.py | doha22/Training_one | 0cd7cf86c7da0f6175834146296b763d1841766b | [
"MIT"
] | 2 | 2019-01-22T10:53:42.000Z | 2019-01-31T08:02:48.000Z | codewars/7kyu/doha22/repeater/test.py | doha22/Training_one | 0cd7cf86c7da0f6175834146296b763d1841766b | [
"MIT"
] | 13 | 2019-01-22T10:37:42.000Z | 2019-01-25T13:30:43.000Z | import unittest
from repeater import repeater
def test_repeater(benchmark):
assert benchmark(repeater,'a',5) == 'aaaaa'
assert benchmark(repeater,'Wub', 6 ) == 'Wub Wub Wub Wub Wub Wub '
| 24.625 | 70 | 0.71066 | import unittest
from repeater import repeater
def test_repeater(benchmark):
assert benchmark(repeater,'a',5) == 'aaaaa'
assert benchmark(repeater,'Wub', 6 ) == 'Wub Wub Wub Wub Wub Wub '
| true | true |
f701f7a9a7a4a33178b37d3b9fb2b490dd4d8458 | 243 | py | Python | Chapter03/Setup As Admin.py | delgadoa1/Python-For-Offensive-Pentest | c768d61f15fccc77768eb400b5c0e36bebde9511 | [
"MIT"
] | 62 | 2018-05-22T20:46:01.000Z | 2022-03-30T11:25:58.000Z | Chapter03/Setup As Admin.py | delgadoa1/Python-For-Offensive-Pentest | c768d61f15fccc77768eb400b5c0e36bebde9511 | [
"MIT"
] | null | null | null | Chapter03/Setup As Admin.py | delgadoa1/Python-For-Offensive-Pentest | c768d61f15fccc77768eb400b5c0e36bebde9511 | [
"MIT"
] | 61 | 2018-04-27T16:49:33.000Z | 2022-03-27T17:59:32.000Z | from distutils.core import setup
import py2exe , sys, os
sys.argv.append("py2exe")
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "DNS.py", 'uac_info': "requireAdministrator"}],
zipfile = None,
)
| 17.357143 | 73 | 0.625514 | from distutils.core import setup
import py2exe , sys, os
sys.argv.append("py2exe")
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "DNS.py", 'uac_info': "requireAdministrator"}],
zipfile = None,
)
| true | true |
f701f865b738ef986aac7ad75382e6e9b70325f2 | 6,277 | py | Python | pyinfra_cli/inventory.py | ryanwersal/pyinfra | 350c9053953531d1d258512f1e0761879df772fb | [
"MIT"
] | 1 | 2022-03-24T05:44:45.000Z | 2022-03-24T05:44:45.000Z | pyinfra_cli/inventory.py | marinakravchenko21/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | null | null | null | pyinfra_cli/inventory.py | marinakravchenko21/pyinfra | 6e14b039422e00ebc68110eabbc6a3a543c96279 | [
"MIT"
] | 1 | 2021-11-12T18:36:01.000Z | 2021-11-12T18:36:01.000Z | from os import listdir, path
from types import GeneratorType
import six
from pyinfra import logger, pseudo_inventory
from pyinfra.api.inventory import Inventory
from pyinfra_cli.util import exec_file
# Hosts in an inventory can be just the hostname or a tuple (hostname, data)
ALLOWED_HOST_TYPES = tuple(
six.stri... | 29.890476 | 88 | 0.644416 | from os import listdir, path
from types import GeneratorType
import six
from pyinfra import logger, pseudo_inventory
from pyinfra.api.inventory import Inventory
from pyinfra_cli.util import exec_file
ALLOWED_HOST_TYPES = tuple(
six.string_types + (tuple,),
)
ALLOWED_DATA_TYPES = tuple(
six.integer_types
... | true | true |
f701f8f535f597b8a4f9c0cbfcd41fb6de407627 | 338 | py | Python | testprojects/tests/python/pants/constants_only/test_constants_only.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | 1 | 2020-08-26T03:30:31.000Z | 2020-08-26T03:30:31.000Z | testprojects/tests/python/pants/constants_only/test_constants_only.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | 1 | 2021-09-02T21:06:31.000Z | 2021-09-02T21:06:31.000Z | testprojects/tests/python/pants/constants_only/test_constants_only.py | anthonyjpratti/pants | d98e53af6ddd877861231bce8343f8204da0a9d1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
def test_constants_only():
try:
from pants.constants_only.constants import VALID_IDENTIFIERS # noqa
except ImportError as e:
assert False, 'Failed to correctly generate python... | 33.8 | 71 | 0.760355 |
def test_constants_only():
try:
from pants.constants_only.constants import VALID_IDENTIFIERS
except ImportError as e:
assert False, 'Failed to correctly generate python package: %s' % e
| true | true |
f701f949821e1f0ee7ad7abeb6beb95d4ae102bf | 409 | py | Python | bglcapi/bgapi/user/parse.py | edgebr/python-bgapi | 0aeb525edf605e892b20f5c3fb11269cce0c5bdf | [
"MIT"
] | null | null | null | bglcapi/bgapi/user/parse.py | edgebr/python-bgapi | 0aeb525edf605e892b20f5c3fb11269cce0c5bdf | [
"MIT"
] | null | null | null | bglcapi/bgapi/user/parse.py | edgebr/python-bgapi | 0aeb525edf605e892b20f5c3fb11269cce0c5bdf | [
"MIT"
] | null | null | null | from struct import (unpack_from, calcsize)
from bglcapi.types import MessageType
from . import rsp
from . import evt
PARSE_MAP = {
MessageType.COMMAND_RESPONSE: {
0x00: rsp.message_to_target,
},
MessageType.EVENT: {
0x00: evt.message_to_host,
},
}
def from_binary(msg_type: int, msg_... | 20.45 | 70 | 0.691932 | from struct import (unpack_from, calcsize)
from bglcapi.types import MessageType
from . import rsp
from . import evt
PARSE_MAP = {
MessageType.COMMAND_RESPONSE: {
0x00: rsp.message_to_target,
},
MessageType.EVENT: {
0x00: evt.message_to_host,
},
}
def from_binary(msg_type: int, msg_... | true | true |
f701f97e1f188d4e04e78e513ce8208e4d9f71ef | 1,360 | py | Python | deploy.py | blockchainhelppro/CelvinRost | aa2661747d06e4610928466521e4da1db77aeadc | [
"MIT"
] | 2 | 2018-08-15T21:27:59.000Z | 2018-08-21T17:56:12.000Z | deploy.py | blockchainhelppro/CelvinRost | aa2661747d06e4610928466521e4da1db77aeadc | [
"MIT"
] | null | null | null | deploy.py | blockchainhelppro/CelvinRost | aa2661747d06e4610928466521e4da1db77aeadc | [
"MIT"
] | 1 | 2021-12-06T04:03:32.000Z | 2021-12-06T04:03:32.000Z | import itertools
import toposort
from populus.utils.contracts import (
compute_direct_dependency_graph,
compute_recursive_contract_dependencies,
)
def compute_deploy_order(dependency_graph):
"""
Given a dictionary that maps contract to their dependencies,
determine the overall dependency orderin... | 33.170732 | 83 | 0.772794 | import itertools
import toposort
from populus.utils.contracts import (
compute_direct_dependency_graph,
compute_recursive_contract_dependencies,
)
def compute_deploy_order(dependency_graph):
return toposort.toposort_flatten(dict(dependency_graph))
def get_deploy_order(contracts_to_deploy, compiled_con... | true | true |
f701f9d8c81d5e989359e6483b6e3216e93ad459 | 28,601 | py | Python | machine_learning_model.py | prakass1/InteractiveSimilarityExplorer | 2fa5fb91c7df6424b9ed777ef4373ed7094c2348 | [
"MIT"
] | null | null | null | machine_learning_model.py | prakass1/InteractiveSimilarityExplorer | 2fa5fb91c7df6424b9ed777ef4373ed7094c2348 | [
"MIT"
] | null | null | null | machine_learning_model.py | prakass1/InteractiveSimilarityExplorer | 2fa5fb91c7df6424b9ed777ef4373ed7094c2348 | [
"MIT"
] | null | null | null | import utility
import static_sim_functions as smf
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import *
from time_series_grp import TimeSeriesGroupProcessing
from RandomNeighbors import RandomNeighbors
from sklearn.neighbors import NearestNeighbors
from sklearn.model_sele... | 43.009023 | 120 | 0.619908 | import utility
import static_sim_functions as smf
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import *
from time_series_grp import TimeSeriesGroupProcessing
from RandomNeighbors import RandomNeighbors
from sklearn.neighbors import NearestNeighbors
from sklearn.model_sele... | true | true |
f701fac9269066e7967ab93ea5152f17e3b246d9 | 4,528 | py | Python | gpsxml2png.py | felmoltor/kismet-heatmap | d145a865f80db16ad8c6d0bb1dd35e0238706f3b | [
"BSD-2-Clause"
] | 11 | 2016-10-13T13:40:59.000Z | 2021-05-29T23:56:59.000Z | gpsxml2png.py | felmoltor/kismet-heatmap | d145a865f80db16ad8c6d0bb1dd35e0238706f3b | [
"BSD-2-Clause"
] | 1 | 2018-07-27T02:32:05.000Z | 2018-12-25T10:12:25.000Z | gpsxml2png.py | felmoltor/kismet-heatmap | d145a865f80db16ad8c6d0bb1dd35e0238706f3b | [
"BSD-2-Clause"
] | 1 | 2021-11-19T15:22:19.000Z | 2021-11-19T15:22:19.000Z | #!/usr/bin/env python2
"""
Copyright (c) 2016, Bliksem Labs B.V.
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 copyright notice, this
list... | 29.594771 | 107 | 0.686396 |
import sys
import numpy
from scipy.interpolate import griddata
import matplotlib.pyplot as plt
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except ImportError:
try:
import xml.etree.ElementTree as etree
except ImportError:
try... | true | true |
f701facbb5489dd40223e0d27d529651494be784 | 5,612 | py | Python | netapp/santricity/models/symbol/thin_volume_reinitialize_descriptor.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | netapp/santricity/models/symbol/thin_volume_reinitialize_descriptor.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | netapp/santricity/models/symbol/thin_volume_reinitialize_descriptor.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | # coding: utf-8
"""
ThinVolumeReinitializeDescriptor.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following con... | 36.921053 | 844 | 0.64273 |
from pprint import pformat
from six import iteritems
class ThinVolumeReinitializeDescriptor(object):
def __init__(self):
self.swagger_types = {
'thin_vol': 'str',
'init_params': 'ThinVolumeReinitializeParams'
}
self.attribute_map = {
'thin_vol': 't... | true | true |
f701fae7234155f95bb3a662b5f3cf38b6fbec3f | 9,618 | py | Python | gamestonk_terminal/options/op_helpers.py | keshabb/GamestonkTerminal | a0acdfb13f806c35c82a7c4dc81ea98de52814e0 | [
"MIT"
] | 1 | 2021-07-25T20:34:29.000Z | 2021-07-25T20:34:29.000Z | gamestonk_terminal/options/op_helpers.py | TomiToivio/GamestonkTerminal | 419c3691db220c467d2979b19ca308b3b800c0bd | [
"MIT"
] | 1 | 2022-02-10T06:49:37.000Z | 2022-02-10T06:49:37.000Z | gamestonk_terminal/options/op_helpers.py | TomiToivio/GamestonkTerminal | 419c3691db220c467d2979b19ca308b3b800c0bd | [
"MIT"
] | null | null | null | """Option helper functions"""
__docformat__ = "numpy"
import argparse
from typing import List
import pandas as pd
import numpy as np
from gamestonk_terminal.helper_funcs import (
parse_known_args_and_warn,
check_non_negative,
)
# pylint: disable=R1710
def load(other_args: List[str]) -> str:
"""Load ti... | 23.288136 | 104 | 0.555521 | __docformat__ = "numpy"
import argparse
from typing import List
import pandas as pd
import numpy as np
from gamestonk_terminal.helper_funcs import (
parse_known_args_and_warn,
check_non_negative,
)
def load(other_args: List[str]) -> str:
parser = argparse.ArgumentParser(
add_help=False,
... | true | true |
f701fb01fdb4c37afc1d4e5189833e347bf52cf0 | 132 | py | Python | conda_pack/__init__.py | calebho/conda-pack | 06b55eff31bc1b8aab765b64924238fa73176793 | [
"BSD-3-Clause"
] | null | null | null | conda_pack/__init__.py | calebho/conda-pack | 06b55eff31bc1b8aab765b64924238fa73176793 | [
"BSD-3-Clause"
] | null | null | null | conda_pack/__init__.py | calebho/conda-pack | 06b55eff31bc1b8aab765b64924238fa73176793 | [
"BSD-3-Clause"
] | null | null | null | from . import _version
from .core import CondaEnv, CondaPackException, File, pack
__version__ = _version.get_versions()['version']
| 26.4 | 58 | 0.787879 | from . import _version
from .core import CondaEnv, CondaPackException, File, pack
__version__ = _version.get_versions()['version']
| true | true |
f701fef52c14cd1ab59e97d3208e9fba872d50d7 | 14,368 | py | Python | flare/framework/agent.py | skylian/flare | c920abcae975cc49c052f5f2abb6bbee5c39a11e | [
"Apache-2.0"
] | null | null | null | flare/framework/agent.py | skylian/flare | c920abcae975cc49c052f5f2abb6bbee5c39a11e | [
"Apache-2.0"
] | null | null | null | flare/framework/agent.py | skylian/flare | c920abcae975cc49c052f5f2abb6bbee5c39a11e | [
"Apache-2.0"
] | 1 | 2018-10-15T21:38:29.000Z | 2018-10-15T21:38:29.000Z | from abc import ABCMeta, abstractmethod
from multiprocessing import Process, Value
import numpy as np
from flare.common.log import GameLogEntry
from flare.common.communicator import AgentCommunicator
from flare.common.replay_buffer import NoReplacementQueue, ReplayBuffer, Experience
class AgentHelper(object):
"""... | 36.374684 | 93 | 0.600362 | from abc import ABCMeta, abstractmethod
from multiprocessing import Process, Value
import numpy as np
from flare.common.log import GameLogEntry
from flare.common.communicator import AgentCommunicator
from flare.common.replay_buffer import NoReplacementQueue, ReplayBuffer, Experience
class AgentHelper(object):
__m... | true | true |
f701ff2a39c9302a8a5530d6b4a34c9cdf05ddd0 | 1,302 | py | Python | custom_components/ge_home/devices/washer_dryer.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 41 | 2021-08-02T02:15:54.000Z | 2022-03-30T11:11:42.000Z | custom_components/ge_home/devices/washer_dryer.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 46 | 2021-08-03T02:20:59.000Z | 2022-03-30T11:17:15.000Z | custom_components/ge_home/devices/washer_dryer.py | olds/ha_gehome | 5cb24deab64bcade45861da0497a84631845922c | [
"MIT"
] | 15 | 2021-08-31T00:21:33.000Z | 2022-03-30T12:53:21.000Z | import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk import ErdCode, ErdApplianceType
from .washer import WasherApi
from .dryer import DryerApi
from ..entities import GeErdSensor, GeErdBinarySensor
_LOGGER = logging.getLogger(__name__)
class WasherDryerApi(WasherApi,... | 35.189189 | 85 | 0.725038 | import logging
from typing import List
from homeassistant.helpers.entity import Entity
from gehomesdk import ErdCode, ErdApplianceType
from .washer import WasherApi
from .dryer import DryerApi
from ..entities import GeErdSensor, GeErdBinarySensor
_LOGGER = logging.getLogger(__name__)
class WasherDryerApi(WasherApi,... | true | true |
f701ffb04ee003deff62ba9a43c50dc9568f0b5f | 6,275 | py | Python | pyldpc/decoder.py | c-w-m/pyldpc | c7eb471359086b7336d7b40f11cc912f0daf0476 | [
"BSD-3-Clause"
] | 69 | 2017-03-12T17:48:54.000Z | 2022-03-25T13:18:46.000Z | pyldpc/decoder.py | hichamjanati/pyldpc | a821ccd1eb3a13b8a0f66ebba8d9923ce2f528ef | [
"BSD-3-Clause"
] | 20 | 2018-03-14T14:29:41.000Z | 2021-12-29T15:40:27.000Z | pyldpc/decoder.py | c-w-m/pyldpc | c7eb471359086b7336d7b40f11cc912f0daf0476 | [
"BSD-3-Clause"
] | 29 | 2017-12-26T22:07:34.000Z | 2022-03-27T13:55:57.000Z | """Decoding module."""
import numpy as np
import warnings
from . import utils
from numba import njit, int64, types, float64
def decode(H, y, snr, maxiter=1000):
"""Decode a Gaussian noise corrupted n bits message using BP algorithm.
Decoding is performed in parallel if multiple codewords are passed in y.
... | 29.599057 | 79 | 0.492271 | import numpy as np
import warnings
from . import utils
from numba import njit, int64, types, float64
def decode(H, y, snr, maxiter=1000):
m, n = H.shape
bits_hist, bits_values, nodes_hist, nodes_values = utils._bitsandnodes(H)
_n_bits = np.unique(H.sum(0))
_n_nodes = np.unique(H.sum(1))
if _n_... | true | true |
f701ffdb06c403bc4f6a1e71c86342279da88863 | 69,260 | py | Python | bitmex_swagger/api/order_api.py | silencewwt/bitmex-swagger-client | 01403685eeb12eb27d53a0310d3bc7541793aa0f | [
"MIT"
] | 1 | 2018-08-04T15:05:43.000Z | 2018-08-04T15:05:43.000Z | bitmex_swagger/api/order_api.py | silencewwt/bitmex-swagger | 01403685eeb12eb27d53a0310d3bc7541793aa0f | [
"MIT"
] | null | null | null | bitmex_swagger/api/order_api.py | silencewwt/bitmex-swagger | 01403685eeb12eb27d53a0310d3bc7541793aa0f | [
"MIT"
] | null | null | null | # coding: utf-8
"""
BitMEX API
## REST API for the BitMEX Trading Platform [View Changelog](/app/apiChangelog) ---- #### Getting Started Base URI: [https://www.bitmex.com/api/v1](/api/v1) ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. M... | 66.087786 | 6,648 | 0.665232 |
"""
BitMEX API
## REST API for the BitMEX Trading Platform [View Changelog](/app/apiChangelog) ---- #### Getting Started Base URI: [https://www.bitmex.com/api/v1](/api/v1) ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. Most table queri... | false | true |
f70200850eca38956d7410a98fa9d47cd58d4c0d | 2,895 | py | Python | kubeyard/dependencies.py | socialwifi/kubeyard | 094576e6ad4ff7b9eb419234a3392523cf9e2b18 | [
"BSD-3-Clause"
] | 16 | 2018-11-30T09:53:23.000Z | 2020-06-07T16:36:10.000Z | kubeyard/dependencies.py | socialwifi/kubeyard | 094576e6ad4ff7b9eb419234a3392523cf9e2b18 | [
"BSD-3-Clause"
] | 34 | 2018-12-17T15:22:16.000Z | 2020-08-14T11:04:24.000Z | kubeyard/dependencies.py | socialwifi/kubeyard | 094576e6ad4ff7b9eb419234a3392523cf9e2b18 | [
"BSD-3-Clause"
] | 4 | 2018-12-17T09:57:09.000Z | 2020-05-14T11:16:34.000Z | import logging
import time
import sh
logger = logging.getLogger(__name__)
def is_command_available(name):
try:
sh.bash('which', name)
except sh.ErrorReturnCode:
return False
else:
return True
class KubernetesDependency:
def ensure_running(self):
logger.debug('Checki... | 29.242424 | 99 | 0.56753 | import logging
import time
import sh
logger = logging.getLogger(__name__)
def is_command_available(name):
try:
sh.bash('which', name)
except sh.ErrorReturnCode:
return False
else:
return True
class KubernetesDependency:
def ensure_running(self):
logger.debug('Checki... | true | true |
f7020126c0821383f6a8544cd6c1e7094992bb87 | 25 | py | Python | btd6_memory_info/generated/Unity/Collections/LowLevel/Unsafe/UnsafeUtility/unsafe_utility.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Unity/Collections/LowLevel/Unsafe/UnsafeUtility/unsafe_utility.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Unity/Collections/LowLevel/Unsafe/UnsafeUtility/unsafe_utility.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class UnsafeUtility: pass | 25 | 25 | 0.88 | class UnsafeUtility: pass | true | true |
f7020143781683c04a23b0b50295a1890ca68391 | 6,509 | py | Python | server/accounts/models.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | server/accounts/models.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | server/accounts/models.py | janheise/zentral | cd809483573301e7d1aa5d3fc2da2c74a62405ab | [
"Apache-2.0"
] | null | null | null | import enum
from itertools import chain
from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserManager
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.functional import cached_pr... | 32.708543 | 103 | 0.665233 | import enum
from itertools import chain
from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserManager
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.functional import cached_pr... | true | true |
f70201eec12852521092e1ed9d3f5bc7a9cd90c2 | 976 | py | Python | deepdab/ai/td0_policy.py | lantunes/deepdab | 0e30f102b9d7c37d3691540496b1649f2704d586 | [
"Apache-2.0"
] | 1 | 2019-04-04T02:26:51.000Z | 2019-04-04T02:26:51.000Z | deepdab/ai/td0_policy.py | lantunes/deepdab | 0e30f102b9d7c37d3691540496b1649f2704d586 | [
"Apache-2.0"
] | null | null | null | deepdab/ai/td0_policy.py | lantunes/deepdab | 0e30f102b9d7c37d3691540496b1649f2704d586 | [
"Apache-2.0"
] | null | null | null | from deepdab.ai import *
class TDZeroPolicy(TabularPolicy):
def __init__(self, board_size, learning_rate=0.0, gamma=0.0, epsilon=0.0, initial_state_value=0.0, table_file_path=None):
super(TDZeroPolicy, self).__init__(board_size=board_size, epsilon=epsilon,
initia... | 57.411765 | 163 | 0.743852 | from deepdab.ai import *
class TDZeroPolicy(TabularPolicy):
def __init__(self, board_size, learning_rate=0.0, gamma=0.0, epsilon=0.0, initial_state_value=0.0, table_file_path=None):
super(TDZeroPolicy, self).__init__(board_size=board_size, epsilon=epsilon,
initia... | true | true |
f7020205688de508cdcaf88f06fa23f6198f18be | 132 | py | Python | tests/classification/digits/ws_digits_SGDClassifier_db2_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 1 | 2019-07-09T14:45:18.000Z | 2019-07-09T14:45:18.000Z | tests/classification/digits/ws_digits_SGDClassifier_db2_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 5 | 2017-11-13T13:35:37.000Z | 2021-11-11T12:57:20.000Z | tests/classification/digits/ws_digits_SGDClassifier_db2_code_gen.py | antoinecarme/sklearn2sql_heroku | d680db10683daa419324461eeea851dd8b103ad5 | [
"BSD-3-Clause"
] | 1 | 2021-09-19T15:05:33.000Z | 2021-09-19T15:05:33.000Z | from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SGDClassifier" , "digits" , "db2")
| 26.4 | 72 | 0.80303 | from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SGDClassifier" , "digits" , "db2")
| true | true |
f702024c3c01565b670bab7999a264ce4f0d7f8d | 260 | py | Python | slack_app/tasks.py | webscopeio/django-slack-app | 65abb3717460c51a19c1238eb0572f25c47b2a42 | [
"MIT"
] | 3 | 2020-06-23T10:02:48.000Z | 2020-10-28T11:59:28.000Z | slack_app/tasks.py | webscopeio/django-slack-integration | 65abb3717460c51a19c1238eb0572f25c47b2a42 | [
"MIT"
] | 2 | 2020-02-17T11:42:03.000Z | 2020-02-18T13:46:38.000Z | slack_app/tasks.py | webscopeio/django-slack-integration | 65abb3717460c51a19c1238eb0572f25c47b2a42 | [
"MIT"
] | 4 | 2020-10-11T11:02:58.000Z | 2022-03-14T08:23:42.000Z | from celery import shared_task
from .signals import slack_event_received
@shared_task
def receive_slack_signal_task(sender, event_type, event_data, **data):
slack_event_received.send(sender=sender, event_type=event_type, event_data=event_data, **data)
| 26 | 98 | 0.819231 | from celery import shared_task
from .signals import slack_event_received
@shared_task
def receive_slack_signal_task(sender, event_type, event_data, **data):
slack_event_received.send(sender=sender, event_type=event_type, event_data=event_data, **data)
| true | true |
f702027b07c86443c8a600458c57b03f9799e7d6 | 370 | py | Python | 10_days_of_statistics_5_4.py | sercangul/HackerRank | e6d7056babe03baafee8d7f1cacdca7c28b72ded | [
"Apache-2.0"
] | null | null | null | 10_days_of_statistics_5_4.py | sercangul/HackerRank | e6d7056babe03baafee8d7f1cacdca7c28b72ded | [
"Apache-2.0"
] | null | null | null | 10_days_of_statistics_5_4.py | sercangul/HackerRank | e6d7056babe03baafee8d7f1cacdca7c28b72ded | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 19:19:34 2019
@author: sercangul
"""
from math import erf
std = 10
h1 = 80
h2 = 60
mean = 70
def N(mean, std, x):
return 0.5 + 0.5 * erf((x-mean)/(std* 2**0.5))
print (round(((1 - N(mean,std,h1))*100),2))
print (round(((1 - N(mean,std,h2)... | 17.619048 | 50 | 0.575676 |
from math import erf
std = 10
h1 = 80
h2 = 60
mean = 70
def N(mean, std, x):
return 0.5 + 0.5 * erf((x-mean)/(std* 2**0.5))
print (round(((1 - N(mean,std,h1))*100),2))
print (round(((1 - N(mean,std,h2))*100),2))
print (round(((N(mean,std,h2)*100)),2)) | true | true |
f7020407270c486b259d7d6e15d11395208c8459 | 22,252 | py | Python | finder/planets.py | astrohr/dagor-preprocessing | 7b44d39f5559cab5e8cf12234193903336d77e36 | [
"MIT"
] | null | null | null | finder/planets.py | astrohr/dagor-preprocessing | 7b44d39f5559cab5e8cf12234193903336d77e36 | [
"MIT"
] | null | null | null | finder/planets.py | astrohr/dagor-preprocessing | 7b44d39f5559cab5e8cf12234193903336d77e36 | [
"MIT"
] | null | null | null | import requests
import requests_cache
from bs4 import BeautifulSoup
import json
from lxml import html
import pdb
import re
import sys
import logging
import datetime
import time
# import winsound
from jinja2 import Environment, FileSystemLoader
import math
import itertools
from playsound import playsound
class Planet... | 42.223909 | 313 | 0.574915 | import requests
import requests_cache
from bs4 import BeautifulSoup
import json
from lxml import html
import pdb
import re
import sys
import logging
import datetime
import time
from jinja2 import Environment, FileSystemLoader
import math
import itertools
from playsound import playsound
class Planet:
maxSca... | true | true |
f70204479a221f5e4f1dc384ae7a40ef6e0943b2 | 2,124 | py | Python | cml/install_dependencies.py | meechos/CML_AMP_Summarize | 6ded75ef2823cd3a70f8ab1a773c09068300d069 | [
"Apache-2.0"
] | 1 | 2021-09-24T18:53:46.000Z | 2021-09-24T18:53:46.000Z | cml/install_dependencies.py | meechos/CML_AMP_Summarize | 6ded75ef2823cd3a70f8ab1a773c09068300d069 | [
"Apache-2.0"
] | 2 | 2021-09-03T16:42:58.000Z | 2021-09-04T04:54:23.000Z | cml/install_dependencies.py | meechos/CML_AMP_Summarize | 6ded75ef2823cd3a70f8ab1a773c09068300d069 | [
"Apache-2.0"
] | 3 | 2021-11-17T14:08:48.000Z | 2022-03-31T22:02:09.000Z | # ###########################################################################
#
# CLOUDERA APPLIED MACHINE LEARNING PROTOTYPE (AMP)
# (C) Cloudera, Inc. 2021
# All rights reserved.
#
# Applicable Open Source License: Apache 2.0
#
# NOTE: Cloudera open source products are modular software products
# made up of hun... | 49.395349 | 77 | 0.704802 | false | true | |
f70206340a2324d17bb06e8517c8d216679dd42c | 1,006 | py | Python | bizfriendly/settings.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 13 | 2015-04-27T14:26:19.000Z | 2021-11-21T16:11:17.000Z | bizfriendly/settings.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 15 | 2015-04-25T22:29:50.000Z | 2016-09-01T16:59:21.000Z | bizfriendly/settings.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 9 | 2015-06-19T19:48:40.000Z | 2021-04-16T10:27:29.000Z | from bizfriendly import app
from flask.ext.heroku import Heroku
import os
heroku = Heroku(app) # Sets CONFIG automagically
app.config.update(
# DEBUG = True,
# SQLALCHEMY_DATABASE_URI = 'postgres://hackyourcity@localhost/howtocity',
# SQLALCHEMY_DATABASE_URI = 'postgres://postgres:root@localhost/howtocity'... | 41.916667 | 95 | 0.752485 | from bizfriendly import app
from flask.ext.heroku import Heroku
import os
heroku = Heroku(app)
app.config.update(
)
app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY')
app.config['MAIL_GUN_KEY'] = os.environ.get('MAIL_GUN_KEY')
app.config['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_... | true | true |
f70206cc800c5e0d94292d32c57ac589cda0f286 | 172 | py | Python | learn1/46.py | raghavi101/HackerRank | 48bf812f1b3c60b5201a95458be76ae9b7323a88 | [
"MIT"
] | null | null | null | learn1/46.py | raghavi101/HackerRank | 48bf812f1b3c60b5201a95458be76ae9b7323a88 | [
"MIT"
] | null | null | null | learn1/46.py | raghavi101/HackerRank | 48bf812f1b3c60b5201a95458be76ae9b7323a88 | [
"MIT"
] | null | null | null | from itertools import product
aarr = list(map(int, input().split()))
barr = list(map(int, input().split()))
print(' '.join(str(i) for i in list(product(*[aarr, barr]))))
| 24.571429 | 61 | 0.651163 | from itertools import product
aarr = list(map(int, input().split()))
barr = list(map(int, input().split()))
print(' '.join(str(i) for i in list(product(*[aarr, barr]))))
| true | true |
f702081e249e1d95321d52a2424e1f7a8a4b4c3a | 5,409 | py | Python | previous/week12/object-oriented/FactorySystemOO.py | code-lab-org/sys611 | 3b8c46788dee629a9f2d6b7f84373e041b918ff0 | [
"MIT"
] | 3 | 2021-04-07T03:52:07.000Z | 2022-03-04T18:16:16.000Z | previous/week12/object-oriented/FactorySystemOO.py | code-lab-org/sys611 | 3b8c46788dee629a9f2d6b7f84373e041b918ff0 | [
"MIT"
] | null | null | null | previous/week12/object-oriented/FactorySystemOO.py | code-lab-org/sys611 | 3b8c46788dee629a9f2d6b7f84373e041b918ff0 | [
"MIT"
] | 6 | 2021-02-12T01:57:23.000Z | 2022-03-04T18:05:27.000Z | """
SYS-611: Example factory model in SimPy (object-oriented).
@author: Paul T. Grogan, pgrogan@stevens.edu
"""
# import the python3 behavior for importing, division, and printing in python2
from __future__ import absolute_import, division, print_function
# import the simpy package
# see https://simpy.readthedocs.i... | 32.781818 | 87 | 0.621557 |
from __future__ import absolute_import, division, print_function
import simpy
import numpy as np
import matplotlib.pyplot as plt
NUM_RUNS = 1
SIM_DURATION = 5*8*52
NUM_SPARES = 20
NUM_REPAIRERS = 5
class Factory(object):
def __init__(self, env, num_repairers, num_spares):
self.repairers... | true | true |
f702082ae713bdb7800692e65c05918519ebe0f6 | 809 | py | Python | flower/views/workers.py | KonstantinKlepikov/flower | 89e71c8c00dcb51bc584e908fc6b2ba97706e89a | [
"BSD-3-Clause"
] | 1 | 2020-07-04T23:10:39.000Z | 2020-07-04T23:10:39.000Z | flower/views/workers.py | KonstantinKlepikov/flower | 89e71c8c00dcb51bc584e908fc6b2ba97706e89a | [
"BSD-3-Clause"
] | null | null | null | flower/views/workers.py | KonstantinKlepikov/flower | 89e71c8c00dcb51bc584e908fc6b2ba97706e89a | [
"BSD-3-Clause"
] | null | null | null | import logging
from tornado import web
from tornado import gen
from ..views import BaseHandler
from ..api.workers import ListWorkers
logger = logging.getLogger(__name__)
class WorkerView(BaseHandler):
@web.authenticated
@gen.coroutine
def get(self, name):
try:
yield ListWorkers.upd... | 24.515152 | 83 | 0.621755 | import logging
from tornado import web
from tornado import gen
from ..views import BaseHandler
from ..api.workers import ListWorkers
logger = logging.getLogger(__name__)
class WorkerView(BaseHandler):
@web.authenticated
@gen.coroutine
def get(self, name):
try:
yield ListWorkers.upd... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.