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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e1d3533156e4de3f0f953303a7aa03e8959c6889 | 990 | py | Python | base/site-packages/jpush/push/audience.py | edisonlz/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | base/site-packages/jpush/push/audience.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | null | null | null | base/site-packages/jpush/push/audience.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z | import re
# Value selectors; aliases, tags, etc.
def tag(*tags):
"""Select a (list of) tag(s)."""
vtag = [t for t in tags]
return {"tag": vtag}
def tag_and(*tag_ands):
"""Select a (list of) tag_and(s)."""
vtag_and = [t for t in tag_ands]
return {"tag_and": vtag_and}
def tag_not(*tag_nots):
... | 25.384615 | 48 | 0.611111 | import re
# Value selectors; aliases, tags, etc.
def tag(*tags):
"""Select a (list of) tag(s)."""
vtag = [t for t in tags]
return {"tag": vtag}
def tag_and(*tag_ands):
"""Select a (list of) tag_and(s)."""
vtag_and = [t for t in tag_ands]
return {"tag_and": vtag_and}
def tag_not(*tag_nots):
... | 0 | 0 | 0 |
24ae06873ec69434dce877fd511455ca4e400e69 | 525 | py | Python | shop/migrations/0027_item_offer_price.py | Zex0n/django-simple-cms | 097098dcea218697a53f9c04005c86a7680ee4e1 | [
"MIT"
] | 1 | 2021-04-03T09:29:13.000Z | 2021-04-03T09:29:13.000Z | shop/migrations/0027_item_offer_price.py | Zex0n/django-simple-cms | 097098dcea218697a53f9c04005c86a7680ee4e1 | [
"MIT"
] | null | null | null | shop/migrations/0027_item_offer_price.py | Zex0n/django-simple-cms | 097098dcea218697a53f9c04005c86a7680ee4e1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-07-30 14:11
from __future__ import unicode_literals
from django.db import migrations, models
| 25 | 126 | 0.64 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-07-30 14:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0026_auto_20180716_1626'),
]
operations = [
migrations.AddField(
... | 0 | 359 | 23 |
1ace981d823bbe67c690c75ab2bed1f4bfa3b8f6 | 1,143 | py | Python | 2019-10-23-ex-11.py | mpassosbr/python3 | ff83f1f6f787206e49696134a99d68190606ed4f | [
"MIT"
] | null | null | null | 2019-10-23-ex-11.py | mpassosbr/python3 | ff83f1f6f787206e49696134a99d68190606ed4f | [
"MIT"
] | null | null | null | 2019-10-23-ex-11.py | mpassosbr/python3 | ff83f1f6f787206e49696134a99d68190606ed4f | [
"MIT"
] | null | null | null | num_vezes = 0
soma_total = 0
maior_numero = None
menor_numero = None
while True:
num = input("Digite um número ou \"sair\" para encerrar o programa: ")
if num == "sair":
break
try:
numero = int(num)
num_vezes += 1
soma_total += numero
if maior_numero is None or numero... | 40.821429 | 126 | 0.648294 | num_vezes = 0
soma_total = 0
maior_numero = None
menor_numero = None
while True:
num = input("Digite um número ou \"sair\" para encerrar o programa: ")
if num == "sair":
break
try:
numero = int(num)
num_vezes += 1
soma_total += numero
if maior_numero is None or numero... | 0 | 0 | 0 |
ad9d7a94f217bd44bed61f7bae257db19128308f | 1,307 | py | Python | modules/WEATHER_command.py | linnil1/slack_emoji_bot | b31b465cdab5ecdcbfc987000e182724e86a83c8 | [
"MIT"
] | 4 | 2016-07-25T12:07:19.000Z | 2020-11-25T15:09:16.000Z | modules/WEATHER_command.py | linnil1/slack_emoji_bot | b31b465cdab5ecdcbfc987000e182724e86a83c8 | [
"MIT"
] | null | null | null | modules/WEATHER_command.py | linnil1/slack_emoji_bot | b31b465cdab5ecdcbfc987000e182724e86a83c8 | [
"MIT"
] | null | null | null | from selenium import webdriver
import time
| 37.342857 | 76 | 0.556236 | from selenium import webdriver
import time
class WEATHER:
def require():
return [{"name": "Imgur", "module": True}]
def __init__(self, slack, custom):
self.slack = slack
self.imgur = custom['Imgur']
self.colorPrint = custom['colorPrint']
self.driver = webdriver.Phantom... | 1,167 | -7 | 103 |
89e8813cf7f6c8a6eea7821b86c6ff1ab918f535 | 5,124 | py | Python | cpix/filters.py | ArrisMultiTrust/pycpix | e250b113e8496c892a78d9a4a55f1c9a0886e4dd | [
"MIT"
] | 15 | 2018-09-25T14:52:04.000Z | 2022-03-01T13:37:38.000Z | cpix/filters.py | ArrisMultiTrust/pycpix | e250b113e8496c892a78d9a4a55f1c9a0886e4dd | [
"MIT"
] | null | null | null | cpix/filters.py | ArrisMultiTrust/pycpix | e250b113e8496c892a78d9a4a55f1c9a0886e4dd | [
"MIT"
] | 5 | 2019-02-19T10:58:59.000Z | 2021-02-01T03:46:56.000Z | """
Filter classes
"""
from . import etree
from .base import CPIXComparableBase
def encode_bool(value):
"""Encode booleans to produce valid XML"""
if value:
return "true"
return "false"
class KeyPeriodFilter(CPIXComparableBase):
"""
KeyPeriodFilter element
Has single required attribu... | 25.878788 | 78 | 0.583724 | """
Filter classes
"""
from . import etree
from .base import CPIXComparableBase
def encode_bool(value):
"""Encode booleans to produce valid XML"""
if value:
return "true"
return "false"
class KeyPeriodFilter(CPIXComparableBase):
"""
KeyPeriodFilter element
Has single required attribu... | 553 | 0 | 108 |
7ec647a60c71377740d89e88489c6c77a19977d5 | 1,001 | py | Python | Proyecto/Obtener El calendario/Correo.py | luisgerardoperalestorres/EstanciasI | 2d9add096919d9911a0d40ad8bcabce4f6a24b40 | [
"MIT"
] | null | null | null | Proyecto/Obtener El calendario/Correo.py | luisgerardoperalestorres/EstanciasI | 2d9add096919d9911a0d40ad8bcabce4f6a24b40 | [
"MIT"
] | null | null | null | Proyecto/Obtener El calendario/Correo.py | luisgerardoperalestorres/EstanciasI | 2d9add096919d9911a0d40ad8bcabce4f6a24b40 | [
"MIT"
] | null | null | null | import base64
import httplib2
from email.mime.text import MIMEText
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run_flow
from google_auth_oauthlib.flow import InstalledAppFlow
permiso = ['https://www.... | 34.517241 | 97 | 0.791209 | import base64
import httplib2
from email.mime.text import MIMEText
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run_flow
from google_auth_oauthlib.flow import InstalledAppFlow
permiso = ['https://www.... | 0 | 0 | 0 |
e8d66f7590965688803098f582bdd62de5164810 | 1,760 | py | Python | zcmds/cmds/common/obs_organize.py | zackees/zcmds | 7868b078bc0a3489f0de8435c19f0c3c7913f50f | [
"MIT"
] | null | null | null | zcmds/cmds/common/obs_organize.py | zackees/zcmds | 7868b078bc0a3489f0de8435c19f0c3c7913f50f | [
"MIT"
] | null | null | null | zcmds/cmds/common/obs_organize.py | zackees/zcmds | 7868b078bc0a3489f0de8435c19f0c3c7913f50f | [
"MIT"
] | null | null | null | import os
import shutil
import traceback
HOME_DIR = os.path.abspath(os.path.expanduser("~"))
PATH_DEFAULT_OBS = os.path.join(HOME_DIR, "videos", "obs")
DRY_RUN = False
def _is_video_file(file_path: str) -> bool:
"""Returns True if the given file is a video file."""
_, ext = os.path.splitext(file_path.lower()... | 28.852459 | 112 | 0.599432 | import os
import shutil
import traceback
HOME_DIR = os.path.abspath(os.path.expanduser("~"))
PATH_DEFAULT_OBS = os.path.join(HOME_DIR, "videos", "obs")
DRY_RUN = False
def _is_video_file(file_path: str) -> bool:
"""Returns True if the given file is a video file."""
_, ext = os.path.splitext(file_path.lower()... | 0 | 0 | 0 |
a004be6db5b89fa71ce5391401e2071c48d2e7ca | 276 | py | Python | Mundo1/aula8C.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | Mundo1/aula8C.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | Mundo1/aula8C.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | import math
x = float(input('Digite um ângulo: '))
tangente = math.tan(math.radians(x))
cos = math.acos(math.radians(x))
seno = math.asin(math.radians(x))
print(f'O cosseno de {x} é {cos:.2f}')
print(f'O seno de {x} é {seno:.2f}')
print(f'A tangente de {x} é {tangente:.2f}') | 34.5 | 45 | 0.65942 | import math
x = float(input('Digite um ângulo: '))
tangente = math.tan(math.radians(x))
cos = math.acos(math.radians(x))
seno = math.asin(math.radians(x))
print(f'O cosseno de {x} é {cos:.2f}')
print(f'O seno de {x} é {seno:.2f}')
print(f'A tangente de {x} é {tangente:.2f}') | 0 | 0 | 0 |
e2412a6280e8cd18645880fc44e80ad1de79dc52 | 2,482 | py | Python | recipes/Python/273844_Minimal_http_upload_cgi/recipe-273844.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/273844_Minimal_http_upload_cgi/recipe-273844.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/273844_Minimal_http_upload_cgi/recipe-273844.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | #!/usr/local/bin/python
"""This demonstrates a minimal http upload cgi.
This allows a user to upload up to three files at once.
It is trivial to change the number of files uploaded.
This script has security risks. A user could attempt to fill
a disk partition with endless uploads.
If you have a system open to the pub... | 35.971014 | 82 | 0.699436 | #!/usr/local/bin/python
"""This demonstrates a minimal http upload cgi.
This allows a user to upload up to three files at once.
It is trivial to change the number of files uploaded.
This script has security risks. A user could attempt to fill
a disk partition with endless uploads.
If you have a system open to the pub... | 0 | 0 | 0 |
86c7c2703b64373394ab93187cb0ba9fcade85a4 | 16,837 | py | Python | tools/converter/integration.py | zypeh/utf8rewind | 46dd600a4716f80debbe4bbbe4a5b19daf0e2cb2 | [
"MIT"
] | 5 | 2021-02-07T08:19:59.000Z | 2021-11-18T01:17:01.000Z | tools/converter/integration.py | zypeh/utf8rewind | 46dd600a4716f80debbe4bbbe4a5b19daf0e2cb2 | [
"MIT"
] | 1 | 2020-05-25T08:59:35.000Z | 2020-05-25T14:59:09.000Z | tools/converter/integration.py | zypeh/utf8rewind | 46dd600a4716f80debbe4bbbe4a5b19daf0e2cb2 | [
"MIT"
] | 1 | 2020-06-06T10:30:33.000Z | 2020-06-06T10:30:33.000Z | import argparse
import datetime
import os
import re
import sys
import unicodedata
import libs.header
import libs.unicode
import libs.utf8
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Parse Unicode codepoint database and write integration tests.')
parser.add_argument(
'-v', ... | 28.440878 | 231 | 0.639247 | import argparse
import datetime
import os
import re
import sys
import unicodedata
import libs.header
import libs.unicode
import libs.utf8
def codepointToUnicode(codepoint):
return "U+%04X" % codepoint
class IntegrationSuite:
def __init__(self, db):
self.db = db
def open(self, filepath):
scr... | 13,717 | 190 | 1,369 |
abefb5b34cf7c2c8dc3c3cbfe3542add3720d435 | 803 | py | Python | notebooks/__code/__all/config_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/__all/config_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/__all/config_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | try:
from PyQt4.QtCore import QSettings
except ImportError:
from PyQt5.QtCore import QSettings
| 24.333333 | 61 | 0.603985 | try:
from PyQt4.QtCore import QSettings
except ImportError:
from PyQt5.QtCore import QSettings
def init_config():
settings = QSettings('settings.ini', QSettings.IniFormat)
def save_config(key='', value='', group=''):
settings = QSettings('settings.ini')
if not (group == ''):
settin... | 614 | 0 | 81 |
15e381d0418ee10c4a423de63fd47788b4712bed | 245 | py | Python | app/service_validators/base_validator.py | OPEN-NEXT/import-export | db3e720f29cdc30846667f7cd6ba3cc653146fc4 | [
"MIT"
] | null | null | null | app/service_validators/base_validator.py | OPEN-NEXT/import-export | db3e720f29cdc30846667f7cd6ba3cc653146fc4 | [
"MIT"
] | 25 | 2021-03-09T15:27:44.000Z | 2021-06-09T10:09:43.000Z | app/service_validators/base_validator.py | wikifactory/import-export | f7775d52d23b06a47cdaad13ae48e7727bb850fd | [
"MIT"
] | null | null | null | from re import search
from typing import List, Optional, Pattern
| 27.222222 | 79 | 0.730612 | from re import search
from typing import List, Optional, Pattern
def regex_validator(
url: str, *, service_id: str, regexes: List[Pattern]
) -> Optional[str]:
return service_id if any(search(regex, url) for regex in regexes) else None
| 156 | 0 | 23 |
0a8a2003d5158da4a6b7bb11a36556ab218b3b4b | 1,475 | py | Python | sila_library/sila2lib/fdl_parser/data_type_response.py | lemmi25/sila2lib | ac4db8ee7fe6c99bde498151a539b25be2021d2f | [
"MIT"
] | null | null | null | sila_library/sila2lib/fdl_parser/data_type_response.py | lemmi25/sila2lib | ac4db8ee7fe6c99bde498151a539b25be2021d2f | [
"MIT"
] | null | null | null | sila_library/sila2lib/fdl_parser/data_type_response.py | lemmi25/sila2lib | ac4db8ee7fe6c99bde498151a539b25be2021d2f | [
"MIT"
] | null | null | null | """
__________________________________________________________________________________________________
:project: SiLA2_python
:details: Response data type in a SiLA Command, Property, Intermediate, ...
:file: data_type_response.py
:authors: Timm Severin
:date: (creation) 20190820
:date: (last modificati... | 37.820513 | 120 | 0.772203 | """
__________________________________________________________________________________________________
:project: SiLA2_python
:details: Response data type in a SiLA Command, Property, Intermediate, ...
:file: data_type_response.py
:authors: Timm Severin
:date: (creation) 20190820
:date: (last modificati... | 0 | 0 | 0 |
5c9e3dccd4c10b46579b853910c08110a0cbf6bd | 1,939 | py | Python | full/api_reader.py | PythonDayMX/MLaaS | 3a109f1e83edabb4044c47e1cfa2a39c6227685c | [
"MIT"
] | 8 | 2018-11-30T05:05:10.000Z | 2021-04-05T07:02:53.000Z | full/api_reader.py | PythonDayMX/MLaaS | 3a109f1e83edabb4044c47e1cfa2a39c6227685c | [
"MIT"
] | null | null | null | full/api_reader.py | PythonDayMX/MLaaS | 3a109f1e83edabb4044c47e1cfa2a39c6227685c | [
"MIT"
] | 2 | 2018-11-30T17:09:05.000Z | 2018-11-30T19:20:05.000Z | # ===============================================================
# Author: Rodolfo Ferro
# Email: ferro@cimat.mx
# Twitter: @FerroRodolfo
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by Rodolfo Ferro, for
# his workshop in PythonDay Mexico 2018 at CUCEA in Gdl, Mx.
# Any explici... | 28.101449 | 77 | 0.598762 | # ===============================================================
# Author: Rodolfo Ferro
# Email: ferro@cimat.mx
# Twitter: @FerroRodolfo
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by Rodolfo Ferro, for
# his workshop in PythonDay Mexico 2018 at CUCEA in Gdl, Mx.
# Any explici... | 0 | 0 | 0 |
1647294741a7ef54149b7e1a9153b9c05311ea75 | 229 | py | Python | PyBullet_experiments/experiments/laber_sac_halfchee.py | AnonymousLaBER/LaBER | af9da8ffda0654e2021de20cb162ef71dc9b9d6c | [
"MIT"
] | 3 | 2021-10-11T22:25:02.000Z | 2022-03-04T20:00:56.000Z | PyBullet_experiments/experiments/laber_sac_halfchee.py | AnonymousLaBER/LaBER | af9da8ffda0654e2021de20cb162ef71dc9b9d6c | [
"MIT"
] | null | null | null | PyBullet_experiments/experiments/laber_sac_halfchee.py | AnonymousLaBER/LaBER | af9da8ffda0654e2021de20cb162ef71dc9b9d6c | [
"MIT"
] | null | null | null | import pybullet_envs
from stable_baselines3 import SAC_LABER
model = SAC_LABER('MlpPolicy', 'HalfCheetahBulletEnv-v0', verbose=1, tensorboard_log="results/long_SAC_LABER_HalfCheetahBullet/")
model.learn(total_timesteps=3000000)
| 38.166667 | 129 | 0.847162 | import pybullet_envs
from stable_baselines3 import SAC_LABER
model = SAC_LABER('MlpPolicy', 'HalfCheetahBulletEnv-v0', verbose=1, tensorboard_log="results/long_SAC_LABER_HalfCheetahBullet/")
model.learn(total_timesteps=3000000)
| 0 | 0 | 0 |
f0ed52cc13fd5b72d59358509be5b900dc005beb | 8,030 | py | Python | testapplehealthdata.py | jclark017/applehealthdata | da825124011fa46f8309203b8a25b80ab5f062e8 | [
"MIT"
] | 56 | 2016-06-05T15:41:02.000Z | 2022-03-02T21:51:50.000Z | testapplehealthdata.py | jclark017/applehealthdata | da825124011fa46f8309203b8a25b80ab5f062e8 | [
"MIT"
] | 1 | 2021-12-30T14:06:18.000Z | 2021-12-30T14:06:18.000Z | testapplehealthdata.py | jclark017/applehealthdata | da825124011fa46f8309203b8a25b80ab5f062e8 | [
"MIT"
] | 21 | 2017-02-04T13:06:20.000Z | 2021-12-29T18:56:42.000Z | # -*- coding: utf-8 -*-
"""
testapplehealthdata.py: tests for the applehealthdata.py
Copyright (c) 2016 Nicholas J. Radcliffe
Licence: MIT
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import... | 31.490196 | 76 | 0.573101 | # -*- coding: utf-8 -*-
"""
testapplehealthdata.py: tests for the applehealthdata.py
Copyright (c) 2016 Nicholas J. Radcliffe
Licence: MIT
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import... | 5,578 | 470 | 23 |
afb0bae78a861d61cb7bff15ba2ae3ac74bd95d9 | 4,024 | py | Python | tests/test_books.py | FilippoPisello/Books-Read-DB | f68b33861dc66222d23d37b03e1abf1d9623c0ba | [
"MIT"
] | null | null | null | tests/test_books.py | FilippoPisello/Books-Read-DB | f68b33861dc66222d23d37b03e1abf1d9623c0ba | [
"MIT"
] | null | null | null | tests/test_books.py | FilippoPisello/Books-Read-DB | f68b33861dc66222d23d37b03e1abf1d9623c0ba | [
"MIT"
] | null | null | null | import unittest
from datetime import date
from controller.books import Book, BookRead
if __name__ == "__main__":
unittest.main()
| 33.815126 | 87 | 0.582256 | import unittest
from datetime import date
from controller.books import Book, BookRead
class TestBooks(unittest.TestCase):
def setUp(self) -> None:
self.book1 = Book("Title", "Lorem", "Ipsum", 120, "Genre", False, None)
self.book2 = Book("title", "lorem", "ipsum", 120, "genre", True, ["Yes", "nO"]... | 1,525 | 2,315 | 46 |
28488c57149aff560b88dcc2034960548dbef7d0 | 5,430 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/realTimeTransportControlProtocol1733_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/realTimeTransportControlProtocol1733_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/realTimeTransportControlProtocol1733_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
| 36.689189 | 113 | 0.68895 | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class RealTimeTransportControlProtocol1733(Base):
__slots__ = ()
_SDM_NAME = 'realTimeTransportControlProtocol1733'
_SDM_ATT_MAP = {
'RtcpHeaderVersion': 'realTimeTransportControlProtocol1733.rtcpHeader.version-1',
... | 173 | 5,153 | 23 |
37db3f8e0076e46058d8fe443f9070145cfe0c5a | 896 | py | Python | tests/resources/project/conftest.py | gitter-badger/charybdis | 1505258db0a43c5cb6e64e0513c74c6651df92fd | [
"MIT"
] | null | null | null | tests/resources/project/conftest.py | gitter-badger/charybdis | 1505258db0a43c5cb6e64e0513c74c6651df92fd | [
"MIT"
] | null | null | null | tests/resources/project/conftest.py | gitter-badger/charybdis | 1505258db0a43c5cb6e64e0513c74c6651df92fd | [
"MIT"
] | 1 | 2019-10-10T23:46:33.000Z | 2019-10-10T23:46:33.000Z | import pytest
@pytest.yield_fixture(scope="module")
@pytest.yield_fixture(scope="module")
@pytest.yield_fixture(scope="module")
| 20.363636 | 49 | 0.691964 | import pytest
@pytest.yield_fixture(scope="module")
def test_domain_project(test_admin_client):
domain = test_admin_client.Domain()
domain.slug = "test-project"
domain.name = "Test Domain"
domain.description = "Test" * 10
domain.save()
yield domain
domain.destroy()
@pytest.yield_fixtur... | 696 | 0 | 66 |
ec861e6dda12fb8898b391b55324a0cbbdef264e | 1,973 | py | Python | ProjectDemo/scripts/test/threadScheduler.py | ryrynoryry/Immersive-Illumination | d0e28fc246850648ffc2eca81b0da3daed994d07 | [
"MIT"
] | null | null | null | ProjectDemo/scripts/test/threadScheduler.py | ryrynoryry/Immersive-Illumination | d0e28fc246850648ffc2eca81b0da3daed994d07 | [
"MIT"
] | null | null | null | ProjectDemo/scripts/test/threadScheduler.py | ryrynoryry/Immersive-Illumination | d0e28fc246850648ffc2eca81b0da3daed994d07 | [
"MIT"
] | null | null | null | import threading
import os.path
import time
from blueThread import MainBlue
# class myThread (threading.Thread):
# def __init__(self, threadID, name, counter):
# threading.Thread.__init__(self)
# self.threadID = threadID
# self.name = name
# self.counter = counter
# def run(self):
#... | 26.662162 | 105 | 0.583376 | import threading
import os.path
import time
from blueThread import MainBlue
# class myThread (threading.Thread):
# def __init__(self, threadID, name, counter):
# threading.Thread.__init__(self)
# self.threadID = threadID
# self.name = name
# self.counter = counter
# def run(self):
#... | 0 | 0 | 0 |
d22c2da0d5387f8d7a44708da0325afb1a53d6ac | 78,592 | py | Python | test/db/__init__.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 150 | 2016-10-05T11:09:36.000Z | 2022-03-06T16:24:41.000Z | test/db/__init__.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 27 | 2017-03-02T03:37:02.000Z | 2022-02-10T04:59:54.000Z | test/db/__init__.py | thenetcircle/dino | 1047c3458e91a1b4189e9f48f1393b3a68a935b3 | [
"Apache-2.0"
] | 21 | 2016-11-11T07:51:48.000Z | 2020-04-26T21:38:33.000Z | import time
from datetime import datetime
from datetime import timedelta
from uuid import uuid4 as uuid
from activitystreams import parse
from dino import environ
from dino.auth.redis import AuthRedis
from dino.cache.redis import CacheRedis
from dino.config import ApiActions, RedisKeys
from dino.config import ConfigK... | 42.852781 | 143 | 0.693607 | import time
from datetime import datetime
from datetime import timedelta
from uuid import uuid4 as uuid
from activitystreams import parse
from dino import environ
from dino.auth.redis import AuthRedis
from dino.cache.redis import CacheRedis
from dino.config import ApiActions, RedisKeys
from dino.config import ConfigK... | 70,519 | 6,459 | 23 |
7c24e0e7bd87da7dcf0d17237156e3ed8a9c914a | 682 | py | Python | packages/postgres-database/src/simcore_postgres_database/migration/versions/cfd1c43b5d33_migrate_workbench_state_enum.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | packages/postgres-database/src/simcore_postgres_database/migration/versions/cfd1c43b5d33_migrate_workbench_state_enum.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | packages/postgres-database/src/simcore_postgres_database/migration/versions/cfd1c43b5d33_migrate_workbench_state_enum.py | mrnicegyu11/osparc-simcore | b6fa6c245dbfbc18cc74a387111a52de9b05d1f4 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | """migrate workbench state enum
Revision ID: cfd1c43b5d33
Revises: c8a7073deebb
Create Date: 2020-11-17 16:42:32.511722+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cfd1c43b5d33'
down_revision = 'c8a7073deebb'
branch_labels = None
depends_on = None
| 19.485714 | 84 | 0.653959 | """migrate workbench state enum
Revision ID: cfd1c43b5d33
Revises: c8a7073deebb
Create Date: 2020-11-17 16:42:32.511722+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cfd1c43b5d33'
down_revision = 'c8a7073deebb'
branch_labels = None
depends_on = None
... | 316 | 0 | 46 |
e0da0a1af0b2f9dd2f59c9caf104f7566ccc85e2 | 270 | py | Python | individual_work/justin/sandbox/build_alderman.py | marquettecomputationalsocialscience/clusteredcrimemaps | 4fb4ad1ad2474f854dabc1a72fbefcbb700d601a | [
"MIT"
] | 2 | 2017-11-16T23:22:53.000Z | 2018-02-05T21:04:03.000Z | individual_work/justin/sandbox/build_alderman.py | marquettecomputationalsocialscience/clusteredcrimemaps | 4fb4ad1ad2474f854dabc1a72fbefcbb700d601a | [
"MIT"
] | null | null | null | individual_work/justin/sandbox/build_alderman.py | marquettecomputationalsocialscience/clusteredcrimemaps | 4fb4ad1ad2474f854dabc1a72fbefcbb700d601a | [
"MIT"
] | 3 | 2017-08-06T22:44:45.000Z | 2018-10-28T02:11:56.000Z | import json
fn = open('../static/alderman.js', 'w')
#add alderman boundaries variable
json_file = open('../maps/alderman.geojson')
geo_json = json.load(json_file)
fn.write('var alderman_boundaries = ')
fn.write(json.dumps(geo_json))
fn.write(';\n\n')
json_file.close() | 24.545455 | 44 | 0.722222 | import json
fn = open('../static/alderman.js', 'w')
#add alderman boundaries variable
json_file = open('../maps/alderman.geojson')
geo_json = json.load(json_file)
fn.write('var alderman_boundaries = ')
fn.write(json.dumps(geo_json))
fn.write(';\n\n')
json_file.close() | 0 | 0 | 0 |
1685444ea08d378d0e2dd4b7a518820677952a30 | 5,760 | py | Python | heavymodel/tables.py | lewisfogden/heavymodel | 53507be8b7ce099740126d524f84e8cf84214995 | [
"MIT"
] | 3 | 2020-05-22T22:38:56.000Z | 2021-11-23T19:38:44.000Z | heavymodel/tables.py | lewisfogden/heavymodel | 53507be8b7ce099740126d524f84e8cf84214995 | [
"MIT"
] | 2 | 2020-05-23T21:08:22.000Z | 2020-07-10T21:35:06.000Z | heavymodel/tables.py | lewisfogden/heavymodel | 53507be8b7ce099740126d524f84e8cf84214995 | [
"MIT"
] | 2 | 2021-01-31T10:37:39.000Z | 2022-03-02T09:07:06.000Z | # tables.py
class MortalityTable:
"""mortalitytable is a matrix, by age and duration."""
class MortalityImprovementTable:
"""MortalityImprovementTable is a matrix, by age and year."""
class RangeTable:
"""range table"""
| 36.687898 | 129 | 0.485243 | # tables.py
class MortalityTable:
"""mortalitytable is a matrix, by age and duration."""
def __init__(self, csv_filename, name, select_period, pc_of_base=1):
self.filename = csv_filename
self.name = name
self.select_period = select_period
self.pc_of_base = pc_of_base... | 4,814 | 237 | 450 |
9c9bdde05fd6b005c418fb0f2df26af899a1b5ee | 457 | py | Python | pysimgame/utils/maths.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | pysimgame/utils/maths.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | pysimgame/utils/maths.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | """Mathematical helper functions."""
def normalize(array):
"""Normalize the array.
Set all the values betwwen 0 and 1.
0 corresponds to the min value and 1 the max.
If the normalization cannot occur, will return the array.
"""
min_ = min(array)
max_ = max(array)
return (
(arra... | 25.388889 | 62 | 0.601751 | """Mathematical helper functions."""
def normalize(array):
"""Normalize the array.
Set all the values betwwen 0 and 1.
0 corresponds to the min value and 1 the max.
If the normalization cannot occur, will return the array.
"""
min_ = min(array)
max_ = max(array)
return (
(arra... | 0 | 0 | 0 |
1767230b91ddc9a5770836dbc0935ed70a2e4b8d | 105 | py | Python | files/Strings/d25.py | heltonricardo/estudo-python | e82eb8ebc15378175b03d367a6eeea66e8858cff | [
"MIT"
] | null | null | null | files/Strings/d25.py | heltonricardo/estudo-python | e82eb8ebc15378175b03d367a6eeea66e8858cff | [
"MIT"
] | null | null | null | files/Strings/d25.py | heltonricardo/estudo-python | e82eb8ebc15378175b03d367a6eeea66e8858cff | [
"MIT"
] | null | null | null | nome = input('Insira nome completo: ').strip()
print('Possui "Silva"?', 'silva' in nome.lower())
input()
| 26.25 | 49 | 0.657143 | nome = input('Insira nome completo: ').strip()
print('Possui "Silva"?', 'silva' in nome.lower())
input()
| 0 | 0 | 0 |
de22e77706673d86f80049a8a5df73132c478cf4 | 5,266 | py | Python | models/resnet.py | akanametov/classification-pytorch | 1090d6e794a789150c3e8f0f68080dd208d340c1 | [
"MIT"
] | null | null | null | models/resnet.py | akanametov/classification-pytorch | 1090d6e794a789150c3e8f0f68080dd208d340c1 | [
"MIT"
] | null | null | null | models/resnet.py | akanametov/classification-pytorch | 1090d6e794a789150c3e8f0f68080dd208d340c1 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
def conv3x3(in_planes, out_planes, **kwargs):
"""3x3 convolution with padding"""
kwargs['kernel_size'] = 3
kwargs['padding'] = 1
kwargs['bias'] = False
return nn.Conv2d(in_planes, ... | 30.616279 | 96 | 0.590201 | import torch
import torch.nn as nn
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
def conv3x3(in_planes, out_planes, **kwargs):
"""3x3 convolution with padding"""
kwargs['kernel_size'] = 3
kwargs['padding'] = 1
kwargs['bias'] = False
return nn.Conv2d(in_planes, ... | 3,726 | 0 | 221 |
41d120032ce70ba4e8b62faacb4efbcdbe973dd7 | 12,787 | py | Python | tests/impact/client/test_experiment_definition.py | iakov-test/impact-client-python | c1f0f91fc15c3b8c80408cd0c0c1afc5dc67e827 | [
"BSD-3-Clause"
] | 3 | 2020-09-30T12:08:58.000Z | 2021-09-22T08:42:14.000Z | tests/impact/client/test_experiment_definition.py | iakov-test/impact-client-python | c1f0f91fc15c3b8c80408cd0c0c1afc5dc67e827 | [
"BSD-3-Clause"
] | 11 | 2020-09-24T14:25:41.000Z | 2022-02-17T03:48:26.000Z | tests/impact/client/test_experiment_definition.py | iakov-test/impact-client-python | c1f0f91fc15c3b8c80408cd0c0c1afc5dc67e827 | [
"BSD-3-Clause"
] | 1 | 2022-01-10T13:50:51.000Z | 2022-01-10T13:50:51.000Z | from modelon.impact.client import (
SimpleFMUExperimentDefinition,
SimpleModelicaExperimentDefinition,
Range,
Choices,
SimpleExperimentExtension,
)
import pytest
from modelon.impact.client import exceptions
from tests.impact.client.fixtures import *
| 37.498534 | 93 | 0.574255 | from modelon.impact.client import (
SimpleFMUExperimentDefinition,
SimpleModelicaExperimentDefinition,
Range,
Choices,
SimpleExperimentExtension,
)
import pytest
from modelon.impact.client import exceptions
from tests.impact.client.fixtures import *
class TestSimpleFMUExperimentDefinition:
de... | 11,660 | 58 | 795 |
b9fcee270a8071595b5e1f5162f790c169294d8f | 3,537 | py | Python | database.py | shikanon/sota-website | 3a49fe5e91de72a5d7c7a07ce8b76637953c8194 | [
"MIT"
] | null | null | null | database.py | shikanon/sota-website | 3a49fe5e91de72a5d7c7a07ce8b76637953c8194 | [
"MIT"
] | null | null | null | database.py | shikanon/sota-website | 3a49fe5e91de72a5d7c7a07ce8b76637953c8194 | [
"MIT"
] | null | null | null | #coding:utf-8
import pymongo
import records
| 34.009615 | 125 | 0.615493 | #coding:utf-8
import pymongo
import records
class DB:
def __init__(self):
''' 初始化数据库
'''
self.init_mongo()
self.init_record()
def init_mongo(self):
# mongodb客户端
mongo_client = pymongo.MongoClient('mongodb://10.10.6.85:27017/')
api_db = mongo_client["sot... | 1,646 | 2,043 | 23 |
36557163a13310fca57cbdee6a3ecf79cac43fbc | 27,785 | py | Python | tm351_nb_utils.py | innovationOUtside/notebook_processing | 7444235112c2c0677f0873db54f080138c78ad95 | [
"MIT"
] | 2 | 2020-02-12T06:34:03.000Z | 2021-09-30T04:55:10.000Z | tm351_nb_utils.py | innovationOUtside/notebook_processing | 7444235112c2c0677f0873db54f080138c78ad95 | [
"MIT"
] | 8 | 2020-07-04T21:35:31.000Z | 2022-01-10T17:13:40.000Z | tm351_nb_utils.py | innovationOUtside/notebook_processing | 7444235112c2c0677f0873db54f080138c78ad95 | [
"MIT"
] | null | null | null | # ou-tm351 - `nb_pub_utils`
#GOTCHA - Python on Mac logging in to Github: https://stackoverflow.com/a/42098127/454773
import click
import os
import shutil
import zipfile
import humanize
import datetime
import github
from tabulate import tabulate
from shlex import quote
import subprocess
def listify(item):
'''... | 44.670418 | 272 | 0.633831 | # ou-tm351 - `nb_pub_utils`
#GOTCHA - Python on Mac logging in to Github: https://stackoverflow.com/a/42098127/454773
import click
import os
import shutil
import zipfile
import humanize
import datetime
import github
from tabulate import tabulate
from shlex import quote
import subprocess
def cli_command(cmd):
t... | 1,166 | 0 | 122 |
9753d7bfd9a6580628e5db08bdd5fcda2b36ed62 | 42,974 | py | Python | plots/instrument_plot.py | shaunwbell/EcoFOCI_MooringAnalysis | 369617cac20b41c1606aeac83fbd9131b77e1c15 | [
"MIT"
] | 3 | 2017-03-23T16:52:44.000Z | 2022-03-08T16:53:29.000Z | plots/instrument_plot.py | shaunwbell/EcoFOCI_MooringAnalysis | 369617cac20b41c1606aeac83fbd9131b77e1c15 | [
"MIT"
] | 43 | 2017-04-03T23:12:52.000Z | 2022-01-28T16:04:34.000Z | plots/instrument_plot.py | shaunwbell/EcoFOCI_MooringAnalysis | 369617cac20b41c1606aeac83fbd9131b77e1c15 | [
"MIT"
] | 2 | 2017-03-30T22:01:25.000Z | 2019-10-17T17:30:29.000Z | #!/usr/bin/env
"""
class definitions for standard 1 variable plots
class definitions for standard 2 variable plots
class definitions for standard 3 variable plots
History:
--------
2019-05-21: error in calculation used corrected udata to correct vdata
"""
# System Stack
import datetime
# science stack
import n... | 36.635976 | 119 | 0.588472 | #!/usr/bin/env
"""
class definitions for standard 1 variable plots
class definitions for standard 2 variable plots
class definitions for standard 3 variable plots
History:
--------
2019-05-21: error in calculation used corrected udata to correct vdata
"""
# System Stack
import datetime
# science stack
import n... | 15,568 | 24,092 | 210 |
1e8a2fa776f5bd96393450257a891c27824bdb82 | 14,904 | py | Python | tests/test_interactions/test_omit_interactions.py | radifar/PyPLIF-HIPPOS | 95fc5dd81b900e84ae6f3368c4b70a08d17257dd | [
"HPND"
] | 13 | 2020-07-29T12:19:56.000Z | 2022-02-07T04:48:19.000Z | tests/test_interactions/test_omit_interactions.py | radifar/PyPLIF-HIPPOS | 95fc5dd81b900e84ae6f3368c4b70a08d17257dd | [
"HPND"
] | 5 | 2021-03-30T01:11:49.000Z | 2021-09-13T11:49:35.000Z | tests/test_interactions/test_omit_interactions.py | radifar/PyPLIF-HIPPOS | 95fc5dd81b900e84ae6f3368c4b70a08d17257dd | [
"HPND"
] | 5 | 2020-08-06T07:26:06.000Z | 2021-10-30T17:16:39.000Z | """
The tests for omit interaction feature
"""
import os
import sys
from collections import namedtuple
from pyplif_hippos import ParseConfig, hippos, similarity
def test_configuration_single_omit_interaction(tmpdir):
"""Test configuration for omitting specific interaction"""
# Arrange
config_file = t... | 39.638298 | 495 | 0.790526 | """
The tests for omit interaction feature
"""
import os
import sys
from collections import namedtuple
from pyplif_hippos import ParseConfig, hippos, similarity
def test_configuration_single_omit_interaction(tmpdir):
"""Test configuration for omitting specific interaction"""
# Arrange
config_file = t... | 0 | 0 | 0 |
18b43d93d77ebe67e06100b1f3fc186f79af79fd | 3,413 | py | Python | lib/demucs_service.py | avillalobos/demucs_service | 0ef2c45983620cd9522a5953387ec19662283456 | [
"MIT"
] | 2 | 2021-03-05T11:25:23.000Z | 2022-01-03T19:42:28.000Z | lib/demucs_service.py | avillalobos/demucs_service | 0ef2c45983620cd9522a5953387ec19662283456 | [
"MIT"
] | null | null | null | lib/demucs_service.py | avillalobos/demucs_service | 0ef2c45983620cd9522a5953387ec19662283456 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
from lib.demucs import demucs
from lib.demucs.demucs import model
from lib.demucs.demucs.audio import AudioFile
from lib.demucs.demucs.utils import apply_model, load_model
from pathlib import Path
from scipy.io import wavfile
# within the demucs directory
sys.modules['demucs.model'] = ... | 36.698925 | 79 | 0.612364 | #!/usr/bin/python3
import sys
from lib.demucs import demucs
from lib.demucs.demucs import model
from lib.demucs.demucs.audio import AudioFile
from lib.demucs.demucs.utils import apply_model, load_model
from pathlib import Path
from scipy.io import wavfile
# within the demucs directory
sys.modules['demucs.model'] = ... | 2,122 | 0 | 54 |
781b2eb6394e77875786319670d0805d9e8efe89 | 596 | py | Python | 100days/day80/query_demo.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | 100days/day80/query_demo.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | 16 | 2020-02-12T03:09:30.000Z | 2022-03-12T00:08:59.000Z | 100days/day80/query_demo.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | import pymysql
conn = pymysql.Connection(
host = '192.168.160.33',
port = 3306,
user = 'develop',
password='xs_dev',
database='test',
charset='utf8'
)
cursor = conn.cursor()
sql = """
select * from user1
"""
try:
cursor.execute(sql)
res = cursor.fetchall()
for row in res:
... | 18.060606 | 103 | 0.553691 | import pymysql
conn = pymysql.Connection(
host = '192.168.160.33',
port = 3306,
user = 'develop',
password='xs_dev',
database='test',
charset='utf8'
)
cursor = conn.cursor()
sql = """
select * from user1
"""
try:
cursor.execute(sql)
res = cursor.fetchall()
for row in res:
... | 0 | 0 | 0 |
22bac7328f5707f686d5d1081d9a304673121b3f | 2,245 | py | Python | nfmanagementapi/resources/ServiceObjectCollectionResource.py | nfirewall/nfmapi | 7232975711ad01b031ed50d7f26936afcfe5312a | [
"MIT"
] | null | null | null | nfmanagementapi/resources/ServiceObjectCollectionResource.py | nfirewall/nfmapi | 7232975711ad01b031ed50d7f26936afcfe5312a | [
"MIT"
] | null | null | null | nfmanagementapi/resources/ServiceObjectCollectionResource.py | nfirewall/nfmapi | 7232975711ad01b031ed50d7f26936afcfe5312a | [
"MIT"
] | null | null | null | from nfmanagementapi.models import ServiceObject
from nfmanagementapi.schemata import ServiceObjectSchema
from marshmallow.exceptions import ValidationError
from .BaseResource import BaseResource
from flask import request
from app import db
from uuid import uuid4
path = 'service_objects'
endpoint = 'service_objects'
| 29.155844 | 72 | 0.561247 | from nfmanagementapi.models import ServiceObject
from nfmanagementapi.schemata import ServiceObjectSchema
from marshmallow.exceptions import ValidationError
from .BaseResource import BaseResource
from flask import request
from app import db
from uuid import uuid4
path = 'service_objects'
endpoint = 'service_objects'
... | 0 | 1,903 | 23 |
0e99d00e9c38f4e19afb900ddb0a47445848a8c2 | 3,824 | py | Python | code/EthicAssessmentSoftware/migrations/0001_initial.py | FelixOliverLange/ethikbackend | 3fd2ad6c2953966254841fb770b482c7f7741791 | [
"BSD-3-Clause"
] | null | null | null | code/EthicAssessmentSoftware/migrations/0001_initial.py | FelixOliverLange/ethikbackend | 3fd2ad6c2953966254841fb770b482c7f7741791 | [
"BSD-3-Clause"
] | 2 | 2021-06-10T20:36:01.000Z | 2021-09-22T19:44:05.000Z | code/EthicAssessmentSoftware/migrations/0001_initial.py | FelixOliverLange/ethikbackend | 3fd2ad6c2953966254841fb770b482c7f7741791 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-12 00:15
from django.db import migrations, models
import django.db.models.deletion
| 50.986667 | 138 | 0.599895 | # Generated by Django 3.1.6 on 2021-02-12 00:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Anwendung',
fields=[
... | 0 | 3,677 | 23 |
b0c7f1929a58731db1dd66c0222e1c9b375dbf86 | 1,339 | py | Python | old/v1/config_v1.py | apollo-heidal/Sound-Synth | c392291ee83d391333acaaff7ff3448da758bdbb | [
"MIT"
] | null | null | null | old/v1/config_v1.py | apollo-heidal/Sound-Synth | c392291ee83d391333acaaff7ff3448da758bdbb | [
"MIT"
] | null | null | null | old/v1/config_v1.py | apollo-heidal/Sound-Synth | c392291ee83d391333acaaff7ff3448da758bdbb | [
"MIT"
] | null | null | null | config = {
"frequency": 440.0,
"duration": 20.0,
"sampling_rate": 44100,
"filename": "test_v1.wav",
"overtones": [
[
440.0,
1.0
],
[
12447.350408741928,
0.1098108639573242
],
[
12465.35... | 17.853333 | 33 | 0.285288 | config = {
"frequency": 440.0,
"duration": 20.0,
"sampling_rate": 44100,
"filename": "test_v1.wav",
"overtones": [
[
440.0,
1.0
],
[
12447.350408741928,
0.1098108639573242
],
[
12465.35... | 0 | 0 | 0 |
66cc98c8d9319502ca072034ba7112b3f7e1b2f6 | 67,679 | py | Python | pyspectools/ftmw_analysis.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 22 | 2018-03-14T10:44:17.000Z | 2022-01-10T15:02:37.000Z | pyspectools/ftmw_analysis.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 21 | 2019-07-27T01:43:50.000Z | 2021-11-15T14:57:15.000Z | pyspectools/ftmw_analysis.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 3 | 2020-08-03T16:22:00.000Z | 2021-11-01T15:31:55.000Z | import datetime
import re
import os
import struct
from dataclasses import dataclass, field
from itertools import combinations, product
from typing import List, Dict
import pandas as pd
import numpy as np
import peakutils
from matplotlib import pyplot as plt
from scipy import signal as spsig
import plotly.graph_objs as... | 37.516075 | 120 | 0.576604 | import datetime
import re
import os
import struct
from dataclasses import dataclass, field
from itertools import combinations, product
from typing import List, Dict
import pandas as pd
import numpy as np
import peakutils
from matplotlib import pyplot as plt
from scipy import signal as spsig
import plotly.graph_objs as... | 4,983 | 33,421 | 304 |
cf478e66633fb9947f670d728f5489d1a7e3d900 | 999 | py | Python | dnsimple/struct/domain_renewal.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 12 | 2020-06-18T17:16:03.000Z | 2022-03-23T08:35:49.000Z | dnsimple/struct/domain_renewal.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 129 | 2020-06-25T12:15:51.000Z | 2022-03-23T09:42:16.000Z | dnsimple/struct/domain_renewal.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 6 | 2020-07-03T09:34:01.000Z | 2021-12-20T04:29:59.000Z | import json
from dataclasses import dataclass
import omitempty
from dnsimple.struct import Struct
class DomainRenewRequest(dict):
"""DomainRenewRequest represents the attributes you can pass to a renew API request."""
@dataclass
class DomainRenewal(Struct):
"""Represents the result of a domain renewal ca... | 27 | 91 | 0.692693 | import json
from dataclasses import dataclass
import omitempty
from dnsimple.struct import Struct
class DomainRenewRequest(dict):
"""DomainRenewRequest represents the attributes you can pass to a renew API request."""
def __init__(self, period=None, premium_price=None):
dict.__init__(self, period=pe... | 178 | 0 | 80 |
ab2b1e286f0be8439a38f4a5f410e09790e73292 | 898 | py | Python | transmute_core/framework/request_adapter.py | yunstanford/transmute-core | a8e5dd055f0f3d39327d71dd61bf0ee147f59ebe | [
"MIT"
] | null | null | null | transmute_core/framework/request_adapter.py | yunstanford/transmute-core | a8e5dd055f0f3d39327d71dd61bf0ee147f59ebe | [
"MIT"
] | null | null | null | transmute_core/framework/request_adapter.py | yunstanford/transmute-core | a8e5dd055f0f3d39327d71dd61bf0ee147f59ebe | [
"MIT"
] | null | null | null | class RequestAdapter(object):
"""
RequestAdapters bridge transmute's
representation of a request, with the framework's
implementation.
implement the unimplemented methods.
"""
@property
def body(self):
""" return the request body. """
raise NotImplementedError()
de... | 28.0625 | 71 | 0.662584 | class RequestAdapter(object):
"""
RequestAdapters bridge transmute's
representation of a request, with the framework's
implementation.
implement the unimplemented methods.
"""
@property
def body(self):
""" return the request body. """
raise NotImplementedError()
de... | 147 | 0 | 81 |
2d8767d69cb3fe7dd0333a69a100b095f51eda10 | 942 | py | Python | week4_divide_and_conquer/4_number_of_inversions/inversions.py | thegautamkumarjaiswal/Algorithm-s_ToolBox_Solutions | bb265647ed183f44e0d56f14a4b8b966af73dfd2 | [
"Apache-2.0"
] | null | null | null | week4_divide_and_conquer/4_number_of_inversions/inversions.py | thegautamkumarjaiswal/Algorithm-s_ToolBox_Solutions | bb265647ed183f44e0d56f14a4b8b966af73dfd2 | [
"Apache-2.0"
] | null | null | null | week4_divide_and_conquer/4_number_of_inversions/inversions.py | thegautamkumarjaiswal/Algorithm-s_ToolBox_Solutions | bb265647ed183f44e0d56f14a4b8b966af73dfd2 | [
"Apache-2.0"
] | null | null | null | # python3
""" Task: Count the number of inversions of a given sequence """
tot_count = 0
n = int ( input () )
seq = [ int ( i ) for i in input ().split () ]
mergesort ( seq )
print ( tot_count )
| 21.409091 | 64 | 0.505308 | # python3
""" Task: Count the number of inversions of a given sequence """
def merge(left , right) :
i , j , inversion_counter = 0 , 0 , 0
final = list ()
while i < len ( left ) and j < len ( right ) :
if left [ i ] <= right [ j ] :
final.append ( left [ i ] )
i += 1
... | 696 | 0 | 46 |
7672fabf7a8b7a3f323dedbf8df709a757105afa | 3,646 | py | Python | py3/tflib/lsun256.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | py3/tflib/lsun256.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | py3/tflib/lsun256.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | import numpy as np
import scipy.misc
import os
import time
# from PIL import Image
DATA_DIR = '/home/ubuntu/lsun/bedrooms/'
NEW_DATA_DIR = '/home/ubuntu/lsun/bedrooms_128/'
# with open(DATA_DIR+'files.txt', 'r') as f:
# files = [l[:-1] for l in f]
# # images = np.zeros((batch_size, 3, 256, 256), dtype='int32')
# ... | 36.828283 | 133 | 0.507131 | import numpy as np
import scipy.misc
import os
import time
# from PIL import Image
DATA_DIR = '/home/ubuntu/lsun/bedrooms/'
NEW_DATA_DIR = '/home/ubuntu/lsun/bedrooms_128/'
# with open(DATA_DIR+'files.txt', 'r') as f:
# files = [l[:-1] for l in f]
# # images = np.zeros((batch_size, 3, 256, 256), dtype='int32')
# ... | 1,458 | 0 | 23 |
0980ee7ae89d6028f2daf449114f96ec122ba0e5 | 3,461 | py | Python | server/favorite_thing/serializers.py | omobosteven/favorite-things | c5fdf307f9a0c5d2ab659d0cc826f0f7201df141 | [
"MIT"
] | null | null | null | server/favorite_thing/serializers.py | omobosteven/favorite-things | c5fdf307f9a0c5d2ab659d0cc826f0f7201df141 | [
"MIT"
] | 15 | 2019-12-04T23:16:58.000Z | 2022-02-27T05:06:03.000Z | server/favorite_thing/serializers.py | omobosteven/favorite-things | c5fdf307f9a0c5d2ab659d0cc826f0f7201df141 | [
"MIT"
] | 1 | 2019-07-25T20:35:24.000Z | 2019-07-25T20:35:24.000Z | from django.db.utils import IntegrityError
from django.db.models import Q
from rest_framework import serializers
from core.models import FavoriteThing
from core.models import Category
from .helper import reorder_rankings, reorder_rankings_subtract
| 39.781609 | 78 | 0.645478 | from django.db.utils import IntegrityError
from django.db.models import Q
from rest_framework import serializers
from core.models import FavoriteThing
from core.models import Category
from .helper import reorder_rankings, reorder_rankings_subtract
class FavoriteThingSerializer(serializers.ModelSerializer):
catego... | 2,592 | 597 | 23 |
52f33d0f97e1c3d24a976315266ee6737b9b34db | 14,048 | py | Python | tests/cron_job_tests/test_genomic_data_quality_pipeline.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | tests/cron_job_tests/test_genomic_data_quality_pipeline.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | tests/cron_job_tests/test_genomic_data_quality_pipeline.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | # Tests for the Genomics Data Quality Pipeline
import mock, datetime, pytz
from rdr_service import clock
from rdr_service.api_util import open_cloud_file
from rdr_service.genomic_enums import GenomicJob, GenomicSubProcessStatus, GenomicSubProcessResult, \
GenomicManifestTypes, GenomicIncidentCode
from tests.helper... | 42.313253 | 105 | 0.670487 | # Tests for the Genomics Data Quality Pipeline
import mock, datetime, pytz
from rdr_service import clock
from rdr_service.api_util import open_cloud_file
from rdr_service.genomic_enums import GenomicJob, GenomicSubProcessStatus, GenomicSubProcessResult, \
GenomicManifestTypes, GenomicIncidentCode
from tests.helper... | 12,168 | 1,182 | 176 |
431ef6db152840abe39b59d1b1a27606e88c65d6 | 716 | py | Python | Tried/Strings/1237.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Tried/Strings/1237.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Tried/Strings/1237.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | # Time limit exceeded
while True:
try:
A = input()
B = input()
lA = len(A)
lB = len(B)
biggest = ""
shortest = ""
lshortest = 0
if max(lA, lB) == lA:
biggest, shortest = A, B
lbiggest = lA
lshortest = lB
else:
biggest, shortest = B, A
lbiggest = lB
lshortest = lA
bSub = 0
c... | 14.916667 | 35 | 0.539106 | # Time limit exceeded
while True:
try:
A = input()
B = input()
lA = len(A)
lB = len(B)
biggest = ""
shortest = ""
lshortest = 0
if max(lA, lB) == lA:
biggest, shortest = A, B
lbiggest = lA
lshortest = lB
else:
biggest, shortest = B, A
lbiggest = lB
lshortest = lA
bSub = 0
c... | 0 | 0 | 0 |
32ed63da26a1030fea2213fe16ac945a18313b1b | 1,490 | py | Python | galvatron_lib/core/location_handlers/chrome_handler.py | viking333/galvatron | c2dc9c94ad64e79ad234c4a04b039f6cf429e0f3 | [
"MIT"
] | null | null | null | galvatron_lib/core/location_handlers/chrome_handler.py | viking333/galvatron | c2dc9c94ad64e79ad234c4a04b039f6cf429e0f3 | [
"MIT"
] | null | null | null | galvatron_lib/core/location_handlers/chrome_handler.py | viking333/galvatron | c2dc9c94ad64e79ad234c4a04b039f6cf429e0f3 | [
"MIT"
] | 7 | 2019-08-22T15:17:44.000Z | 2020-01-03T17:18:06.000Z | import os, urllib, requests, json
priority = 1
| 37.25 | 230 | 0.672483 | import os, urllib, requests, json
priority = 1
def get_extension_id(arg1):
package = "\"{}\"".format(arg1.replace("chrome://", ""))
package = urllib.quote_plus(package)
url = "https://chrome.google.com/webstore/ajax/item?hl=en&gl=GB&pv=20181009&count=2&searchTerm={}".format(package)
resp = requests.po... | 1,351 | 0 | 92 |
eb509f37c00b60320a88eccf0074acfe172aadc6 | 124 | py | Python | Code/lecture 17/code6_list.py | capacitybuilding/Introduction-to-Computng | 77639e53ed53896581c4a8431f32198237ac70dc | [
"MIT"
] | null | null | null | Code/lecture 17/code6_list.py | capacitybuilding/Introduction-to-Computng | 77639e53ed53896581c4a8431f32198237ac70dc | [
"MIT"
] | null | null | null | Code/lecture 17/code6_list.py | capacitybuilding/Introduction-to-Computng | 77639e53ed53896581c4a8431f32198237ac70dc | [
"MIT"
] | null | null | null |
list1 = [1, 4, 8, 2, 9]
print len(list1)
print max(list1), min(list1)
print list1[-2]
print list1[-5:3]
print list1[-3:]
| 12.4 | 28 | 0.629032 |
list1 = [1, 4, 8, 2, 9]
print len(list1)
print max(list1), min(list1)
print list1[-2]
print list1[-5:3]
print list1[-3:]
| 0 | 0 | 0 |
698015ddf789237819b0eaa04da727793abc9f2a | 2,079 | py | Python | plot/histogram.py | IvoryLu/data-processing | 65d91537dea777d037e9a419a355a0c8493aa19c | [
"BSD-3-Clause"
] | null | null | null | plot/histogram.py | IvoryLu/data-processing | 65d91537dea777d037e9a419a355a0c8493aa19c | [
"BSD-3-Clause"
] | null | null | null | plot/histogram.py | IvoryLu/data-processing | 65d91537dea777d037e9a419a355a0c8493aa19c | [
"BSD-3-Clause"
] | null | null | null | from matplotlib import pyplot as plt
from script import sales_times1
from script import sales_times2
# normed=True This command divides the height of each column by
# a constant such that the total shaded area of the histogram sums
# to 1
plt.hist(sales_times1, bins=20, alpha=0.4, normed=True)
plt.hist(sales_times2, b... | 36.473684 | 259 | 0.721501 | from matplotlib import pyplot as plt
from script import sales_times1
from script import sales_times2
# normed=True This command divides the height of each column by
# a constant such that the total shaded area of the histogram sums
# to 1
plt.hist(sales_times1, bins=20, alpha=0.4, normed=True)
plt.hist(sales_times2, b... | 0 | 0 | 0 |
9f18495a49f1afc15c2ebfbfac14e88650c4cc8b | 214 | py | Python | basico/aula002/aula02.py | KaicPierre/Curso-de-Python3 | 6267ba92c298f0ffa103e374615f040b0db13339 | [
"MIT"
] | 1 | 2020-09-04T07:46:45.000Z | 2020-09-04T07:46:45.000Z | basico/aula002/aula02.py | KaicPierre/Curso-de-Python3 | 6267ba92c298f0ffa103e374615f040b0db13339 | [
"MIT"
] | null | null | null | basico/aula002/aula02.py | KaicPierre/Curso-de-Python3 | 6267ba92c298f0ffa103e374615f040b0db13339 | [
"MIT"
] | null | null | null | # print(123456)
# print('Kaic', 'Pierre', 'Outra Coisa')
# print('Kaic', 'Pierre', sep='-', end='')
# print('Testando', 'Outras', 'Coisas', sep='-', end='')
print('428', '330', '048', sep='.', end='-')
print('93')
| 30.571429 | 56 | 0.537383 | # print(123456)
# print('Kaic', 'Pierre', 'Outra Coisa')
# print('Kaic', 'Pierre', sep='-', end='')
# print('Testando', 'Outras', 'Coisas', sep='-', end='')
print('428', '330', '048', sep='.', end='-')
print('93')
| 0 | 0 | 0 |
6dda831cadd31c8f32d1dc02a292c613ee99c7ef | 6,245 | py | Python | voc_classifier/bert_model.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | 6 | 2021-08-18T00:52:38.000Z | 2021-12-03T12:37:18.000Z | voc_classifier/bert_model.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | null | null | null | voc_classifier/bert_model.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | 1 | 2022-03-24T08:02:44.000Z | 2022-03-24T08:02:44.000Z | import sys
sys.path.append("../")
# KoBERT 모델
import config
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import gluonnlp as nlp
fro... | 36.098266 | 151 | 0.63699 | import sys
sys.path.append("../")
# KoBERT 모델
import config
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import gluonnlp as nlp
fro... | 4,011 | 19 | 261 |
55ed52af5669483d0d12633c9132b7026ed87a23 | 2,061 | py | Python | src/plugins/pic_searcher/model.py | Lycreal/qbot | e0cb5af8295efb1d58780ac4a420551e1183ba8b | [
"MIT"
] | 7 | 2019-10-09T07:09:37.000Z | 2020-07-15T01:30:25.000Z | src/plugins/pic_searcher/model.py | Lycreal/cqbot | b189a17283a63e982bf7f99e529486af8d2bfb76 | [
"MIT"
] | 59 | 2021-05-20T07:21:50.000Z | 2022-03-25T21:17:07.000Z | src/plugins/pic_searcher/model.py | Lycreal/cqbot | b189a17283a63e982bf7f99e529486af8d2bfb76 | [
"MIT"
] | 2 | 2020-12-31T06:23:10.000Z | 2021-07-27T07:40:16.000Z | import urllib.parse
from .saucenao import get_saucenao_detail, SauceNAOError
| 32.203125 | 95 | 0.5541 | import urllib.parse
from .saucenao import get_saucenao_detail, SauceNAOError
class PicSearcher:
@classmethod
async def do_search(cls, image: str, site: str = 'saucenao') -> str:
try:
if site == 'saucenao':
reply: str = await cls.do_search_saucenao(image)
else:
... | 1,599 | 394 | 23 |
47c13dd4c0d747a6ab363ae514e4d9c517553a49 | 48 | py | Python | week1/logical1.py | pkoarmy/Learning-Python | 79067de3c09240d26939ca23ec98e96304660e7c | [
"MIT"
] | null | null | null | week1/logical1.py | pkoarmy/Learning-Python | 79067de3c09240d26939ca23ec98e96304660e7c | [
"MIT"
] | null | null | null | week1/logical1.py | pkoarmy/Learning-Python | 79067de3c09240d26939ca23ec98e96304660e7c | [
"MIT"
] | null | null | null | A = True
B = False
print(A and B)
print(A or B)
| 9.6 | 14 | 0.625 | A = True
B = False
print(A and B)
print(A or B)
| 0 | 0 | 0 |
49326b7f76171a6e4c3018363dc191db9d2b6e72 | 8,565 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/gsl_function.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/gsl_function.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/gsl_function.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/env python
# Author : Pierre Schnizer
"""
Collection of Callbacks systems for pygsl. They follow the GSL definitions as
close as possible. Instead os a struct python classes are used.
All solvers accept a C void pointer, which is passed to the callback. In Pygsl
this is an abitrary python object. See the... | 26.682243 | 79 | 0.585873 | #!/usr/bin/env python
# Author : Pierre Schnizer
"""
Collection of Callbacks systems for pygsl. They follow the GSL definitions as
close as possible. Instead os a struct python classes are used.
All solvers accept a C void pointer, which is passed to the callback. In Pygsl
this is an abitrary python object. See the... | 1,015 | 520 | 186 |
25348b308d580d2c34e6c0dbc12c85b434a6ba49 | 441 | py | Python | d05/main.py | burk3/aoc2020 | 541d6102276978ea5e4e7abbd25a8811268be148 | [
"MIT"
] | null | null | null | d05/main.py | burk3/aoc2020 | 541d6102276978ea5e4e7abbd25a8811268be148 | [
"MIT"
] | null | null | null | d05/main.py | burk3/aoc2020 | 541d6102276978ea5e4e7abbd25a8811268be148 | [
"MIT"
] | null | null | null | import argparse
if __name__ == "__main__":
main() | 20.045455 | 61 | 0.562358 | import argparse
def to_n(s: str) -> int:
s = s.replace("F", "0").replace("B", "1")
s = s.replace("L", "0").replace("R", "1")
return int(s, base=2)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("input", type=argparse.FileType("r"))
args = parser.parse_args()
r = 0
... | 339 | 0 | 46 |
f7651a1cc1b8afbcfdaaac06947975fdaeb6345c | 1,128 | py | Python | Bio-StrongHold/src/Creating_a_Restriction_Map.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | 1 | 2018-10-10T19:03:52.000Z | 2018-10-10T19:03:52.000Z | Bio-StrongHold/src/Creating_a_Restriction_Map.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | null | null | null | Bio-StrongHold/src/Creating_a_Restriction_Map.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | null | null | null | from collections import Counter
def partial_digest(distances):
'''Returns a set whose positive pairwise differences generate 'distances'.'''
# Initialize variables.
X = {0}
width = max(distances)
# Create lambda functions for multiset operations.
new_dist = lambda y, S: Counter(abs(y-s) for s... | 26.857143 | 81 | 0.606383 | from collections import Counter
def partial_digest(distances):
'''Returns a set whose positive pairwise differences generate 'distances'.'''
# Initialize variables.
X = {0}
width = max(distances)
# Create lambda functions for multiset operations.
new_dist = lambda y, S: Counter(abs(y-s) for s... | 0 | 0 | 0 |
5249edbb51e3631d816de207fdd0682d7f1d7da4 | 1,291 | py | Python | exercises/exercise_10_25_16.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | exercises/exercise_10_25_16.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | exercises/exercise_10_25_16.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
text = input("Give words: ")
print(pig_latin(text))
| 35.861111 | 74 | 0.459334 | def pig_latin(text_input):
final = "" # create final string, couples, and split text_input
couples = ['bl', 'br', 'ch', 'cl', 'cr', 'dr', 'fl', 'fr', 'gh', 'gl',
'gr', 'ph', 'pl', 'pr', 'qu', 'sh', 'sk', 'sl', 'sm', 'sn',
'sp', 'st', 'sw', 'th', 'tr', 'tw', 'wh', 'wr']
split_t... | 1,180 | 0 | 22 |
8a17fe6998c6e108cf61b5bc941dda0925aaff14 | 5,144 | py | Python | North Pacific/PacificTimestepDensities.py | OceanParcels/SKIM-garbagepatchlocations | 3c028e3ceba902ff79f52e31b83bed811bde1133 | [
"MIT"
] | 1 | 2021-07-13T12:55:20.000Z | 2021-07-13T12:55:20.000Z | North Pacific/PacificTimestepDensities.py | OceanParcels/SKIM-garbagepatchlocations | 3c028e3ceba902ff79f52e31b83bed811bde1133 | [
"MIT"
] | null | null | null | North Pacific/PacificTimestepDensities.py | OceanParcels/SKIM-garbagepatchlocations | 3c028e3ceba902ff79f52e31b83bed811bde1133 | [
"MIT"
] | 1 | 2022-02-28T14:03:13.000Z | 2022-02-28T14:03:13.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 13:35:23 2018
@author: Victor Onink
Here we create a figure that has the 24h, and the 3h flow field densities
for the North Pacific
"""
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from scipy import io
import pandas as pd... | 43.965812 | 108 | 0.666796 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 13:35:23 2018
@author: Victor Onink
Here we create a figure that has the 24h, and the 3h flow field densities
for the North Pacific
"""
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from scipy import io
import pandas as pd... | 3,294 | 0 | 118 |
abd35021221bc3bef34a47edf3e936e59ef5dd0a | 1,563 | py | Python | openduty/settings_environment.py | pataquets/openduty | 5604e22b6a1aec7406ccd94ab2c17c1a6abd56c7 | [
"MIT"
] | null | null | null | openduty/settings_environment.py | pataquets/openduty | 5604e22b6a1aec7406ccd94ab2c17c1a6abd56c7 | [
"MIT"
] | 2 | 2020-07-18T18:13:51.000Z | 2020-07-18T18:14:43.000Z | openduty/settings_environment.py | pataquets/openduty | 5604e22b6a1aec7406ccd94ab2c17c1a6abd56c7 | [
"MIT"
] | 3 | 2016-10-24T17:36:00.000Z | 2018-04-30T18:07:51.000Z | from settings import *
BASE_URL = os.getenv('OPENDUTY_BASE_URL', "http://localhost")
XMPP_SETTINGS = {
'user': os.getenv('OPENDUTY_XMPP_USER'),
'password': os.getenv('OPENDUTY_XMPP_PASS'),
'server': os.getenv('OPENDUTY_XMPP_SERVER', 'xmpp'),
'port': os.getenv('OPENDUTY_XMPP_PORT', 5222),
}
EMAIL_SET... | 27.421053 | 84 | 0.676903 | from settings import *
BASE_URL = os.getenv('OPENDUTY_BASE_URL', "http://localhost")
XMPP_SETTINGS = {
'user': os.getenv('OPENDUTY_XMPP_USER'),
'password': os.getenv('OPENDUTY_XMPP_PASS'),
'server': os.getenv('OPENDUTY_XMPP_SERVER', 'xmpp'),
'port': os.getenv('OPENDUTY_XMPP_PORT', 5222),
}
EMAIL_SET... | 0 | 0 | 0 |
6df353ed1986cfdd80127c2f8b54ef1714e4f5d8 | 1,313 | py | Python | NaiveBayes/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2018-04-25T18:00:28.000Z | 2018-08-08T09:39:18.000Z | NaiveBayes/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | null | null | null | NaiveBayes/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2019-03-03T02:55:48.000Z | 2021-01-21T04:50:46.000Z | # Conventional Machine Learning Algorithms
# Test Script for Class of "NaiveBayes".
# Author: Qixun Qu
# Create on: 2018/04/24
# Modify on: 2018/04/25
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $... | 24.314815 | 65 | 0.603199 | # Conventional Machine Learning Algorithms
# Test Script for Class of "NaiveBayes".
# Author: Qixun Qu
# Create on: 2018/04/24
# Modify on: 2018/04/25
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $... | 0 | 0 | 0 |
192178a5c7c75105a3ee01c6e1f52067461ee41b | 2,921 | py | Python | login_script.py | ThBlitz/Minecraft-Packet-Mapper-MPM- | a2583574d176b57df341ee3eb023b1f29f0f1183 | [
"MIT"
] | null | null | null | login_script.py | ThBlitz/Minecraft-Packet-Mapper-MPM- | a2583574d176b57df341ee3eb023b1f29f0f1183 | [
"MIT"
] | null | null | null | login_script.py | ThBlitz/Minecraft-Packet-Mapper-MPM- | a2583574d176b57df341ee3eb023b1f29f0f1183 | [
"MIT"
] | null | null | null | from Bridge import Proxy2Server
import os
from DataTypes import Packet, A_Packet_Class
from DataTypes import VarInt, Output_Streamer, Bytes_Streamer, Socket_Streamer
import time
output = Output_Streamer()
input = Bytes_Streamer()
login_packets = A_Packet_Class()
SOCK = Socket_Streamer('connect.2b2t.org', 25565, lo... | 20.716312 | 78 | 0.740157 | from Bridge import Proxy2Server
import os
from DataTypes import Packet, A_Packet_Class
from DataTypes import VarInt, Output_Streamer, Bytes_Streamer, Socket_Streamer
import time
output = Output_Streamer()
input = Bytes_Streamer()
login_packets = A_Packet_Class()
SOCK = Socket_Streamer('connect.2b2t.org', 25565, lo... | 264 | 0 | 46 |
fe59772b65a640da95a676113cf3e37dc12af265 | 4,836 | py | Python | src/data_analysis/analyze_goodreads_reviews_cleaned.py | ejgenc/data-analysis_goodreads_translation_reviews | c00dc7b59d5e3295df89d080e7d49792c15fa760 | [
"MIT"
] | 1 | 2021-09-04T15:11:20.000Z | 2021-09-04T15:11:20.000Z | src/data_analysis/analyze_goodreads_reviews_cleaned.py | ejgenc/data-analysis_goodreads_translation_reviews | c00dc7b59d5e3295df89d080e7d49792c15fa760 | [
"MIT"
] | null | null | null | src/data_analysis/analyze_goodreads_reviews_cleaned.py | ejgenc/data-analysis_goodreads_translation_reviews | c00dc7b59d5e3295df89d080e7d49792c15fa760 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 13:35:39 2021
@author: ejgen
------ What is this file? ------
This script targets the files goodreads_reviews_cleaned.csv and
review_sentences_analyzed.csv, calculating summary statistics such as
review length and sentiment score.
This script targets the following f... | 38.07874 | 81 | 0.580645 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 13:35:39 2021
@author: ejgen
------ What is this file? ------
This script targets the files goodreads_reviews_cleaned.csv and
review_sentences_analyzed.csv, calculating summary statistics such as
review length and sentiment score.
This script targets the following f... | 0 | 0 | 0 |
14d38902ff34fd61ae460246a58b5f14f1a88d4b | 2,614 | py | Python | save_face.py | idea4good/ReadFace | 0482befcfe6e2d232cae87fd9802aa80d037c907 | [
"Apache-2.0"
] | 2 | 2018-10-13T10:42:04.000Z | 2020-05-13T03:49:54.000Z | save_face.py | idea4good/ReadFace | 0482befcfe6e2d232cae87fd9802aa80d037c907 | [
"Apache-2.0"
] | 1 | 2018-05-03T06:09:21.000Z | 2018-05-07T09:51:35.000Z | save_face.py | idea4good/ReadFace | 0482befcfe6e2d232cae87fd9802aa80d037c907 | [
"Apache-2.0"
] | null | null | null | import cv2, json, sys, datetime
import tensorflow as tf
import numpy as np
from face_filter import c_face_filter
from mtcnn_detect import c_MTCNNDetect
from face_attr import c_face_attr_reader
standard_face_size = 160 # 160(weight) * 160(height)
detect_resolution = 80 # 80(weight) * 80(height)
the_face_attrs_reader ... | 39.014925 | 121 | 0.594109 | import cv2, json, sys, datetime
import tensorflow as tf
import numpy as np
from face_filter import c_face_filter
from mtcnn_detect import c_MTCNNDetect
from face_attr import c_face_attr_reader
standard_face_size = 160 # 160(weight) * 160(height)
detect_resolution = 80 # 80(weight) * 80(height)
def record_single_face... | 2,014 | 0 | 23 |
d5bd8672c6fe31af95abb4e2bcd7359d4196917f | 15,661 | py | Python | otp/level/LevelSpec.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 8 | 2017-10-10T11:41:01.000Z | 2021-02-23T12:55:47.000Z | otp/level/LevelSpec.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | otp/level/LevelSpec.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 2 | 2019-04-06T16:18:23.000Z | 2021-02-25T06:25:01.000Z | from pandac import PandaModules as PM
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import list2dict, uniqueElements
import string
import LevelConstants
import types
if __dev__:
import os
| 37.023641 | 162 | 0.534066 | from pandac import PandaModules as PM
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import list2dict, uniqueElements
import string
import LevelConstants
import types
if __dev__:
import os
class LevelSpec:
notify = DirectNotifyGlobal.directNotify.newCategory('LevelSpec')
... | 13,957 | 1,452 | 23 |
8612134a84d546ccb13eba2fcebd4f7f0b9a3940 | 6,349 | py | Python | grantTempAdmin.py | hoyle-ub/MakeMeAdminPy | 9a674fb829b1a83e9f6e61436d36fd0b13897196 | [
"BSD-3-Clause"
] | null | null | null | grantTempAdmin.py | hoyle-ub/MakeMeAdminPy | 9a674fb829b1a83e9f6e61436d36fd0b13897196 | [
"BSD-3-Clause"
] | null | null | null | grantTempAdmin.py | hoyle-ub/MakeMeAdminPy | 9a674fb829b1a83e9f6e61436d36fd0b13897196 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2017 Jamf. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 49.217054 | 133 | 0.556466 | #!/usr/bin/env python
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2017 Jamf. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 0 | 0 | 0 |
8d63061f1915c19b1edccebd546ba851e25c34a5 | 86 | py | Python | boj/10930.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | 1 | 2022-01-16T19:57:28.000Z | 2022-01-16T19:57:28.000Z | boj/10930.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | null | null | null | boj/10930.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | null | null | null | import hashlib
message = input()
print(hashlib.sha256(message.encode()).hexdigest()) | 17.2 | 51 | 0.755814 | import hashlib
message = input()
print(hashlib.sha256(message.encode()).hexdigest()) | 0 | 0 | 0 |
29f85f52ee9b12989c3c1794431c329b04a4a16a | 2,127 | py | Python | my_app/migrations/0001_initial.py | B0und/kotanima_server | 01b25531de219d16831d97a76c7e5f6326b6e99d | [
"MIT"
] | 1 | 2021-10-03T20:20:22.000Z | 2021-10-03T20:20:22.000Z | my_app/migrations/0001_initial.py | Kotanima/kotanima_server | 01b25531de219d16831d97a76c7e5f6326b6e99d | [
"MIT"
] | null | null | null | my_app/migrations/0001_initial.py | Kotanima/kotanima_server | 01b25531de219d16831d97a76c7e5f6326b6e99d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-04-17 11:19
import django.contrib.postgres.fields
from django.db import migrations, models
| 42.54 | 147 | 0.586272 | # Generated by Django 3.1.6 on 2021-04-17 11:19
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RedditPost',
fields=[... | 0 | 1,975 | 23 |
37a24d22cb3598933be530ff93291dd60b3d68a5 | 5,591 | py | Python | PyStationB/libraries/ABEX/tests/test_generic_parsing.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 6 | 2021-09-29T15:46:55.000Z | 2021-12-14T18:39:51.000Z | PyStationB/libraries/ABEX/tests/test_generic_parsing.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | null | null | null | PyStationB/libraries/ABEX/tests/test_generic_parsing.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 3 | 2021-09-27T10:35:20.000Z | 2021-10-02T17:53:07.000Z | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 43.341085 | 111 | 0.636738 | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 160 | 1,279 | 73 |
1cfd6c15d5a97dcc496e4cf4e6fa21334efe7b93 | 1,873 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.22449 | 171 | 0.623065 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 228 | 0 | 27 |
7fd3683a28de92b0f6f5f6203676d99dc6051d1a | 1,289 | py | Python | django/app_website/views.py | a-rey/aaronmreyes_heroku | f397741ec33a35c318b6e4d51837b352183085f9 | [
"MIT"
] | 1 | 2022-03-12T22:23:44.000Z | 2022-03-12T22:23:44.000Z | django/app_website/views.py | a-rey/docker_website | f397741ec33a35c318b6e4d51837b352183085f9 | [
"MIT"
] | 2 | 2020-04-07T22:09:50.000Z | 2020-04-07T22:09:50.000Z | django/app_website/views.py | a-rey/docker_website | f397741ec33a35c318b6e4d51837b352183085f9 | [
"MIT"
] | null | null | null | import django.shortcuts
def main(request):
"""
request handler for '/'.
"""
return django.shortcuts.render(request, 'app_website/index.html', {})
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# global error handlers for app_website
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 23.87037 | 79 | 0.582622 | import django.shortcuts
def main(request):
"""
request handler for '/'.
"""
return django.shortcuts.render(request, 'app_website/index.html', {})
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# global error handlers for app_website
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 0 | 0 | 0 |
f3f230d0ddb68e27c72ea274c9b6285a7b13450d | 53 | py | Python | backend/app/views/sculpt_a_sequence/__init__.py | Edinburgh-Genome-Foundry/CUBA | d57565951ead619ef9263e8b356b451001fb910f | [
"MIT"
] | 15 | 2018-02-12T13:12:13.000Z | 2021-08-15T11:37:59.000Z | backend/app/views/sculpt_a_sequence/__init__.py | Edinburgh-Genome-Foundry/CUBA | d57565951ead619ef9263e8b356b451001fb910f | [
"MIT"
] | 9 | 2020-06-05T17:54:54.000Z | 2022-02-12T12:03:19.000Z | backend/app/views/sculpt_a_sequence/__init__.py | Edinburgh-Genome-Foundry/CUBA | d57565951ead619ef9263e8b356b451001fb910f | [
"MIT"
] | 3 | 2018-10-18T13:08:50.000Z | 2020-08-17T14:09:46.000Z | from .SculptASequenceView import SculptASequenceView
| 26.5 | 52 | 0.90566 | from .SculptASequenceView import SculptASequenceView
| 0 | 0 | 0 |
28bef48c033a719579453f4084bb87df283e7408 | 13,037 | py | Python | ansible/lib/ansible/module_utils/netcfg.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/module_utils/netcfg.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/module_utils/netcfg.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 31.490338 | 92 | 0.554192 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 8,508 | 2,341 | 319 |
315d972515790c8be08d568bf8607f2d1b58ff02 | 4,054 | py | Python | tests/func/test_check_ignore.py | santos22/dvc | adce620621230da180c184d5b295ad3129560251 | [
"Apache-2.0"
] | null | null | null | tests/func/test_check_ignore.py | santos22/dvc | adce620621230da180c184d5b295ad3129560251 | [
"Apache-2.0"
] | null | null | null | tests/func/test_check_ignore.py | santos22/dvc | adce620621230da180c184d5b295ad3129560251 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from dvc.ignore import DvcIgnore
from dvc.main import main
@pytest.mark.parametrize(
"file,ret,output", [("ignored", 0, True), ("not_ignored", 1, False)]
)
@pytest.mark.parametrize(
"file,ret,output",
[
("file", 0, "{}:1:f*\tfile\n".format(DvcIgnore.DVCIGNORE_FILE)),
... | 29.808824 | 79 | 0.602121 | import os
import pytest
from dvc.ignore import DvcIgnore
from dvc.main import main
@pytest.mark.parametrize(
"file,ret,output", [("ignored", 0, True), ("not_ignored", 1, False)]
)
def test_check_ignore(tmp_dir, dvc, file, ret, output, caplog):
tmp_dir.gen(DvcIgnore.DVCIGNORE_FILE, "ignored")
assert mai... | 2,741 | 0 | 247 |
14401b26c4f2699577a5a8de47556e68420e2570 | 3,923 | py | Python | streamdeck.py | the-gearheads/StreamDeck | 616d06e28c0e79093507a656a6972a916ab17fc7 | [
"MIT"
] | null | null | null | streamdeck.py | the-gearheads/StreamDeck | 616d06e28c0e79093507a656a6972a916ab17fc7 | [
"MIT"
] | null | null | null | streamdeck.py | the-gearheads/StreamDeck | 616d06e28c0e79093507a656a6972a916ab17fc7 | [
"MIT"
] | null | null | null | import os
import threading
import time
from networktables import NetworkTables
from PIL import Image
from PIL.ImageColor import getcolor, getrgb
from PIL.ImageOps import grayscale
from StreamDeck.DeviceManager import DeviceManager
from StreamDeck.ImageHelpers import PILHelper
ASSETS_PATH = os.path.join(os.path.dirna... | 25.640523 | 81 | 0.624522 | import os
import threading
import time
from networktables import NetworkTables
from PIL import Image
from PIL.ImageColor import getcolor, getrgb
from PIL.ImageOps import grayscale
from StreamDeck.DeviceManager import DeviceManager
from StreamDeck.ImageHelpers import PILHelper
ASSETS_PATH = os.path.join(os.path.dirna... | 1,919 | -8 | 172 |
873966cecd914fb9e587a731142d35c5dac67b39 | 9,649 | py | Python | _curry.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | 3 | 2020-09-06T10:40:19.000Z | 2020-09-29T20:39:52.000Z | _curry.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | _curry.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | from dragonfly import (Grammar, CompoundRule, Text, MappingRule, Dictation, Function, Choice)
from macro_utilities import (replace_in_text, comment_choice, execute_with_dictation)
from vim.rules.letter import (camel_case, proper)
comparison_choice_map = {
"equal": "==",
"not equal": "/=",
"less or e... | 31.025723 | 96 | 0.635092 | from dragonfly import (Grammar, CompoundRule, Text, MappingRule, Dictation, Function, Choice)
from macro_utilities import (replace_in_text, comment_choice, execute_with_dictation)
from vim.rules.letter import (camel_case, proper)
class CurryEnabler(CompoundRule):
spec = "enable Curry"
def _process_recognitio... | 5,599 | 2,434 | 644 |
3bbe192c0bd0ecce276a3a5226d771eca7a1f92d | 712 | py | Python | updatorr/__init__.py | idlesign/deluge-updatorr | aa7c5b0a312fdef580c8dd263760d48f3ac2a56e | [
"BSD-3-Clause"
] | 14 | 2015-02-24T21:50:06.000Z | 2022-01-17T07:51:35.000Z | updatorr/__init__.py | idlesign/deluge-updatorr | aa7c5b0a312fdef580c8dd263760d48f3ac2a56e | [
"BSD-3-Clause"
] | 1 | 2016-07-07T05:15:37.000Z | 2016-07-07T05:50:56.000Z | updatorr/__init__.py | idlesign/deluge-updatorr | aa7c5b0a312fdef580c8dd263760d48f3ac2a56e | [
"BSD-3-Clause"
] | 4 | 2015-04-27T10:47:23.000Z | 2019-01-08T02:53:18.000Z | from deluge.plugins.init import PluginInitBase
VERSION = (0, 1, 8)
| 25.428571 | 54 | 0.714888 | from deluge.plugins.init import PluginInitBase
VERSION = (0, 1, 8)
class CorePlugin(PluginInitBase):
def __init__(self, plugin_name):
from core import Core as _plugin_cls
self._plugin_cls = _plugin_cls
super(CorePlugin, self).__init__(plugin_name)
class GtkUIPlugin(PluginInitBase):
... | 453 | 38 | 149 |
18263fc551610af8df9f1b2b30108a9e0d99788f | 993 | py | Python | applications/users/views/profile.py | arielcalzadadeveloper/django-base-project | 6e6b8d4f25f45d76f34633f38eaec8d4880130ea | [
"MIT"
] | null | null | null | applications/users/views/profile.py | arielcalzadadeveloper/django-base-project | 6e6b8d4f25f45d76f34633f38eaec8d4880130ea | [
"MIT"
] | null | null | null | applications/users/views/profile.py | arielcalzadadeveloper/django-base-project | 6e6b8d4f25f45d76f34633f38eaec8d4880130ea | [
"MIT"
] | null | null | null | from django.shortcuts import reverse
from django.views.generic import UpdateView
from applications.users.forms.profile import ProfileForm
from applications.users.layouts.profile import ProfileLayout
from applications.users.mixins.authenticated import AuthenticatedMixin
from applications.common.mixins.add_message impor... | 31.03125 | 89 | 0.769386 | from django.shortcuts import reverse
from django.views.generic import UpdateView
from applications.users.forms.profile import ProfileForm
from applications.users.layouts.profile import ProfileLayout
from applications.users.mixins.authenticated import AuthenticatedMixin
from applications.common.mixins.add_message impor... | 298 | 219 | 23 |
eadbb2d6d149a0b57c452f236114b2ae0e66a136 | 9,334 | py | Python | app/main/video/video.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 1 | 2021-03-15T02:59:13.000Z | 2021-03-15T02:59:13.000Z | app/main/video/video.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 6 | 2021-03-19T09:49:44.000Z | 2022-03-12T00:10:14.000Z | app/main/video/video.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 2 | 2020-01-11T13:39:22.000Z | 2020-07-02T03:57:43.000Z | # -*- coding: utf-8 -*-
import csv
import os
import cv2
import numpy as np
from flask import render_template, request, redirect, url_for
from flask import jsonify
from app.main import main
from app.utils.frame.frame import base64_to_png
from app.utils.frame.site import Site
from app.utils.frame.sub import PictureSub
... | 35.9 | 117 | 0.607028 | # -*- coding: utf-8 -*-
import csv
import os
import cv2
import numpy as np
from flask import render_template, request, redirect, url_for
from flask import jsonify
from app.main import main
from app.utils.frame.frame import base64_to_png
from app.utils.frame.site import Site
from app.utils.frame.sub import PictureSub
... | 9,068 | 0 | 154 |
ec9fd9597bdca1b68870394bf77473afe8484e61 | 233 | py | Python | lfs/manage/discounts/forms.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | lfs/manage/discounts/forms.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | lfs/manage/discounts/forms.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | # django imports
from django.forms import ModelForm
# lfs imports
from lfs.discounts.models import Discount
class DiscountForm(ModelForm):
"""
Form to manage discount data.
"""
| 16.642857 | 41 | 0.690987 | # django imports
from django.forms import ModelForm
# lfs imports
from lfs.discounts.models import Discount
class DiscountForm(ModelForm):
"""
Form to manage discount data.
"""
class Meta:
model = Discount
| 0 | 15 | 26 |
161fc216cd97b68346d08db33a110ef3a04fb9bd | 5,738 | py | Python | betka/utils.py | phracek/betka | 12c920bd76d33f81bbf8cda6f27d673c8826cf9e | [
"MIT"
] | 1 | 2020-11-05T21:16:28.000Z | 2020-11-05T21:16:28.000Z | betka/utils.py | phracek/betka | 12c920bd76d33f81bbf8cda6f27d673c8826cf9e | [
"MIT"
] | 16 | 2020-03-20T11:23:27.000Z | 2022-03-08T17:09:11.000Z | betka/utils.py | phracek/betka | 12c920bd76d33f81bbf8cda6f27d673c8826cf9e | [
"MIT"
] | 1 | 2020-03-11T09:29:48.000Z | 2020-03-11T09:29:48.000Z | # MIT License
#
# Copyright (c) 2020 SCL team at Red Hat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 32.788571 | 89 | 0.66626 | # MIT License
#
# Copyright (c) 2020 SCL team at Red Hat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 109 | 0 | 23 |
7f019039c93471670011b52c66c98041328e2ea4 | 2,848 | py | Python | deepspeech/io/collator.py | iclementine/DeepSpeech | d0635c6592a2e787ca296e15241e7371a83ca55f | [
"Apache-2.0"
] | 1 | 2021-05-14T23:27:13.000Z | 2021-05-14T23:27:13.000Z | deepspeech/io/collator.py | xihuanafeng/DeepSpeech | 2bdf4c946af66cc173d638c072ba6435cd18a286 | [
"Apache-2.0"
] | null | null | null | deepspeech/io/collator.py | xihuanafeng/DeepSpeech | 2bdf4c946af66cc173d638c072ba6435cd18a286 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.050633 | 86 | 0.61236 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 1,997 | 23 |
c7c5f6d1f99a696768cc8b80c7193f77e06c25f7 | 28,956 | py | Python | lib/vclib/svn/svn_ra.py | cmanley/viewvc | 18ce398586ff99ee13ac64f85c205efdf9c23bad | [
"BSD-2-Clause"
] | null | null | null | lib/vclib/svn/svn_ra.py | cmanley/viewvc | 18ce398586ff99ee13ac64f85c205efdf9c23bad | [
"BSD-2-Clause"
] | null | null | null | lib/vclib/svn/svn_ra.py | cmanley/viewvc | 18ce398586ff99ee13ac64f85c205efdf9c23bad | [
"BSD-2-Clause"
] | null | null | null | # -*-python-*-
#
# Copyright (C) 1999-2018 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | 36.285714 | 79 | 0.645738 | # -*-python-*-
#
# Copyright (C) 1999-2018 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | 20,482 | 6,375 | 407 |
defb121c8e657f37a2d4f8f5f56bc62934ede14f | 14,143 | py | Python | pdfannots.py | pykong/pdfannots | 4d95245d95dca6d1114b39674c2bd5d329d825e7 | [
"MIT"
] | 1 | 2018-11-23T12:29:52.000Z | 2018-11-23T12:29:52.000Z | pdfannots.py | pykong/pdfannots | 4d95245d95dca6d1114b39674c2bd5d329d825e7 | [
"MIT"
] | null | null | null | pdfannots.py | pykong/pdfannots | 4d95245d95dca6d1114b39674c2bd5d329d825e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import pathlib
import sys
import tempfile
from multiprocessing import Pool, cpu_count
import PyPDF2 as PyPDF2
import click
import pdfminer.pdftypes as pdftypes
import pdfminer.settings
from fpdf import FPDF
from pdfminer.converter import TextConverter
from pdf... | 32.143182 | 114 | 0.581489 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import pathlib
import sys
import tempfile
from multiprocessing import Pool, cpu_count
import PyPDF2 as PyPDF2
import click
import pdfminer.pdftypes as pdftypes
import pdfminer.settings
from fpdf import FPDF
from pdfminer.converter import TextConverter
from pdf... | 12,337 | -2 | 718 |
c015a9dfa5a763bce4bb483cef8e2db5dd41369b | 1,196 | py | Python | scripts/loss.py | Spritaro/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | 3 | 2021-11-14T14:11:10.000Z | 2022-02-16T11:42:40.000Z | scripts/loss.py | datomi79/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | null | null | null | scripts/loss.py | datomi79/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | 1 | 2022-02-14T21:47:55.000Z | 2022-02-14T21:47:55.000Z | import torch
def heatmap_focal_loss(preds, gt_heatmap, alpha, gamma, eps=1e-3):
"""
Params:
preds: Tensor[num_classes, height, width]
gt_heatmap: Tensor[num_classes, height, width]
alpha:
gamma: how much you want to reduce penalty around the ground truth locations
eps: a... | 31.473684 | 109 | 0.612876 | import torch
def heatmap_focal_loss(preds, gt_heatmap, alpha, gamma, eps=1e-3):
"""
Params:
preds: Tensor[num_classes, height, width]
gt_heatmap: Tensor[num_classes, height, width]
alpha:
gamma: how much you want to reduce penalty around the ground truth locations
eps: a... | 0 | 0 | 0 |
cfcd628d6daa7217e23c473f633d9ebe42bea5a0 | 3,352 | py | Python | preprocessors/verilog_tokenize.py | JonathanPierce/Algae | 8fc42981f8a97a3ee9d9f71cb051621422150a08 | [
"MIT"
] | 18 | 2015-09-01T03:47:42.000Z | 2021-01-28T21:49:09.000Z | preprocessors/verilog_tokenize.py | JonathanPierce/Algae | 8fc42981f8a97a3ee9d9f71cb051621422150a08 | [
"MIT"
] | 5 | 2015-11-24T21:51:39.000Z | 2016-01-04T18:59:43.000Z | preprocessors/verilog_tokenize.py | JonathanPierce/Algae | 8fc42981f8a97a3ee9d9f71cb051621422150a08 | [
"MIT"
] | 4 | 2016-01-22T11:23:48.000Z | 2018-02-22T23:41:27.000Z | import pygments.lexers.hdl as lexers
from multiprocessing import Process
import helpers.common as common
tokenizer = lexers.VerilogLexer()
| 37.662921 | 1,353 | 0.666766 | import pygments.lexers.hdl as lexers
from multiprocessing import Process
import helpers.common as common
tokenizer = lexers.VerilogLexer()
def compress_value(value):
names = ['always', 'always_comb', 'always_ff', 'always_latch', 'and', 'assign', 'automatic', 'begin', 'break', 'buf', 'bufif0', 'bufif1', 'case', 'casex... | 3,097 | 0 | 115 |
8674b3f9d5c0f0928f6536ab7399dbeda0ee16e1 | 20,839 | py | Python | tests/test_event_handlers.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | tests/test_event_handlers.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | tests/test_event_handlers.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | """
.. module:: dj-stripe.tests.test_event_handlers
:synopsis: dj-stripe Event Handler Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
.. moduleauthor:: Lee Skillen (@lskillen)
"""
from copy import deepcopy
import decimal
from django.contrib.auth import get_user_model
from django.test import TestCase
from mock... | 46.619687 | 118 | 0.729018 | """
.. module:: dj-stripe.tests.test_event_handlers
:synopsis: dj-stripe Event Handler Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
.. moduleauthor:: Lee Skillen (@lskillen)
"""
from copy import deepcopy
import decimal
from django.contrib.auth import get_user_model
from django.test import TestCase
from mock... | 14,830 | 4,514 | 161 |
9ff7a9dd754ac5e203b75c39934d21c4dbb3bd05 | 4,489 | py | Python | kms_utils.py | unai-ttxu/marathon-lb-sec | a893cc7c550af02b15d307f941023c7d26a9f1ba | [
"Apache-2.0"
] | 23 | 2017-04-17T14:15:10.000Z | 2021-03-27T12:14:58.000Z | kms_utils.py | unai-ttxu/marathon-lb-sec | a893cc7c550af02b15d307f941023c7d26a9f1ba | [
"Apache-2.0"
] | 13 | 2017-11-10T11:31:04.000Z | 2019-07-02T08:13:21.000Z | kms_utils.py | unai-ttxu/marathon-lb-sec | a893cc7c550af02b15d307f941023c7d26a9f1ba | [
"Apache-2.0"
] | 17 | 2017-03-17T08:48:59.000Z | 2020-04-13T15:06:48.000Z | import common
import json
import logging
import os
import subprocess
import time
from dateutil import parser
head_vault_hosts = 'OLD_IFS=${IFS};IFS=\',\' read -r -a VAULT_HOSTS <<< \"$STRING_VAULT_HOST\";IFS=${OLD_IFS};'
source_kms_utils = '. /usr/sbin/kms_utils.sh;'
global vault_token
global vault_accessor
global M... | 34.267176 | 183 | 0.704611 | import common
import json
import logging
import os
import subprocess
import time
from dateutil import parser
head_vault_hosts = 'OLD_IFS=${IFS};IFS=\',\' read -r -a VAULT_HOSTS <<< \"$STRING_VAULT_HOST\";IFS=${OLD_IFS};'
source_kms_utils = '. /usr/sbin/kms_utils.sh;'
global vault_token
global vault_accessor
global M... | 3,844 | 0 | 160 |
7d51bd641910bdf93e36062ca99dbd8e06962b76 | 154 | py | Python | chapter_2/intro-sys-mod.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_2/intro-sys-mod.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_2/intro-sys-mod.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | "Introducing the sys Module"
import sys
print(sys.platform)
print(sys.maxsize)
print(sys.version)
if sys.platform[:3] == 'win': print('hello windows')
| 17.111111 | 52 | 0.727273 | "Introducing the sys Module"
import sys
print(sys.platform)
print(sys.maxsize)
print(sys.version)
if sys.platform[:3] == 'win': print('hello windows')
| 0 | 0 | 0 |
e62a25962c26e93b18a28ed5fccdc965fc0e07e8 | 31 | py | Python | hyperion/importers/__init__.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | 2 | 2015-05-14T17:26:16.000Z | 2019-03-13T17:33:18.000Z | hyperion/importers/__init__.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | null | null | null | hyperion/importers/__init__.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | null | null | null | from .orion import parse_orion
| 15.5 | 30 | 0.83871 | from .orion import parse_orion
| 0 | 0 | 0 |
842d510acc09dda24940ad15781378acbc93a47e | 1,009 | py | Python | aoc/day09.py | ryanolsonx/aocpy | 051f965c443c3d4798e15f1fe86327b0d755d27f | [
"MIT"
] | null | null | null | aoc/day09.py | ryanolsonx/aocpy | 051f965c443c3d4798e15f1fe86327b0d755d27f | [
"MIT"
] | null | null | null | aoc/day09.py | ryanolsonx/aocpy | 051f965c443c3d4798e15f1fe86327b0d755d27f | [
"MIT"
] | null | null | null | with open("./day09.input") as file:
data = [int(line.strip()) for line in file.readlines()]
p1 = get_first_not_matching(25)
print(p1)
p2 = get_contiguous_ns_that_add_to(p1)
print(p2) | 15.287879 | 56 | 0.581764 | with open("./day09.input") as file:
data = [int(line.strip()) for line in file.readlines()]
def get_first_not_matching(preamble_size):
i = preamble_size
while i < len(data):
n = data[i]
is_match = False
ds = data[i - preamble_size:i]
for j in ds:
for k in ds:
if j == k:
continue
if j + k =... | 753 | 0 | 69 |
5f957dac4e3aaa4e9760d7ae025a52ebc53a0390 | 1,533 | py | Python | utils/ppmi_data.py | Devin-Taylor/multi-head-co-attention | 466bf1cfe39bc271ff5a1947e15756b69cf22967 | [
"MIT"
] | 2 | 2019-11-04T14:26:21.000Z | 2019-11-09T21:13:41.000Z | utils/ppmi_data.py | Devin-Taylor/multi-head-co-attention | 466bf1cfe39bc271ff5a1947e15756b69cf22967 | [
"MIT"
] | null | null | null | utils/ppmi_data.py | Devin-Taylor/multi-head-co-attention | 466bf1cfe39bc271ff5a1947e15756b69cf22967 | [
"MIT"
] | null | null | null | import json
import os
import nibabel as nib
import numpy as np
import pandas as pd
ROOT = "./"
DATA = os.path.join(ROOT, "data/")
| 38.325 | 127 | 0.714938 | import json
import os
import nibabel as nib
import numpy as np
import pandas as pd
ROOT = "./"
DATA = os.path.join(ROOT, "data/")
def load_ppmi(dataset, filter_feats=True, normalise=True):
patient_summary = pd.read_csv(os.path.join(DATA, "patient_summary.csv"))
metadata = patient_summary[patient_summary.DIAG... | 1,378 | 0 | 23 |
1a9eb26b2e45a592e8105ef8cc9bc6ff155afcb4 | 3,981 | py | Python | Programming_for_GIA_Core_Skills/Assessment_2/final_model.py | jord9762/jordy9762.github.io | 28bcc21d140371e08cd074895f48fe646e2e7c79 | [
"Apache-2.0"
] | null | null | null | Programming_for_GIA_Core_Skills/Assessment_2/final_model.py | jord9762/jordy9762.github.io | 28bcc21d140371e08cd074895f48fe646e2e7c79 | [
"Apache-2.0"
] | null | null | null | Programming_for_GIA_Core_Skills/Assessment_2/final_model.py | jord9762/jordy9762.github.io | 28bcc21d140371e08cd074895f48fe646e2e7c79 | [
"Apache-2.0"
] | null | null | null | import matplotlib
import random
import operator
import csv
import drunkframework
import matplotlib.animation
import matplotlib.pyplot
"""WARNING!!!!!"""
"""This code was tested using Spyder 5.0.4, should any problems be encountered using older
models please try """
#creates a new empty list for wha... | 36.190909 | 140 | 0.707109 | import matplotlib
import random
import operator
import csv
import drunkframework
import matplotlib.animation
import matplotlib.pyplot
"""WARNING!!!!!"""
"""This code was tested using Spyder 5.0.4, should any problems be encountered using older
models please try """
#creates a new empty list for wha... | 0 | 0 | 0 |
7fb3bf3ccd9b91d3bdbcbdf7e10aa8941cf222d8 | 1,841 | py | Python | script/test_caffemodel.py | duguyue100/transcaffe | aee7f34e98630ca4b1d717f65bc3b83edd00acd6 | [
"MIT"
] | 1 | 2017-10-30T01:34:14.000Z | 2017-10-30T01:34:14.000Z | script/test_caffemodel.py | duguyue100/transcaffe | aee7f34e98630ca4b1d717f65bc3b83edd00acd6 | [
"MIT"
] | null | null | null | script/test_caffemodel.py | duguyue100/transcaffe | aee7f34e98630ca4b1d717f65bc3b83edd00acd6 | [
"MIT"
] | 1 | 2021-07-11T04:30:58.000Z | 2021-07-11T04:30:58.000Z | """Loading a .caffemodel and figure out the encoding.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import absolute_import
from __future__ import print_function
import os
# from keras.utils.visualize_util import plot
from keras.datasets import mnist as dataset
from keras.utils import np_utils
... | 27.893939 | 70 | 0.751222 | """Loading a .caffemodel and figure out the encoding.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import absolute_import
from __future__ import print_function
import os
# from keras.utils.visualize_util import plot
from keras.datasets import mnist as dataset
from keras.utils import np_utils
... | 0 | 0 | 0 |
bdafb5b9a495fe79186ed42ceb1d64616f684e58 | 2,044 | py | Python | tlaunch/lp_k8s/config.py | TARTRL/TLaunch | 198dada129f2143b6f626a50b82d45575f4c1115 | [
"Apache-2.0"
] | 18 | 2021-12-19T09:43:17.000Z | 2021-12-30T06:09:03.000Z | tlaunch/lp_k8s/config.py | TARTRL/TLaunch | 198dada129f2143b6f626a50b82d45575f4c1115 | [
"Apache-2.0"
] | null | null | null | tlaunch/lp_k8s/config.py | TARTRL/TLaunch | 198dada129f2143b6f626a50b82d45575f4c1115 | [
"Apache-2.0"
] | 1 | 2022-01-14T06:20:20.000Z | 2022-01-14T06:20:20.000Z | from typing import Dict, List, Optional
from kubernetes import client
from tlaunch.lp_k8s.resource import Resource
from tlaunch.lp_k8s.util import map_opt
DEFAULT_PORT = 8001
DEFAULT_NAME = 'launchpad'
REVERB_IMAGE = 'reg.real-ai.cn/launchpad/reverb'
DEFAULT_COMMAND = ['python3', '-u', '-mlaunchpad_kubernetes.proces... | 30.969697 | 79 | 0.627202 | from typing import Dict, List, Optional
from kubernetes import client
from tlaunch.lp_k8s.resource import Resource
from tlaunch.lp_k8s.util import map_opt
DEFAULT_PORT = 8001
DEFAULT_NAME = 'launchpad'
REVERB_IMAGE = 'reg.real-ai.cn/launchpad/reverb'
DEFAULT_COMMAND = ['python3', '-u', '-mlaunchpad_kubernetes.proces... | 1,470 | 0 | 241 |
2f89d30a8c0491da0365da93766c0592009a4f5a | 2,694 | py | Python | retry_download_errors.py | calstateteach/canvas_artifacts_download | 1fbff01c80214d1e05616097aecd13cbb7faa3ca | [
"MIT"
] | null | null | null | retry_download_errors.py | calstateteach/canvas_artifacts_download | 1fbff01c80214d1e05616097aecd13cbb7faa3ca | [
"MIT"
] | null | null | null | retry_download_errors.py | calstateteach/canvas_artifacts_download | 1fbff01c80214d1e05616097aecd13cbb7faa3ca | [
"MIT"
] | null | null | null | """Retry downloading files that caused errors in http_downloader.
We can find files to try downloading again by parsing the err.txt file for error messages.
Error log lines we are interested in look like:
09-04-2017 12:45:17..Error_http_downloader 'exports/CalStateTEACH Term 1/grios/Schedule/Mentor Info.docx', 'https:... | 30.613636 | 228 | 0.639198 | """Retry downloading files that caused errors in http_downloader.
We can find files to try downloading again by parsing the err.txt file for error messages.
Error log lines we are interested in look like:
09-04-2017 12:45:17..Error_http_downloader 'exports/CalStateTEACH Term 1/grios/Schedule/Mentor Info.docx', 'https:... | 1,131 | 0 | 46 |
fea9894192b3f338d5d4d6a5b7224a49e2e10fb5 | 4,769 | py | Python | beatcrunch/utils/model_common.py | iero/BeatCrunch | baa88595670b0dc1fb2a0e95fe33b176a0c010d6 | [
"Apache-2.0"
] | null | null | null | beatcrunch/utils/model_common.py | iero/BeatCrunch | baa88595670b0dc1fb2a0e95fe33b176a0c010d6 | [
"Apache-2.0"
] | null | null | null | beatcrunch/utils/model_common.py | iero/BeatCrunch | baa88595670b0dc1fb2a0e95fe33b176a0c010d6 | [
"Apache-2.0"
] | null | null | null | from nltk import RegexpTokenizer
# Common stopwords in french and english
# Clean text or sentence, removing stopwords
# return list
| 108.386364 | 2,076 | 0.626756 | from nltk import RegexpTokenizer
# Common stopwords in french and english
def get_stopwords(lang) :
stopset = []
stopwords_ponctuation = [',','"',';',':','.','?','!','*','—']
for w in stopwords_ponctuation: stopset.append(w)
if lang == "fr" or lang == "all":
stopwords_base = ['aussi','au','aux','avec','ça','ce... | 4,638 | 0 | 44 |
b87d6c5cb06be96998619a9cb340e11359c13595 | 15,498 | py | Python | faster_rcnn/rpn_util.py | Kelicious/faster_rcnn | fde1a2f342855b8a3b6c1a54878e59d29102a26d | [
"MIT"
] | 18 | 2018-05-13T14:50:03.000Z | 2022-02-23T14:27:17.000Z | faster_rcnn/rpn_util.py | Kelicious/faster_rcnn | fde1a2f342855b8a3b6c1a54878e59d29102a26d | [
"MIT"
] | 3 | 2018-05-15T08:46:10.000Z | 2020-03-17T12:46:31.000Z | faster_rcnn/rpn_util.py | Kelicious/faster_rcnn | fde1a2f342855b8a3b6c1a54878e59d29102a26d | [
"MIT"
] | 15 | 2018-05-13T14:50:24.000Z | 2022-02-24T09:50:07.000Z | import random
from enum import Enum
import numpy as np
from custom_decorators import profile
from shapes import Box
from shared_constants import BBREG_MULTIPLIERS, DEFAULT_ANCHORS
from util import calc_iou, cross_ious, get_reg_params, get_bbox_coords
POS_OVERLAP = 0.7
NEG_OVERLAP = 0.3
SAMPLE_SIZE = 256
MAX_POS_SAM... | 44.153846 | 154 | 0.703123 | import random
from enum import Enum
import numpy as np
from custom_decorators import profile
from shapes import Box
from shared_constants import BBREG_MULTIPLIERS, DEFAULT_ANCHORS
from util import calc_iou, cross_ious, get_reg_params, get_bbox_coords
POS_OVERLAP = 0.7
NEG_OVERLAP = 0.3
SAMPLE_SIZE = 256
MAX_POS_SAM... | 7,177 | 40 | 227 |
f7ded778c29259e2a89bf5a9a9ac772ebb515972 | 25,965 | py | Python | samples/client/petstore/python-experimental/petstore_api/models/xml_item.py | malymato/openapi-generator | 47e2c0d027d867de67633bbc9c0a5d7e1054a778 | [
"Apache-2.0"
] | 2 | 2019-12-08T12:00:11.000Z | 2022-01-02T13:47:52.000Z | samples/client/petstore/python-experimental/petstore_api/models/xml_item.py | malymato/openapi-generator | 47e2c0d027d867de67633bbc9c0a5d7e1054a778 | [
"Apache-2.0"
] | 8 | 2021-03-01T21:18:19.000Z | 2022-02-27T07:56:15.000Z | samples/client/petstore/python-experimental/petstore_api/models/xml_item.py | malymato/openapi-generator | 47e2c0d027d867de67633bbc9c0a5d7e1054a778 | [
"Apache-2.0"
] | 1 | 2020-03-08T12:31:09.000Z | 2020-03-08T12:31:09.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 35.135318 | 174 | 0.605507 | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 1,959 | 0 | 54 |
9cc0213534d4746545b92434c9c6e16f37a99b1a | 4,745 | py | Python | Grundgeruest/models.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | Grundgeruest/models.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | Grundgeruest/models.py | wmles/olymp | 97b1a256982c2a75c39ba3a855b63a147d4409c5 | [
"MIT"
] | null | null | null | """
Die Modelle für Projektweite Daten: Nutzer/Profile
"""
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile
from django.core.validators import RegexValidato... | 32.278912 | 100 | 0.616228 | """
Die Modelle für Projektweite Daten: Nutzer/Profile
"""
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile
from django.core.validators import RegexValidato... | 461 | 1,595 | 158 |
b3e937dcb8ac9e14cc91bc39a1395544f1f257fb | 8,595 | py | Python | dataset/datasets.py | notplus/FaceLandmark_PFLD_UltraLight | 89aa36d5369f7d8d6661eb67d8490c774ea4685a | [
"Apache-2.0"
] | 38 | 2021-05-10T01:22:44.000Z | 2022-03-30T06:54:39.000Z | dataset/datasets.py | notplus/FaceLandmark_PFLD_UltraLight | 89aa36d5369f7d8d6661eb67d8490c774ea4685a | [
"Apache-2.0"
] | 7 | 2021-06-01T06:39:47.000Z | 2022-03-16T05:43:50.000Z | dataset/datasets.py | notplus/FaceLandmark_PFLD_UltraLight | 89aa36d5369f7d8d6661eb67d8490c774ea4685a | [
"Apache-2.0"
] | 14 | 2021-05-10T01:22:46.000Z | 2022-03-30T06:54:42.000Z | import numpy as np
import cv2
import sys
import torch
sys.path.append('..')
from torch.utils import data
from torch.utils.data import DataLoader
if __name__ == '__main__':
file_list = './data/test_data/list.txt'
wlfwdataset = WLFWDatasets(file_list)
dataloader = DataLoader(wlfwdataset, batch... | 33.705882 | 166 | 0.601745 | import numpy as np
import cv2
import sys
import torch
sys.path.append('..')
from torch.utils import data
from torch.utils.data import DataLoader
def flip(img, annotation):
# parse
img = np.fliplr(img).copy()
h, w = img.shape[:2]
x_min, y_min, x_max, y_max = annotation[0:4]
landmark_x = annotati... | 7,612 | 12 | 356 |
966bc627671a534dd1312e08c0b1d98dc88fba85 | 1,671 | py | Python | tests/test_masks.py | nexpy/nexusformat | 8c7eccaae2e60d7643e473093c5087b653270f7b | [
"BSD-3-Clause-Clear"
] | 9 | 2015-01-12T22:26:35.000Z | 2020-06-02T08:17:24.000Z | tests/test_masks.py | rayosborn/nexusformat | 8c7eccaae2e60d7643e473093c5087b653270f7b | [
"BSD-3-Clause-Clear"
] | 23 | 2015-12-15T11:57:20.000Z | 2021-11-17T18:03:18.000Z | tests/test_masks.py | rayosborn/nexusformat | 8c7eccaae2e60d7643e473093c5087b653270f7b | [
"BSD-3-Clause-Clear"
] | 12 | 2015-05-22T18:27:43.000Z | 2022-03-31T12:35:19.000Z | import os
import numpy as np
import pytest
from nexusformat.nexus.tree import NXfield, NXgroup, NXroot, nxload
@pytest.mark.parametrize("save", ["False", "True"])
| 33.42 | 76 | 0.652902 | import os
import numpy as np
import pytest
from nexusformat.nexus.tree import NXfield, NXgroup, NXroot, nxload
def test_field_masks(arr1D):
field = NXfield(arr1D)
field[10:20] = np.ma.masked
assert isinstance(field.nxvalue, np.ma.masked_array)
assert np.all(field[8:12].mask == np.array([False, False... | 1,459 | 0 | 45 |