hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
632076a5b0b4718ee9b622d4f1c6eb2d7a83c415 | 2,131 | py | Python | join.py | geekyvyas/Sleep-Tight | 20aaaf6d192fbec97bc549e6024fe13247beac19 | [
"MIT"
] | 2 | 2020-12-01T02:53:23.000Z | 2020-12-01T04:37:37.000Z | join.py | geekyvyas/Sleep-Tight | 20aaaf6d192fbec97bc549e6024fe13247beac19 | [
"MIT"
] | null | null | null | join.py | geekyvyas/Sleep-Tight | 20aaaf6d192fbec97bc549e6024fe13247beac19 | [
"MIT"
] | 2 | 2020-11-27T19:02:57.000Z | 2020-12-01T05:30:10.000Z | import pickle
from firebase import firebase
import pyautogui
import time
firebase = firebase.FirebaseApplication('https://sleep-tight-8a6df.firebaseio.com/', None)
id2 = pickle.load(open("chrome","rb"))
X = firebase.get('/sleep-tight-8a6df/Chrome/'+ str(id2) , 'CX' )
Y = firebase.get('/sleep-tight-8a6df/Chrome/'+ st... | 26.6375 | 97 | 0.679493 | import pickle
from firebase import firebase
import pyautogui
import time
def space(saq):
for j in range(0, saq):
pyautogui.scroll(-100)
def slass(st):
id2 = pickle.load(open(st+"1","rb"))
CX = firebase.get('/sleep-tight-8a6df/'+st+'/'+ str(id2) , 'X' )
CY = firebase.get('/sleep-tight-8a6df/'+... | 254 | 0 | 46 |
96a0a75dc8ec2587e6eff3eebbee708fbf747ff7 | 5,361 | py | Python | tests/functional/regressions/test_refactoring_execution.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 530 | 2019-06-04T11:45:36.000Z | 2022-03-31T09:29:56.000Z | tests/functional/regressions/test_refactoring_execution.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 242 | 2019-06-04T11:53:08.000Z | 2022-03-28T07:06:27.000Z | tests/functional/regressions/test_refactoring_execution.py | matt-koevort/tartiflette | 5777866b133d846ce4f8aa03f735fa81832896cd | [
"MIT"
] | 36 | 2019-06-21T06:40:27.000Z | 2021-11-04T13:11:16.000Z | import pytest
_EXPECTED = {
"data": {
"dog": {
"name": "Dog",
"nickname": "Doggo",
"barkVolume": 2,
"doesKnowCommand": True,
"isHousetrained": False,
"owner": {"name": "Hooman"},
}
}
}
@pytest.mark.asyncio
@pyte... | 24.705069 | 73 | 0.403096 | import pytest
async def resolve_query_dog(parent, args, ctx, info):
return {"name": "Dog", "nickname": "Doggo", "barkVolume": 2}
async def resolve_dog_does_know_command(parent, args, ctx, info):
return True
async def resolve_dog_is_housetrained(parent, args, ctx, info):
return False
async def resolv... | 1,015 | 0 | 229 |
16cce0186da20c0727107873fe01ccdc2e82f594 | 1,632 | py | Python | setup.py | msftgits/xblock-azure-media-services | ab0a61484611d990d603cc4e3dbeac7c43be435f | [
"MIT"
] | 7 | 2016-08-12T03:48:18.000Z | 2018-07-30T23:02:29.000Z | setup.py | msftgits/xblock-azure-media-services | ab0a61484611d990d603cc4e3dbeac7c43be435f | [
"MIT"
] | 17 | 2017-01-31T03:20:20.000Z | 2018-11-02T21:36:09.000Z | setup.py | msftgits/xblock-azure-media-services | ab0a61484611d990d603cc4e3dbeac7c43be435f | [
"MIT"
] | 11 | 2019-08-13T07:11:32.000Z | 2021-12-30T09:52:03.000Z | # Copyright (c) Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT license. See LICENSE file on the project webpage for details.
"""Setup for azure_media_services XBlock."""
import os
from setuptools import setup
def package_data(pkg, roots):
"""Generic function to find package_data.
All ... | 29.672727 | 105 | 0.637255 | # Copyright (c) Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT license. See LICENSE file on the project webpage for details.
"""Setup for azure_media_services XBlock."""
import os
from setuptools import setup
def package_data(pkg, roots):
"""Generic function to find package_data.
All ... | 0 | 0 | 0 |
250e3619ae2c338be24317e38207f7f12ae1b258 | 2,206 | py | Python | pipeline/coann/brents_bpbio/biostuff/tests/test_blast_line.py | gturco/find_cns | 63e08d17d9c81e250ef2637216fbf947cc295823 | [
"MIT"
] | 4 | 2016-03-21T19:19:24.000Z | 2019-10-23T09:20:13.000Z | pipeline/coann/brents_bpbio/biostuff/tests/test_blast_line.py | hengbingao/find_cns | 63e08d17d9c81e250ef2637216fbf947cc295823 | [
"MIT"
] | 10 | 2016-03-21T16:55:29.000Z | 2022-03-22T07:26:03.000Z | pipeline/coann/brents_bpbio/biostuff/tests/test_blast_line.py | hengbingao/find_cns | 63e08d17d9c81e250ef2637216fbf947cc295823 | [
"MIT"
] | 5 | 2016-03-02T16:20:05.000Z | 2021-07-28T02:31:23.000Z | from biostuff import BlastLine, BlastFile
some_attrs = ('qstart', 'qstop', 'sstart', 'sstop', 'pctid', 'score', 'query',
'subject')
| 26.261905 | 78 | 0.601995 | from biostuff import BlastLine, BlastFile
some_attrs = ('qstart', 'qstop', 'sstart', 'sstop', 'pctid', 'score', 'query',
'subject')
def test_blastfile():
f = "tests/data/tabd.blast"
bf = BlastFile(f)
fh = open(f, 'r')
# iterate via python and c and check each line is the same.
for line, ... | 1,898 | 0 | 161 |
78b965963b0fdbf939b3cdfaf57a5f0c64642a25 | 1,433 | py | Python | enemy.py | Harris-Lodi/Alien_Invasion_Game | 449f694d5a51c806d5174a1a122dc881a3cb1ca0 | [
"MIT"
] | null | null | null | enemy.py | Harris-Lodi/Alien_Invasion_Game | 449f694d5a51c806d5174a1a122dc881a3cb1ca0 | [
"MIT"
] | null | null | null | enemy.py | Harris-Lodi/Alien_Invasion_Game | 449f694d5a51c806d5174a1a122dc881a3cb1ca0 | [
"MIT"
] | null | null | null | import pygame
from pygame.sprite import Sprite
# a class to represent a single enemy in the fleet
# init the enemy and it's starting position
# function to check if enemy is at edge of screen
# enemy update function
| 31.844444 | 77 | 0.653873 | import pygame
from pygame.sprite import Sprite
# a class to represent a single enemy in the fleet
class Enemy(Sprite):
# init the enemy and it's starting position
def __init__(self, ai_game):
# just like with bullet, initialize the Sprite super class
# and set enemy to main game screen
... | 1,100 | -1 | 100 |
aa4d461901599ec9db199d26d7650629fd8584e3 | 10,822 | py | Python | error_report/sentry.py | biolab/orange-web | f1b1e4fc6acd00dd4033cdf55baef0b8d216428a | [
"Qhull"
] | 17 | 2016-04-14T17:07:20.000Z | 2021-02-14T09:27:50.000Z | error_report/sentry.py | biolab/orange-web | f1b1e4fc6acd00dd4033cdf55baef0b8d216428a | [
"Qhull"
] | 38 | 2015-08-28T08:53:20.000Z | 2019-05-10T11:49:24.000Z | error_report/sentry.py | biolab/orange-web | f1b1e4fc6acd00dd4033cdf55baef0b8d216428a | [
"Qhull"
] | 27 | 2015-01-29T10:44:12.000Z | 2021-12-12T17:21:26.000Z | import copy
import logging
import re
import uuid
from django.conf import settings
from raven import Client
logger = logging.getLogger(__name__)
REPORTS_BASE_URL = 'http://qa.orange.biolab.si/errors/{}'
PYTHON_FOLDERS = [
"site-packages",
"dist-packages",
"Python34.lib",
"anaconda3.lib",
"lib.pyt... | 41.305344 | 151 | 0.660044 | import copy
import logging
import re
import uuid
from django.conf import settings
from raven import Client
logger = logging.getLogger(__name__)
REPORTS_BASE_URL = 'http://qa.orange.biolab.si/errors/{}'
PYTHON_FOLDERS = [
"site-packages",
"dist-packages",
"Python34.lib",
"anaconda3.lib",
"lib.pyt... | 6,023 | 0 | 230 |
3f095342eb1ff4768b62daab63c4c5199750e7c7 | 1,465 | py | Python | amd64-linux/lib/python/mod_AM79C973_commands.py | qiyancos/Simics-3.0.31 | 9bd52d5abad023ee87a37306382a338abf7885f1 | [
"BSD-4-Clause",
"FSFAP"
] | 1 | 2020-06-15T10:41:18.000Z | 2020-06-15T10:41:18.000Z | amd64-linux/lib/python/mod_AM79C973_commands.py | qiyancos/Simics-3.0.31 | 9bd52d5abad023ee87a37306382a338abf7885f1 | [
"BSD-4-Clause",
"FSFAP"
] | null | null | null | amd64-linux/lib/python/mod_AM79C973_commands.py | qiyancos/Simics-3.0.31 | 9bd52d5abad023ee87a37306382a338abf7885f1 | [
"BSD-4-Clause",
"FSFAP"
] | 3 | 2020-08-10T10:25:02.000Z | 2021-09-12T01:12:09.000Z | # Copyright 2006-2007 Virtutech AB
import sim_commands
sim_commands.new_pci_header_command('AM79C973', None)
sim_commands.new_info_command('AM79C973', get_info)
sim_commands.new_status_command('AM79C973', get_status)
| 38.552632 | 92 | 0.564505 | # Copyright 2006-2007 Virtutech AB
import sim_commands
def checkbit(a, bit):
if a & (1 << bit):
return 1
else:
return 0
def get_info(obj):
return [ (None, [
("PHY object", obj.phy),
] ) ] + sim_commands.get_pci_info(obj)
def get_status(obj):
csr0 = obj.csr_csr0
cs... | 1,177 | 0 | 69 |
1952ef4f5d62b3cb9b445e1bcbb21e0b780982a0 | 638 | py | Python | Testing/unit_test/pytest_for_python/tests/test_setup_teardown_demo.py | Ziang-Lu/edX-Software-Object-Oriented-Design | f0d7660c8377c0055e61978bda754a82079f2856 | [
"MIT"
] | 1 | 2018-04-04T21:44:46.000Z | 2018-04-04T21:44:46.000Z | Testing/unit_test/pytest_for_python/tests/test_setup_teardown_demo.py | Ziang-Lu/Software-Development-and-Design | f0d7660c8377c0055e61978bda754a82079f2856 | [
"MIT"
] | null | null | null | Testing/unit_test/pytest_for_python/tests/test_setup_teardown_demo.py | Ziang-Lu/Software-Development-and-Design | f0d7660c8377c0055e61978bda754a82079f2856 | [
"MIT"
] | null | null | null | #!usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pytest setup_module() and teardown_module() demo.
Assumption: creating a user is a very resource-consuming process
=> Thus, we don't want to do user creation every time we run a test.
"""
__author__ = 'Ziang Lu'
import pytest
from pytest_for_python.src.codes import... | 18.228571 | 72 | 0.725705 | #!usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pytest setup_module() and teardown_module() demo.
Assumption: creating a user is a very resource-consuming process
=> Thus, we don't want to do user creation every time we run a test.
"""
__author__ = 'Ziang Lu'
import pytest
from pytest_for_python.src.codes import... | 175 | 0 | 92 |
4fdbc43ae4020bb00409ab430663c9095dfffe93 | 12,036 | py | Python | sassh/main.py | joaompinto/sassh | d41df6cc7529f254244e1bff0ca67fc73523e4c1 | [
"Apache-2.0"
] | 1 | 2017-09-23T20:57:05.000Z | 2017-09-23T20:57:05.000Z | sassh/main.py | joaompinto/sassh | d41df6cc7529f254244e1bff0ca67fc73523e4c1 | [
"Apache-2.0"
] | 1 | 2017-08-18T07:32:28.000Z | 2017-08-18T08:02:26.000Z | sassh/main.py | joaompinto/sassh | d41df6cc7529f254244e1bff0ca67fc73523e4c1 | [
"Apache-2.0"
] | 1 | 2019-07-17T13:22:38.000Z | 2019-07-17T13:22:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import socket
import errno
from getpass import getpass
from optparse import OptionParser
from sassh.connectionlib import Library, Connection
from sassh.sshclient import SSHClient
from paramiko import SSHException
try:
import pygtk
pygtk.requir... | 41.360825 | 97 | 0.547607 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import socket
import errno
from getpass import getpass
from optparse import OptionParser
from sassh.connectionlib import Library, Connection
from sassh.sshclient import SSHClient
from paramiko import SSHException
try:
import pygtk
pygtk.requir... | 183 | 0 | 27 |
122621fb346426bde1492a27cde9e0a3a348a9cc | 2,456 | py | Python | tests/etl/epic2op/predictor_server_long.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | tests/etl/epic2op/predictor_server_long.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | tests/etl/epic2op/predictor_server_long.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import asyncio
import logging
import os
import json
import etl.io_config.server_protocol as protocol
alert_dns = '127.0.0.1'
predictor_dns = '0.0.0.0'
SRV_LOG_FMT = '%(asctime)s|%(name)s|%(process)s-%(thread)s|%(levelname)s|%(message)s'
logging.basicConfig(level=logging.INFO, format=SRV_LOG_FMT)
loop = asyncio.ge... | 26.408602 | 106 | 0.680782 | import asyncio
import logging
import os
import json
import etl.io_config.server_protocol as protocol
alert_dns = '127.0.0.1'
predictor_dns = '0.0.0.0'
SRV_LOG_FMT = '%(asctime)s|%(name)s|%(process)s-%(thread)s|%(levelname)s|%(message)s'
logging.basicConfig(level=logging.INFO, format=SRV_LOG_FMT)
async def start_pre... | 1,692 | 0 | 46 |
2fd714a8950f2c7b4486141a9f24bd33c7a6eb72 | 14,375 | py | Python | ironic_inspector/plugins/standard.py | NaohiroTamura/ironic-inspector | 7b7fba72de46806ce84d6d4758a2343b52b0c96d | [
"Apache-2.0"
] | null | null | null | ironic_inspector/plugins/standard.py | NaohiroTamura/ironic-inspector | 7b7fba72de46806ce84d6d4758a2343b52b0c96d | [
"Apache-2.0"
] | null | null | null | ironic_inspector/plugins/standard.py | NaohiroTamura/ironic-inspector | 7b7fba72de46806ce84d6d4758a2343b52b0c96d | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 40.954416 | 79 | 0.559304 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 2,209 | 0 | 81 |
5b230dec7eab3cfb02f6bb4a08d27808289fbced | 366 | py | Python | oommfc/evolvers/__init__.py | ubermag/oommfc | 38deb4f6209fff03c4b9d573f84c934af7d078a5 | [
"BSD-3-Clause"
] | 23 | 2019-09-18T10:58:00.000Z | 2022-02-07T07:05:49.000Z | oommfc/evolvers/__init__.py | ubermag/oommfc | 38deb4f6209fff03c4b9d573f84c934af7d078a5 | [
"BSD-3-Clause"
] | 43 | 2019-08-22T04:31:36.000Z | 2022-03-28T09:09:15.000Z | oommfc/evolvers/__init__.py | ubermag/oommfc | 38deb4f6209fff03c4b9d573f84c934af7d078a5 | [
"BSD-3-Clause"
] | 7 | 2020-04-25T13:25:25.000Z | 2021-12-06T15:06:28.000Z | from .cgevolver import CGEvolver
from .eulerevolver import EulerEvolver
from .rungekuttaevolver import RungeKuttaEvolver
from .spintevolver import SpinTEvolver
from .spinxferevolver import SpinXferEvolver
from .uhh_thetaevolver import UHH_ThetaEvolver
from .xf_thermheunevolver import Xf_ThermHeunEvolver
from .xf_therms... | 40.666667 | 60 | 0.89071 | from .cgevolver import CGEvolver
from .eulerevolver import EulerEvolver
from .rungekuttaevolver import RungeKuttaEvolver
from .spintevolver import SpinTEvolver
from .spinxferevolver import SpinXferEvolver
from .uhh_thetaevolver import UHH_ThetaEvolver
from .xf_thermheunevolver import Xf_ThermHeunEvolver
from .xf_therms... | 0 | 0 | 0 |
db849eea5e1442cdce0205480c96ac7d81db1226 | 803 | py | Python | restrictmethodorigin/base.py | Ruhshan/django-restrictmethodorigin | 9c02e1e9851ca7cdc07620ffdb081668ee648e5d | [
"MIT"
] | 2 | 2018-03-11T16:09:34.000Z | 2018-07-16T06:51:53.000Z | restrictmethodorigin/base.py | Ruhshan/django-restrictmethodorigin | 9c02e1e9851ca7cdc07620ffdb081668ee648e5d | [
"MIT"
] | null | null | null | restrictmethodorigin/base.py | Ruhshan/django-restrictmethodorigin | 9c02e1e9851ca7cdc07620ffdb081668ee648e5d | [
"MIT"
] | null | null | null | from django.conf import settings
from django.http import HttpResponseForbidden
target_methods = settings.METHOD_ORIGIN.keys()
http_methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] | 33.458333 | 77 | 0.632628 | from django.conf import settings
from django.http import HttpResponseForbidden
target_methods = settings.METHOD_ORIGIN.keys()
http_methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
def OriginRestrictor(get_response):
def middleware(request):
forbid = False
for method in htt... | 575 | 0 | 23 |
70a6ef452aec3b684b02e99d069966cee34a952c | 928 | py | Python | Mundo 3/Aula17.Ex85.py | uirasiqueira/Exercicios_Python | 409b7be9cf278e3043149654de7b41be56a3d951 | [
"MIT"
] | null | null | null | Mundo 3/Aula17.Ex85.py | uirasiqueira/Exercicios_Python | 409b7be9cf278e3043149654de7b41be56a3d951 | [
"MIT"
] | null | null | null | Mundo 3/Aula17.Ex85.py | uirasiqueira/Exercicios_Python | 409b7be9cf278e3043149654de7b41be56a3d951 | [
"MIT"
] | null | null | null | ''' Crie um programa onde o usuário possa digitar sete valores numéricos e cadastre-os
em uma lista única que mantenha separados os valores pares e ímpares.
No final, mostre os valores pares e ímpares em ordem crescente.'''
'''princ = []
impar= []
par= []
for c in range (0,7):
n = int(input('Digite um número: '))
... | 27.294118 | 86 | 0.632543 | ''' Crie um programa onde o usuário possa digitar sete valores numéricos e cadastre-os
em uma lista única que mantenha separados os valores pares e ímpares.
No final, mostre os valores pares e ímpares em ordem crescente.'''
'''princ = []
impar= []
par= []
for c in range (0,7):
n = int(input('Digite um número: '))
... | 0 | 0 | 0 |
1e0c4b6f02e04cd28a089a60101106ce4a5f7ec2 | 1,456 | py | Python | slack_conn.py | eshioji/omibot | 606377942350a61ec128fbcd6e3ec1cf8d1605b7 | [
"Apache-2.0"
] | null | null | null | slack_conn.py | eshioji/omibot | 606377942350a61ec128fbcd6e3ec1cf8d1605b7 | [
"Apache-2.0"
] | null | null | null | slack_conn.py | eshioji/omibot | 606377942350a61ec128fbcd6e3ec1cf8d1605b7 | [
"Apache-2.0"
] | null | null | null | import time
from slackclient import SlackClient
import common
import config
if __name__ == '__main__':
conn = SlackConn(config.slack_token)
conn.upload_img('/Users/omibot/data/omibot/sentry/Dienstag, 31. Oktober 2017 um 14:15:51/Image2.jpeg', '#allgemein')
| 26.962963 | 120 | 0.538462 | import time
from slackclient import SlackClient
import common
import config
class SlackConn:
def __init__(self, slack_token):
self.slack_token = slack_token
self.sc = SlackClient(slack_token)
self.listening = True
def post_msg(self, msg, channel=config.general_channel):
ret ... | 1,061 | -5 | 130 |
14223365b4a249e7ea4ba0ff7d14b335763258c3 | 609 | py | Python | easistrain/log_parameters.py | woutdenolf/easistrain | 0484168e33e548af01a5cc649abf815c45b182f1 | [
"MIT"
] | null | null | null | easistrain/log_parameters.py | woutdenolf/easistrain | 0484168e33e548af01a5cc649abf815c45b182f1 | [
"MIT"
] | 11 | 2021-11-10T08:36:22.000Z | 2022-03-21T08:31:17.000Z | easistrain/log_parameters.py | EASI-STRESS/easistrain | 86192d1c4135875daec8e4e4abcb67e372f86efb | [
"MIT"
] | 1 | 2021-08-04T14:02:16.000Z | 2021-08-04T14:02:16.000Z | import os
from datetime import datetime
| 38.0625 | 87 | 0.597701 | import os
from datetime import datetime
def log_parameters(filename, parameters, task_name):
filename = os.path.join(parameters["root_data"], filename)
with open(filename, "w") as fwlog:
fwlog.write(f"{task_name.upper()} LOG FILE\n")
fwlog.write(f"Date and time : {datetime.now()}\n")
f... | 545 | 0 | 23 |
761d615503334752d3b3dc0238f8967f8df622ab | 1,481 | py | Python | SC101_Assignment1/draw_line.py | kevinfang418/sc-projects | c5b9023b137c704de3488fe2f5fe307187d957b6 | [
"MIT"
] | null | null | null | SC101_Assignment1/draw_line.py | kevinfang418/sc-projects | c5b9023b137c704de3488fe2f5fe307187d957b6 | [
"MIT"
] | null | null | null | SC101_Assignment1/draw_line.py | kevinfang418/sc-projects | c5b9023b137c704de3488fe2f5fe307187d957b6 | [
"MIT"
] | null | null | null | """
File: draw_line.py
Name: Kevin Fang
-------------------------
TODO:
"""
from campy.graphics.gobjects import GOval, GLine
from campy.graphics.gwindow import GWindow
from campy.gui.events.mouse import onmouseclicked
# Assign window as constant to create canvas
window = GWindow()
SIZE = 10
# a, b ,c ,d a... | 27.425926 | 87 | 0.594868 | """
File: draw_line.py
Name: Kevin Fang
-------------------------
TODO:
"""
from campy.graphics.gobjects import GOval, GLine
from campy.graphics.gwindow import GWindow
from campy.gui.events.mouse import onmouseclicked
# Assign window as constant to create canvas
window = GWindow()
SIZE = 10
# a, b ,c ,d a... | 710 | 0 | 25 |
b9f156865c4501e3c6f146833e523ef8115f0c71 | 2,473 | py | Python | tests/unit/auth/test_registration_processors.py | Arjun-sna/flask-forum-api-service | 9c33c10269a147d7c5225e9c9106ccc43eb31705 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/auth/test_registration_processors.py | Arjun-sna/flask-forum-api-service | 9c33c10269a147d7c5225e9c9106ccc43eb31705 | [
"BSD-3-Clause"
] | 1 | 2021-11-25T17:25:19.000Z | 2021-11-25T17:25:19.000Z | tests/unit/auth/test_registration_processors.py | Arjun-sna/flask-forum-api-service | 9c33c10269a147d7c5225e9c9106ccc43eb31705 | [
"BSD-3-Clause"
] | null | null | null | from flask import get_flashed_messages
from flask_login import current_user
from app.auth.services.registration import (
AutoActivateUserPostProcessor,
AutologinPostProcessor,
SendActivationPostProcessor,
)
from app.core.auth.activation import AccountActivator
from app.utils.settings import app_config
| 29.440476 | 89 | 0.696725 | from flask import get_flashed_messages
from flask_login import current_user
from app.auth.services.registration import (
AutoActivateUserPostProcessor,
AutologinPostProcessor,
SendActivationPostProcessor,
)
from app.core.auth.activation import AccountActivator
from app.utils.settings import app_config
cl... | 1,766 | 238 | 150 |
3a6cf595448f1392abc3066f4404fa1077c8347f | 1,598 | py | Python | exercise_fstrings_solution.py | annezola/gdi-python | a806f0eca2eb17e5a975cce8d0b1d90490dd455e | [
"MIT"
] | null | null | null | exercise_fstrings_solution.py | annezola/gdi-python | a806f0eca2eb17e5a975cce8d0b1d90490dd455e | [
"MIT"
] | null | null | null | exercise_fstrings_solution.py | annezola/gdi-python | a806f0eca2eb17e5a975cce8d0b1d90490dd455e | [
"MIT"
] | 1 | 2022-01-04T15:26:40.000Z | 2022-01-04T15:26:40.000Z | """ This function should return a string like
"There are NUM planets in the solar system"
where NUM is provided as an argument."""
# Should equal "There are 8 planets in the solar system"
ss1 = solar_system(8)
# Should equal "There are 9 planets in the solar system"
ss2 = solar_system(9)
""" This function should ret... | 31.96 | 63 | 0.704005 | """ This function should return a string like
"There are NUM planets in the solar system"
where NUM is provided as an argument."""
def solar_system(num_planets):
# Replace this line!
return f"There are {num_planets} planets in the solar system"
# Should equal "There are 8 planets in the solar system"
ss1 = solar_s... | 287 | 0 | 88 |
de902fdb86f709ef7f595a5ba51b0a79c8789d68 | 3,256 | py | Python | webradio.py | akaessens/raspi_music | 36c83519036be48cb29db3755a77f5855ba788a0 | [
"MIT"
] | null | null | null | webradio.py | akaessens/raspi_music | 36c83519036be48cb29db3755a77f5855ba788a0 | [
"MIT"
] | null | null | null | webradio.py | akaessens/raspi_music | 36c83519036be48cb29db3755a77f5855ba788a0 | [
"MIT"
] | null | null | null | import logging
import vlc
import xml.etree.ElementTree as ET
import os
import sys
import re
from threading import Timer
from time import sleep
@vlc.CallbackDecorators.LogCb
| 29.071429 | 76 | 0.588452 | import logging
import vlc
import xml.etree.ElementTree as ET
import os
import sys
import re
from threading import Timer
from time import sleep
@vlc.CallbackDecorators.LogCb
def log_callback(data, level, ctx, fmt, args):
if level > 0:
logging.debug("VLC: " + fmt.decode('UTF-8'), args)
pass
class WebR... | 2,759 | 276 | 45 |
5cae7b4d407c82f31dcbfab59de323eab0edb688 | 433 | py | Python | user/admin.py | judeakinwale/SMS-backup | 30636591b43bec94e7406f4c02fde402a5a2e38f | [
"MIT"
] | null | null | null | user/admin.py | judeakinwale/SMS-backup | 30636591b43bec94e7406f4c02fde402a5a2e38f | [
"MIT"
] | null | null | null | user/admin.py | judeakinwale/SMS-backup | 30636591b43bec94e7406f4c02fde402a5a2e38f | [
"MIT"
] | null | null | null | from django.contrib import admin
from user import models
# Register your models here.
admin.site.register(models.User)
admin.site.register(models.Staff)
admin.site.register(models.CourseAdviser)
admin.site.register(models.Student)
admin.site.register(models.Biodata)
admin.site.register(models.AcademicData)
admin.sit... | 27.0625 | 43 | 0.831409 | from django.contrib import admin
from user import models
# Register your models here.
admin.site.register(models.User)
admin.site.register(models.Staff)
admin.site.register(models.CourseAdviser)
admin.site.register(models.Student)
admin.site.register(models.Biodata)
admin.site.register(models.AcademicData)
admin.sit... | 0 | 0 | 0 |
fb054d420db735d95ad2eb975049ec59b089b6d7 | 1,409 | py | Python | dictionaries/ForceBook_dictionary.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | dictionaries/ForceBook_dictionary.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | null | null | null | dictionaries/ForceBook_dictionary.py | MaggieIllustrations/softuni-github-programming | f5695cb14602f3d2974359f6d8734332acc650d3 | [
"MIT"
] | 1 | 2022-01-14T17:12:44.000Z | 2022-01-14T17:12:44.000Z | line = input()
sides = {}
while line != "Lumpawaroo":
if " | " in line:
args = line.split(" | ")
side = args[0]
user = args[1]
# TODO If you receive forceSide | forceUser, you should check if such forceUser already exists, and if not, add him/her to the corresponding side
if... | 23.881356 | 153 | 0.504613 | line = input()
sides = {}
while line != "Lumpawaroo":
if " | " in line:
args = line.split(" | ")
side = args[0]
user = args[1]
# TODO If you receive forceSide | forceUser, you should check if such forceUser already exists, and if not, add him/her to the corresponding side
if... | 0 | 0 | 0 |
6ee78f3fabbf50a0a068253b548dc1470a1883e0 | 1,368 | py | Python | src/client/client.py | MayD524/MDrive | 36f2d6ea70f2821c31c49371b0483ab1bdc7dc7a | [
"MIT"
] | null | null | null | src/client/client.py | MayD524/MDrive | 36f2d6ea70f2821c31c49371b0483ab1bdc7dc7a | [
"MIT"
] | null | null | null | src/client/client.py | MayD524/MDrive | 36f2d6ea70f2821c31c49371b0483ab1bdc7dc7a | [
"MIT"
] | null | null | null | import requests
import os
url = 'http://admin:SuperAdminPasssword6742344234!!@localhost:8080/'#'http://admin:SuperAdminPasssword6742344234!!@a18e-2601-182-ce00-c860-3c42-c8b2-be91-176.ngrok.io/'
#resp = requests.post(url, data={'newUser': True, 'username': 'new_user', 'password': 'test_pass'})
## makefile : f... | 36.972973 | 169 | 0.681287 | import requests
import os
url = 'http://admin:SuperAdminPasssword6742344234!!@localhost:8080/'#'http://admin:SuperAdminPasssword6742344234!!@a18e-2601-182-ce00-c860-3c42-c8b2-be91-176.ngrok.io/'
#resp = requests.post(url, data={'newUser': True, 'username': 'new_user', 'password': 'test_pass'})
## makefile : f... | 0 | 0 | 0 |
8bf234cc035bc4ea8b0dd72e26461c4cdb4d1364 | 10,933 | py | Python | LM.py | StonyBrookNLP/SLDS-Stories | 2a2bbcb48b860e833c93c34f0389c9f6ea851160 | [
"MIT"
] | 1 | 2020-10-28T22:30:32.000Z | 2020-10-28T22:30:32.000Z | LM.py | StonyBrookNLP/SLDS-Stories | 2a2bbcb48b860e833c93c34f0389c9f6ea851160 | [
"MIT"
] | 1 | 2021-05-01T03:28:19.000Z | 2021-05-01T03:28:19.000Z | LM.py | StonyBrookNLP/SLDS-Stories | 2a2bbcb48b860e833c93c34f0389c9f6ea851160 | [
"MIT"
] | null | null | null | ##############################################
# Switching Linear Dynamical System
# Code for both SLDS generative model as well
# as variational inference code
##############################################
import torch
import torch.nn as nn
import numpy as np
import math
from torch.autograd import Variable... | 43.557769 | 171 | 0.617214 | ##############################################
# Switching Linear Dynamical System
# Code for both SLDS generative model as well
# as variational inference code
##############################################
import torch
import torch.nn as nn
import numpy as np
import math
from torch.autograd import Variable... | 357 | 9,988 | 23 |
ce9a67cea15ae75df85394fc0d7f7e0ce45cad6c | 1,617 | py | Python | houttuynia/nn/modules/conv.py | speedcell4/houttuynia | 598ba06d70c1263a6d256991a52e424c03d73130 | [
"MIT"
] | 1 | 2018-04-24T01:50:39.000Z | 2018-04-24T01:50:39.000Z | houttuynia/nn/modules/conv.py | speedcell4/houttuynia | 598ba06d70c1263a6d256991a52e424c03d73130 | [
"MIT"
] | 29 | 2018-05-05T02:00:55.000Z | 2018-07-23T07:03:42.000Z | houttuynia/nn/modules/conv.py | speedcell4/houttuynia | 598ba06d70c1263a6d256991a52e424c03d73130 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from houttuynia.nn import init
__all__ = [
'Conv1d', 'Conv2d', 'Conv3d', 'GramConv1',
]
| 29.4 | 115 | 0.648114 | import torch
from torch import nn
from houttuynia.nn import init
__all__ = [
'Conv1d', 'Conv2d', 'Conv3d', 'GramConv1',
]
class Conv1d(nn.Conv1d):
def reset_parameters(self) -> None:
return init.keras_conv_(self)
class Conv2d(nn.Conv2d):
def reset_parameters(self) -> None:
return init.... | 1,216 | 19 | 250 |
5a2dcb5b0bad00488d5c4efd76e4f03fb861fc7f | 2,370 | py | Python | src/ecr/ui/cli.py | eXceediDeaL/edl-coderunner | 52f7eedd0727b8a428b61640cd9fad33c083d0fc | [
"Apache-2.0"
] | 1 | 2018-11-18T09:30:11.000Z | 2018-11-18T09:30:11.000Z | src/ecr/ui/cli.py | eXceediDeaL/edl-coderunner | 52f7eedd0727b8a428b61640cd9fad33c083d0fc | [
"Apache-2.0"
] | 6 | 2018-11-23T10:44:58.000Z | 2018-12-04T03:44:00.000Z | src/ecr/ui/cli.py | eXceediDeaL/edl-coderunner | 52f7eedd0727b8a428b61640cd9fad33c083d0fc | [
"Apache-2.0"
] | null | null | null | from enum import Enum
from typing import Dict, List, Optional
import click
from pygments.lexers.shell import BashLexer
from prompt_toolkit import prompt, print_formatted_text, PromptSession
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit... | 34.852941 | 96 | 0.68692 | from enum import Enum
from typing import Dict, List, Optional
import click
from pygments.lexers.shell import BashLexer
from prompt_toolkit import prompt, print_formatted_text, PromptSession
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit... | 1,262 | 61 | 234 |
37a39c70b751dc22b1734d409c9237e48ff8ee2f | 2,577 | py | Python | Spy-Games/code.py | Seema10/ga-learner-dsmp-repo | ef41b506eab012960e914c3b3de23be3a2d0e1b6 | [
"MIT"
] | null | null | null | Spy-Games/code.py | Seema10/ga-learner-dsmp-repo | ef41b506eab012960e914c3b3de23be3a2d0e1b6 | [
"MIT"
] | null | null | null | Spy-Games/code.py | Seema10/ga-learner-dsmp-repo | ef41b506eab012960e914c3b3de23be3a2d0e1b6 | [
"MIT"
] | null | null | null | # --------------
##File path for the file
file_path
#Code starts here
sample_message= str(read_file(file_path))
print(sample_message)
# --------------
#Code starts here
file_path_1
file_path_2
message_1=read_file(file_path_1)
message_2=read_file(file_path_2)
print("message1", message_1)
... | 18.673913 | 71 | 0.660458 | # --------------
##File path for the file
file_path
#Code starts here
def read_file(path):
file = open(file_path,"r")
sentence = file.readline()
return sentence
file.close()
sample_message= str(read_file(file_path))
print(sample_message)
# --------------
#Code starts here
f... | 862 | 0 | 148 |
064bf9548636f1a3c5e4f5616d11b9d576690817 | 2,065 | py | Python | tests/test_string.py | ARgorithm/TemplateLibrary | cde4a2bea81815a14f052ca6cf32db79b3366e99 | [
"Apache-2.0"
] | 3 | 2021-01-20T20:12:26.000Z | 2021-02-24T17:23:34.000Z | tests/test_string.py | ARgorithm/TemplateLibrary | cde4a2bea81815a14f052ca6cf32db79b3366e99 | [
"Apache-2.0"
] | 19 | 2021-01-18T03:29:53.000Z | 2021-06-19T07:25:43.000Z | tests/test_string.py | ARgorithm/toolkit | cde4a2bea81815a14f052ca6cf32db79b3366e99 | [
"Apache-2.0"
] | null | null | null | """Test string
"""
import ARgorithmToolkit
algo = ARgorithmToolkit.StateSet()
st = ARgorithmToolkit.String('st', algo, "Hello world! 1234")
def test_body():
"""Test string contents
"""
assert st.body == "Hello world! 1234"
last_state = algo.states[-1]
assert last_state.content["state_type"] == 'st... | 35 | 87 | 0.666828 | """Test string
"""
import ARgorithmToolkit
algo = ARgorithmToolkit.StateSet()
st = ARgorithmToolkit.String('st', algo, "Hello world! 1234")
def test_body():
"""Test string contents
"""
assert st.body == "Hello world! 1234"
last_state = algo.states[-1]
assert last_state.content["state_type"] == 'st... | 0 | 0 | 0 |
62a9fa8ca3c66a2ada506b599b4e445bbfd93542 | 14,282 | py | Python | scraper/TA_scrapy/spiders/restoSpiderReview.py | elalamik/NLP_Capgemini_Data_Camp | 31143116e02dad07a379bb81524cdc0e1fe796bd | [
"MIT"
] | null | null | null | scraper/TA_scrapy/spiders/restoSpiderReview.py | elalamik/NLP_Capgemini_Data_Camp | 31143116e02dad07a379bb81524cdc0e1fe796bd | [
"MIT"
] | null | null | null | scraper/TA_scrapy/spiders/restoSpiderReview.py | elalamik/NLP_Capgemini_Data_Camp | 31143116e02dad07a379bb81524cdc0e1fe796bd | [
"MIT"
] | 1 | 2021-02-09T18:33:10.000Z | 2021-02-09T18:33:10.000Z |
from logzero import logger
import logzero
import logging
import glob
import pandas as pd
# Scrapy packages
import scrapy
import requests
from scrapy.selector import Selector
from TA_scrapy.items import ReviewRestoItem, RestoItem, UserItem
from TA_scrapy.spiders import get_info
# Chromedriver package and options
from... | 44.354037 | 126 | 0.624422 |
from logzero import logger
import logzero
import logging
import glob
import pandas as pd
# Scrapy packages
import scrapy
import requests
from scrapy.selector import Selector
from TA_scrapy.items import ReviewRestoItem, RestoItem, UserItem
from TA_scrapy.spiders import get_info
# Chromedriver package and options
from... | 2,179 | 11,491 | 23 |
58737f5795ad4f2ff4461e48442256d05959521e | 2,304 | py | Python | keystone/common/sql/migrate_repo/versions/022_move_legacy_endpoint_id.py | sanket4373/keystone | 7cf7e7497729803f0470167315af9349b88fe0ec | [
"Apache-2.0"
] | null | null | null | keystone/common/sql/migrate_repo/versions/022_move_legacy_endpoint_id.py | sanket4373/keystone | 7cf7e7497729803f0470167315af9349b88fe0ec | [
"Apache-2.0"
] | null | null | null | keystone/common/sql/migrate_repo/versions/022_move_legacy_endpoint_id.py | sanket4373/keystone | 7cf7e7497729803f0470167315af9349b88fe0ec | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 33.391304 | 78 | 0.661892 | # Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 1,528 | 0 | 46 |
9d26b7db93c9e456352fc078aed365cac899c4ce | 4,165 | py | Python | src/test/test_scene.py | jielyu/animations | 1e7b1f54a5379082e97de4c66332fe3dd6302803 | [
"MIT"
] | null | null | null | src/test/test_scene.py | jielyu/animations | 1e7b1f54a5379082e97de4c66332fe3dd6302803 | [
"MIT"
] | null | null | null | src/test/test_scene.py | jielyu/animations | 1e7b1f54a5379082e97de4c66332fe3dd6302803 | [
"MIT"
] | null | null | null | """测试场景组件的使用"""
from manimlib.imports import *
class Graph2DExample(GraphScene):
"""二维坐标图实例"""
CONFIG = {
"x_min": -1,
"x_max": 6,
"x_axis_width": 10,
"x_axis_label": "time",
#"x_label_color": RED,
"y_min": -1,
"y_max": 20,
"y_axis_height": 8,
... | 24.215116 | 78 | 0.543818 | """测试场景组件的使用"""
from manimlib.imports import *
class Graph2DExample(GraphScene):
"""二维坐标图实例"""
CONFIG = {
"x_min": -1,
"x_max": 6,
"x_axis_width": 10,
"x_axis_label": "time",
#"x_label_color": RED,
"y_min": -1,
"y_max": 20,
"y_axis_height": 8,
... | 2,935 | 0 | 269 |
25dc4b4b6fd6e5bca2f99c074b011050a886b11c | 17,399 | py | Python | iPERCore/tools/human_pose2d_estimators/openpose/post_process.py | JSssssss/iPERCore | 510ae3ef5cac9e2fc0cda7a72cdc8b1962719431 | [
"Apache-2.0"
] | 2,223 | 2020-11-19T02:16:07.000Z | 2022-03-30T01:54:11.000Z | iPERCore/tools/human_pose2d_estimators/openpose/post_process.py | JSssssss/iPERCore | 510ae3ef5cac9e2fc0cda7a72cdc8b1962719431 | [
"Apache-2.0"
] | 131 | 2020-11-19T06:15:00.000Z | 2022-01-24T07:52:21.000Z | iPERCore/tools/human_pose2d_estimators/openpose/post_process.py | JSssssss/iPERCore | 510ae3ef5cac9e2fc0cda7a72cdc8b1962719431 | [
"Apache-2.0"
] | 286 | 2020-11-19T07:30:58.000Z | 2022-03-03T13:23:41.000Z | # Copyright (c) 2020-2021 impersonator.org authors (Wen Liu and Zhixin Piao). All rights reserved.
import cv2
import torch
import numpy as np
import math
from operator import itemgetter
from .dataset import normalize, pad_width
def infer_fast_post_process(net_outputs, PoseClass):
"""
Args:
net... | 43.389027 | 119 | 0.587103 | # Copyright (c) 2020-2021 impersonator.org authors (Wen Liu and Zhixin Piao). All rights reserved.
import cv2
import torch
import numpy as np
import math
from operator import itemgetter
from .dataset import normalize, pad_width
def infer(net, img, scales, base_height, stride, device, num_kpts=25,
pad_valu... | 14,694 | 0 | 138 |
5e0f63bb4a3c9df4fcdd6ef680c2df73f869edf7 | 2,018 | py | Python | 1.3.BayesianInference/exercises/srcs/7/challenger.py | mihaighidoveanu/machine-learning-examples | e5a7ab71e52ae2809115eb7d7c943b46ebf394f3 | [
"MIT"
] | null | null | null | 1.3.BayesianInference/exercises/srcs/7/challenger.py | mihaighidoveanu/machine-learning-examples | e5a7ab71e52ae2809115eb7d7c943b46ebf394f3 | [
"MIT"
] | null | null | null | 1.3.BayesianInference/exercises/srcs/7/challenger.py | mihaighidoveanu/machine-learning-examples | e5a7ab71e52ae2809115eb7d7c943b46ebf394f3 | [
"MIT"
] | 1 | 2021-05-02T13:12:21.000Z | 2021-05-02T13:12:21.000Z | import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
challenger_data = np.genfromtxt("challenger_data.csv", skip_header=1,
usecols=[1, 2], missing_values="NA",
delimiter=",")
# drop the NA values
challenger_data = challenger_d... | 33.081967 | 77 | 0.666501 | import numpy as np
import pymc as pm
from matplotlib import pyplot as plt
challenger_data = np.genfromtxt("challenger_data.csv", skip_header=1,
usecols=[1, 2], missing_values="NA",
delimiter=",")
# drop the NA values
challenger_data = challenger_d... | 142 | 0 | 48 |
4f197e4b4b505eb45a77d225b7775d7855e0153e | 1,351 | py | Python | oop 1-1.py | Blasco0616/OOP-1-1 | 98ae3c1f5e3dc719d4216bcd163a8e482cba10a2 | [
"Apache-2.0"
] | null | null | null | oop 1-1.py | Blasco0616/OOP-1-1 | 98ae3c1f5e3dc719d4216bcd163a8e482cba10a2 | [
"Apache-2.0"
] | null | null | null | oop 1-1.py | Blasco0616/OOP-1-1 | 98ae3c1f5e3dc719d4216bcd163a8e482cba10a2 | [
"Apache-2.0"
] | null | null | null | from tkinter import *
window = Tk()
window.geometry("600x500+30+20")
window.title("Welcome to Python Programming")
btn = Button(window, text = "Click to add name", fg ="blue")
btn.place(x= 80, y= 100)
lbl = Label(window, text = "Student Personal Information", fg = "Blue", bg = "orange")
lbl.place(relx=.5, ... | 26.490196 | 87 | 0.672095 | from tkinter import *
window = Tk()
window.geometry("600x500+30+20")
window.title("Welcome to Python Programming")
btn = Button(window, text = "Click to add name", fg ="blue")
btn.place(x= 80, y= 100)
lbl = Label(window, text = "Student Personal Information", fg = "Blue", bg = "orange")
lbl.place(relx=.5, ... | 0 | 0 | 0 |
df93a21376abc28670852f1dc620b7f1137f0134 | 1,241 | py | Python | day-07/problem.py | mkemp/aoc-2020 | 01f65bc4aee05f819c3a8f3b04565188fcc17d25 | [
"MIT"
] | 1 | 2020-12-06T19:33:53.000Z | 2020-12-06T19:33:53.000Z | day-07/problem.py | mkemp/aoc-2020 | 01f65bc4aee05f819c3a8f3b04565188fcc17d25 | [
"MIT"
] | null | null | null | day-07/problem.py | mkemp/aoc-2020 | 01f65bc4aee05f819c3a8f3b04565188fcc17d25 | [
"MIT"
] | null | null | null | from collections import defaultdict
forward, reverse = build_mapping_from_input()
# Part 1
print(len(can_contain('shiny gold')))
# Part 2
print(count_bags('shiny gold'))
| 28.860465 | 92 | 0.622885 | from collections import defaultdict
def build_mapping_from_input():
forward, reverse = defaultdict(dict), defaultdict(dict)
with open('input') as f:
for line in f.read().strip().split('\n'):
container, _, subcontainers = line[:-1].partition(' bags contain ')
for token in subcon... | 993 | 0 | 67 |
4f1fab1f8c93e7902ff058430006c7c05bbf3f66 | 5,969 | py | Python | osu-ac/comparer.py | ChrisMiuchiz/osu-ac | 37a62624bf569b2b5774f5ac72198c273ffddc4a | [
"MIT"
] | 1 | 2021-04-01T21:39:41.000Z | 2021-04-01T21:39:41.000Z | osu-ac/comparer.py | ChrisMiuchiz/osu-ac | 37a62624bf569b2b5774f5ac72198c273ffddc4a | [
"MIT"
] | null | null | null | osu-ac/comparer.py | ChrisMiuchiz/osu-ac | 37a62624bf569b2b5774f5ac72198c273ffddc4a | [
"MIT"
] | null | null | null | import itertools
import numpy as np
from draw import Draw
from replay import Replay
from config import WHITELIST
class Comparer:
"""
A class for managing a set of replay comparisons.
Attributes:
List replays1: A list of Replay instances to compare against replays2.
List replays2: A ... | 39.793333 | 137 | 0.62322 | import itertools
import numpy as np
from draw import Draw
from replay import Replay
from config import WHITELIST
class Comparer:
"""
A class for managing a set of replay comparisons.
Attributes:
List replays1: A list of Replay instances to compare against replays2.
List replays2: A ... | 0 | 0 | 0 |
ff34b53715690a0f2b3c069cbb92b44d4175382f | 1,004 | py | Python | setup.py | kyleaj/ProxImaL | 2986b1ed40b58057822922522145bfbbdd2cf9de | [
"MIT"
] | 101 | 2016-07-24T00:33:12.000Z | 2022-03-23T23:51:58.000Z | setup.py | kyleaj/ProxImaL | 2986b1ed40b58057822922522145bfbbdd2cf9de | [
"MIT"
] | 57 | 2016-07-26T18:12:37.000Z | 2022-02-14T04:19:26.000Z | setup.py | kyleaj/ProxImaL | 2986b1ed40b58057822922522145bfbbdd2cf9de | [
"MIT"
] | 30 | 2016-07-26T22:51:59.000Z | 2021-01-15T14:45:42.000Z | from setuptools import setup
setup(
name='proximal',
version='0.1.7',
packages=['proximal',
'proximal.prox_fns',
'proximal.lin_ops',
'proximal.algorithms',
'proximal.utils',
'proximal.halide',
'proximal.tests',
... | 34.62069 | 95 | 0.473108 | from setuptools import setup
setup(
name='proximal',
version='0.1.7',
packages=['proximal',
'proximal.prox_fns',
'proximal.lin_ops',
'proximal.algorithms',
'proximal.utils',
'proximal.halide',
'proximal.tests',
... | 0 | 0 | 0 |
b1aca679b19896f4133a9892eaf56574ec2802c4 | 7,262 | py | Python | python/SNRstudy.py | titodalcanton/flare | 4ffb02977d19786ab8c1a767cc495a799d9575ae | [
"Apache-2.0"
] | 3 | 2015-05-26T15:21:13.000Z | 2020-07-20T02:56:25.000Z | python/SNRstudy.py | titodalcanton/flare | 4ffb02977d19786ab8c1a767cc495a799d9575ae | [
"Apache-2.0"
] | null | null | null | python/SNRstudy.py | titodalcanton/flare | 4ffb02977d19786ab8c1a767cc495a799d9575ae | [
"Apache-2.0"
] | 2 | 2018-09-20T14:19:13.000Z | 2020-07-20T02:56:30.000Z | import math
import numpy as np
import subprocess
import re
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import astropy.units as units
from astropy.cosmology import Planck15 as cosmo,z_at_value
from matplotlib.backends.backend_pdf import PdfPages
flare_dir="../flare"
Ms=1.5e4*10**(np.a... | 39.68306 | 172 | 0.593638 | import math
import numpy as np
import subprocess
import re
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import astropy.units as units
from astropy.cosmology import Planck15 as cosmo,z_at_value
from matplotlib.backends.backend_pdf import PdfPages
def set_flare_flags(snr,params):
flags=""... | 6,464 | 0 | 165 |
e2c28fc5e68159bb5f061e1ed6ea103347940c98 | 15,317 | py | Python | pupa/scrape/schemas/event.py | paultag/pupa | 137293925503496e15137540e049bf544e129971 | [
"BSD-3-Clause"
] | null | null | null | pupa/scrape/schemas/event.py | paultag/pupa | 137293925503496e15137540e049bf544e129971 | [
"BSD-3-Clause"
] | null | null | null | pupa/scrape/schemas/event.py | paultag/pupa | 137293925503496e15137540e049bf544e129971 | [
"BSD-3-Clause"
] | null | null | null | """
Schema for event objects.
"""
from .common import sources, extras
media_schema = {
"description": ("This \"special\" schema is used in two places in the Event"
" schema, on the top level and inside the agenda item. This is an"
" optional component that may be omited... | 39.681347 | 97 | 0.354182 | """
Schema for event objects.
"""
from .common import sources, extras
media_schema = {
"description": ("This \"special\" schema is used in two places in the Event"
" schema, on the top level and inside the agenda item. This is an"
" optional component that may be omited... | 0 | 0 | 0 |
9c877e6deca4ca37bf5c51bf382eec0bc84d1116 | 1,717 | py | Python | fileupload/urls.py | bgreenawald/CS-3240-Semester-Project | 087c4bfd825793697c6657fe5c298bf2700a081a | [
"MIT"
] | null | null | null | fileupload/urls.py | bgreenawald/CS-3240-Semester-Project | 087c4bfd825793697c6657fe5c298bf2700a081a | [
"MIT"
] | null | null | null | fileupload/urls.py | bgreenawald/CS-3240-Semester-Project | 087c4bfd825793697c6657fe5c298bf2700a081a | [
"MIT"
] | null | null | null | from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf.urls.static import static
from django.conf import settings
from django.views.generic import RedirectView
from fileu... | 61.321429 | 107 | 0.70763 | from django.contrib.auth import views as auth_views
from django.views.generic.base import TemplateView
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf.urls.static import static
from django.conf import settings
from django.views.generic import RedirectView
from fileu... | 0 | 0 | 0 |
0eec5b50d5b837337d0bdd12089a3040dc3427bf | 5,530 | py | Python | .vim/plugged/ultisnips/pythonx/UltiSnips/text_objects/choices.py | traitran44/vIDE | 12ca056ce0223e24146f96d59da6aa60a67a376f | [
"MIT"
] | 1 | 2017-04-24T04:07:48.000Z | 2017-04-24T04:07:48.000Z | sources_non_forked/ultisnips/pythonx/UltiSnips/text_objects/choices.py | RobotMa/vimrc | 5beda397d3c6f88b8542d843107a64c42bf13c93 | [
"MIT"
] | null | null | null | sources_non_forked/ultisnips/pythonx/UltiSnips/text_objects/choices.py | RobotMa/vimrc | 5beda397d3c6f88b8542d843107a64c42bf13c93 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
"""Choices are enumeration values you can choose, by selecting index number.
It is a special TabStop, its content are taken literally, thus said, they will not be parsed recursively.
"""
from UltiSnips import vim_helper
from UltiSnips.position import Position
from UltiSnips.te... | 37.619048 | 105 | 0.608318 | #!/usr/bin/env python3
# encoding: utf-8
"""Choices are enumeration values you can choose, by selecting index number.
It is a special TabStop, its content are taken literally, thus said, they will not be parsed recursively.
"""
from UltiSnips import vim_helper
from UltiSnips.position import Position
from UltiSnips.te... | 4,927 | 0 | 134 |
af5e57ce578d5e381101a8679f6e3120fd34f348 | 457 | py | Python | mltk/models/tests/test_tflite_micro_models.py | SiliconLabs/mltk | 56b19518187e9d1c8a0d275de137fc9058984a1f | [
"Zlib"
] | null | null | null | mltk/models/tests/test_tflite_micro_models.py | SiliconLabs/mltk | 56b19518187e9d1c8a0d275de137fc9058984a1f | [
"Zlib"
] | 1 | 2021-11-19T20:10:09.000Z | 2021-11-19T20:10:09.000Z | mltk/models/tests/test_tflite_micro_models.py | sldriedler/mltk | d82a60359cf875f542a2257f1bc7d8eb4bdaa204 | [
"Zlib"
] | null | null | null |
import pytest
from mltk.utils.test_helper import run_model_operation, generate_run_model_params
@pytest.mark.parametrize(*generate_run_model_params())
@pytest.mark.parametrize(*generate_run_model_params()) | 38.083333 | 81 | 0.822757 |
import pytest
from mltk.utils.test_helper import run_model_operation, generate_run_model_params
@pytest.mark.parametrize(*generate_run_model_params())
def test_tflite_micro_speech(op, tflite, build):
run_model_operation('tflite_micro_speech-test', op, tflite, build)
@pytest.mark.parametrize(*generate_run_model_... | 204 | 0 | 44 |
10bd1640a99feefa6d2eec90c19302930ffb5ea6 | 338 | py | Python | Scripts-python/022 Analisador de textos.py | rromulofer/python | eea56018b7974911fc125202ce556ec2fa59bc7f | [
"MIT"
] | 2 | 2021-02-11T18:36:35.000Z | 2021-09-16T18:00:28.000Z | Scripts-python/022 Analisador de textos.py | rromulofer/python | eea56018b7974911fc125202ce556ec2fa59bc7f | [
"MIT"
] | null | null | null | Scripts-python/022 Analisador de textos.py | rromulofer/python | eea56018b7974911fc125202ce556ec2fa59bc7f | [
"MIT"
] | null | null | null | name = str(input('Type your name: ')).strip()
print('Uppercase name: {}'.format(name.upper()))
print('Lowercase name: {}'.format(name.lower()))
print('Total letters: {}'.format(len(name) - name.count(' ')))
#print('First name has {} letters. '.format(name.find(' ')))
s = name.split()
print('First name has {} letters.'.... | 48.285714 | 62 | 0.642012 | name = str(input('Type your name: ')).strip()
print('Uppercase name: {}'.format(name.upper()))
print('Lowercase name: {}'.format(name.lower()))
print('Total letters: {}'.format(len(name) - name.count(' ')))
#print('First name has {} letters. '.format(name.find(' ')))
s = name.split()
print('First name has {} letters.'.... | 0 | 0 | 0 |
ae49e9537cb9a4005738067ee22e85bd6dde74fa | 8,659 | py | Python | scripts/python/plots.py | mlliarm/higgs-decay-classification | c65e3c0d54527f9603ebf968b374fe16a2ea84e4 | [
"MIT"
] | null | null | null | scripts/python/plots.py | mlliarm/higgs-decay-classification | c65e3c0d54527f9603ebf968b374fe16a2ea84e4 | [
"MIT"
] | null | null | null | scripts/python/plots.py | mlliarm/higgs-decay-classification | c65e3c0d54527f9603ebf968b374fe16a2ea84e4 | [
"MIT"
] | null | null | null | #====================================================
# MODULES
#====================================================
import pandas as pd
import ROOT
import matplotlib.pyplot as plt
import numpy as np
#====================================================
# DATA PREPARATION
#==================================... | 35.05668 | 116 | 0.667052 | #====================================================
# MODULES
#====================================================
import pandas as pd
import ROOT
import matplotlib.pyplot as plt
import numpy as np
#====================================================
# DATA PREPARATION
#==================================... | 0 | 0 | 0 |
e7ac312acc5098ff8df1adff5d7683c9356e8c8b | 444 | py | Python | tests/kyu_7_tests/test_filter_list.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/kyu_7_tests/test_filter_list.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/kyu_7_tests/test_filter_list.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.kyu_7.filter_list import filter_list
| 27.75 | 71 | 0.596847 | import unittest
from katas.kyu_7.filter_list import filter_list
class FilterListTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(filter_list([1, 2, 'a', 'b']), [1, 2])
def test_equals_2(self):
self.assertEqual(filter_list([1, 'a', 'b', 0, 15]), [1, 0, 15])
def test_e... | 252 | 23 | 103 |
75d5f54b3dff3715cd2acdc0ff97e60f3dc126bf | 6,936 | py | Python | program/demo/Decide-topic-color.py | shutokawabata0723/kenkyu | b613b4daddca9b8b16efe0802669611948daea18 | [
"MIT"
] | 1 | 2021-05-06T03:35:16.000Z | 2021-05-06T03:35:16.000Z | program/demo/Decide-topic-color.py | shutokawabata0723/kenkyu | b613b4daddca9b8b16efe0802669611948daea18 | [
"MIT"
] | null | null | null | program/demo/Decide-topic-color.py | shutokawabata0723/kenkyu | b613b4daddca9b8b16efe0802669611948daea18 | [
"MIT"
] | null | null | null | #coding:utf-8
PURPLE = '\033[35m'
RED = '\033[31m'
CYAN = '\033[36m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
import csv
import sys
import codecs
from urllib.parse import urlparse #URL --> Domain
from time import sleep
dict_web_id = {}
dict_url ... | 24.94964 | 204 | 0.60496 | #coding:utf-8
PURPLE = '\033[35m'
RED = '\033[31m'
CYAN = '\033[36m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
import csv
import sys
import codecs
from urllib.parse import urlparse #URL --> Domain
from time import sleep
dict_web_id = {}
dict_url ... | 4,609 | 0 | 45 |
05ecb7474295517cf171a8fb7afcbdc8d005f9dd | 337 | py | Python | stage_0_Wealth.py | ssiddhantsharma/team-greider | 4b2725ff64614fd4e200606b06e8d9ea132b8ec8 | [
"MIT"
] | 9 | 2021-08-01T20:26:55.000Z | 2021-08-07T11:32:25.000Z | stage_0_Wealth.py | ssiddhantsharma/team-greider | 4b2725ff64614fd4e200606b06e8d9ea132b8ec8 | [
"MIT"
] | 2 | 2021-08-02T09:08:09.000Z | 2021-08-03T21:10:24.000Z | stage_0_Wealth.py | ssiddhantsharma/team-greider | 4b2725ff64614fd4e200606b06e8d9ea132b8ec8 | [
"MIT"
] | 16 | 2021-08-01T19:41:45.000Z | 2021-08-06T09:26:15.000Z | #personaldetails
print("NAME:Wealth Okete \nE-MAIL: wealth.okete@gmail.com \nSLACK USERNAME: @Wealth \nBIOSTACK: Genomics \nTwitter Handle: @Wealty")
print(hamming_distance('@Wealth','@Wealty'))
| 30.636364 | 133 | 0.637982 | #personaldetails
print("NAME:Wealth Okete \nE-MAIL: wealth.okete@gmail.com \nSLACK USERNAME: @Wealth \nBIOSTACK: Genomics \nTwitter Handle: @Wealty")
def hamming_distance(a,b):
count=0
for i in range(len(a)):
if a[i] != b[i]:
count +=1
return count
print(hamming_distance('@Weal... | 114 | 0 | 23 |
5681df8daee7cd3898d6815b687eb1b76c33923d | 1,594 | py | Python | conditional statements in python.py | K-P1/kp-learning-python | 67e63a53b93f269ba25d45f6811727382edf3fff | [
"bzip2-1.0.6"
] | null | null | null | conditional statements in python.py | K-P1/kp-learning-python | 67e63a53b93f269ba25d45f6811727382edf3fff | [
"bzip2-1.0.6"
] | null | null | null | conditional statements in python.py | K-P1/kp-learning-python | 67e63a53b93f269ba25d45f6811727382edf3fff | [
"bzip2-1.0.6"
] | null | null | null | conditional statement in python:
this performs different computations or actions depending on whatever a specific boolean expression evaluaates to true or false.
they are handled by if statements in python.
from maths:
equals: a==b
not equals: a != b
less than: a<b
greater than: a>b
greater than or equals to: a... | 26.131148 | 149 | 0.732748 | conditional statement in python:
this performs different computations or actions depending on whatever a specific boolean expression evaluaates to true or false.
they are handled by if statements in python.
from maths:
equals: a==b
not equals: a != b
less than: a<b
greater than: a>b
greater than or equals to: a... | 0 | 0 | 0 |
8645205f23ad064961651704a81244a750672741 | 27,895 | py | Python | src/sentry/event_manager.py | mastacheata/sentry | cc4536901db0323d1e6433416abf1d0ecd977d61 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/event_manager.py | mastacheata/sentry | cc4536901db0323d1e6433416abf1d0ecd977d61 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/event_manager.py | mastacheata/sentry | cc4536901db0323d1e6433416abf1d0ecd977d61 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.event_manager
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import math
import six
from datetime import datetime, timedelta
from collect... | 33.447242 | 100 | 0.579745 | """
sentry.event_manager
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import math
import six
from datetime import datetime, timedelta
from collect... | 25,470 | 505 | 351 |
841a190902c19e9b46726c2ff72f20fccefd58aa | 1,925 | py | Python | Geolocation/Data/Design2a/design2a_11k_test5/pilot.0000/rp_install/lib/python2.7/site-packages/radical/saga/__init__.py | radical-experiments/iceberg_escience | e5c230a23395a71a4adf554730ea3d77f923166c | [
"MIT"
] | 1 | 2019-05-24T02:19:29.000Z | 2019-05-24T02:19:29.000Z | Geolocation/Data/Design2a/design2a_11k_test5/pilot.0000/rp_install/lib/python2.7/site-packages/radical/saga/__init__.py | radical-experiments/iceberg_escience | e5c230a23395a71a4adf554730ea3d77f923166c | [
"MIT"
] | null | null | null | Geolocation/Data/Design2a/design2a_11k_test5/pilot.0000/rp_install/lib/python2.7/site-packages/radical/saga/__init__.py | radical-experiments/iceberg_escience | e5c230a23395a71a4adf554730ea3d77f923166c | [
"MIT"
] | null | null | null |
__author__ = "RADICAL-SAGA Development Team"
__copyright__ = "Copyright 2013, RADICAL"
__license__ = "MIT"
import os
import radical.utils as ru
# ------------------------------------------------------------------------------
#
import utils
# ------------------------------------------------------------------... | 30.078125 | 80 | 0.603636 |
__author__ = "RADICAL-SAGA Development Team"
__copyright__ = "Copyright 2013, RADICAL"
__license__ = "MIT"
import os
import radical.utils as ru
# ------------------------------------------------------------------------------
#
import utils
# ------------------------------------------------------------------... | 0 | 0 | 0 |
666d8967aa54a5ca6e2ff1fe991fa6dced6b3f03 | 781 | py | Python | alexa_siterank/future/future.py | mytja/SiteRank-Alexa | 4b8637fe622915953826b0c624b3a055710082da | [
"MIT"
] | 10 | 2020-11-20T10:10:31.000Z | 2021-09-18T16:15:46.000Z | alexa_siterank/future/future.py | mytja/SiteRank-Alexa | 4b8637fe622915953826b0c624b3a055710082da | [
"MIT"
] | null | null | null | alexa_siterank/future/future.py | mytja/SiteRank-Alexa | 4b8637fe622915953826b0c624b3a055710082da | [
"MIT"
] | 1 | 2021-12-17T20:37:37.000Z | 2021-12-17T20:37:37.000Z | import json
from .utils import Utils
utils = Utils()
| 32.541667 | 94 | 0.758003 | import json
from .utils import Utils
utils = Utils()
async def getRank(website):
r = await utils.getInfo(website)
return r["siteinfo"]
async def getTopKeywords(website):
return await utils.parse(website, '<script type="application/json" id="topKeywordsJSON">')
async def getCompetitors(website):
return await... | 589 | 0 | 138 |
35e4334fd81871fb480642c1d1359ca7d51365fb | 3,725 | py | Python | src/data/738.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/738.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/738.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
main()
| 31.837607 | 76 | 0.368591 | # -*- coding: utf-8 -*-
def main():
N, Q = map(int, input().split())
class LowestCommonAncestor:
""" <O(nlog(n)), O(1)> """
def __init__(self, G: "隣接リスト", root: "根"):
self.n = len(G)
self.tour = [0] * (2 * self.n - 1)
self.depth_list = [0] * (2 * self.n - 1)
... | 3,721 | 0 | 22 |
c10497e6c9cb9109d06fde46cc53d923263f33ab | 5,467 | py | Python | networkapi/api_peer_group/v4/tests/sanity/sync/test_put.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 73 | 2015-04-13T17:56:11.000Z | 2022-03-24T06:13:07.000Z | networkapi/api_peer_group/v4/tests/sanity/sync/test_put.py | leopoldomauricio/GloboNetworkAPI | 3b5b2e336d9eb53b2c113977bfe466b23a50aa29 | [
"Apache-2.0"
] | 99 | 2015-04-03T01:04:46.000Z | 2021-10-03T23:24:48.000Z | networkapi/api_peer_group/v4/tests/sanity/sync/test_put.py | shildenbrand/GloboNetworkAPI | 515d5e961456cee657c08c275faa1b69b7452719 | [
"Apache-2.0"
] | 64 | 2015-08-05T21:26:29.000Z | 2022-03-22T01:06:28.000Z | # -*- coding: utf-8 -*-
from django.test.client import Client
from networkapi.test.test_case import NetworkApiTestCase
from networkapi.util.geral import mount_url
| 36.939189 | 80 | 0.674044 | # -*- coding: utf-8 -*-
from django.test.client import Client
from networkapi.test.test_case import NetworkApiTestCase
from networkapi.util.geral import mount_url
class PeerGroupPutSuccessTestCase(NetworkApiTestCase):
peer_group_uri = '/api/v4/peer-group/'
fixtures_path = 'networkapi/api_peer_group/v4/fixtu... | 351 | 4,904 | 46 |
3d3881828bc5cc9edd3b3036e7819e6964670267 | 434 | py | Python | solthiruthi/stopwords.py | nv-d/open-tamil | 0fcb1cece5ffd6263210db987bede09566353e80 | [
"MIT"
] | 2 | 2021-07-17T02:52:38.000Z | 2021-07-17T02:52:52.000Z | solthiruthi/stopwords.py | nv-d/open-tamil | 0fcb1cece5ffd6263210db987bede09566353e80 | [
"MIT"
] | null | null | null | solthiruthi/stopwords.py | nv-d/open-tamil | 0fcb1cece5ffd6263210db987bede09566353e80 | [
"MIT"
] | null | null | null | ## -*- coding: utf-8 -*-
## (C) 2018 Muthiah Annamalai, <ezhillang@gmail.com>
import codecs
import os
from .resources import get_data_dir
| 24.111111 | 82 | 0.608295 | ## -*- coding: utf-8 -*-
## (C) 2018 Muthiah Annamalai, <ezhillang@gmail.com>
import codecs
import os
from .resources import get_data_dir
def get_stop_words():
stop_words = []
with codecs.open(
os.path.join(get_data_dir(), u"TamilStopWords.txt"), "r", "utf-8"
) as fp:
stop_words = list(
... | 271 | 0 | 23 |
496652ef3216fd70615f2b8ec8e89f2948ba3468 | 20,250 | py | Python | advbench/attacks.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | null | null | null | advbench/attacks.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | null | null | null | advbench/attacks.py | constrainedlearning/advbench | 68f9f6d77268aad45517ca84d383b996724cc976 | [
"MIT"
] | null | null | null | import os, sys
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.laplace import Laplace
from torch.distributions.normal import Normal
from torch.optim import Adam
from einops import rearrange, reduce, repeat
from advbench import perturb... | 48.795181 | 136 | 0.633284 | import os, sys
from math import sqrt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.laplace import Laplace
from torch.distributions.normal import Normal
from torch.optim import Adam
from einops import rearrange, reduce, repeat
from advbench import perturb... | 18,200 | 113 | 1,447 |
aad78611eb26492e75d0af384e9d0c95a3e5e0f0 | 559 | py | Python | bin/redmapper_make_zred_bkg.py | jacobic/redmapper | bda5bd6f486fd5f18d35aa9ae4b875628e905604 | [
"Apache-2.0"
] | 17 | 2016-03-06T07:51:02.000Z | 2022-02-03T15:17:26.000Z | bin/redmapper_make_zred_bkg.py | jacobic/redmapper | bda5bd6f486fd5f18d35aa9ae4b875628e905604 | [
"Apache-2.0"
] | 42 | 2016-07-27T20:48:20.000Z | 2022-01-31T20:47:51.000Z | bin/redmapper_make_zred_bkg.py | jacobic/redmapper | bda5bd6f486fd5f18d35aa9ae4b875628e905604 | [
"Apache-2.0"
] | 8 | 2017-01-26T01:38:41.000Z | 2020-11-14T07:41:53.000Z | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import sys
import argparse
import redmapper
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Compute the zred background for all galaxies')
parser.add_argument('-c', '--configfile', actio... | 23.291667 | 96 | 0.710197 | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import sys
import argparse
import redmapper
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Compute the zred background for all galaxies')
parser.add_argument('-c', '--configfile', actio... | 0 | 0 | 0 |
e6235d7138bff4ef6e29135647b1f07992f5da72 | 409 | py | Python | wakeonlan/search/arp.py | tuimac/wake_on_lan | 150f3657796537a6ac61e391e41169c48b2375cb | [
"MIT"
] | null | null | null | wakeonlan/search/arp.py | tuimac/wake_on_lan | 150f3657796537a6ac61e391e41169c48b2375cb | [
"MIT"
] | 1 | 2020-05-12T05:04:02.000Z | 2020-05-12T05:04:02.000Z | wakeonlan/search/arp.py | tuimac/wakeonlan | 150f3657796537a6ac61e391e41169c48b2375cb | [
"MIT"
] | null | null | null | import socket
import uuid
from struct import pack
| 20.45 | 43 | 0.569682 | import socket
import uuid
from struct import pack
class Arp:
def __init__(self):
pass
def getMacAddress(self):
rawData = uuid.getnode()
data = bytes()
for i in range(6):
data += bytes([rawData & 0xff])
rawData = rawData >> 8
return data
def ... | 267 | -11 | 103 |
0243ae709ebdd5569c0ba07be3af26232b3c03fe | 750 | py | Python | setup.py | linky00/pythonthegathering | 5077b29ab3eb2351cd61204c9552bac889679b78 | [
"MIT"
] | 2 | 2017-10-07T13:52:37.000Z | 2020-04-17T15:23:28.000Z | setup.py | linky00/pythonthegathering | 5077b29ab3eb2351cd61204c9552bac889679b78 | [
"MIT"
] | null | null | null | setup.py | linky00/pythonthegathering | 5077b29ab3eb2351cd61204c9552bac889679b78 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='pythonthegathering',
packages=['pythonthegathering'],
version='1.2.1',
description='Replaces everything good and practical about Python with MTG!',
author='Theo Hamilton/linky00',
author_email='linky00@plotholestudios.com',
url='https://github.com/l... | 34.090909 | 87 | 0.66 | from setuptools import setup
setup(
name='pythonthegathering',
packages=['pythonthegathering'],
version='1.2.1',
description='Replaces everything good and practical about Python with MTG!',
author='Theo Hamilton/linky00',
author_email='linky00@plotholestudios.com',
url='https://github.com/l... | 0 | 0 | 0 |
3499224506e26aaf6873fa7f3c65731a93700a0c | 342 | py | Python | jobs/file_remover.py | nSimonFR/spoken_language_dataset | 07c018f28be72cec3ba5e9ec07608f79a6d32031 | [
"MIT"
] | 23 | 2018-06-25T10:22:57.000Z | 2021-07-09T09:53:47.000Z | jobs/file_remover.py | nSimonFR/spoken_language_dataset | 07c018f28be72cec3ba5e9ec07608f79a6d32031 | [
"MIT"
] | 3 | 2018-07-19T18:47:07.000Z | 2021-06-01T22:11:53.000Z | jobs/file_remover.py | nSimonFR/spoken_language_dataset | 07c018f28be72cec3ba5e9ec07608f79a6d32031 | [
"MIT"
] | 6 | 2018-07-14T17:48:51.000Z | 2020-12-24T01:31:41.000Z | from . import common
| 22.8 | 51 | 0.681287 | from . import common
class FileRemover:
def __init__(self, input_files_key):
self.input_files_key = input_files_key
def execute(self, context):
input_files = context[self.input_files_key]
for input_file in input_files:
common.remove_file(input_file)
context[self.... | 247 | -3 | 76 |
81e0688249e61336036091af470d91b39d4b9458 | 1,155 | py | Python | matsdp/default_params.py | dianwdw/matsdp | b5b822036d2ae1dab00f02a39fe7ba4a51384017 | [
"BSD-3-Clause"
] | 2 | 2019-11-12T08:35:45.000Z | 2022-02-20T14:26:54.000Z | matsdp/default_params.py | dianwdw/matsdp | b5b822036d2ae1dab00f02a39fe7ba4a51384017 | [
"BSD-3-Clause"
] | null | null | null | matsdp/default_params.py | dianwdw/matsdp | b5b822036d2ae1dab00f02a39fe7ba4a51384017 | [
"BSD-3-Clause"
] | 1 | 2021-12-13T13:27:04.000Z | 2021-12-13T13:27:04.000Z | # -*- coding: utf-8 -*-
def default_params():
'''
Description:
It defines the default parameters of the program.
Args:
None
Return:
defaults_dict
'''
defaults_dict = {}
defaults_dict['program_name'] = 'MATSDP'
defaults_dict['version'] = '0.2.4'
de... | 50.217391 | 246 | 0.604329 | # -*- coding: utf-8 -*-
def default_params():
'''
Description:
It defines the default parameters of the program.
Args:
None
Return:
defaults_dict
'''
defaults_dict = {}
defaults_dict['program_name'] = 'MATSDP'
defaults_dict['version'] = '0.2.4'
de... | 0 | 0 | 0 |
e5f323d36236662137792ccb26942032c399a889 | 92 | py | Python | wordhit_crawler/items.py | InsightLab/wordhit-crawler | 7daba16204387263d61644ef3381ac389ccd466a | [
"MIT"
] | 1 | 2019-04-13T18:01:58.000Z | 2019-04-13T18:01:58.000Z | wordhit_crawler/items.py | InsightLab/wordhit-crawler | 7daba16204387263d61644ef3381ac389ccd466a | [
"MIT"
] | null | null | null | wordhit_crawler/items.py | InsightLab/wordhit-crawler | 7daba16204387263d61644ef3381ac389ccd466a | [
"MIT"
] | null | null | null | import scrapy | 18.4 | 31 | 0.73913 | import scrapy
class WordhitItem(scrapy.Item):
word = scrapy.Field()
hits = scrapy.Field() | 0 | 56 | 23 |
a40b5456dfaeb74461d6a07aecdf92edba57ecbd | 3,873 | py | Python | utility_angles.py | spectralskylight/skydataviewer | ac45fde11fb2cd1daa3f09bc30c2fad9391438df | [
"BSD-3-Clause"
] | null | null | null | utility_angles.py | spectralskylight/skydataviewer | ac45fde11fb2cd1daa3f09bc30c2fad9391438df | [
"BSD-3-Clause"
] | 1 | 2020-06-17T01:58:35.000Z | 2021-04-28T01:57:07.000Z | utility_angles.py | spectralskylight/skydataviewer | ac45fde11fb2cd1daa3f09bc30c2fad9391438df | [
"BSD-3-Clause"
] | 4 | 2020-02-03T23:05:00.000Z | 2021-04-28T02:28:43.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ====================================================================
# @author: Joe Del Rocco
# @since: 11/02/2017
# @summary: A module with angle and coordinate transformations.
# @note: Parts of this file came from angle_utilities.py written by Dan Knowlton of PCG at Cornel... | 34.580357 | 119 | 0.633876 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ====================================================================
# @author: Joe Del Rocco
# @since: 11/02/2017
# @summary: A module with angle and coordinate transformations.
# @note: Parts of this file came from angle_utilities.py written by Dan Knowlton of PCG at Cornel... | 2,095 | 0 | 88 |
b941ee17f4e874ec5ff0869d0c49beae63d5cc83 | 2,343 | py | Python | mla_game/settings/prod.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/settings/prod.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/settings/prod.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | from .base import *
import os
MINIMUM_SAMPLE_SIZE = 3
TRANSCRIPT_PHRASE_POSITIVE_CONFIDENCE_LIMIT = .51
TRANSCRIPT_PHRASE_NEGATIVE_CONFIDENCE_LIMIT = -.51
TRANSCRIPT_PHRASE_CORRECTION_LOWER_LIMIT = .51
TRANSCRIPT_PHRASE_CORRECTION_UPPER_LIMIT = .66
INSTALLED_APPS += ('storages',)
SECRET_KEY = os.environ['SECRET_KEY... | 25.467391 | 72 | 0.625694 | from .base import *
import os
MINIMUM_SAMPLE_SIZE = 3
TRANSCRIPT_PHRASE_POSITIVE_CONFIDENCE_LIMIT = .51
TRANSCRIPT_PHRASE_NEGATIVE_CONFIDENCE_LIMIT = -.51
TRANSCRIPT_PHRASE_CORRECTION_LOWER_LIMIT = .51
TRANSCRIPT_PHRASE_CORRECTION_UPPER_LIMIT = .66
INSTALLED_APPS += ('storages',)
SECRET_KEY = os.environ['SECRET_KEY... | 0 | 0 | 0 |
41d226f582b97fed8f9d1b5282260ffbb37f8314 | 1,712 | py | Python | src/Sentiment_Analysis_Model [LR].py | lhk1234/Text-Mining-Sentiment-Analysis | 8190571886e8cfe9325d48587d115e870ebb077d | [
"MIT"
] | 1 | 2021-07-21T05:07:46.000Z | 2021-07-21T05:07:46.000Z | src/Sentiment_Analysis_Model [LR].py | lhk1234/Text-Mining-Sentiment-Analysis | 8190571886e8cfe9325d48587d115e870ebb077d | [
"MIT"
] | null | null | null | src/Sentiment_Analysis_Model [LR].py | lhk1234/Text-Mining-Sentiment-Analysis | 8190571886e8cfe9325d48587d115e870ebb077d | [
"MIT"
] | null | null | null | import urllib.request
import os
import pandas as pd
import numpy as np
from nltk.tokenize import RegexpTokenizer
from nltk.stem.porter import PorterStemmer
from nltk.corpus import stopwords
df = pd.read_csv('../data/raw/movie_data.csv',encoding='utf-8')
#print(df.head(3))
# init Objects
tokenizer=RegexpTokenizer(r'\w... | 34.24 | 89 | 0.751752 | import urllib.request
import os
import pandas as pd
import numpy as np
from nltk.tokenize import RegexpTokenizer
from nltk.stem.porter import PorterStemmer
from nltk.corpus import stopwords
df = pd.read_csv('../data/raw/movie_data.csv',encoding='utf-8')
#print(df.head(3))
# init Objects
tokenizer=RegexpTokenizer(r'\w... | 331 | 0 | 22 |
9cefb62a5d6a34ab9204ef1ffdff5e3c2ccb9315 | 1,443 | py | Python | cosmoboost/lib/jeong.py | maamari/CosmoBoost | c59a6d4edce2a981f6d3d8a775f656d62b348d47 | [
"MIT"
] | null | null | null | cosmoboost/lib/jeong.py | maamari/CosmoBoost | c59a6d4edce2a981f6d3d8a775f656d62b348d47 | [
"MIT"
] | null | null | null | cosmoboost/lib/jeong.py | maamari/CosmoBoost | c59a6d4edce2a981f6d3d8a775f656d62b348d47 | [
"MIT"
] | null | null | null | import numpy as np
########################################
# Jeong approximate functions
########################################
| 30.702128 | 95 | 0.566875 | import numpy as np
########################################
# Jeong approximate functions
########################################
def jeong_boost_Cl_1storder(L, Cl, beta, cos_avg=None, only_dCl=True):
if cos_avg == None:
from scipy.integrate import dblquad
cos_avg = dblquad(lambda ph, th: np... | 1,235 | 0 | 69 |
28dc70287a20b11ef4d8b4817f104a521a87f8d7 | 11,431 | py | Python | fastrunner/views/newrun.py | liuguanglei123/FasterRunnerNew | d37ca7350846296853d791b76571332cf12ad60c | [
"MIT"
] | null | null | null | fastrunner/views/newrun.py | liuguanglei123/FasterRunnerNew | d37ca7350846296853d791b76571332cf12ad60c | [
"MIT"
] | 2 | 2020-02-11T23:38:06.000Z | 2020-07-31T10:18:35.000Z | fastrunner/views/newrun.py | liuguanglei123/FasterRunnerNew | d37ca7350846296853d791b76571332cf12ad60c | [
"MIT"
] | null | null | null | from rest_framework.decorators import api_view
from fastrunner.utils import loader,newloader
from rest_framework.response import Response
from fastrunner.utils.parser import Format
from fastrunner import models
from django.conf import settings
import os,time,sys
from httprunner.utils import create_scaffold
from fastrun... | 34.327327 | 128 | 0.652699 | from rest_framework.decorators import api_view
from fastrunner.utils import loader,newloader
from rest_framework.response import Response
from fastrunner.utils.parser import Format
from fastrunner import models
from django.conf import settings
import os,time,sys
from httprunner.utils import create_scaffold
from fastrun... | 4,522 | 0 | 110 |
0e2a2f45007c6483cc3877028f4b5fe4cc1ec1db | 255 | py | Python | code/python/30_seconds_of_py/count_by.py | AlexMapley/Scanner | d286fc969d540d9599dad487e6e6d9b3734ade0c | [
"Unlicense"
] | 2 | 2019-07-03T17:49:24.000Z | 2019-10-24T02:18:59.000Z | code/python/30_seconds_of_py/count_by.py | AlexMapley/Scanner | d286fc969d540d9599dad487e6e6d9b3734ade0c | [
"Unlicense"
] | 7 | 2019-07-03T17:46:53.000Z | 2019-11-14T23:37:30.000Z | code/python/30_seconds_of_py/count_by.py | AlexMapley/workstation | d286fc969d540d9599dad487e6e6d9b3734ade0c | [
"Unlicense"
] | null | null | null |
from math import floor
print(count_by([6.1,4.2,6.3], floor))
print(count_by(['one', 'two', 'three'], len))
| 21.25 | 53 | 0.584314 | def count_by(arr, fn=lambda x: x):
key = {}
for el in map(fn, arr):
key[el] = 1 if el not in key else key[el] + 1
return key
from math import floor
print(count_by([6.1,4.2,6.3], floor))
print(count_by(['one', 'two', 'three'], len))
| 123 | 0 | 22 |
41febecd73e6f74324319424d041cc0b66eff5d8 | 270 | py | Python | lifelineExample.py | gkovacs/habitlab-conservation-analysis-chi2019 | 3ac52c4b5ab65d54cf6da0441bca829765ed21ec | [
"MIT"
] | null | null | null | lifelineExample.py | gkovacs/habitlab-conservation-analysis-chi2019 | 3ac52c4b5ab65d54cf6da0441bca829765ed21ec | [
"MIT"
] | null | null | null | lifelineExample.py | gkovacs/habitlab-conservation-analysis-chi2019 | 3ac52c4b5ab65d54cf6da0441bca829765ed21ec | [
"MIT"
] | null | null | null | from lifelines.datasets import load_rossi
from lifelines import CoxPHFitter
rossi_dataset = load_rossi()
cph = CoxPHFitter()
cph.fit(rossi_dataset, duration_col='week', event_col='arrest', show_progress=True)
cph.print_summary() # access the results using cph.summary | 33.75 | 83 | 0.807407 | from lifelines.datasets import load_rossi
from lifelines import CoxPHFitter
rossi_dataset = load_rossi()
cph = CoxPHFitter()
cph.fit(rossi_dataset, duration_col='week', event_col='arrest', show_progress=True)
cph.print_summary() # access the results using cph.summary | 0 | 0 | 0 |
7de79c6601b2d07d6fa324109ff7200d849f78c6 | 5,772 | py | Python | samples/LuceneInAction/lia/searching/QueryParserTest.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | 15 | 2015-05-21T09:28:01.000Z | 2022-03-18T23:41:49.000Z | samples/LuceneInAction/lia/searching/QueryParserTest.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | null | null | null | samples/LuceneInAction/lia/searching/QueryParserTest.py | fnp/pylucene | fb16ac375de5479dec3919a5559cda02c899e387 | [
"Apache-2.0"
] | 13 | 2015-04-18T23:05:11.000Z | 2021-11-29T21:23:26.000Z | # ====================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 38.48 | 86 | 0.601351 | # ====================================================================
# 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 re... | 4,461 | 14 | 347 |
ec917be2412342c0cd49ea56f2b8aec6f6878936 | 1,274 | py | Python | chord_recognition/cache.py | discort/chord-recognition | 0527084d0616dcf4c8fa27faec878427543384fb | [
"MIT"
] | 5 | 2021-01-22T18:22:25.000Z | 2021-11-30T18:33:39.000Z | chord_recognition/cache.py | discort/chord-recognition | 0527084d0616dcf4c8fa27faec878427543384fb | [
"MIT"
] | null | null | null | chord_recognition/cache.py | discort/chord-recognition | 0527084d0616dcf4c8fa27faec878427543384fb | [
"MIT"
] | null | null | null | import h5py
import numpy as np
# @staticmethod
# def _preprocess_group_value(group):
# data = group['data'][:]
# labels = group['labels'][:]
# result = [(data[i][np.newaxis], labels[i, 0]) for i in range(data.shape[0])]
# return result
# @staticmethod
# def _preproces... | 26.541667 | 86 | 0.545526 | import h5py
import numpy as np
class Cache:
@classmethod
def get(cls, key):
raise NotImplemented
@classmethod
def set(self, key, value):
raise NotImplemented
class HDF5Cache(Cache):
def __init__(self, filename):
self.filename = filename
def get(self, key):
v... | 596 | 80 | 126 |
d864da6d5ec0e0d923fdeb84db63bf1604b209a3 | 16,919 | py | Python | src/entity/clause.py | yakuza8/first-order-predicate-logic-theorem-prover | f0a2b2a8d13b21f668cc2977a37b63691acdb883 | [
"MIT"
] | 7 | 2020-01-05T17:37:07.000Z | 2022-03-16T11:31:38.000Z | src/entity/clause.py | yakuza8/first-order-predicate-logic-theorem-prover | f0a2b2a8d13b21f668cc2977a37b63691acdb883 | [
"MIT"
] | null | null | null | src/entity/clause.py | yakuza8/first-order-predicate-logic-theorem-prover | f0a2b2a8d13b21f668cc2977a37b63691acdb883 | [
"MIT"
] | 4 | 2020-03-13T07:30:26.000Z | 2021-06-25T19:37:08.000Z | import itertools
import unittest
from typing import List, Optional, Union, Tuple
from . import children_entity_parser
from .predicate import Predicate
from ..most_general_unifier import MostGeneralUnifier
class Clause(object):
"""
Class for keeping predicates together and some several multi-predicate suppor... | 49.761765 | 119 | 0.675395 | import itertools
import unittest
from typing import List, Optional, Union, Tuple
from . import children_entity_parser
from .predicate import Predicate
from ..most_general_unifier import MostGeneralUnifier
class Clause(object):
"""
Class for keeping predicates together and some several multi-predicate suppor... | 10,061 | 469 | 185 |
cc692a03f5ec7b579bbaa20d4760c3c4612fdc95 | 3,133 | py | Python | apps/arus_demo/session_panel.py | qutang/arus | ee422bbadc72635037944359d00475f698e8fc61 | [
"MIT"
] | null | null | null | apps/arus_demo/session_panel.py | qutang/arus | ee422bbadc72635037944359d00475f698e8fc61 | [
"MIT"
] | 264 | 2019-09-25T14:15:39.000Z | 2022-03-11T10:11:38.000Z | apps/arus_demo/session_panel.py | qutang/arus | ee422bbadc72635037944359d00475f698e8fc61 | [
"MIT"
] | null | null | null | import PySimpleGUI as sg
import app_state as app
import dashboard
import backend
import os
from loguru import logger
import traceback
import arus
| 38.679012 | 113 | 0.533993 | import PySimpleGUI as sg
import app_state as app
import dashboard
import backend
import os
from loguru import logger
import traceback
import arus
def control_button(text, disabled, key=None):
return sg.Button(button_text=text,
font=('Helvetica', 15), auto_size_button=True, size=(25, None), ke... | 2,852 | 7 | 126 |
ec5aac30b24743db5cf9c8fd21fb7ab43ce419ce | 1,667 | py | Python | paths.py | cleysonsilvame/R2R-PDF | 8f71b3130d23b2cd257fbf0e854c64f8d37679fc | [
"MIT"
] | null | null | null | paths.py | cleysonsilvame/R2R-PDF | 8f71b3130d23b2cd257fbf0e854c64f8d37679fc | [
"MIT"
] | null | null | null | paths.py | cleysonsilvame/R2R-PDF | 8f71b3130d23b2cd257fbf0e854c64f8d37679fc | [
"MIT"
] | null | null | null | import time
import timeit
from handlerPdf import getPDFname, getLocalTime
from pathlib import Path, PurePath
| 24.514706 | 79 | 0.595681 | import time
import timeit
from handlerPdf import getPDFname, getLocalTime
from pathlib import Path, PurePath
def getPDFByPath(selected_folder, window):
files = Path(selected_folder)
paths_filtered_by_PDF = map(lambda file: {
"name": file.name,
"path": file,
"root": file.parent
}, ... | 1,486 | 0 | 69 |
0a4b776b9a7b0e70bfcedbf13a543757169dce86 | 5,531 | py | Python | axelrod/tests/integration/test_round_robin.py | lipingzhu/Zero-determinant | 6e30aa72358d5dfc3975abe433d0d13cc3a750a1 | [
"MIT"
] | null | null | null | axelrod/tests/integration/test_round_robin.py | lipingzhu/Zero-determinant | 6e30aa72358d5dfc3975abe433d0d13cc3a750a1 | [
"MIT"
] | null | null | null | axelrod/tests/integration/test_round_robin.py | lipingzhu/Zero-determinant | 6e30aa72358d5dfc3975abe433d0d13cc3a750a1 | [
"MIT"
] | null | null | null | import unittest
import random
import axelrod
C, D = axelrod.Actions.C, axelrod.Actions.D
| 42.221374 | 92 | 0.633339 | import unittest
import random
import axelrod
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestRoundRobin(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.game = axelrod.Game()
@classmethod
def payoffs2scores(cls, payoffs):
return [sum([pp for ipp, pp in enumerate(p) if ... | 2,193 | 3,225 | 23 |
a3ba9515a19b08eb9d9f9e3d1bd37373a12af5c6 | 7,713 | py | Python | supermariopy/ptutils/test/test_nn.py | theRealSuperMario/supermariopy | 9fff8275278ff26caff50da86109c25d276bb30b | [
"MIT"
] | 36 | 2019-07-14T16:10:37.000Z | 2022-03-29T10:11:03.000Z | supermariopy/ptutils/test/test_nn.py | theRealSuperMario/supermariopy | 9fff8275278ff26caff50da86109c25d276bb30b | [
"MIT"
] | 3 | 2019-10-09T15:11:13.000Z | 2021-07-31T02:17:43.000Z | supermariopy/ptutils/test/test_nn.py | theRealSuperMario/supermariopy | 9fff8275278ff26caff50da86109c25d276bb30b | [
"MIT"
] | 14 | 2019-08-29T14:11:54.000Z | 2022-03-06T13:41:56.000Z | import numpy as np
import pytest
import torch
from supermariopy.ptutils import nn
| 29.10566 | 86 | 0.595747 | import numpy as np
import pytest
import torch
from supermariopy.ptutils import nn
def test_spatial_softmax():
t = torch.rand(1, 10, 128, 128)
probs = nn.spatial_softmax(t)
assert nn.shape_as_list(probs) == [1, 10, 128, 128]
assert np.allclose(torch.sum(probs, dim=[2, 3]).numpy(), np.ones((1, 10)))
d... | 6,912 | 359 | 345 |
6569b350c282db3c0db747befde1f58375f52655 | 1,322 | py | Python | corehq/apps/consumption/models.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/consumption/models.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/consumption/models.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | from dimagi.ext.couchdbkit import DecimalProperty, Document, StringProperty
from corehq.apps.cachehq.mixins import CachedCouchDocumentMixin
TYPE_DOMAIN = 'domain'
TYPE_PRODUCT = 'product'
TYPE_SUPPLY_POINT_TYPE = 'supply-point-type'
TYPE_SUPPLY_POINT = 'supply-point'
class DefaultConsumption(CachedCouchDocumentMixi... | 32.243902 | 87 | 0.710287 | from dimagi.ext.couchdbkit import DecimalProperty, Document, StringProperty
from corehq.apps.cachehq.mixins import CachedCouchDocumentMixin
TYPE_DOMAIN = 'domain'
TYPE_PRODUCT = 'product'
TYPE_SUPPLY_POINT_TYPE = 'supply-point-type'
TYPE_SUPPLY_POINT = 'supply-point'
class DefaultConsumption(CachedCouchDocumentMixi... | 455 | 0 | 104 |
9365747a58e4241bec7c4cf80ad605ed7efc1366 | 9,200 | py | Python | 11_calibration_NHMv11/plot_byHW_calibration_results.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | 11_calibration_NHMv11/plot_byHW_calibration_results.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | 11_calibration_NHMv11/plot_byHW_calibration_results.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python [conda env:bandit_38]
# language: python
# name: conda-env-bandi... | 34.848485 | 126 | 0.65163 | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python [conda env:bandit_38]
# language: python
# name: conda-env-bandi... | 0 | 0 | 0 |
b946a1266385ed0c2b650d8a7767efd4107ff908 | 13,287 | py | Python | oelint_adv/__main__.py | skycaptain/oelint-adv | ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46 | [
"BSD-2-Clause"
] | null | null | null | oelint_adv/__main__.py | skycaptain/oelint-adv | ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46 | [
"BSD-2-Clause"
] | null | null | null | oelint_adv/__main__.py | skycaptain/oelint-adv | ff67d3149cf8b1de2b0b2d158a68f4e2cf5e9e46 | [
"BSD-2-Clause"
] | null | null | null | import argparse
import json
import os
import re
import sys
from configparser import ConfigParser
from configparser import NoOptionError
from configparser import NoSectionError
from configparser import ParsingError
from typing import Union, Dict
from oelint_parser.cls_stash import Stash
from oelint_parser.constants imp... | 39.310651 | 137 | 0.57989 | import argparse
import json
import os
import re
import sys
from configparser import ConfigParser
from configparser import NoOptionError
from configparser import NoSectionError
from configparser import ParsingError
from typing import Union, Dict
from oelint_parser.cls_stash import Stash
from oelint_parser.constants imp... | 11,770 | 23 | 234 |
d943948e5dc3be1e7b8dcba0fcb1cfc4e4c719e8 | 1,213 | py | Python | pyclopedia/p01_beginner/p02_data_type/p03_str.py | MacHu-GWU/pyclopedia-project | c6ee156eb40bc5a4ac5f51aa735b6fd004cb68ee | [
"MIT"
] | null | null | null | pyclopedia/p01_beginner/p02_data_type/p03_str.py | MacHu-GWU/pyclopedia-project | c6ee156eb40bc5a4ac5f51aa735b6fd004cb68ee | [
"MIT"
] | null | null | null | pyclopedia/p01_beginner/p02_data_type/p03_str.py | MacHu-GWU/pyclopedia-project | c6ee156eb40bc5a4ac5f51aa735b6fd004cb68ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
String manipulate.
"""
# left strip
assert " Hello ".lstrip() == "Hello "
# right strip
assert " Hello ".rstrip() == " Hello"
# strip
assert " Hello ".strip() == "Hello"
# upper case
assert "Hello".upper() == "HELLO"
# lower case
assert "Hello".lower() == ... | 18.661538 | 71 | 0.591921 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
String manipulate.
"""
# left strip
assert " Hello ".lstrip() == "Hello "
# right strip
assert " Hello ".rstrip() == " Hello"
# strip
assert " Hello ".strip() == "Hello"
# upper case
assert "Hello".upper() == "HELLO"
# lower case
assert "Hello".lower() == ... | 0 | 0 | 0 |
deea753df2648662a3991eee9178a066ec6dd686 | 13,111 | py | Python | api/tests.py | MatteoNardi/dyanote-server | b7e61555da147f699962bd1ea3df5970175594d6 | [
"MIT"
] | null | null | null | api/tests.py | MatteoNardi/dyanote-server | b7e61555da147f699962bd1ea3df5970175594d6 | [
"MIT"
] | null | null | null | api/tests.py | MatteoNardi/dyanote-server | b7e61555da147f699962bd1ea3df5970175594d6 | [
"MIT"
] | null | null | null | """
This file contains unittests for the api app.
Use test_settings when running this:
./manage.py test --settings=dyanote.test_settings api
This will use sqlite and other settings to make test execution faster.
Command used to create test database.
./manage.py dumpdata --indent=4
--natural
-e admin
-e se... | 38.789941 | 89 | 0.636641 | """
This file contains unittests for the api app.
Use test_settings when running this:
./manage.py test --settings=dyanote.test_settings api
This will use sqlite and other settings to make test execution faster.
Command used to create test database.
./manage.py dumpdata --indent=4
--natural
-e admin
-e se... | 10,745 | 856 | 66 |
328b618a39d4ad5e9ab39c77cc3954ce5a7783ae | 3,280 | py | Python | tests/sparktests/test_sources.py | commonsearch/cosr-back | 28ca0c1b938dde52bf4f59a835c98dd5ab22cad6 | [
"Apache-2.0"
] | 141 | 2016-02-17T14:27:57.000Z | 2021-12-27T02:56:48.000Z | tests/sparktests/test_sources.py | commonsearch/cosr-back | 28ca0c1b938dde52bf4f59a835c98dd5ab22cad6 | [
"Apache-2.0"
] | 69 | 2016-02-20T02:06:59.000Z | 2017-01-29T22:23:46.000Z | tests/sparktests/test_sources.py | commonsearch/cosr-back | 28ca0c1b938dde52bf4f59a835c98dd5ab22cad6 | [
"Apache-2.0"
] | 38 | 2016-02-25T04:40:07.000Z | 2020-06-11T07:22:44.000Z | import pytest
import shutil
import tempfile
import os
import pipes
import ujson as json
CORPUS = {
"docs": [
{
"url": "http://www.douglasadams.com/",
"content": """ <title>xxxxuniquecontent</title> """
},
{
"url": "http://www.example.com/page1",
... | 30.654206 | 104 | 0.602439 | import pytest
import shutil
import tempfile
import os
import pipes
import ujson as json
CORPUS = {
"docs": [
{
"url": "http://www.douglasadams.com/",
"content": """ <title>xxxxuniquecontent</title> """
},
{
"url": "http://www.example.com/page1",
... | 2,793 | 0 | 45 |
8a88666d1dd6f499a3ed35078674e978ae79866d | 1,366 | py | Python | h2o-py/tests/testdir_algos/glm/pyunit_mean_residual_deviance_glm.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_algos/glm/pyunit_mean_residual_deviance_glm.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_algos/glm/pyunit_mean_residual_deviance_glm.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
if __name__ == "__main__":
pyunit_utils.standalone_test(glm_mean_residual_deviance)
else:
glm_mean_residual_deviance()
| 42.6875 | 120 | 0.669107 | import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
def glm_mean_residual_deviance():
cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv"))
s = cars[0].runif()
train = cars[s > 0.2]
vali... | 1,071 | 0 | 23 |
7eaaf4d3a29ee1f4f1ae7d478ad437c6dff04d92 | 1,210 | py | Python | hw/ni_dac_hw.py | ScopeFoundry/HW_ni_daq | aebe097df1fbd7abcfe93e08c93ba0be0a285216 | [
"MIT"
] | null | null | null | hw/ni_dac_hw.py | ScopeFoundry/HW_ni_daq | aebe097df1fbd7abcfe93e08c93ba0be0a285216 | [
"MIT"
] | null | null | null | hw/ni_dac_hw.py | ScopeFoundry/HW_ni_daq | aebe097df1fbd7abcfe93e08c93ba0be0a285216 | [
"MIT"
] | null | null | null | from ScopeFoundry import HardwareComponent
from ScopeFoundryHW.ni_daq.devices.NI_Daq import NI_DacTask | 32.702703 | 70 | 0.599174 | from ScopeFoundry import HardwareComponent
from ScopeFoundryHW.ni_daq.devices.NI_Daq import NI_DacTask
class NI_DAC_HW(HardwareComponent):
def __init__(self, app, name='ni_dac', debug=False):
self.name = name
HardwareComponent.__init__(self, app, debug=debug)
def setup(self):
... | 939 | 14 | 155 |
137fa1dfdd618ac27b052bdf4dc933141bdaf33c | 5,328 | py | Python | elastico/cli/alerter.py | klorenz/python-elastico | 9a39e6cfe33d3081cc52424284c19e9698343006 | [
"MIT"
] | null | null | null | elastico/cli/alerter.py | klorenz/python-elastico | 9a39e6cfe33d3081cc52424284c19e9698343006 | [
"MIT"
] | null | null | null | elastico/cli/alerter.py | klorenz/python-elastico | 9a39e6cfe33d3081cc52424284c19e9698343006 | [
"MIT"
] | null | null | null | """cli.alerter -- control alerter
With ``alerter`` command you can control the :py:mod:`~elastico.alerter`
module.
For more help on a command, run::
elastico alerter <command> -h
"""
from .cli import command, opt, arg
from ..alerter import Alerter
from ..connection import elasticsearch
from ..util import write_o... | 31.714286 | 98 | 0.631569 | """cli.alerter -- control alerter
With ``alerter`` command you can control the :py:mod:`~elastico.alerter`
module.
For more help on a command, run::
elastico alerter <command> -h
"""
from .cli import command, opt, arg
from ..alerter import Alerter
from ..connection import elasticsearch
from ..util import write_o... | 2,428 | 0 | 115 |
34823fdc749a9ba46e904acdd2ec15c0818a7a24 | 4,902 | py | Python | src/restfx/middleware/middlewares/session.py | hyjiacan/restfx | 8ba70bc099e6ace0c9b3afe8909ea61a5ff82dec | [
"MIT",
"BSD-3-Clause"
] | 5 | 2021-01-25T11:09:41.000Z | 2021-04-28T07:17:21.000Z | src/restfx/middleware/middlewares/session.py | hyjiacan/restfx | 8ba70bc099e6ace0c9b3afe8909ea61a5ff82dec | [
"MIT",
"BSD-3-Clause"
] | null | null | null | src/restfx/middleware/middlewares/session.py | hyjiacan/restfx | 8ba70bc099e6ace0c9b3afe8909ea61a5ff82dec | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-01-28T00:53:37.000Z | 2021-01-28T00:53:37.000Z | import time
import uuid
from ...config import AppConfig
from ...middleware.interface import MiddlewareBase
from ...session.interfaces import ISessionProvider
from ...util import md5, b64
| 32.68 | 67 | 0.549572 | import time
import uuid
from ...config import AppConfig
from ...middleware.interface import MiddlewareBase
from ...session.interfaces import ISessionProvider
from ...util import md5, b64
class SessionMiddleware(MiddlewareBase):
def __init__(self, provider: ISessionProvider,
secret=Non... | 2,613 | 2,440 | 24 |
c6228ba792993028a93c9f240e189a2996613f3b | 940 | py | Python | param.py | vieilfrance/TwitterBot | 72307862d49f2c3b1488e1c89db94ace3e71aa29 | [
"MIT"
] | 2 | 2015-01-20T17:14:54.000Z | 2016-05-16T05:46:11.000Z | param.py | vieilfrance/TwitterBot | 72307862d49f2c3b1488e1c89db94ace3e71aa29 | [
"MIT"
] | null | null | null | param.py | vieilfrance/TwitterBot | 72307862d49f2c3b1488e1c89db94ace3e71aa29 | [
"MIT"
] | null | null | null | LATESTMFILE = 'last_id.txt'
LOGFILE = "twitterbot_log.txt"
verbose = False
twitterName = "ui_cer_bot"
# Liste de terme qui servent pour répondre
answers = ['ahah :)' , 'YO' , 'O_O', 'stoi' , 'TG' , 'MER IL ET FOU']
# Liste des terme qui servent a repondre "stoi xxxx"
bad_words = {'boloss' : 'le boloss', 'boulette' :... | 47 | 176 | 0.66383 | LATESTMFILE = 'last_id.txt'
LOGFILE = "twitterbot_log.txt"
verbose = False
twitterName = "ui_cer_bot"
# Liste de terme qui servent pour répondre
answers = ['ahah :)' , 'YO' , 'O_O', 'stoi' , 'TG' , 'MER IL ET FOU']
# Liste des terme qui servent a repondre "stoi xxxx"
bad_words = {'boloss' : 'le boloss', 'boulette' :... | 0 | 0 | 0 |
4cfae502db39016626f313d1e7ed2997741ffab6 | 391 | py | Python | tests/ctoi_chap2/ex_03.py | tvatter/dsa | e5ae217e38441d90914a55103e23d86f5821dc2f | [
"MIT"
] | null | null | null | tests/ctoi_chap2/ex_03.py | tvatter/dsa | e5ae217e38441d90914a55103e23d86f5821dc2f | [
"MIT"
] | null | null | null | tests/ctoi_chap2/ex_03.py | tvatter/dsa | e5ae217e38441d90914a55103e23d86f5821dc2f | [
"MIT"
] | null | null | null | from dsa.data_structures import LinkedList, ListNode
l = [1, 2, 3]
ll = LinkedList(l, doubly=False)
mid_n = ll.head.next_node
delete_middle_node(mid_n)
str(ll)
| 23 | 52 | 0.774936 | from dsa.data_structures import LinkedList, ListNode
def delete_middle_node(mid_node: ListNode):
next_node = mid_node.next_node
mid_node.key = next_node.key
mid_node.data = next_node.data
mid_node.next_node = next_node.next_node
mid_node.prev_node = next_node.prev_node
l = [1, 2, 3]
ll = LinkedList(l, dou... | 205 | 0 | 23 |
8f5fa4bb7c149bc76a139e4ca5d49be7e9640bc4 | 889 | py | Python | music/models.py | rayyanshikoh/djangomusicsite | be1582b2e48c6c3edde15b69c1299682fbc1b12a | [
"MIT"
] | null | null | null | music/models.py | rayyanshikoh/djangomusicsite | be1582b2e48c6c3edde15b69c1299682fbc1b12a | [
"MIT"
] | null | null | null | music/models.py | rayyanshikoh/djangomusicsite | be1582b2e48c6c3edde15b69c1299682fbc1b12a | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models.deletion import CASCADE
# Create your models here. | 37.041667 | 64 | 0.75703 | from django.db import models
from django.db.models.deletion import CASCADE
# Create your models here.
class Artist(models.Model):
artist_name = models.CharField(max_length=100)
artist_picture_name = models.CharField(max_length=100)
artist_description = models.CharField(max_length=100)
def __str__(self)... | 57 | 662 | 68 |
899a8ac3943f0e2672d9868197a5e5bb885a511f | 2,218 | py | Python | scripts/csv_to_gv.py | mingkaic/callgraph-profiler | b3258dd67ee530ed5362ff1d0120b7cf100fa4cb | [
"MIT"
] | 9 | 2017-01-06T17:10:53.000Z | 2022-01-21T12:09:09.000Z | scripts/csv_to_gv.py | mingkaic/callgraph-profiler | b3258dd67ee530ed5362ff1d0120b7cf100fa4cb | [
"MIT"
] | 1 | 2017-01-09T18:50:56.000Z | 2017-01-09T18:50:56.000Z | scripts/csv_to_gv.py | mingkaic/callgraph-profiler | b3258dd67ee530ed5362ff1d0120b7cf100fa4cb | [
"MIT"
] | 14 | 2017-01-09T04:19:48.000Z | 2022-03-14T03:27:21.000Z | #!/usr/bin/env python3
from collections import defaultdict
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('csv', nargs='?', default=None,
help='the CSV format callgraph to transform')
args = parser.parse_args()
import... | 32.617647 | 79 | 0.558161 | #!/usr/bin/env python3
from collections import defaultdict
def get_row_tuples(instream):
return (tuple(col.strip() for col in line.split(',')) for line in instream)
def read_callgraph(instream):
nodes = set()
edges = defaultdict(lambda : defaultdict(list))
for (caller, filename, line, callee, count... | 1,662 | 0 | 92 |
44ec7269f753565b6d256da9e84d6e1d7e9ed9cb | 2,628 | py | Python | tests/integration/test_passwd.py | mthaddon/operator-libs-linux | ef86a004f51ae7a506718c90c66d5464d58ac731 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_passwd.py | mthaddon/operator-libs-linux | ef86a004f51ae7a506718c90c66d5464d58ac731 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_passwd.py | mthaddon/operator-libs-linux | ef86a004f51ae7a506718c90c66d5464d58ac731 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
from charms.operator_libs_linux.v0 import passwd
from helpers import lines_in_file
logger = logging.getLogger(__name__)
| 29.52809 | 90 | 0.708904 | #!/usr/bin/env python3
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
from charms.operator_libs_linux.v0 import passwd
from helpers import lines_in_file
logger = logging.getLogger(__name__)
def test_add_user():
# First check the user we're creating doesn't exist
a... | 2,248 | 0 | 138 |
b58e318ca4f093238eee18f1e7d2c3f073e021ad | 11,006 | py | Python | mqtt-relais.py | meberli/mqtt-relais | b0de69d6da6119e9c09601355ea4de1b525402b9 | [
"Apache-2.0"
] | null | null | null | mqtt-relais.py | meberli/mqtt-relais | b0de69d6da6119e9c09601355ea4de1b525402b9 | [
"Apache-2.0"
] | null | null | null | mqtt-relais.py | meberli/mqtt-relais | b0de69d6da6119e9c09601355ea4de1b525402b9 | [
"Apache-2.0"
] | 1 | 2022-01-02T23:14:21.000Z | 2022-01-02T23:14:21.000Z | # !/usr/bin/python3
import string
import time
import random
import json
import yaml
import ssl
import base64
import logging
from logging.config import fileConfig
import importlib
import argparse
import os
import re
from rich.logging import RichHandler
from datetime import datetime
import paho.mqtt.client as mqtt
fr... | 36.203947 | 124 | 0.621116 | # !/usr/bin/python3
import string
import time
import random
import json
import yaml
import ssl
import base64
import logging
from logging.config import fileConfig
import importlib
import argparse
import os
import re
from rich.logging import RichHandler
from datetime import datetime
import paho.mqtt.client as mqtt
fr... | 6,598 | 0 | 207 |
118d6b457420d337af3414d3d155dda1d1ccd34c | 1,458 | py | Python | FusionSlicerLT.py | tapnair/FusionSlicerLT | 11f17855bffab81371431e779d7b6e5edc242006 | [
"MIT"
] | 3 | 2018-09-27T17:28:23.000Z | 2021-07-31T05:07:54.000Z | FusionSlicerLT.py | tapnair/FusionSlicerLT | 11f17855bffab81371431e779d7b6e5edc242006 | [
"MIT"
] | null | null | null | FusionSlicerLT.py | tapnair/FusionSlicerLT | 11f17855bffab81371431e779d7b6e5edc242006 | [
"MIT"
] | 2 | 2019-05-15T06:09:20.000Z | 2021-07-31T05:07:55.000Z | # Author-Patrick Rainsberry
# Description-Simplified Slicer for Fusion 360
# Importing sample Fusion Command
# Could import multiple Command definitions here
from .FusionSlicerLTCommand import FusionSlicerLTCommand, FusionSlicerLTCommand2
commands = []
command_definitions = []
# Define parameters for 1st command
cmd... | 27 | 80 | 0.733882 | # Author-Patrick Rainsberry
# Description-Simplified Slicer for Fusion 360
# Importing sample Fusion Command
# Could import multiple Command definitions here
from .FusionSlicerLTCommand import FusionSlicerLTCommand, FusionSlicerLTCommand2
commands = []
command_definitions = []
# Define parameters for 1st command
cmd... | 120 | 0 | 46 |
10e82da9ec01eac8d5b3c46539f095f880596fbb | 2,871 | py | Python | old_version/threads/downloader.py | DenisZhmakin/VK-Music-Downloader | 217d54f462b2da74776eec47bf1c355c54b017ab | [
"Unlicense"
] | null | null | null | old_version/threads/downloader.py | DenisZhmakin/VK-Music-Downloader | 217d54f462b2da74776eec47bf1c355c54b017ab | [
"Unlicense"
] | 1 | 2021-12-20T03:42:21.000Z | 2021-12-20T09:57:57.000Z | old_version/threads/downloader.py | DenisZhmakin/VK-Music-Downloader | 217d54f462b2da74776eec47bf1c355c54b017ab | [
"Unlicense"
] | null | null | null | import subprocess
import tempfile
from pathlib import Path
import requests
from mutagen.easyid3 import EasyID3
from mutagen.id3 import APIC, ID3
from mutagen.mp3 import MP3
from pathvalidate import sanitize_filename
from PyQt5.QtCore import QThread
from vk_api.audio import VkAudio
from entities.album import VkAlbum
f... | 34.590361 | 131 | 0.642285 | import subprocess
import tempfile
from pathlib import Path
import requests
from mutagen.easyid3 import EasyID3
from mutagen.id3 import APIC, ID3
from mutagen.mp3 import MP3
from pathvalidate import sanitize_filename
from PyQt5.QtCore import QThread
from vk_api.audio import VkAudio
from entities.album import VkAlbum
f... | 2,246 | 7 | 195 |
eee40442b370235e54fc3c68ad3f9b6e578cb6a3 | 2,494 | py | Python | train.py | konowrockis/ai2-comments-generator | 62ca30aeeb332dbbe39a9120ca38d07e69ae76be | [
"MIT"
] | null | null | null | train.py | konowrockis/ai2-comments-generator | 62ca30aeeb332dbbe39a9120ca38d07e69ae76be | [
"MIT"
] | null | null | null | train.py | konowrockis/ai2-comments-generator | 62ca30aeeb332dbbe39a9120ca38d07e69ae76be | [
"MIT"
] | null | null | null | import h5py
import math
import time
import numpy
import sys
from functools import reduce
from keras.models import Sequential
from keras.layers import GRU, LSTM, Dropout, Dense
from keras.layers.wrappers import TimeDistributed
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
with open('./dat... | 30.790123 | 189 | 0.685646 | import h5py
import math
import time
import numpy
import sys
from functools import reduce
from keras.models import Sequential
from keras.layers import GRU, LSTM, Dropout, Dense
from keras.layers.wrappers import TimeDistributed
from keras.callbacks import ModelCheckpoint
from keras.utils import np_utils
with open('./dat... | 653 | 0 | 23 |
3829eb9ad6055f6bc1ed519ee8456fa201a7dced | 790 | py | Python | var/spack/repos/builtin/packages/r-clue/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-clue/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-clue/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 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.package import *
class RClue(RPackage):
"""Cluster Ensembles."""
cran = "clue"
version('0.3-61'... | 37.619048 | 96 | 0.756962 | # Copyright 2013-2022 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.package import *
class RClue(RPackage):
"""Cluster Ensembles."""
cran = "clue"
version('0.3-61'... | 0 | 0 | 0 |
e6aa0f6654ae612b3d6e03152a37d40e81cf4608 | 18 | py | Python | One Road.py | MrAnonymous5635/CSCircles | 010ac82942c88da357e214ea5462ec378f3667b8 | [
"MIT"
] | 17 | 2018-09-19T09:44:33.000Z | 2022-01-17T15:17:11.000Z | One Road.py | MrAnonymous5635/CSCircles | 010ac82942c88da357e214ea5462ec378f3667b8 | [
"MIT"
] | 2 | 2020-02-24T15:28:33.000Z | 2021-11-16T00:04:52.000Z | One Road.py | MrAnonymous5635/CSCircles | 010ac82942c88da357e214ea5462ec378f3667b8 | [
"MIT"
] | 8 | 2020-02-20T00:02:06.000Z | 2022-01-06T17:25:51.000Z | print(min(a,b,c))
| 9 | 17 | 0.611111 | print(min(a,b,c))
| 0 | 0 | 0 |
7fa4a0b55f76126d1cfae7e663e73c96dbb0b977 | 11,714 | py | Python | Compute_all_features/resources/feature_functions.py | BenjaminDHorne/Language-Features-for-News | eaaaf81b8908a8c9d19f97800d566300286db72e | [
"Unlicense"
] | 12 | 2018-03-28T02:16:52.000Z | 2020-09-23T07:38:01.000Z | Compute_all_features/resources/feature_functions.py | BenjaminDHorne/Language-Features-for-News | eaaaf81b8908a8c9d19f97800d566300286db72e | [
"Unlicense"
] | 4 | 2018-11-09T17:50:24.000Z | 2019-12-08T05:02:09.000Z | Compute_all_features/resources/feature_functions.py | BenjaminDHorne/Language-Features-for-News | eaaaf81b8908a8c9d19f97800d566300286db72e | [
"Unlicense"
] | 14 | 2018-11-09T12:12:32.000Z | 2021-11-29T17:53:25.000Z | import nltk
from nltk import tokenize
from nltk.util import ngrams
import os
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from readability import Readability
import collections
from nltk.stem.porter import *
from nltk import word_tokenize
import string
import pickle
### This File co... | 37.787097 | 218 | 0.655967 | import nltk
from nltk import tokenize
from nltk.util import ngrams
import os
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
from readability import Readability
import collections
from nltk.stem.porter import *
from nltk import word_tokenize
import string
import pickle
### This File co... | 10,813 | -5 | 440 |
07e053226e18266eef9402961a67ab146eb222b4 | 3,107 | py | Python | sandbox/vtk/vtkqt.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2021-12-12T13:26:06.000Z | 2022-03-03T16:14:53.000Z | sandbox/vtk/vtkqt.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 5 | 2019-03-01T07:08:46.000Z | 2019-04-28T07:32:42.000Z | sandbox/vtk/vtkqt.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2017-12-13T13:13:52.000Z | 2019-03-13T20:08:15.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2017 Romain Boman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 35.306818 | 76 | 0.671709 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2017 Romain Boman
#
# 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
#
... | 1,901 | 17 | 98 |
ab5fb1a7d6f2ca56ccccbda5f8782171c842d4bd | 1,796 | py | Python | datasets/hdf5datasetwriter.py | mihsamusev/pytrl_demo | 411a74cb5f3601f03438f608b4cf8e451a88345e | [
"MIT"
] | null | null | null | datasets/hdf5datasetwriter.py | mihsamusev/pytrl_demo | 411a74cb5f3601f03438f608b4cf8e451a88345e | [
"MIT"
] | null | null | null | datasets/hdf5datasetwriter.py | mihsamusev/pytrl_demo | 411a74cb5f3601f03438f608b4cf8e451a88345e | [
"MIT"
] | null | null | null | import h5py
import os
| 34.538462 | 79 | 0.599109 | import h5py
import os
class HDF5DatasetWriter:
def __init__(self, dims, outputPath, dataKey="images",bufSize=1000):
# verify that file doesnt exist
if os.path.exists(outputPath):
raise ValueError("Specified path to HDF5 file already exists",
outputPath)
# initializ... | 1,613 | 3 | 157 |
cf4315f5984ce6db46cd3a2ae1530f8767e750cf | 8,189 | py | Python | autokeras/hypermodel/processor.py | dickronez/autokeras | b31f2cafe77bf3a2f738289a89438fb72936117c | [
"MIT"
] | 1 | 2019-09-06T07:47:40.000Z | 2019-09-06T07:47:40.000Z | autokeras/hypermodel/processor.py | dickronez/autokeras | b31f2cafe77bf3a2f738289a89438fb72936117c | [
"MIT"
] | null | null | null | autokeras/hypermodel/processor.py | dickronez/autokeras | b31f2cafe77bf3a2f738289a89438fb72936117c | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
from sklearn.feature_extraction import text
from sklearn import feature_selection
from tensorflow.python.util import nest
from autokeras import const
from autokeras.hypermodel import hyper_block as hb_module
class HyperPreprocessor(hb_module.HyperBlock):
"""Hyper prepro... | 31.74031 | 84 | 0.620222 | import tensorflow as tf
import numpy as np
from sklearn.feature_extraction import text
from sklearn import feature_selection
from tensorflow.python.util import nest
from autokeras import const
from autokeras.hypermodel import hyper_block as hb_module
class HyperPreprocessor(hb_module.HyperBlock):
"""Hyper prepro... | 2,947 | 0 | 459 |