hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ae93b350a737e64fb7552c84ff50d4dbc14ab372 | 1,610 | py | Python | get_bitcoin_price.py | ZanW/newsScraper_new | a1995c18d256856c66387bcf290d02e82ae24869 | [
"MIT"
] | null | null | null | get_bitcoin_price.py | ZanW/newsScraper_new | a1995c18d256856c66387bcf290d02e82ae24869 | [
"MIT"
] | null | null | null | get_bitcoin_price.py | ZanW/newsScraper_new | a1995c18d256856c66387bcf290d02e82ae24869 | [
"MIT"
] | null | null | null |
FETCH_URL = "https://poloniex.com/public?command=returnChartData¤cyPair=%s&start=%d&end=%d&period=300"
#PAIR_LIST = ["BTC_ETH"]
DATA_DIR = "data"
COLUMNS = ["date","high","low","open","close","volume","quoteVolume","weightedAverage"]
if __name__ == '__main__':
main()
| 26.393443 | 108 | 0.625466 | import os
import time
import pandas as pd
FETCH_URL = "https://poloniex.com/public?command=returnChartData¤cyPair=%s&start=%d&end=%d&period=300"
#PAIR_LIST = ["BTC_ETH"]
DATA_DIR = "data"
COLUMNS = ["date","high","low","open","close","volume","quoteVolume","weightedAverage"]
def get_data(pair):
datafile = o... | 0 | 0 | 0 | 0 | 0 | 1,241 | 0 | -24 | 112 |
069bc2c04b617aebb7c7459106d35ec20698985f | 2,659 | py | Python | sdk/python/touca/cli/_merge.py | trytouca/trytouca | eae38a96407d1ecac543c5a5fb05cbbe632ddfca | [
"Apache-2.0"
] | 6 | 2022-03-19T02:57:11.000Z | 2022-03-31T16:34:34.000Z | sdk/python/touca/cli/_merge.py | trytouca/trytouca | eae38a96407d1ecac543c5a5fb05cbbe632ddfca | [
"Apache-2.0"
] | null | null | null | sdk/python/touca/cli/_merge.py | trytouca/trytouca | eae38a96407d1ecac543c5a5fb05cbbe632ddfca | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Touca, Inc. Subject to Apache-2.0 License.
| 33.2375 | 81 | 0.599097 | # Copyright 2022 Touca, Inc. Subject to Apache-2.0 License.
from sys import stderr, stdout
from pathlib import Path
from argparse import ArgumentParser
from loguru import logger
from touca.cli._common import Operation
def _merge(touca_cli: Path, dir_src: Path, dir_dst: Path):
from subprocess import Popen
if... | 0 | 514 | 0 | 1,179 | 0 | 699 | 0 | 48 | 157 |
9cb3935c9a570950e26ec0e2f7fcb068ee01b448 | 4,939 | py | Python | chess/game.py | rdebek/chess | 0f72894ded5b464994ae03993c5224f705dc8eb7 | [
"MIT"
] | null | null | null | chess/game.py | rdebek/chess | 0f72894ded5b464994ae03993c5224f705dc8eb7 | [
"MIT"
] | null | null | null | chess/game.py | rdebek/chess | 0f72894ded5b464994ae03993c5224f705dc8eb7 | [
"MIT"
] | null | null | null | import pygame
SIZE = (1000, 800)
SQUARE_WIDTH = int(0.8 * SIZE[0] // 8)
SQUARE_HEIGHT = SIZE[1] // 8
IMAGES = {}
pygame.init()
screen = pygame.display.set_mode(SIZE)
move_feed = []
running = True
board_array = [
['Br', 'Bn', 'Bb', 'Bq', 'Bk', 'Bb', 'Bn', 'Br'],
['Bp', 'Bp', 'Bp', 'Bp', 'Bp', 'Bp', 'Bp', 'Bp'... | 33.828767 | 117 | 0.561652 | import pygame
import moves
from typing import List
from pieces.king import King
import copy
SIZE = (1000, 800)
SQUARE_WIDTH = int(0.8 * SIZE[0] // 8)
SQUARE_HEIGHT = SIZE[1] // 8
IMAGES = {}
pygame.init()
screen = pygame.display.set_mode(SIZE)
move_feed = []
running = True
board_array = [
['Br', 'Bn', 'Bb', 'Bq'... | 0 | 0 | 0 | 0 | 0 | 3,010 | 0 | -10 | 272 |
00893092dc39939fef6d823715dc13387f457e50 | 1,135 | py | Python | pyiArduinoI2Cbumper/examples/changeLineType.py | tremaru/pyiArduinoI2Cbumper | 94cb0ee7c38cb375cf1df97cacc7b3db3374e594 | [
"MIT"
] | null | null | null | pyiArduinoI2Cbumper/examples/changeLineType.py | tremaru/pyiArduinoI2Cbumper | 94cb0ee7c38cb375cf1df97cacc7b3db3374e594 | [
"MIT"
] | null | null | null | pyiArduinoI2Cbumper/examples/changeLineType.py | tremaru/pyiArduinoI2Cbumper | 94cb0ee7c38cb375cf1df97cacc7b3db3374e594 | [
"MIT"
] | null | null | null | # :
# , ,
# .
from time import sleep
# I2C-flash.
# bum
# pyiArduinoI2Cbumper, I2C.
# bum = pyiArduinoI2Cbumper(),
# .
bum = pyiArduinoI2Cbumper(0x09)
while True:
# :
if bum.getLineType() == BUM_LINE_BLACK:
first = ""
second = ""
e... | 28.375 | 73 | 0.710132 | # ПРИМЕР ПОЛУЧЕНИЯ И УКАЗАНИЯ ТИПА ЛИНИИ ТРАССЫ:
# Тип линии, равно как и калибровочные значения,
# хранятся в энергонезависимой памяти модуля.
from time import sleep
# Подключаем библиотеку для работы с бампером I2C-flash.
from pyiArduinoI2Cbumper import *
# Объявляем объект bum для работы с функциями и метода... | 964 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 22 |
8a9aae2331f5c2c081342a50ca86c1dea6863527 | 470 | py | Python | FMsystem/dashboard/migrations/0002_auto_20191112_1718.py | emetowinner/FMS | 85fd1791ab9835c20cf6473703e6adf72416719a | [
"Apache-2.0"
] | null | null | null | FMsystem/dashboard/migrations/0002_auto_20191112_1718.py | emetowinner/FMS | 85fd1791ab9835c20cf6473703e6adf72416719a | [
"Apache-2.0"
] | null | null | null | FMsystem/dashboard/migrations/0002_auto_20191112_1718.py | emetowinner/FMS | 85fd1791ab9835c20cf6473703e6adf72416719a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.6 on 2019-11-12 17:18
| 19.583333 | 47 | 0.548936 | # Generated by Django 2.2.6 on 2019-11-12 17:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='userprofile',
name='user',
),
... | 0 | 0 | 0 | 364 | 0 | 0 | 0 | 11 | 46 |
c91d0475a83d6bf7dbbdd3cfc8f67e8f444ecc8a | 9,594 | py | Python | demo_doc2sim_education.py | interxuxing/qa_education | 1ae8247bd05b1870b14c3af6c1eceea2c5c9dd14 | [
"MIT"
] | 1 | 2018-07-05T06:20:55.000Z | 2018-07-05T06:20:55.000Z | demo_doc2sim_education.py | interxuxing/qa_education | 1ae8247bd05b1870b14c3af6c1eceea2c5c9dd14 | [
"MIT"
] | null | null | null | demo_doc2sim_education.py | interxuxing/qa_education | 1ae8247bd05b1870b14c3af6c1eceea2c5c9dd14 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
This script is used to build a qa data for usage.
Typically, each enty contains three elements: a question, an answer, a url
"""
import sys
import re
import os
import jieba
import gensim
try:
import cPickle as pickle
except:
import pickle
reload(sys)
sys.setdefaultencoding('utf-8'... | 35.014599 | 114 | 0.654472 | # -*- coding:utf-8 -*-
"""
This script is used to build a qa data for usage.
Typically, each enty contains three elements: a question, an answer, a url
"""
import sys
import re
import os
import jieba
import gensim
try:
import cPickle as pickle
except:
import pickle
reload(sys)
sys.setdefaultencoding('utf-8'... | 1,126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cac677165073ebf21ff71868eeada85dd2f640ab | 3,661 | py | Python | satchmo/apps/l10n/south_migrations/0001_initial.py | predatell/satchmo | 6ced1f845aadec240c7e433c3cbf4caca96e0d92 | [
"BSD-3-Clause"
] | 1 | 2019-10-08T16:19:59.000Z | 2019-10-08T16:19:59.000Z | satchmo/apps/l10n/south_migrations/0001_initial.py | predatell/satchmo | 6ced1f845aadec240c7e433c3cbf4caca96e0d92 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/l10n/south_migrations/0001_initial.py | predatell/satchmo | 6ced1f845aadec240c7e433c3cbf4caca96e0d92 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 57.203125 | 123 | 0.575253 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Country'
db.create_table('l10n_country', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
... | 0 | 0 | 0 | 3,546 | 0 | 0 | 0 | 17 | 71 |
03b4111150c9056bb5e0216fdc83c869ac11a37e | 19,080 | py | Python | plotting_scripts/pylot_utils.py | erdos-project/erdos-experiments | 56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e | [
"Apache-2.0"
] | 1 | 2022-03-04T11:41:35.000Z | 2022-03-04T11:41:35.000Z | plotting_scripts/pylot_utils.py | erdos-project/erdos-experiments | 56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e | [
"Apache-2.0"
] | null | null | null | plotting_scripts/pylot_utils.py | erdos-project/erdos-experiments | 56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e | [
"Apache-2.0"
] | null | null | null |
from absl import flags
import numpy as np
import pandas as pd
FLAGS = flags.FLAGS
def get_timestamps_with_obstacles(filename, obstacle_distance_threshold=10):
"""Finds timestamps when we detected obstacles."""
print(filename)
df = pd.read_csv(
filename,
names=["timestamp", "ms", "lo... | 39.503106 | 101 | 0.574266 | import ast
import csv
import json
from absl import flags
import numpy as np
import pandas as pd
FLAGS = flags.FLAGS
class ProfileEvent(object):
def __init__(self, json_dict):
self.name = json_dict['name']
self.event_time = float(json_dict['ts']) / 1000.0 # in ms
self.runtime = float(js... | 0 | 0 | 0 | 6,308 | 0 | 11,248 | 0 | -32 | 319 |
553261ede6908d15a260c9d80a6cc7e5e9bc751f | 1,256 | py | Python | solutions/longest-substring-without-repeating-characters.py | oopsno/leetcode.py | fe454137aef32b4950a1fdb398f90d5212a90fb8 | [
"WTFPL"
] | 1 | 2017-11-30T12:23:59.000Z | 2017-11-30T12:23:59.000Z | solutions/longest-substring-without-repeating-characters.py | oopsno/leetcode.py | fe454137aef32b4950a1fdb398f90d5212a90fb8 | [
"WTFPL"
] | null | null | null | solutions/longest-substring-without-repeating-characters.py | oopsno/leetcode.py | fe454137aef32b4950a1fdb398f90d5212a90fb8 | [
"WTFPL"
] | null | null | null | # encoding: UTF-8
| 26.166667 | 127 | 0.585191 | # encoding: UTF-8
from leetcode import *
from typing import Generator, Tuple
@Problem(3, 'Longest Substring Without Repeating Characters', Difficulty.Medium, Tags.HashTable, Tags.String, Tags.TwoPointers)
class Solution:
@staticmethod
def iterate(s: str) -> Generator[Tuple[int, int], None, None]:
"""... | 105 | 1,047 | 0 | 0 | 0 | 0 | 0 | 15 | 137 |
691c6dad4265dcd18d18b8b3764b927ce6ce8e3c | 381 | py | Python | wikidata-to-gedcom/mywikidata/WikidataKeys.py | lmallez/wikidata-to-gedcom | fac73e0cb6589e25bcb3c8c388ff7afc86273586 | [
"MIT"
] | 5 | 2019-11-12T20:45:46.000Z | 2020-04-30T05:57:01.000Z | wikidata-to-gedcom/mywikidata/WikidataKeys.py | lmallez/wikidata-to-gedcom | fac73e0cb6589e25bcb3c8c388ff7afc86273586 | [
"MIT"
] | null | null | null | wikidata-to-gedcom/mywikidata/WikidataKeys.py | lmallez/wikidata-to-gedcom | fac73e0cb6589e25bcb3c8c388ff7afc86273586 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
| 19.05 | 29 | 0.574803 | #!/usr/bin/env python3
class WikidataKey:
HUMAN = 'Q5'
MALE = 'Q6581097'
FEMALE = 'Q6581072'
ADOPTED = 'Q20746725'
SEX = 'P21'
FATHER = 'P22'
MOTHER = 'P25'
INSTANCE_OF = 'P31'
CHILD = 'P40'
FAMILY = 'P53'
GIVEN_NAME = 'P735'
FAMILY_NAME = 'P734'
DATE_OF_BIRTH = 'P5... | 0 | 0 | 0 | 334 | 0 | 0 | 0 | 0 | 23 |
e4d46792cc68d8be20c27212cb496b7f1e2c6189 | 101,385 | py | Python | emoji_list.py | williln/emojihaiku | 87a5558c2de397726d4fc360cf1e11da2152a9f3 | [
"MIT"
] | 20 | 2015-07-24T09:36:41.000Z | 2020-05-09T16:22:02.000Z | emoji_list.py | williln/emojihaiku | 87a5558c2de397726d4fc360cf1e11da2152a9f3 | [
"MIT"
] | 9 | 2015-07-24T04:54:52.000Z | 2017-03-20T20:14:50.000Z | emoji_list.py | williln/emojihaiku | 87a5558c2de397726d4fc360cf1e11da2152a9f3 | [
"MIT"
] | 7 | 2015-08-18T06:18:35.000Z | 2021-04-10T17:06:24.000Z | EMOJI_LIST = [
':1st_place_medal:',
':2nd_place_medal:',
':3rd_place_medal:',
':AB_button_(blood_type):',
':ATM_sign:',
':A_button_(blood_type):',
':Afghanistan:',
':Albania:',
':Algeria:',
':American_Samoa:',
':Andorra:',
':Angola:',
':Anguilla:',
':Antarctica:',
... | 27.460726 | 64 | 0.630646 | EMOJI_LIST = [
':1st_place_medal:',
':2nd_place_medal:',
':3rd_place_medal:',
':AB_button_(blood_type):',
':ATM_sign:',
':A_button_(blood_type):',
':Afghanistan:',
':Albania:',
':Algeria:',
':American_Samoa:',
':Andorra:',
':Angola:',
':Anguilla:',
':Antarctica:',
... | 96 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d31af86c40fba5fb7d0eda60023797aec4514b11 | 1,686 | py | Python | app.py | selmargoulart08/dolarparareal | 8824b628d668037cf2981db9107d4e75d8a23ff9 | [
"MIT"
] | 2 | 2022-03-04T16:13:12.000Z | 2022-03-04T21:21:37.000Z | app.py | selmargoulart08/dolarparareal | 8824b628d668037cf2981db9107d4e75d8a23ff9 | [
"MIT"
] | null | null | null | app.py | selmargoulart08/dolarparareal | 8824b628d668037cf2981db9107d4e75d8a23ff9 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
API_KEY = 'RQM7GIDWT0ZU2WLU'
if __name__ == "__main__":
app.run(debug= False) | 45.567568 | 156 | 0.603203 | from flask import Flask,render_template,request
import requests
app = Flask(__name__)
API_KEY = 'RQM7GIDWT0ZU2WLU'
@app.route('/',methods=['GET','POST'])
def home():
if request.method == 'POST':
try:
amount = request.form['amount']
amount = float(amount)
fro... | 0 | 1,481 | 0 | 0 | 0 | 0 | 0 | 18 | 48 |
72feb42656b0d22751d723a497e020605e203efa | 700 | py | Python | pycargr/__init__.py | Florents-Tselai/PyCarGr | ed8ae8878d0d188d1f9ab44b62ed529764ef8e45 | [
"MIT"
] | 13 | 2017-05-07T20:40:23.000Z | 2022-03-09T12:40:02.000Z | pycargr/__init__.py | Florents-Tselai/PyCarGr | ed8ae8878d0d188d1f9ab44b62ed529764ef8e45 | [
"MIT"
] | 1 | 2021-12-08T17:45:49.000Z | 2021-12-08T17:45:49.000Z | pycargr/__init__.py | Florents-Tselai/PyCarGr | ed8ae8878d0d188d1f9ab44b62ed529764ef8e45 | [
"MIT"
] | 14 | 2017-05-08T07:45:17.000Z | 2022-03-20T07:54:28.000Z | from pathlib import Path
DB_PATH = Path.home().joinpath('pycargr.db')
SEARCH_BASE_URL = 'https://www.car.gr/classifieds/cars/'
| 35 | 112 | 0.594286 | from json import dumps
from pathlib import Path
from sqlite3 import connect
from pycargr.model import Car
DB_PATH = Path.home().joinpath('pycargr.db')
SEARCH_BASE_URL = 'https://www.car.gr/classifieds/cars/'
def save_car(*cars):
car_data = [(c.car_id, c.title, c.price, c.release_date, c.km, c.bhp, c.url, c.col... | 0 | 0 | 0 | 0 | 0 | 465 | 0 | 15 | 90 |
41bf7bbb2675b0dfe18d90074eb48a93a6f2e4c5 | 1,293 | py | Python | tests/generator_python3_marshmallow_test.py | expobrain/json-schema-codegen | e22b386333c6230e5d6f5984fd947fdd7b947e82 | [
"MIT"
] | 21 | 2018-06-15T16:08:57.000Z | 2022-02-11T16:16:11.000Z | tests/generator_python3_marshmallow_test.py | expobrain/json-schema-codegen | e22b386333c6230e5d6f5984fd947fdd7b947e82 | [
"MIT"
] | 14 | 2018-08-09T18:02:19.000Z | 2022-01-24T18:04:17.000Z | tests/generator_python3_marshmallow_test.py | expobrain/json-schema-codegen | e22b386333c6230e5d6f5984fd947fdd7b947e82 | [
"MIT"
] | 4 | 2018-11-30T18:19:10.000Z | 2021-11-18T04:04:36.000Z | from pathlib import Path
import ast
import pytest
import astor
SCHEMAS_DIR = Path(__file__).parent / "fixtures" / "schemas"
FIXTURES_DIR = Path(__file__).parent / "fixtures" / "python3_marshmallow"
expected_init_py = astor.dump_tree(ast.Module(body=[]))
test_params = sorted(pytest.param(f, id=f.name) for f in SCHE... | 26.9375 | 91 | 0.743233 | from pathlib import Path
import ast
import pytest
import astor
import warnings
import os
from json_codegen import load_schema
from json_codegen.generators.python3_marshmallow import Python3MarshmallowGenerator
SCHEMAS_DIR = Path(__file__).parent / "fixtures" / "schemas"
FIXTURES_DIR = Path(__file__).parent / "fixtu... | 0 | 660 | 0 | 0 | 0 | 86 | 0 | 59 | 135 |
9b3c571c5bc94ea87ff20714b5a8b05aada9fe40 | 569 | py | Python | ABC/abc051-abc100/abc079/d.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc051-abc100/abc079/d.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc051-abc100/abc079/d.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
if __name__ == '__main__':
main()
| 21.074074 | 61 | 0.411248 | # -*- coding: utf-8 -*-
def main():
h, w = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
a = [list(map(int, input().split())) for _ in range(h)]
ans = 0
for k in range(10):
for i in range(10):
for j in range(10):
... | 0 | 0 | 0 | 0 | 0 | 473 | 0 | 0 | 25 |
cf03515cb78738608985a3bcb75662fa5776e3d7 | 638 | py | Python | Docs/Examples/howtos/glyphMath_00.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 61 | 2015-01-17T10:15:45.000Z | 2018-12-02T13:53:02.000Z | Docs/Examples/howtos/glyphMath_00.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 37 | 2015-01-05T23:44:56.000Z | 2018-03-16T19:05:28.000Z | Docs/Examples/howtos/glyphMath_00.py | Vectro-Type-Foundry/robofab | cd65d78292d24358c98dce53d283314cdc85878e | [
"BSD-3-Clause"
] | 25 | 2015-01-08T19:49:36.000Z | 2018-10-29T00:36:46.000Z | # robofab manual
# Glyphmath howto
# Fun examples
#FLM: Fun with GlyphMath
# this example is meant to run with the RoboFab Demo Font
# as the Current Font. So, if you're doing this in FontLab
# import the Demo Font UFO first.
from robofab.world import CurrentFont
from random import random
f = CurrentFont()
conde... | 22.785714 | 58 | 0.747649 | # robofab manual
# Glyphmath howto
# Fun examples
#FLM: Fun with GlyphMath
# this example is meant to run with the RoboFab Demo Font
# as the Current Font. So, if you're doing this in FontLab
# import the Demo Font UFO first.
from robofab.world import CurrentFont
from random import random
f = CurrentFont()
conde... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0220466f686772c657c40b619251e273a74a65d7 | 1,376 | py | Python | pypy/translator/js/examples/console/docloader.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | pypy/translator/js/examples/console/docloader.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | null | null | null | pypy/translator/js/examples/console/docloader.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z |
""" Simple module for loading documentation of various
pypy-cs from doc directory
"""
| 31.272727 | 76 | 0.582122 |
""" Simple module for loading documentation of various
pypy-cs from doc directory
"""
import py
class DocLoader(object):
def __init__(self, consoles, docdir, testfile):
self.consoles = consoles
self.docdir = py.path.local(docdir)
assert self.docdir.check(dir=1)
self.testfile = tes... | 0 | 0 | 0 | 1,254 | 0 | 0 | 0 | -12 | 46 |
9160e3ca26bcd83ce1ff19da7116c3bd5688dbed | 5,685 | py | Python | src/sst/elements/scheduler/simulations/makeInput.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 2 | 2019-06-10T15:32:03.000Z | 2019-06-11T14:17:32.000Z | src/sst/elements/scheduler/simulations/makeInput.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 39 | 2016-01-06T15:08:15.000Z | 2020-06-03T18:12:31.000Z | src/sst/elements/scheduler/simulations/makeInput.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 2 | 2021-05-23T02:28:02.000Z | 2021-09-08T13:38:46.000Z | #!/usr/bin/env python
'''
SST scheduler simulation input file generator
Input parameters are given below
Setting a parameter to "default" or "" will select the default option
'''
import os
# Input workload trace path:
traceName = 'jobtrace_files/bisection_N1.sim'
# Output file name:
outFile = 'simple_libtopomap_bisec... | 34.664634 | 81 | 0.610554 | #!/usr/bin/env python
'''
SST scheduler simulation input file generator
Input parameters are given below
Setting a parameter to "default" or "" will select the default option
'''
import os
# Input workload trace path:
traceName = 'jobtrace_files/bisection_N1.sim'
# Output file name:
outFile = 'simple_libtopomap_bisec... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
30654d429382de6f8edb4c2fc8cb6391f4f78fba | 2,626 | py | Python | gaul/utils/pbar.py | al-jshen/gaul | f0c8d165adc4dbec328af34e26d8988a89c5c385 | [
"Apache-2.0",
"MIT"
] | null | null | null | gaul/utils/pbar.py | al-jshen/gaul | f0c8d165adc4dbec328af34e26d8988a89c5c385 | [
"Apache-2.0",
"MIT"
] | null | null | null | gaul/utils/pbar.py | al-jshen/gaul | f0c8d165adc4dbec328af34e26d8988a89c5c385 | [
"Apache-2.0",
"MIT"
] | null | null | null | from jax import lax
from jax.experimental import host_callback
def progress_bar_scan(num_samples, message=None):
"""
Progress bar for a JAX scan.
"""
if message is None:
message = f"Running for {num_samples:,} iterations"
tqdm_bars = {}
if num_samples > 20:
print_rate = int(nu... | 30.183908 | 86 | 0.589871 | from jax import lax
from jax.experimental import host_callback
from tqdm.auto import tqdm
def progress_bar_scan(num_samples, message=None):
"""
Progress bar for a JAX scan.
"""
if message is None:
message = f"Running for {num_samples:,} iterations"
tqdm_bars = {}
if num_samples > 20:
... | 0 | 0 | 0 | 0 | 0 | 682 | 0 | 5 | 161 |
d69fac53ce9bde7627a2d348edbe244afc9d3c48 | 5,347 | py | Python | alunos/views.py | Antonio-Neves/Gestao-Escolar | a97052beb571a32619d4e6b6f5e7c3aae3bc8e9b | [
"MIT"
] | 7 | 2021-05-21T00:23:40.000Z | 2021-12-09T12:35:00.000Z | alunos/views.py | Antonio-Neves/Gestao-Escolar | a97052beb571a32619d4e6b6f5e7c3aae3bc8e9b | [
"MIT"
] | null | null | null | alunos/views.py | Antonio-Neves/Gestao-Escolar | a97052beb571a32619d4e6b6f5e7c3aae3bc8e9b | [
"MIT"
] | 7 | 2021-08-03T22:28:36.000Z | 2022-03-13T20:08:40.000Z |
from unidecode import unidecode # normalize strings Csii
from accounts.models import CustomUser
# Classes to control admin acess and success messages
# Constants Vars
def create_user_after_registration(
username, password, first_name, last_name, department):
"""
Create user after aluno registration
"""
Custo... | 27.994764 | 86 | 0.734618 | from django.shortcuts import redirect, render, reverse
from django.urls import reverse_lazy
from django.contrib import messages
from django.db.models import Case, CharField, Value, When
from django.views.generic.base import TemplateView
from django.views.generic import ListView
from django.views.generic.edit import Cr... | 38 | 0 | 0 | 3,503 | 0 | 0 | 0 | 286 | 424 |
3275a9b589be4d602a175fa7da9c5e68fd17c61c | 3,319 | py | Python | src/predict.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | 1 | 2019-12-17T01:17:01.000Z | 2019-12-17T01:17:01.000Z | src/predict.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | 2 | 2021-09-08T01:37:46.000Z | 2022-03-12T00:13:53.000Z | src/predict.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | null | null | null | # *****************************************************************************
# * Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved. *
# *
# Licensed under the Amazon Software License (the "License"). *
... | 38.593023 | 86 | 0.536607 | # *****************************************************************************
# * Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved. *
# *
# Licensed under the Amazon Software License (the "License"). *
... | 0 | 0 | 0 | 2,040 | 0 | 0 | 0 | 45 | 113 |
c4fbb9422b36b275ee83b64ac351d700c80cd454 | 185 | py | Python | pythonexamples/generatepassword.py | faizmd12/ADVANCEDREFLECTIVEADOPTION | 830083a000fc76b58999de88edc668df7c16bad7 | [
"Apache-2.0"
] | null | null | null | pythonexamples/generatepassword.py | faizmd12/ADVANCEDREFLECTIVEADOPTION | 830083a000fc76b58999de88edc668df7c16bad7 | [
"Apache-2.0"
] | 3 | 2018-09-19T17:00:05.000Z | 2018-09-20T03:42:37.000Z | pythonexamples/generatepassword.py | faizmd12/ADVANCEDREFLECTIVEADOPTION | 830083a000fc76b58999de88edc668df7c16bad7 | [
"Apache-2.0"
] | 2 | 2018-09-20T03:28:36.000Z | 2018-09-20T03:31:27.000Z | import string
characters = string.ascii_letters + string.punctuation + string.digits
pswd = "".join(choice(characters) for x in range(randint(6, 14)))
print pswd
| 30.833333 | 71 | 0.756757 | import string
from random import *
characters = string.ascii_letters + string.punctuation + string.digits
pswd = "".join(choice(characters) for x in range(randint(6, 14)))
print pswd
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
fb8ba77729ed278c59294b6a64660bff6686985f | 2,180 | py | Python | openslides/agenda/apps.py | boehlke/OpenSlides | 7a64fb83ebda2cb41706f62d7cfc5a63dbcab4a2 | [
"MIT"
] | null | null | null | openslides/agenda/apps.py | boehlke/OpenSlides | 7a64fb83ebda2cb41706f62d7cfc5a63dbcab4a2 | [
"MIT"
] | null | null | null | openslides/agenda/apps.py | boehlke/OpenSlides | 7a64fb83ebda2cb41706f62d7cfc5a63dbcab4a2 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Set
def required_users(element: Dict[str, Any]) -> Set[int]:
"""
Returns all user ids that are displayed as speaker in the given element.
"""
return set(speaker["user_id"] for speaker in element["speakers"])
| 32.058824 | 88 | 0.673394 | from typing import Any, Dict, Set
from django.apps import AppConfig
class AgendaAppConfig(AppConfig):
name = "openslides.agenda"
verbose_name = "OpenSlides Agenda"
angular_site_module = True
def ready(self):
# Import all required stuff.
from django.db.models.signals import pre_delete... | 0 | 0 | 0 | 1,865 | 0 | 0 | 0 | 12 | 46 |
b60ba245f6e4ca2d7772d3fac4ee1aec9528d42b | 2,367 | py | Python | pysamples/pytictoc/txc13.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 31 | 2020-06-23T13:53:47.000Z | 2022-03-28T08:09:00.000Z | pysamples/pytictoc/txc13.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2020-11-01T21:35:47.000Z | 2021-08-29T11:40:50.000Z | pysamples/pytictoc/txc13.py | ranarashadmahmood/OMNETPY | 13ab49106a3ac700aa633a8eb37acdad5e3157ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2021-03-22T15:32:22.000Z | 2022-02-02T14:57:56.000Z | """
In this step the destination address is no longer node 2 -- we draw a
random destination, and we'll add the destination address to the message.
The best way is to subclass cMessage and add destination as a data member.
To make the model execute longer, after a message arrives to its destination
the destination no... | 32.875 | 100 | 0.607098 | """
In this step the destination address is no longer node 2 -- we draw a
random destination, and we'll add the destination address to the message.
The best way is to subclass cMessage and add destination as a data member.
To make the model execute longer, after a message arrives to its destination
the destination no... | 0 | 0 | 0 | 1,866 | 0 | 0 | 0 | 24 | 69 |
ebcc63cf681a889e84bf9cc7e88caeb454c5a2b5 | 844 | py | Python | examples/metadata.py | SpotlightKid/jackclient-python | cfc1e6a11f50f98abcd351b6e372e98da8e3a06d | [
"MIT"
] | 120 | 2015-04-03T03:55:04.000Z | 2022-03-06T07:21:38.000Z | examples/metadata.py | SpotlightKid/jackclient-python | cfc1e6a11f50f98abcd351b6e372e98da8e3a06d | [
"MIT"
] | 84 | 2015-01-04T12:42:43.000Z | 2022-03-15T18:13:13.000Z | examples/metadata.py | SpotlightKid/jackclient-python | cfc1e6a11f50f98abcd351b6e372e98da8e3a06d | [
"MIT"
] | 31 | 2015-04-11T13:03:35.000Z | 2022-03-06T07:21:38.000Z | #!/usr/bin/env python3
"""Set/get/remove client/port metadata."""
from pprint import pprint
import jack
client = jack.Client('Metadata-Client')
port = client.inports.register('input')
client.set_property(client, jack.METADATA_PRETTY_NAME, 'Best Client Ever')
print('Client "pretty" name:',
jack.get_property(cli... | 27.225806 | 74 | 0.770142 | #!/usr/bin/env python3
"""Set/get/remove client/port metadata."""
from pprint import pprint
import jack
client = jack.Client('Metadata-Client')
port = client.inports.register('input')
client.set_property(client, jack.METADATA_PRETTY_NAME, 'Best Client Ever')
print('Client "pretty" name:',
jack.get_property(cli... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e395b41818739ee3e695c411d1a683c3bf241ba7 | 5,284 | py | Python | trench_automation/main.py | yozoon/TrenchDepositionAutomation | 4eb1dd9fbabe7a782aa2070de144240616c00472 | [
"MIT"
] | null | null | null | trench_automation/main.py | yozoon/TrenchDepositionAutomation | 4eb1dd9fbabe7a782aa2070de144240616c00472 | [
"MIT"
] | null | null | null | trench_automation/main.py | yozoon/TrenchDepositionAutomation | 4eb1dd9fbabe7a782aa2070de144240616c00472 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser, ArgumentTypeError
from os import path
import numpy as np
# This import only works if the directory where "generate_trench.so" is located is present in
# the PYTHONPATH environment variable
#import generate_trench
VIENNATS_EXE = "../../ViennaTools/ViennaTS/build/viennats-2.3.2"
P... | 37.211268 | 112 | 0.614497 | import csv
from argparse import ArgumentParser, ArgumentTypeError
from os import path
from string import Template
from subprocess import Popen
from tempfile import NamedTemporaryFile
import numpy as np
import util
# This import only works if the directory where "generate_trench.so" is located is present in
# the PYT... | 0 | 0 | 0 | 0 | 0 | 3,392 | 0 | 10 | 134 |
fd3c6d601192d4d75328ddcda0cc18d339d3860f | 41,703 | py | Python | pirates/makeapirate/NameGUI.py | ksmit799/POTCO-PS | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 8 | 2017-01-24T04:33:29.000Z | 2020-11-01T08:36:24.000Z | pirates/makeapirate/NameGUI.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 1 | 2017-03-02T18:05:17.000Z | 2017-03-14T06:47:10.000Z | pirates/makeapirate/NameGUI.py | ksmit799/Pirates-Online-Remake | 520d38935ae8df4b452c733a82c94dddac01e275 | [
"Apache-2.0"
] | 11 | 2017-03-02T18:46:07.000Z | 2020-11-01T08:36:26.000Z | # File: N (Python 2.4)
MAX_NAME_WIDTH = 9
| 41.578265 | 1,162 | 0.603362 | # File: N (Python 2.4)
import random
import types
import string
from direct.fsm import StateData
from direct.fsm import ClassicFSM
from direct.fsm import State
from direct.gui import DirectGuiGlobals
from direct.gui.DirectGui import *
from direct.task import Task
from pandac.PandaModules import *
from pandac.PandaModu... | 0 | 0 | 0 | 40,821 | 0 | 0 | 0 | 330 | 508 |
9feb5e9b65602d98fbbe238994e65df1e102a0e9 | 972 | py | Python | app.py | BelminD/bobby | 8763fa9e12dd911dfe8e279bd33db65495ec067b | [
"MIT"
] | 1 | 2020-03-02T14:50:11.000Z | 2020-03-02T14:50:11.000Z | app.py | BelminD/bobby | 8763fa9e12dd911dfe8e279bd33db65495ec067b | [
"MIT"
] | null | null | null | app.py | BelminD/bobby | 8763fa9e12dd911dfe8e279bd33db65495ec067b | [
"MIT"
] | 1 | 2020-03-26T08:56:06.000Z | 2020-03-26T08:56:06.000Z |
if __name__ == '__main__':
main()
| 22.604651 | 140 | 0.609053 | import argparse
import config
import utils
from chat import ChatSession
from utils import Color
def parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'-f',
'--file_name',
type=str,
help='chatlog output filename, .txt format'
)
return parser.parse_args()... | 4 | 0 | 0 | 0 | 0 | 786 | 0 | -14 | 157 |
f22e830fb9aacfaedbbdc3927d8137c30da1348f | 3,346 | py | Python | train.py | takahiro-777/tf-dqn-reversi | 35875c593e58b60173c290b0a04544dfa288289f | [
"MIT"
] | null | null | null | train.py | takahiro-777/tf-dqn-reversi | 35875c593e58b60173c290b0a04544dfa288289f | [
"MIT"
] | 3 | 2017-11-04T05:55:09.000Z | 2017-11-04T11:49:21.000Z | train.py | takahiro-777/tf-dqn-reversi | 35875c593e58b60173c290b0a04544dfa288289f | [
"MIT"
] | null | null | null | import copy
from Reversi import Reversi
from dqn_agent import DQNAgent
if __name__ == "__main__":
# parameters
#n_epochs = 1000
n_epochs = 5
# environment, agent
env = Reversi()
# playerID
playerID = [env.Black, env.White, env.Black]
# player agent
players = []
# player[0]=... | 32.173077 | 110 | 0.443515 | import copy
from Reversi import Reversi
from dqn_agent import DQNAgent
if __name__ == "__main__":
# parameters
#n_epochs = 1000
n_epochs = 5
# environment, agent
env = Reversi()
# playerID
playerID = [env.Black, env.White, env.Black]
# player agent
players = []
# player[0]=... | 291 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3310368135e649bf028187ed7a04013100b76b9e | 4,905 | py | Python | python/registration_gui.py | zivy/ISBI2018_TUTORIAL | 4fa3d695982785f858fc35ac3ff02822bf5a1cdd | [
"Apache-2.0"
] | 26 | 2018-03-15T19:46:16.000Z | 2022-01-11T11:26:28.000Z | python/registration_gui.py | zivy/ISBI2018_TUTORIAL | 4fa3d695982785f858fc35ac3ff02822bf5a1cdd | [
"Apache-2.0"
] | 1 | 2018-04-02T15:27:13.000Z | 2018-04-02T16:12:04.000Z | python/registration_gui.py | zivy/ISBI2018_TUTORIAL | 4fa3d695982785f858fc35ac3ff02822bf5a1cdd | [
"Apache-2.0"
] | 16 | 2018-03-16T13:50:03.000Z | 2021-09-11T08:11:46.000Z | import SimpleITK as sitk
import matplotlib.pyplot as plt
import numpy as np
#
# Set of methods used for displaying the registration metric during the optimization.
#
# Callback invoked when the StartEvent happens, sets up our new data.
# Callback invoked when the EndEvent happens, do cleanup of data and figure.
#... | 44.189189 | 116 | 0.66422 | import SimpleITK as sitk
import matplotlib.pyplot as plt
import numpy as np
#
# Set of methods used for displaying the registration metric during the optimization.
#
# Callback invoked when the StartEvent happens, sets up our new data.
def start_plot():
global metric_values, multires_iterations, ax, fig
fig,... | 0 | 0 | 0 | 0 | 0 | 829 | 0 | 0 | 88 |
f4b2b6a614552cb471ee1018cb6473daef2454ed | 4,499 | py | Python | valet/utils/protobuf/communicate_pb2.py | sadmicrowave/valet | 39724c3f2a49b2253e89044af2b103e3e89d4cd8 | [
"MIT"
] | null | null | null | valet/utils/protobuf/communicate_pb2.py | sadmicrowave/valet | 39724c3f2a49b2253e89044af2b103e3e89d4cd8 | [
"MIT"
] | null | null | null | valet/utils/protobuf/communicate_pb2.py | sadmicrowave/valet | 39724c3f2a49b2253e89044af2b103e3e89d4cd8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: communicate.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | 31.243056 | 329 | 0.759724 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: communicate.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00abcc7f4cf9a20a02896d0e5d048eb36a63e80c | 2,801 | py | Python | main.py | TheWithz/discord-selfbot.py | 848fb994a4a8e2a1ccb69a948219b7ce356e8ad3 | [
"MIT"
] | null | null | null | main.py | TheWithz/discord-selfbot.py | 848fb994a4a8e2a1ccb69a948219b7ce356e8ad3 | [
"MIT"
] | null | null | null | main.py | TheWithz/discord-selfbot.py | 848fb994a4a8e2a1ccb69a948219b7ce356e8ad3 | [
"MIT"
] | null | null | null | import json
with open('config.json') as f:
config = json.load(f)
if __name__ == '__main__':
main()
| 30.445652 | 82 | 0.482685 | import asyncio
import json
import os
import aiofiles
import discord
with open('config.json') as f:
config = json.load(f)
class Bot(discord.Client):
def __init__(self):
super(Bot, self).__init__()
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print... | 0 | 0 | 2,327 | 119 | 0 | 93 | 0 | -32 | 181 |
46cc55d2fe6b35ca6e90b4d3845fd8292a1109ea | 1,769 | py | Python | pyformlang/pda/utils.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 15 | 2020-06-25T14:38:27.000Z | 2022-03-09T17:55:07.000Z | pyformlang/pda/utils.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 11 | 2020-09-23T09:48:35.000Z | 2021-08-24T08:37:47.000Z | pyformlang/pda/utils.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | 5 | 2020-03-08T19:00:17.000Z | 2021-08-15T12:38:05.000Z | """ Useful functions for a PDA """
| 30.5 | 72 | 0.63143 | """ Useful functions for a PDA """
from .state import State
from .symbol import Symbol
from .stack_symbol import StackSymbol
from .epsilon import Epsilon
class PDAObjectCreator:
"""
A Object in a PDA
"""
def __init__(self):
self._state_creator = dict()
self._symbol_creator = dict()
... | 0 | 0 | 0 | 1,203 | 0 | 339 | 0 | 31 | 158 |
fed03a781b64a2ca6afd5bacbc8faa8e99b33252 | 1,144 | py | Python | bottrust/solve.py | corbinmcneill/codejam | 5156fec100c73eb95969a91fd20bf411aec4b795 | [
"Apache-2.0"
] | null | null | null | bottrust/solve.py | corbinmcneill/codejam | 5156fec100c73eb95969a91fd20bf411aec4b795 | [
"Apache-2.0"
] | null | null | null | bottrust/solve.py | corbinmcneill/codejam | 5156fec100c73eb95969a91fd20bf411aec4b795 | [
"Apache-2.0"
] | null | null | null |
infile = open("input.txt")
T =int(infile.readline().strip())
for t in range(1, T+1):
solve(t, infile.readline().split(' '))
| 23.833333 | 94 | 0.627622 | def opp(x):
return (x+1)%2
def solve(casenum, inlist):
inlist.pop(0)
pos=[1,1]
time=0
waitingOn = 0
queue = []
while len(inlist) > 0:
queue.append((1 if inlist.pop(0)=='O' else 0, int(inlist.pop(0))))
primary = queue.pop(0)
while len(queue) > 0:
waitingOn = primary[0]
primetime = abs(primary[1] - po... | 0 | 0 | 0 | 0 | 0 | 970 | 0 | 0 | 46 |
4b318a33f234812471367a2b69c153781e83ecf3 | 797 | py | Python | pyisis/tests/check_performance.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | null | null | null | pyisis/tests/check_performance.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | null | null | null | pyisis/tests/check_performance.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | 2 | 2019-11-08T20:51:54.000Z | 2021-08-17T23:49:48.000Z | # -*- coding: utf-8 -*-
"""
File to test Isis performance
"""
__created__ = "2007-05-15"
__updated__ = "2008-05-15"
__author__ = "Rodrigo Senra <rsenra@acm.org>"
# Setup test environment
from pyisis.tests.config_tests import initialize
config = initialize()
setup="""
from pyisis.files import MasterFile
from pyisis... | 20.435897 | 65 | 0.668758 | # -*- coding: utf-8 -*-
"""
File to test Isis performance
"""
__created__ = "2007-05-15"
__updated__ = "2008-05-15"
__author__ = "Rodrigo Senra <rsenra@acm.org>"
# Setup test environment
from timeit import Timer
from pyisis.tests.config_tests import test_data, Lyer, initialize
config = initialize()
setup="""
from ... | 0 | 0 | 0 | 0 | 0 | 273 | 0 | 20 | 45 |
8c2ffadb64c357fa253ed239b739f7970fd7159f | 1,833 | py | Python | learning/base-language/custom-errors/custom-error-2.py | gerryw1389/python | 74fedaf2034769f2865659f14d332026b9aaede3 | [
"MIT"
] | 2 | 2020-12-01T17:29:09.000Z | 2020-12-13T02:54:43.000Z | learning/base-language/custom-errors/custom-error-2.py | gerryw1389/python | 74fedaf2034769f2865659f14d332026b9aaede3 | [
"MIT"
] | 4 | 2020-12-26T15:08:02.000Z | 2021-05-16T13:19:33.000Z | learning/base-language/custom-errors/custom-error-2.py | gerryw1389/python | 74fedaf2034769f2865659f14d332026b9aaede3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
################################################################
# Check for 'myfile.csv' in a certain directory
# Since this has more than two lines, it will output the files contents
# You should also try renaming to 'myfile3.csv' and re-running to ensure it catches it
#######################... | 33.944444 | 104 | 0.624659 | #!/usr/bin/env python3
################################################################
# Check for 'myfile.csv' in a certain directory
# Since this has more than two lines, it will output the files contents
# You should also try renaming to 'myfile3.csv' and re-running to ensure it catches it
#######################... | 0 | 0 | 0 | 70 | 0 | 0 | 0 | 0 | 45 |
e92a4323942d5e185d2ec4d2a8f20702a5940c71 | 3,429 | py | Python | DIKB/DIKB_Utils.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | 3 | 2015-06-08T17:58:54.000Z | 2022-03-10T18:49:44.000Z | DIKB/DIKB_Utils.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | null | null | null | DIKB/DIKB_Utils.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | null | null | null | ## The Drug Interaction Knowledge Base (DIKB) is (C) Copyright 2005 by
## Richard Boyce
## Original Authors:
## Richard Boyce
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; eithe... | 45.118421 | 132 | 0.649169 | ## The Drug Interaction Knowledge Base (DIKB) is (C) Copyright 2005 by
## Richard Boyce
## Original Authors:
## Richard Boyce
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; eithe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 66 |
3f33f3dcee520339082c17e485022226b8479d5f | 4,828 | py | Python | tests/functional/test_empty_value.py | mazzi/tartiflette | 54ffdcb97f3ef0ea8b87ea3378790221cdb08e0b | [
"MIT"
] | 530 | 2019-06-04T11:45:36.000Z | 2022-03-31T09:29:56.000Z | tests/functional/test_empty_value.py | mazzi/tartiflette | 54ffdcb97f3ef0ea8b87ea3378790221cdb08e0b | [
"MIT"
] | 242 | 2019-06-04T11:53:08.000Z | 2022-03-28T07:06:27.000Z | tests/functional/test_empty_value.py | mazzi/tartiflette | 54ffdcb97f3ef0ea8b87ea3378790221cdb08e0b | [
"MIT"
] | 36 | 2019-06-21T06:40:27.000Z | 2021-11-04T13:11:16.000Z |
_SDL = """
type bobby {
c: String
}
type boby {
b: bobby!
}
type bob {
a: boby
}
type Query {
string1: String!
stringList: [String]
stringListNonNull: [String]!
nonNullStringList: [String!]
nonNullStringListNonNull: [String!]!
anObject: bob
}
"""
| 27.276836 | 111 | 0.440969 | import pytest
from tartiflette import Resolver, create_engine
_SDL = """
type bobby {
c: String
}
type boby {
b: bobby!
}
type bob {
a: boby
}
type Query {
string1: String!
stringList: [String]
stringListNonNull: [String]!
nonNullStringList: [String!]
nonNullStringListNonNull: [Str... | 0 | 4,356 | 0 | 0 | 0 | 0 | 0 | 18 | 160 |
e2257060548bbe94947020be6e7151c54ae4f973 | 673 | py | Python | tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | # Test fairness of scheduler
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
asyncio.run(main())
| 19.228571 | 44 | 0.592868 | # Test fairness of scheduler
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task(id, t):
print("task start", id)
while True:
if t > 0:
print("task work", id)
a... | 0 | 0 | 414 | 0 | 0 | 0 | 0 | 0 | 46 |
8f572daf819a48b89eb252616a9f6be2ccd086e9 | 5,767 | py | Python | assessment/views.py | ma2th/vfat-server | 3ccf98159c0b404e42cd8b2b66593130d8575c00 | [
"Apache-2.0"
] | null | null | null | assessment/views.py | ma2th/vfat-server | 3ccf98159c0b404e42cd8b2b66593130d8575c00 | [
"Apache-2.0"
] | null | null | null | assessment/views.py | ma2th/vfat-server | 3ccf98159c0b404e42cd8b2b66593130d8575c00 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Matthias Ring
# Machine Learning and Data Analytics Lab
# Friedrich-Alexander-University Erlangen-Nuremberg
#
# 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.apa... | 42.718519 | 119 | 0.710075 | # Copyright 2019 Matthias Ring
# Machine Learning and Data Analytics Lab
# Friedrich-Alexander-University Erlangen-Nuremberg
#
# 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.apa... | 0 | 0 | 0 | 0 | 0 | 4,566 | 0 | 120 | 296 |
70b67168ab77c3dc1229b30dab4060805c01673a | 770 | py | Python | python/Orbits/OrbitColor.py | PaulAustin/sb7 | e7e7f9f85387d16f6069ed8e98192bd387d8cf95 | [
"MIT"
] | null | null | null | python/Orbits/OrbitColor.py | PaulAustin/sb7 | e7e7f9f85387d16f6069ed8e98192bd387d8cf95 | [
"MIT"
] | null | null | null | python/Orbits/OrbitColor.py | PaulAustin/sb7 | e7e7f9f85387d16f6069ed8e98192bd387d8cf95 | [
"MIT"
] | null | null | null | # Turtles in space
import turtle
sky = turtle.Screen()
sky.tracer(0)
sky.bgcolor('black')
rocket = turtle.Turtle()
rocket.speed(0)
rocket.color('green')
a = 10.0
b = 28.0
c = 8.0/3.0
x = y = z= 1.0e-1
#x = y = z= 1.0e-200
tic = 0.0
sky.ontimer(tictoc, 5)
| 16.73913 | 31 | 0.509091 | # Turtles in space
import turtle
sky = turtle.Screen()
sky.tracer(0)
sky.bgcolor('black')
rocket = turtle.Turtle()
rocket.speed(0)
rocket.color('green')
a = 10.0
b = 28.0
c = 8.0/3.0
x = y = z= 1.0e-1
#x = y = z= 1.0e-200
def setColor(x, y, z):
r = min(abs(x+0.5), 1.0)
g = min(abs(y+0.5), 1.0)
b = min(ab... | 0 | 0 | 0 | 0 | 0 | 442 | 0 | 0 | 68 |
d1a33930c9561630af9fd3336226f039547dac00 | 27,966 | py | Python | pesummary/gw/conversions/remnant.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 1 | 2021-08-03T05:58:20.000Z | 2021-08-03T05:58:20.000Z | pesummary/gw/conversions/remnant.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 1 | 2020-06-13T13:29:35.000Z | 2020-06-15T12:45:04.000Z | pesummary/gw/conversions/remnant.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 3 | 2021-07-08T08:31:28.000Z | 2022-03-31T14:08:58.000Z | # Licensed under an MIT style license -- see LICENSE.md
__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"]
try:
from lalsimulation import (FLAG_SEOBNRv4P_HAMILTONIAN_DERIVATIVE_NUMERICAL, FLAG_SEOBNRv4P_EULEREXT_QNM_SIMPLE_PRECESSION, FLAG_SEOBNRv4P_ZFRAME_L)
from lal import MSUN_SI
except ImportError:
p... | 37.997283 | 87 | 0.667525 | # Licensed under an MIT style license -- see LICENSE.md
import numpy as np
from pesummary.utils.utils import logger, iterator
from pesummary.utils.decorators import array_input
from .spins import chi_p
__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"]
try:
import lalsimulation
from lalsimulation import (
... | 0 | 9,635 | 0 | 0 | 0 | 0 | 0 | 101 | 208 |
76beea20d465eec4a5cee6eba183bfc6d0f150c4 | 9,159 | py | Python | nrc/nrc/spiders/PAPermitScraper.py | SkyTruth/scraper | c1903a74c717a7b36a05f0f466c51544911c4499 | [
"MIT"
] | 2 | 2016-07-01T02:41:17.000Z | 2020-04-04T16:16:55.000Z | nrc/nrc/spiders/PAPermitScraper.py | SkyTruth/scraper | c1903a74c717a7b36a05f0f466c51544911c4499 | [
"MIT"
] | 4 | 2015-01-14T17:00:12.000Z | 2015-06-29T19:36:27.000Z | nrc/nrc/spiders/PAPermitScraper.py | SkyTruth/scraper | c1903a74c717a7b36a05f0f466c51544911c4499 | [
"MIT"
] | null | null | null | # PA Well Permit Scraper
#import uuid
#from scrapy.stats import stats
| 42.402778 | 155 | 0.599301 | # PA Well Permit Scraper
import re
from datetime import datetime, timedelta
import xlrd
#import uuid
from string import Template
from xml.sax.saxutils import escape
from dateutil.parser import parse as parse_date
from scrapy.spider import BaseSpider
from scrapy.contrib.loader import ItemLoader
from scrapy.http import... | 0 | 0 | 0 | 8,434 | 0 | 0 | 0 | 276 | 378 |
ee78a57c8a14d6b4c72780cf061ac7ed488b5e03 | 3,941 | py | Python | cryptobrute.py | mustafasayilan/cryptobrute | 855959ebc04388e12ea786133ab8eb2f464cf637 | [
"MIT"
] | 8 | 2021-06-14T21:02:47.000Z | 2022-03-17T20:57:20.000Z | cryptobrute.py | mustafasayilan/cryptobrute | 855959ebc04388e12ea786133ab8eb2f464cf637 | [
"MIT"
] | 4 | 2021-06-17T17:24:19.000Z | 2022-03-18T16:22:26.000Z | cryptobrute.py | mustafasayilan/cryptobrute | 855959ebc04388e12ea786133ab8eb2f464cf637 | [
"MIT"
] | 2 | 2021-06-25T09:44:14.000Z | 2021-10-08T17:42:06.000Z | from multiprocessing import Process
import argparse
import sys
import signal
# Set the signal handler
signal.signal(signal.SIGINT, handler)
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", action='store', dest='output', help="Results will write this file.")
parser.add_argument("-p", "-... | 30.550388 | 134 | 0.544278 | from bitcoinaddress import Wallet
import os
from multiprocessing import Process
import argparse
import sys
import signal
def handler(signum, frame):
print('Exiting')
sys.exit()
# Set the signal handler
signal.signal(signal.SIGINT, handler)
parser = argparse.ArgumentParser()
parser.add_argument("... | 0 | 0 | 0 | 2,395 | 0 | 44 | 0 | 0 | 166 |
5e3dafd6d0e7593121c3eb1051224de153348874 | 1,180 | py | Python | src/tasks.py | artinnok/billing-gateway | fbb0b358066a0038e775e6a9c4d40bcdf8f79e8e | [
"MIT"
] | null | null | null | src/tasks.py | artinnok/billing-gateway | fbb0b358066a0038e775e6a9c4d40bcdf8f79e8e | [
"MIT"
] | 4 | 2021-03-18T23:34:38.000Z | 2021-06-04T22:27:26.000Z | src/tasks.py | artinnok/billing-gateway | fbb0b358066a0038e775e6a9c4d40bcdf8f79e8e | [
"MIT"
] | 1 | 2020-02-11T09:20:30.000Z | 2020-02-11T09:20:30.000Z | import django
from django.contrib.auth import get_user_model
django.setup()
USER = get_user_model()
| 25.652174 | 55 | 0.619492 | import django
from django.conf import settings
from django.db import transaction
from django.contrib.auth import get_user_model
django.setup()
from billing.models import Account, Payment
from billing.utils import complete_payment
USER = get_user_model()
def init_account(user_id):
with transaction.atomic():
... | 0 | 0 | 0 | 0 | 0 | 874 | 0 | 66 | 135 |
dd3763f11f7171672cdad6d6acbf95ff8acd06bb | 6,545 | py | Python | cride/circles/views/memberships.py | jecs580/django_second_app | ef04b48342ef560eac8f58540ba684e5eb7d7926 | [
"MIT"
] | null | null | null | cride/circles/views/memberships.py | jecs580/django_second_app | ef04b48342ef560eac8f58540ba684e5eb7d7926 | [
"MIT"
] | 2 | 2019-12-24T00:03:49.000Z | 2019-12-24T00:03:50.000Z | cride/circles/views/memberships.py | jecs580/django_second_app | ef04b48342ef560eac8f58540ba684e5eb7d7926 | [
"MIT"
] | null | null | null | """Vistas de miembros del crculo"""
# Django REST Framework
# Models
# Permissions
# Serializers
| 45.451389 | 112 | 0.676394 | """Vistas de miembros del círculo"""
# Django REST Framework
from rest_framework import mixins, viewsets, status
from rest_framework.generics import get_object_or_404
from rest_framework.decorators import action
from rest_framework.response import Response
# Models
from cride.circles.models import Circle, Membership,... | 16 | 2,362 | 0 | 3,564 | 0 | 0 | 0 | 309 | 199 |
5762199f83ef7cf6fdb43234108f9b42447293d5 | 3,947 | py | Python | fencing/diagram/FencingEntity.py | cqtran/Cmput_401_Fence_Friends | 98a25359e3801212e5afaaf71d1191870f73d608 | [
"Apache-2.0"
] | null | null | null | fencing/diagram/FencingEntity.py | cqtran/Cmput_401_Fence_Friends | 98a25359e3801212e5afaaf71d1191870f73d608 | [
"Apache-2.0"
] | null | null | null | fencing/diagram/FencingEntity.py | cqtran/Cmput_401_Fence_Friends | 98a25359e3801212e5afaaf71d1191870f73d608 | [
"Apache-2.0"
] | null | null | null |
# Used for rotations:
# https://stackoverflow.com/questions/34372480/rotate-point-about-another-point-in-degrees-python/34374437#34374437
# Accessed November 17, 2017 | 22.683908 | 115 | 0.657968 | import math
from decimal import Decimal
# Used for rotations:
# https://stackoverflow.com/questions/34372480/rotate-point-about-another-point-in-degrees-python/34374437#34374437
# Accessed November 17, 2017
class Post:
"""A post"""
def __init__(self, postType, x, y, isRemoval=False):
self.entityType = "post"
s... | 0 | 241 | 0 | 3,453 | 0 | 0 | 0 | -4 | 90 |
349f64833648c7a6bb0330713d700aa416d68e30 | 8,314 | py | Python | source/module/memory_helper_v2.py | siat-nlp/TTOS | 524ac690b01415818dd17b045692795db55f1552 | [
"MIT"
] | 14 | 2020-10-12T11:43:04.000Z | 2022-03-11T07:12:12.000Z | source/module/memory_helper_v2.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | 1 | 2020-11-16T17:07:40.000Z | 2021-04-21T08:42:17.000Z | source/module/memory_helper_v2.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | 3 | 2020-11-29T13:36:42.000Z | 2021-11-29T10:36:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: source/module/memory_helper.py
"""
import torch.nn as nn
| 47.238636 | 128 | 0.60332 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: source/module/memory_helper.py
"""
import torch
import torch.nn as nn
class KnowledgeMemoryv2(nn.Module):
def __init__(self,
query_size,
memory_size,
hidden_size,
max_hop=1,
... | 0 | 0 | 0 | 8,152 | 0 | 0 | 0 | -9 | 50 |
dd4abb2ea03219fe9b4715144457ad9fc8a13898 | 2,230 | py | Python | config/settings/env.example.py | hbvj99/market-api | 489c9433556002cb391b93cbd6486da739c2418a | [
"MIT"
] | 1 | 2021-08-28T05:30:40.000Z | 2021-08-28T05:30:40.000Z | config/settings/env.example.py | hbvj99/market-api | 489c9433556002cb391b93cbd6486da739c2418a | [
"MIT"
] | 1 | 2022-01-14T08:57:19.000Z | 2022-01-14T08:57:20.000Z | config/settings/env.example.py | hbvj99/market-api | 489c9433556002cb391b93cbd6486da739c2418a | [
"MIT"
] | 1 | 2022-01-11T10:14:27.000Z | 2022-01-11T10:14:27.000Z | from datetime import timedelta
SECRET_KEY = ''
DEBUG = True
ALLOWED_HOSTS = '*'
INSTALLED_APPS += [
'drf_yasg'
]
INTERNAL_IPS = ['127.0.0.1', ] # required for drf_yasg
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.SessionAuthentication'] + \
... | 22.989691 | 110 | 0.676682 | from datetime import timedelta
from .base import *
SECRET_KEY = ''
DEBUG = True
ALLOWED_HOSTS = '*'
INSTALLED_APPS += [
'drf_yasg'
]
INTERNAL_IPS = ['127.0.0.1', ] # required for drf_yasg
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.SessionAuthentication'] + \
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |
2a466d17f5958a202a4ed6b24cc4a465e028f11d | 2,298 | py | Python | catalogService/handler_apache.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | 3 | 2015-06-10T19:31:17.000Z | 2017-11-29T07:04:12.000Z | catalogService/handler_apache.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | null | null | null | catalogService/handler_apache.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | 2 | 2016-02-04T00:51:15.000Z | 2020-07-24T00:22:44.000Z | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.054054 | 78 | 0.735857 | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 | 768 | 0 | 0 | 0 | 67 | 137 |
de4cf2d04f8b6b65c62b52449a76f4089e5a7ae5 | 1,536 | py | Python | face_detection_mtcnn.py | zjxgithub/mtcnn-pytorch | b0a76c84fc2794e898aff3465bdeffd013616493 | [
"MIT"
] | null | null | null | face_detection_mtcnn.py | zjxgithub/mtcnn-pytorch | b0a76c84fc2794e898aff3465bdeffd013616493 | [
"MIT"
] | null | null | null | face_detection_mtcnn.py | zjxgithub/mtcnn-pytorch | b0a76c84fc2794e898aff3465bdeffd013616493 | [
"MIT"
] | null | null | null | from src import detect_faces
from PIL import Image
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
img_path = '/net/deepfake-defense/datasets/CelebA/img/img_celeba/'
pert_path = '/net/deepfake-defense/datasets/CelebA/img/MTCNN_ifgsm/'
result_f = open('/home/zhujunxiao/protect_face_identity/face_image_protection/MT... | 48 | 146 | 0.692057 | from src import detect_faces, show_bboxes
from PIL import Image
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
img_path = '/net/deepfake-defense/datasets/CelebA/img/img_celeba/'
pert_path = '/net/deepfake-defense/datasets/CelebA/img/MTCNN_ifgsm/'
result_f = open('/home/zhujunxiao/protect_face_identity/face_image_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0 |
6dafa7f39f8db7ea07fba93e25e731b3e174ed07 | 3,897 | py | Python | magcoords_v0.17.py | gregstarr/cartomap | 46f0917c4315dede1a12a663de80cdde0ae73393 | [
"MIT"
] | 5 | 2019-06-21T01:18:20.000Z | 2021-03-21T22:17:40.000Z | magcoords_v0.17.py | mrinalghosh/cartomap | 741c5916ad180b382dd1e60e5c8bb5168899c878 | [
"MIT"
] | 1 | 2019-06-10T13:05:18.000Z | 2019-06-10T13:05:18.000Z | magcoords_v0.17.py | mrinalghosh/cartomap | 741c5916ad180b382dd1e60e5c8bb5168899c878 | [
"MIT"
] | 4 | 2018-08-29T00:08:39.000Z | 2020-06-02T21:51:19.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 14:08:42 2019
@author: smrak
"""
import numpy as np
from cartomap import geogmap as gm
from datetime import datetime
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import apexpy as ap
latlim = [-0,60]
lonlim= [-140,0]
date = datetim... | 40.175258 | 123 | 0.561714 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 14:08:42 2019
@author: smrak
"""
import numpy as np
from cartomap import geogmap as gm
from datetime import datetime
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import apexpy as ap
latlim = [-0,60]
lonlim= [-140,0]
date = datetim... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f5e992e91eca6adf82b3dad2c408676155551138 | 1,136 | py | Python | visan/examples/SCI_NL__1P_spectral_readout.py | ercumentaksoy/visan | 57c9257d80622fc0ab03591db48cc2155bd12f1b | [
"MIT",
"BSD-3-Clause"
] | 7 | 2020-04-09T05:21:03.000Z | 2022-01-23T18:39:02.000Z | visan/examples/SCI_NL__1P_spectral_readout.py | ercumentaksoy/visan | 57c9257d80622fc0ab03591db48cc2155bd12f1b | [
"MIT",
"BSD-3-Clause"
] | 7 | 2020-01-05T19:19:20.000Z | 2020-05-27T09:41:49.000Z | visan/examples/SCI_NL__1P_spectral_readout.py | ercumentaksoy/visan | 57c9257d80622fc0ab03591db48cc2155bd12f1b | [
"MIT",
"BSD-3-Clause"
] | 4 | 2020-04-18T14:11:22.000Z | 2021-11-10T02:27:49.000Z | # This is an example VISAN script for the SCI_NL__1P product
# Make sure to set the 'products-file directory' option in the VISAN Preferences panel to
# a directory containing SCI_NL__1P products.
# This example will then take the first product it finds in this directory and
# for that product plot the measured limb ... | 34.424242 | 98 | 0.712148 | # This is an example VISAN script for the SCI_NL__1P product
# Make sure to set the 'products-file directory' option in the VISAN Preferences panel to
# a directory containing SCI_NL__1P products.
# This example will then take the first product it finds in this directory and
# for that product plot the measured limb ... | 0 | 0 | 0 | 0 | 0 | 748 | 0 | 0 | 23 |
aacb1e500ae26ed3efe067878478f2b7a74cc7a0 | 154 | py | Python | wsgi_multi/wsgi.py | ned2/dash-embed-recipes | ff495afd0e1293125957c86cac7b3953521d4895 | [
"MIT"
] | 1 | 2019-01-21T12:38:27.000Z | 2019-01-21T12:38:27.000Z | wsgi_multi/wsgi.py | ned2/dash-embed-recipes | ff495afd0e1293125957c86cac7b3953521d4895 | [
"MIT"
] | null | null | null | wsgi_multi/wsgi.py | ned2/dash-embed-recipes | ff495afd0e1293125957c86cac7b3953521d4895 | [
"MIT"
] | null | null | null | from app1 import app as app1
from app2 import app as app2
app1.enable_dev_tools(debug=True)
app2.enable_dev_tools(debug=True)
| 19.25 | 33 | 0.818182 | from server import server
from app1 import app as app1
from app2 import app as app2
app1.enable_dev_tools(debug=True)
app2.enable_dev_tools(debug=True)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
06d9344638a0e4528c9018bd45590f8835132b7c | 1,688 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/docker/plugins/module_utils/socket_helper.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 7 | 2021-11-16T04:05:42.000Z | 2022-02-19T21:14:29.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/docker/plugins/module_utils/socket_helper.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/docker/plugins/module_utils/socket_helper.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2022-03-01T05:43:07.000Z | 2022-03-01T05:43:07.000Z | # Copyright (c) 2019-2021, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
| 31.259259 | 108 | 0.677133 | # Copyright (c) 2019-2021, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import fcntl
import os
import os.path
import socket as pysocket
from ansibl... | 0 | 0 | 0 | 0 | 0 | 1,242 | 0 | 7 | 182 |
392aa847b676c6ae4c0ce9254f3f9d819e5bb6ac | 7,438 | py | Python | scripts/match-pr-to-feedstocks.py | ax3l/conda-forge.github.io | 2086f087d3b2875c4493e38c2f71b1ccc5304ffd | [
"BSD-3-Clause"
] | null | null | null | scripts/match-pr-to-feedstocks.py | ax3l/conda-forge.github.io | 2086f087d3b2875c4493e38c2f71b1ccc5304ffd | [
"BSD-3-Clause"
] | null | null | null | scripts/match-pr-to-feedstocks.py | ax3l/conda-forge.github.io | 2086f087d3b2875c4493e38c2f71b1ccc5304ffd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env conda-execute
# conda execute
# env:
# - python
# - click
# - jinja2
# - requests
# - ruamel.yaml
# - conda-smithy
# - pygithub
# - fuzzywuzzy
# channels:
# - conda-forge
# run_with: python
import conda_smithy.feedstocks as feedstocks
import jinja2
import ruamel.yaml
import os
# patch over di... | 36.106796 | 96 | 0.654477 | #!/usr/bin/env conda-execute
# conda execute
# env:
# - python
# - click
# - jinja2
# - requests
# - ruamel.yaml
# - conda-smithy
# - pygithub
# - fuzzywuzzy
# channels:
# - conda-forge
# run_with: python
import click
import conda_smithy.feedstocks as feedstocks
import jinja2
import json
import requests
impo... | 0 | 5,260 | 0 | 257 | 0 | 754 | 0 | 33 | 363 |
e5e0d12a9e36fc5f92b96a631ff6de1286ac2249 | 1,566 | py | Python | application/mod_collage/col_controllers.py | hieusydo/Voyage | 2a98118131fad927326d318ae1766e64bbb5add8 | [
"MIT"
] | 1 | 2018-04-23T05:16:49.000Z | 2018-04-23T05:16:49.000Z | application/mod_collage/col_controllers.py | hieusydo/Voyage | 2a98118131fad927326d318ae1766e64bbb5add8 | [
"MIT"
] | null | null | null | application/mod_collage/col_controllers.py | hieusydo/Voyage | 2a98118131fad927326d318ae1766e64bbb5add8 | [
"MIT"
] | null | null | null | from flask import Blueprint
mod_collage = Blueprint('collage', __name__, url_prefix='/collage')
# Represents the collage form | 32.625 | 72 | 0.716475 | from flask import Blueprint, render_template, session, redirect, url_for
from flask_wtf import FlaskForm
from wtforms import SelectField
from application.mod_collage.photoManip import generateCollage
from application.mod_auth.models import Landmark
mod_collage = Blueprint('collage', __name__, url_prefix='/collage')
... | 0 | 901 | 0 | 271 | 0 | 0 | 0 | 133 | 134 |
0af5e91130c6574093b9682b307fb1019139a663 | 2,201 | py | Python | siteblog/blog/migrations/0001_initial.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | siteblog/blog/migrations/0001_initial.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | siteblog/blog/migrations/0001_initial.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-05 12:46
| 39.303571 | 135 | 0.545207 | # Generated by Django 3.1.6 on 2021-02-05 12:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 54 | 0 | 0 | 2,027 | 0 | 0 | 0 | 30 | 68 |
b2b8567fa0354d9e623bba8b14d8a1f37a000693 | 7,750 | py | Python | autoreload/autoreload.py | jarret/plugins | 65304d4baf3d6a0254148be0fd851789c152d8d3 | [
"BSD-3-Clause"
] | null | null | null | autoreload/autoreload.py | jarret/plugins | 65304d4baf3d6a0254148be0fd851789c152d8d3 | [
"BSD-3-Clause"
] | null | null | null | autoreload/autoreload.py | jarret/plugins | 65304d4baf3d6a0254148be0fd851789c152d8d3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from lightning import Plugin
import psutil
try:
# C-lightning v0.7.2
plugin = Plugin(dynamic=False)
except:
plugin = Plugin()
def inject_manifest(plugin, manifest):
"""Once we have the manifest from the child plugin, inject it into our own.
"""
for opt in manifest.get... | 31.25 | 117 | 0.572645 | #!/usr/bin/env python3
from lightning import Plugin
import json
import psutil
import subprocess
import threading
import time
import os
try:
# C-lightning v0.7.2
plugin = Plugin(dynamic=False)
except:
plugin = Plugin()
class ChildPlugin(object):
def __init__(self, path, plugin):
self.path = p... | 0 | 559 | 0 | 5,303 | 0 | 0 | 0 | -41 | 179 |
15cd974602f7b171557d6e3634177554bb7eed60 | 2,239 | py | Python | hard-gists/1381489/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/1381489/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/1381489/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z |
import maya.cmds as cmds
try:
dialog.deleteLater()
except:
pass
dialog = show()
| 30.671233 | 111 | 0.652523 | from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
class MyDialog(QtGui.QDialog):
def __init__(self, parent, **kwargs):
super(MyDialog, self).__init__(parent, **kwargs)
self.setObjectName("MyWindow")
self.resize(800, 600)
s... | 0 | 0 | 0 | 1,781 | 0 | 221 | 0 | 7 | 113 |
61e3d943b4cd0789dbc0aead054385cc47d08639 | 2,124 | py | Python | fitbert/tests.py | tranvien98/fit_bert | 0857aacaaa5358c3111bb57d675c9edfed8654c8 | [
"Apache-2.0"
] | 67 | 2019-07-15T02:26:14.000Z | 2021-08-29T07:16:12.000Z | fitbert/tests.py | tranvien98/fit_bert | 0857aacaaa5358c3111bb57d675c9edfed8654c8 | [
"Apache-2.0"
] | 12 | 2019-07-12T22:14:25.000Z | 2021-09-06T12:41:13.000Z | fitbert/tests.py | tranvien98/fit_bert | 0857aacaaa5358c3111bb57d675c9edfed8654c8 | [
"Apache-2.0"
] | 14 | 2019-10-04T00:56:38.000Z | 2021-08-11T03:35:56.000Z | from fitbert.delemmatize import Delemmatizer
dl = Delemmatizer()
"""
def test_masker_works_without_instantiating():
masked_string, masked = FitBert.mask(
"This might be justified to signalling the connection between drunken driving and fatal accidents.",
(27, 37),
)
assert FitBert.mas... | 29.5 | 121 | 0.649718 | import pytest
from fitbert import FitBert
from fitbert.delemmatize import Delemmatizer
dl = Delemmatizer()
def test_delemmatizer_instantiates():
assert Delemmatizer() is not None, "It instantiates"
def test_delemmatizer_callable():
assert callable(dl), "Delemmatizer instance should be callable"
def test_... | 0 | 1,067 | 0 | 0 | 0 | 439 | 0 | -2 | 159 |
d30bb470de738f9f6f1fb2cbbd6f7dac331f9e25 | 4,783 | py | Python | swift_iam_role/swift_iam_role.py | sijuvj/quickstart-swift-digital-connectivity | 741eb7422987f9cbde28746443d466351906ce1a | [
"Apache-2.0"
] | null | null | null | swift_iam_role/swift_iam_role.py | sijuvj/quickstart-swift-digital-connectivity | 741eb7422987f9cbde28746443d466351906ce1a | [
"Apache-2.0"
] | null | null | null | swift_iam_role/swift_iam_role.py | sijuvj/quickstart-swift-digital-connectivity | 741eb7422987f9cbde28746443d466351906ce1a | [
"Apache-2.0"
] | null | null | null | """Nested Stack for the sample IAM Role creation for Managing SWIFT components"""
| 45.990385 | 99 | 0.593142 | """Nested Stack for the sample IAM Role creation for Managing SWIFT components"""
from typing import List
from aws_cdk import (
aws_rds as _rds,
aws_iam as _iam
)
from constructs import Construct
from aws_cdk import NestedStack
class SwiftIAMRole(NestedStack):
"""Nested Stack for the sample IAM Role creat... | 0 | 0 | 0 | 4,523 | 0 | 0 | 0 | 66 | 112 |
2593d84834118e5edba7d5ac56debf357570d58b | 1,192 | py | Python | s3prl/downstream/ctc/corpus/downsample_cv.py | hhhaaahhhaa/s3prl | a469787f05c42196c4d989555082f5fd9dcbe8a6 | [
"Apache-2.0"
] | 1 | 2022-03-15T04:04:23.000Z | 2022-03-15T04:04:23.000Z | s3prl/downstream/ctc/corpus/downsample_cv.py | hhhaaahhhaa/s3prl | a469787f05c42196c4d989555082f5fd9dcbe8a6 | [
"Apache-2.0"
] | 2 | 2021-12-08T14:52:39.000Z | 2021-12-12T09:33:08.000Z | s3prl/downstream/ctc/corpus/downsample_cv.py | hhhaaahhhaa/s3prl | a469787f05c42196c4d989555082f5fd9dcbe8a6 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
main()
| 25.913043 | 78 | 0.621644 | import argparse
import csv
from os.path import join
from pathlib import Path
from tqdm import tqdm
import torch
import torchaudio
import numpy as np
from librosa import resample
def read_processed_tsv(path):
with open(path, "r") as fp:
rows = csv.reader(fp, delimiter="\t")
file_list = []
... | 0 | 0 | 0 | 0 | 0 | 925 | 0 | -20 | 245 |
2e9e400801bf584b334ce06ed106835a338d64f7 | 1,474 | py | Python | Kseg2annANN.py | kejitan/ESVGscale | d4674d7ba3c897e25c010b3e1bceb3ca421adcd3 | [
"CC-BY-4.0"
] | null | null | null | Kseg2annANN.py | kejitan/ESVGscale | d4674d7ba3c897e25c010b3e1bceb3ca421adcd3 | [
"CC-BY-4.0"
] | 7 | 2021-04-21T01:01:12.000Z | 2022-03-12T00:18:22.000Z | Kseg2annANN.py | kejitan/ESVGscale | d4674d7ba3c897e25c010b3e1bceb3ca421adcd3 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
import os
#import cv2
| 22.333333 | 93 | 0.629579 | #!/usr/bin/env python
import os
from PIL import Image
import glob, os
from tqdm import tqdm
import six
#import cv2
import pandas as pd
from keras_segmentation.data_utils.data_loader import get_image_array, get_segmentation_array
import numpy as np
import re
import json
from pandas.io.json import json_normalize
impor... | 0 | 0 | 0 | 0 | 0 | 1,097 | 0 | 39 | 290 |
000d0dce0600f816e990894a0f4ae04b12802ab8 | 771 | py | Python | Part_3_advanced/m03_date_and_time/date_iso_calendar_and_weekday/homework_1_solution/new_movies/cinema_schedule.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m03_date_and_time/date_iso_calendar_and_weekday/homework_1_solution/new_movies/cinema_schedule.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m03_date_and_time/date_iso_calendar_and_weekday/homework_1_solution/new_movies/cinema_schedule.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null |
from new_movies import movies_directory
weekly_schedule = {
Weekday.MONDAY: movies_directory.available_movies[0:2],
Weekday.TUESDAY: movies_directory.available_movies[2:4],
Weekday.WEDNESDAY: movies_directory.available_movies[4:6],
Weekday.THURSDAY: movies_directory.available_movies[6:8],
Weekda... | 26.586207 | 63 | 0.736706 | from enum import Enum, auto
from new_movies import movies_directory
class Weekday(Enum):
MONDAY = auto()
TUESDAY = auto()
WEDNESDAY = auto()
THURSDAY = auto()
FRIDAY = auto()
SATURDAY = auto()
SUNDAY = auto()
weekly_schedule = {
Weekday.MONDAY: movies_directory.available_movies[0:2]... | 0 | 0 | 0 | 147 | 0 | 50 | 0 | 6 | 68 |
964acf6bcfdb818f7ae341ce8f450e261785e925 | 3,351 | py | Python | sara_flexbe_behaviors/src/sara_flexbe_behaviors/check_reachability_sm.py | WalkingMachine/sara_behaviors | fcb55d274331915cd39d7d444546f17a39f85a44 | [
"BSD-3-Clause"
] | 5 | 2018-05-07T19:58:08.000Z | 2021-04-21T10:49:05.000Z | sara_flexbe_behaviors/src/sara_flexbe_behaviors/check_reachability_sm.py | WalkingMachine/sara_behaviors | fcb55d274331915cd39d7d444546f17a39f85a44 | [
"BSD-3-Clause"
] | 21 | 2017-05-26T01:20:06.000Z | 2021-01-26T23:03:36.000Z | sara_flexbe_behaviors/src/sara_flexbe_behaviors/check_reachability_sm.py | WalkingMachine/sara_behaviors | fcb55d274331915cd39d7d444546f17a39f85a44 | [
"BSD-3-Clause"
] | 2 | 2019-07-22T07:21:20.000Z | 2019-11-11T20:49:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | 32.852941 | 115 | 0.626977 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | 0 | 0 | 0 | 2,429 | 0 | 0 | 0 | 213 | 111 |
d0d3ee91c9b8767fd459ff0b851864c764d98ba6 | 2,489 | py | Python | uu/formlibrary/upgrades/reindexer.py | mostscript/uu.formlibrary | a7f5819abac7c1ddea69ddee8fce465d45f4d1d5 | [
"BSD-4-Clause-UC"
] | null | null | null | uu/formlibrary/upgrades/reindexer.py | mostscript/uu.formlibrary | a7f5819abac7c1ddea69ddee8fce465d45f4d1d5 | [
"BSD-4-Clause-UC"
] | null | null | null | uu/formlibrary/upgrades/reindexer.py | mostscript/uu.formlibrary | a7f5819abac7c1ddea69ddee8fce465d45f4d1d5 | [
"BSD-4-Clause-UC"
] | null | null | null | import sys
import transaction
from zope.component.hooks import setSite
PKGNAME = 'uu.formlibrary'
PROFILE = 'profile-%s:default' % PKGNAME
_installed = lambda site: site.portal_quickinstaller.isProductInstalled
product_installed = lambda site, name: _installed(site)(name)
if __name__ == '__main__' and 'app' i... | 30.353659 | 78 | 0.634793 | import sys
import transaction
from zope.component.hooks import setSite
PKGNAME = 'uu.formlibrary'
PROFILE = 'profile-%s:default' % PKGNAME
_installed = lambda site: site.portal_quickinstaller.isProductInstalled
product_installed = lambda site, name: _installed(site)(name)
def stale_catalog_entries(site, catalog=N... | 0 | 0 | 0 | 0 | 0 | 1,878 | 0 | 0 | 92 |
e764e1f40a98967bf941bfbb2600858b41fd38ee | 1,364 | py | Python | brain/missing_incorrect_files.py | neuropoly/lesion-mapping | 48365fec608b0a4bce8c613c937b2b7f26317470 | [
"MIT"
] | null | null | null | brain/missing_incorrect_files.py | neuropoly/lesion-mapping | 48365fec608b0a4bce8c613c937b2b7f26317470 | [
"MIT"
] | null | null | null | brain/missing_incorrect_files.py | neuropoly/lesion-mapping | 48365fec608b0a4bce8c613c937b2b7f26317470 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# This script helps at the generation or correction of groundtruths.
#
# Usage: python missing_incorrect_files.py <pickle_filename>
# where <pickle_filename> has been generated by '0_check_data.py'.
# e.g. python missing_incorrect_files.py 201809192209_incorrect_lesion.pkl
#
# Charley Gros 20... | 28.416667 | 111 | 0.703079 | #!/usr/bin/env python
#
# This script helps at the generation or correction of groundtruths.
#
# Usage: python missing_incorrect_files.py <pickle_filename>
# where <pickle_filename> has been generated by '0_check_data.py'.
# e.g. python missing_incorrect_files.py 201809192209_incorrect_lesion.pkl
#
# Charley Gros 20... | 0 | 0 | 0 | 0 | 0 | 187 | 0 | 0 | 23 |
56cb0d99986ba98be7c75318cc32a218466d3d93 | 10,142 | py | Python | scripts/rouge_analysis.py | olizhu10/newsroom | 0a6dccd21da28892cc089e0924c53e0723b42785 | [
"Apache-2.0"
] | null | null | null | scripts/rouge_analysis.py | olizhu10/newsroom | 0a6dccd21da28892cc089e0924c53e0723b42785 | [
"Apache-2.0"
] | null | null | null | scripts/rouge_analysis.py | olizhu10/newsroom | 0a6dccd21da28892cc089e0924c53e0723b42785 | [
"Apache-2.0"
] | 1 | 2019-10-04T03:24:35.000Z | 2019-10-04T03:24:35.000Z |
"""Creates a csv file with rouge scores between summaries in a cluster"""
CLUSTERS = {
'sandy':[
"After Sandy hit the East Coast Monday night, more than 2 million New Jersey residents were left without power and feeling powerless",
"Superstorm Sandy crashed ashore this week, cutting a path of destruction several hun... | 60.369048 | 318 | 0.686945 | from rouge import Rouge
import csv
"""Creates a csv file with rouge scores between summaries in a cluster"""
def rouge(cluster):
matrix1 = []
matrix2 = []
matrixl = []
for summary1 in cluster:
scores1 = []
scores2 = []
scoresl = []
for summary2 in cluster:
r... | 33 | 0 | 0 | 0 | 0 | 4,233 | 0 | -9 | 136 |
a392f556d31a226a84e5dcaedacfa7b0401a58a5 | 3,422 | py | Python | dearpygui_ext/simple_table.py | Atlamillias/DearPyGui_Ext | 7f8e500988c697d6e006af625065a2065537f56e | [
"MIT"
] | 27 | 2021-08-19T16:10:23.000Z | 2022-03-25T16:53:11.000Z | dearpygui_ext/simple_table.py | Atlamillias/DearPyGui_Ext | 7f8e500988c697d6e006af625065a2065537f56e | [
"MIT"
] | 4 | 2021-08-23T23:30:14.000Z | 2022-02-21T19:27:44.000Z | dearpygui_ext/simple_table.py | Atlamillias/DearPyGui_Ext | 7f8e500988c697d6e006af625065a2065537f56e | [
"MIT"
] | 4 | 2021-08-19T16:10:39.000Z | 2022-02-12T05:20:28.000Z |
# 0.6 functions
# * add_column
# * delete_column
# * set_table_data
# * get_table_data
# * get_table_item
# * set_table_item
# * get_table_selections
# * set_table_selections
# * insert_column
# * insert_row
# * set_headers
| 34.918367 | 122 | 0.579778 | import dearpygui._dearpygui as internal_dpg
import dearpygui.dearpygui as dpg
# 0.6 functions
# * add_column
# * delete_column
# * set_table_data
# * get_table_data
# * get_table_item
# * set_table_item
# * get_table_selections
# * set_table_selections
# * insert_column
# * insert_row
# * set_hea... | 0 | 0 | 0 | 3,073 | 0 | 0 | 0 | 34 | 67 |
0acac77f99130902d3f1059af0697c6e56b0ebbd | 12,283 | py | Python | article/experiments/exp13.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | 2 | 2018-08-23T06:54:17.000Z | 2021-03-05T14:38:41.000Z | article/experiments/exp13.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | null | null | null | article/experiments/exp13.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | null | null | null |
"""
Experiment using all GALAH data.
"""
from __future__ import division # Just in case. Use Python 3.
import os
import sys
import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import yaml
from scipy import linalg
from hashlib import md5
sys.path.insert(0, "../../")
from mcfa import (... | 29.175772 | 183 | 0.642107 |
"""
Experiment using all GALAH data.
"""
from __future__ import division # Just in case. Use Python 3.
import os
import sys
import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import yaml
from matplotlib.ticker import MaxNLocator
from collections import Counter
from scipy import linalg... | 0 | 0 | 0 | 0 | 0 | 488 | 0 | 36 | 90 |
e67ed531cbda0b0c671afd7ecd25b2ee8474f03a | 1,268 | py | Python | SIP/src/peer/server/__init__.py | trishantpahwa/Session-Initiation-Protocol | 5b770dbb9533fbe3a8ff31fc583576cc107e5ba8 | [
"MIT"
] | 3 | 2019-06-18T18:21:05.000Z | 2021-07-15T06:28:25.000Z | SIP/src/peer/server/__init__.py | trishantpahwa/Session-Initiation-Protocol | 5b770dbb9533fbe3a8ff31fc583576cc107e5ba8 | [
"MIT"
] | 4 | 2019-01-30T11:31:13.000Z | 2019-03-06T12:36:54.000Z | SIP/src/peer/server/__init__.py | trishantpahwa/Session-Initiation-Protocol | 5b770dbb9533fbe3a8ff31fc583576cc107e5ba8 | [
"MIT"
] | 1 | 2019-08-12T11:31:23.000Z | 2019-08-12T11:31:23.000Z | # Sample TCP Server
'''from server import server
server_name = 'server'
domain = '192.168.1.218'
protocol = 'TCP'
port = '5060'
server_network_name = 'SERVER'
content_type = 'application'
content_sub_type = 'sdp'
server_ = server(server_name, domain, protocol, port, server_network_name,
content_type... | 24.862745 | 74 | 0.721609 | # Sample TCP Server
'''from server import server
server_name = 'server'
domain = '192.168.1.218'
protocol = 'TCP'
port = '5060'
server_network_name = 'SERVER'
content_type = 'application'
content_sub_type = 'sdp'
server_ = server(server_name, domain, protocol, port, server_network_name,
content_type... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
fb7f5797b0a8a40e01914660c71d0962e8e429dc | 841 | py | Python | Analysis/tests/ParserTests.py | ashishnitinpatil/resanalysersite | 0604d2fed4760be741c4d90b6d230d0f2cd8bf9e | [
"CC-BY-4.0"
] | null | null | null | Analysis/tests/ParserTests.py | ashishnitinpatil/resanalysersite | 0604d2fed4760be741c4d90b6d230d0f2cd8bf9e | [
"CC-BY-4.0"
] | null | null | null | Analysis/tests/ParserTests.py | ashishnitinpatil/resanalysersite | 0604d2fed4760be741c4d90b6d230d0f2cd8bf9e | [
"CC-BY-4.0"
] | null | null | null | import unittest
# Pro tip - Am a noob at Testing :|
if __name__ == '__main__':
unittest.main()
| 24.028571 | 61 | 0.650416 | import unittest
import random
from Analysis.ResAnalyser import PDF_Parser
# Pro tip - Am a noob at Testing :|
class ParserTests(unittest.TestCase):
"""
All tests for PDFParser class & all it's methods go here
"""
def setUp(self):
self.parser = PDF_Parser(testing=True)
def test_is_credit(s... | 0 | 0 | 0 | 659 | 0 | 0 | 0 | 14 | 67 |
4d21e2bbb3f7199438454942c63073b8ad992302 | 5,027 | py | Python | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_parse.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 11,356 | 2017-12-08T19:42:32.000Z | 2022-03-31T16:55:25.000Z | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_parse.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 2,402 | 2017-12-08T22:31:01.000Z | 2022-03-28T19:25:52.000Z | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_parse.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 1,343 | 2017-12-08T19:47:19.000Z | 2022-03-26T11:31:36.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import pytest
pytest.importorskip("tensorflow", minversion="1.14.0")
import ... | 39.896825 | 88 | 0.655262 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import unittest
import pytest
pytest.importorskip("tensorflow", minversion=... | 0 | 356 | 0 | 3,990 | 0 | 0 | 0 | 163 | 135 |
3002f2f09fa463bc36f6a4afa3490d0ddcbaccac | 4,581 | py | Python | tsmtool/tarsnap.py | rstms/tsmtool | 97ce28e398185d983a96dc2787274946bfab5553 | [
"MIT"
] | null | null | null | tsmtool/tarsnap.py | rstms/tsmtool | 97ce28e398185d983a96dc2787274946bfab5553 | [
"MIT"
] | 1 | 2022-03-28T11:07:36.000Z | 2022-03-28T11:07:36.000Z | tsmtool/tarsnap.py | rstms/tsmtool | 97ce28e398185d983a96dc2787274946bfab5553 | [
"MIT"
] | null | null | null | # Tarsnap - tarsnap website interface
URL = "https://www.tarsnap.com"
| 29.554839 | 79 | 0.505566 | # Tarsnap - tarsnap website interface
import datetime
from pathlib import Path
import requests
from bs4 import BeautifulSoup, element
URL = "https://www.tarsnap.com"
class Tarsnap:
def __init__(self, config_file, account=None, email=None, password=None):
self.url = URL
self.account = account o... | 0 | 0 | 0 | 4,388 | 0 | 0 | 0 | 8 | 113 |
96f267c168e1d5d5937fae5a5b39d3b15c98c832 | 395 | py | Python | simple_fun_#204_smallest_integer.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | simple_fun_#204_smallest_integer.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | simple_fun_#204_smallest_integer.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Simple Fun #204: Smallest Integer
#Problem level: 7 kyu
| 24.6875 | 90 | 0.61519 | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Simple Fun #204: Smallest Integer
#Problem level: 7 kyu
from itertools import groupby, chain
def smallest_integer(matrix):
min = pos = 0
for key,_ in groupby([x for x in sorted(list(chain.from_iterable(matrix))) if x>=0]):
if key==min:
min... | 0 | 0 | 0 | 0 | 0 | 228 | 0 | 15 | 45 |
4d0d23e77fd94495bc44c0163012002503b7b6dc | 2,147 | py | Python | siam_tracker/models/necks/adjust.py | microsoft/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 28 | 2020-03-18T04:41:21.000Z | 2022-02-24T16:44:01.000Z | siam_tracker/models/necks/adjust.py | HengFan2010/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 1 | 2020-04-05T15:23:22.000Z | 2020-04-07T16:23:12.000Z | siam_tracker/models/necks/adjust.py | HengFan2010/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 11 | 2020-03-19T00:30:06.000Z | 2021-11-10T08:22:35.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
| 38.339286 | 71 | 0.585468 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import torch
from torch import nn
from typing import List, Union, Dict
from ..builder import NECKS
from ..utils import build_stack_conv_layers, random_init_weights
@NECKS.register_module
class Adjust(nn.Module):
def _... | 0 | 1,863 | 0 | 0 | 0 | 0 | 0 | 54 | 135 |
035257ef15ef2d405531293d8c35ccff5962b78c | 557 | py | Python | runserver.py | GFZ-Centre-for-Early-Warning/REM_DEA | 68af70088db58acc916f2223a8e3b715beb3866d | [
"BSD-3-Clause"
] | null | null | null | runserver.py | GFZ-Centre-for-Early-Warning/REM_DEA | 68af70088db58acc916f2223a8e3b715beb3866d | [
"BSD-3-Clause"
] | null | null | null | runserver.py | GFZ-Centre-for-Early-Warning/REM_DEA | 68af70088db58acc916f2223a8e3b715beb3866d | [
"BSD-3-Clause"
] | null | null | null | '''
---------------------------
runserver.py
---------------------------
Created on 24.04.2015
Last modified on 12.01.2016
Author: Marc Wieland
Description: Starts the application using a local flask server (NOT RECOMMENDED: use wsgi implementation instead see README.md)
----
'''
from webapp import app, db
#create... | 26.52381 | 127 | 0.70377 | '''
---------------------------
runserver.py
---------------------------
Created on 24.04.2015
Last modified on 12.01.2016
Author: Marc Wieland
Description: Starts the application using a local flask server (NOT RECOMMENDED: use wsgi implementation instead see README.md)
----
'''
from webapp import app, db, models
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 44 |
7476c102eb8d74542cc6384cbb824d87d94c1c07 | 3,394 | py | Python | setup.py | Bhaskers-Blu-Org2/mu_pip_environment | d62df3b1d86bf375e82a7ca09740fa0aa3504fcc | [
"BSD-2-Clause"
] | 6 | 2019-07-01T05:10:41.000Z | 2021-06-11T08:58:35.000Z | setup.py | Microsoft/mu_pip_environment | d62df3b1d86bf375e82a7ca09740fa0aa3504fcc | [
"BSD-2-Clause"
] | null | null | null | setup.py | Microsoft/mu_pip_environment | d62df3b1d86bf375e82a7ca09740fa0aa3504fcc | [
"BSD-2-Clause"
] | 5 | 2019-07-01T05:10:42.000Z | 2020-08-05T14:52:28.000Z | # @file setup.py
# This contains setup info for mu_environment pip module
#
##
# Copyright (c) 2018, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistribut... | 34.989691 | 120 | 0.68739 | # @file setup.py
# This contains setup info for mu_environment pip module
#
##
# Copyright (c) 2018, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistribut... | 0 | 0 | 0 | 503 | 0 | 0 | 0 | 99 | 167 |
b514131d371af8802111a0dae7ec5445b63bcfcd | 10,929 | py | Python | tensorflow_probability/python/distributions/jax_transformation_test.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 2 | 2020-12-17T20:43:24.000Z | 2021-06-11T22:09:16.000Z | tensorflow_probability/python/distributions/jax_transformation_test.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/jax_transformation_test.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 1 | 2021-01-03T20:23:52.000Z | 2021-01-03T20:23:52.000Z | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.835913 | 87 | 0.708116 | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 5,027 | 0 | 2,028 | 0 | 0 | 0 | 115 | 391 |
0bee46430076063eb07a695c066b5cd6da03fd47 | 1,257 | py | Python | setup.py | JWKennington/CompPhys | f53ad33609738eeed81aa4b3390599668bf54017 | [
"MIT"
] | null | null | null | setup.py | JWKennington/CompPhys | f53ad33609738eeed81aa4b3390599668bf54017 | [
"MIT"
] | null | null | null | setup.py | JWKennington/CompPhys | f53ad33609738eeed81aa4b3390599668bf54017 | [
"MIT"
] | null | null | null | """Setup file
"""
import setuptools
import compphys
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(name='compphys',
version=compphys.__version__,
description='compphys',
long_description=long_description,
long_... | 32.230769 | 63 | 0.446301 | """Setup file
"""
import setuptools
import compphys
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(name='compphys',
version=compphys.__version__,
description='compphys',
long_description=long_description,
long_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4c0c86973bef9febabafdbc0b7755320ac5cdf61 | 166 | py | Python | lazy_record/typecasts.py | ECESeniorDesign/lazy_record | 929d3cc7c2538b0f792365c0d2b0e0d41084c2dd | [
"MIT"
] | 2 | 2017-02-04T03:33:28.000Z | 2021-01-08T05:58:18.000Z | lazy_record/typecasts.py | ECESeniorDesign/lazy_record | 929d3cc7c2538b0f792365c0d2b0e0d41084c2dd | [
"MIT"
] | 17 | 2016-01-05T00:09:30.000Z | 2016-02-15T20:06:45.000Z | lazy_record/typecasts.py | ECESeniorDesign/lazy_record | 929d3cc7c2538b0f792365c0d2b0e0d41084c2dd | [
"MIT"
] | null | null | null | """Functions to convert objects to a type"""
| 20.75 | 44 | 0.716867 | """Functions to convert objects to a type"""
def date(datetime):
# may get more complexity later
return datetime
def datetime(datetime):
return datetime
| 0 | 0 | 0 | 0 | 0 | 76 | 0 | 0 | 45 |
3b034620c9c0ef8e147d7736b8c194653375c054 | 2,070 | py | Python | ingestion/main.py | mharrisb1/blocktrace | 3c54286d4f28c3b0610f577dfdbbf643953475fa | [
"MIT"
] | null | null | null | ingestion/main.py | mharrisb1/blocktrace | 3c54286d4f28c3b0610f577dfdbbf643953475fa | [
"MIT"
] | null | null | null | ingestion/main.py | mharrisb1/blocktrace | 3c54286d4f28c3b0610f577dfdbbf643953475fa | [
"MIT"
] | null | null | null | import os
from fastapi import FastAPI
app = FastAPI()
API_KEY = os.getenv("BT__API_KEY") or ""
GCP_PROJECT_ID = os.getenv("BT__GCP_PROJECT_ID") or ""
GCP_PUBSUB_BLOCK_TOPIC_ID = os.getenv("BT__GCP_PUBSUB_BLOCK_TOPIC_ID") or ""
GCP_PUBSUB_TX_TOPIC_ID = os.getenv("BT__GCP_PUBSUB_TX_TOPIC_ID") or ""
GCP_PUBSUB_ACT_TOPI... | 25.875 | 76 | 0.669565 | import os
from typing import List, Optional
import multiprocessing as mp
from fastapi import FastAPI, BackgroundTasks
from Blocktrace.Networks import Wax
from Blocktrace.Streaming import stream_writer, publish_messages
app = FastAPI()
API_KEY = os.getenv("BT__API_KEY") or ""
GCP_PROJECT_ID = os.getenv("BT__GCP_PROJ... | 0 | 667 | 0 | 0 | 0 | 799 | 0 | 93 | 135 |
f245d7340956f5a4519687e8747eb806b6b1f7a9 | 2,544 | py | Python | src/diffsnn/popp/thinning.py | ibm-research-tokyo/diffsnn | 9299fc5e8542c6fde33a287f81e7ae3682b2fd9d | [
"Apache-2.0"
] | 20 | 2021-06-01T02:42:43.000Z | 2022-02-14T07:08:34.000Z | src/diffsnn/popp/thinning.py | ibm-research-tokyo/diffsnn | 9299fc5e8542c6fde33a287f81e7ae3682b2fd9d | [
"Apache-2.0"
] | null | null | null | src/diffsnn/popp/thinning.py | ibm-research-tokyo/diffsnn | 9299fc5e8542c6fde33a287f81e7ae3682b2fd9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Title '''
__author__ = 'Hiroshi Kajino <KAJINO@jp.ibm.com>'
__copyright__ = 'Copyright IBM Corp. 2020, 2021'
EPS = 1e-2
| 41.032258 | 82 | 0.608491 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Title '''
__author__ = 'Hiroshi Kajino <KAJINO@jp.ibm.com>'
__copyright__ = 'Copyright IBM Corp. 2020, 2021'
import math
import torch
from ..data import (EventSeq,
MultivariateEventSeq,
append_hidden)
from ..utils import complet... | 0 | 0 | 0 | 2,077 | 0 | 0 | 0 | 138 | 156 |
61b5cf4058bc359d31b1993b7454a6d576f40a1b | 2,320 | py | Python | downloader.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | downloader.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | downloader.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Specify youtube url to download audio from.")
parser.add_argument("--out", default="out", metavar="<FILENAME>", help="Specify name of output file.")
parser.add_argument("-verbose", action="sto... | 38.666667 | 191 | 0.658621 | import argparse
import subprocess
import os
import re
def cmdcall(command):
process = subprocess.Popen(command)
process.communicate()
def trimUrl(url):
trimmed_url = re.search(r'[^&]+', url).group()
print("[INFO]: Input URL trimmed to: {}".format(trimmed_url))
return trimmed_url
def isValidUrl(ur... | 0 | 0 | 0 | 0 | 0 | 1,602 | 0 | -28 | 158 |
261e351ade7c25413d564adb4e59ef72613cb9f9 | 2,045 | py | Python | tests/unit/tst_26.py | qrefine/qrefine | 016cac07a39e032c07f34384065dbd4756fe85f8 | [
"Apache-2.0"
] | 17 | 2016-01-13T02:22:26.000Z | 2021-04-03T18:58:43.000Z | tests/unit/tst_26.py | rajeevroy09/qrefine | 789cb6266d7a3055aea0ebb5a5f0a253680a97d0 | [
"Apache-2.0"
] | 78 | 2015-12-23T12:03:38.000Z | 2022-01-28T18:13:21.000Z | tests/unit/tst_26.py | rajeevroy09/qrefine | 789cb6266d7a3055aea0ebb5a5f0a253680a97d0 | [
"Apache-2.0"
] | 11 | 2017-04-04T04:10:25.000Z | 2021-04-13T08:54:54.000Z | import os
import run_tests
import libtbx.load_env
qrefine_path = libtbx.env.find_in_repositories("qrefine")
pdb_lines = '''
CRYST1 72.470 66.336 68.552 90.00 90.00 90.00 P 1
ATOM 387 N HIS A 30 62.619 25.986 37.359 1.00 66.84 N
ATOM 388 CA HIS A 30 63.258 26.030 36.050 ... | 44.456522 | 78 | 0.549144 | import os, sys
import run_tests
from libtbx import easy_run
import libtbx.load_env
qrefine_path = libtbx.env.find_in_repositories("qrefine")
pdb_lines = '''
CRYST1 72.470 66.336 68.552 90.00 90.00 90.00 P 1
ATOM 387 N HIS A 30 62.619 25.986 37.359 1.00 66.84 N
ATOM 388 CA HIS A ... | 0 | 0 | 0 | 0 | 0 | 228 | 0 | 11 | 45 |
5d973a87f39d560b2655e7710aee9c5c99bf2cd5 | 1,693 | py | Python | DataStructures/Hashing/ChainingHashing.py | Yarintop/Data-Structures-And-Algorithms-In-Python | 55db9e7f39211c42988171d51ef2659041df1aa1 | [
"MIT"
] | null | null | null | DataStructures/Hashing/ChainingHashing.py | Yarintop/Data-Structures-And-Algorithms-In-Python | 55db9e7f39211c42988171d51ef2659041df1aa1 | [
"MIT"
] | null | null | null | DataStructures/Hashing/ChainingHashing.py | Yarintop/Data-Structures-And-Algorithms-In-Python | 55db9e7f39211c42988171d51ef2659041df1aa1 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
h = ChainingHashing()
h.insert(1, 'a')
h.insert(2, 'b')
h.insert(3, 'c')
h.insert(3, 'd')
print(h[3])
| 28.694915 | 84 | 0.478441 | from HashFunctions import HashFunctions
class ChainingHashing:
def __init__(self, maxSize = 10000, hashFunction = HashFunctions.djb2a) -> None:
self.maxSize = maxSize
self.hash = [[]] * maxSize
self.hashFunction = hashFunction
def insert(self, key, data):
pos = self.hashFun... | 0 | 0 | 0 | 1,458 | 0 | 0 | 0 | 18 | 45 |
617675dd9196551a79d5a7317754b632108d6ec1 | 7,179 | py | Python | src/showbits.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | src/showbits.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | src/showbits.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | import warnings
import sys
def bits(v, numbits=None):
"""
Display the bits used to store an object
:param v: the value to display the bits of
:param numbits: the number of bits to display. Only used for int objects. bytes objects
always show the exact bits stored, and int objects d... | 33.863208 | 120 | 0.6246 | import warnings
import sys
def bits(v, numbits=None):
"""
Display the bits used to store an object
:param v: the value to display the bits of
:param numbits: the number of bits to display. Only used for int objects. bytes objects
always show the exact bits stored, and int objects d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
af9bb922f3751e526ef2ef2b4b54d0b758578ed4 | 296 | py | Python | Plots and Graphs/potassium_boxplot.py | archit-47/Predicting-Chronic-Kidney-Diseases | 6f0a1ca68302a8ef2c5ba15ae136a011faf97aab | [
"MIT"
] | null | null | null | Plots and Graphs/potassium_boxplot.py | archit-47/Predicting-Chronic-Kidney-Diseases | 6f0a1ca68302a8ef2c5ba15ae136a011faf97aab | [
"MIT"
] | null | null | null | Plots and Graphs/potassium_boxplot.py | archit-47/Predicting-Chronic-Kidney-Diseases | 6f0a1ca68302a8ef2c5ba15ae136a011faf97aab | [
"MIT"
] | null | null | null | import csv
import matplotlib.pyplot as plt
with open('idsfinal.csv',mode='r') as csv_file:
csv_reader=csv.DictReader(csv_file)
mydata=[]
for row in csv_reader:
mydata.append(float(row["pot"]))
plt.boxplot(mydata)
plt.ylabel("Potassium")
plt.title("Potassium distribution")
plt.show()
| 18.5 | 47 | 0.736486 | import csv
import matplotlib.pyplot as plt
with open('idsfinal.csv',mode='r') as csv_file:
csv_reader=csv.DictReader(csv_file)
mydata=[]
for row in csv_reader:
mydata.append(float(row["pot"]))
plt.boxplot(mydata)
plt.ylabel("Potassium")
plt.title("Potassium distribution")
plt.show()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a768a7c7b3a894f4c526eaefb45d9d4f53fb312d | 12,091 | py | Python | classify.py | rothadamg/UPSITE | 80cce9c9dfc097bb5aaecb0a0975e6a49fdf184c | [
"MIT"
] | null | null | null | classify.py | rothadamg/UPSITE | 80cce9c9dfc097bb5aaecb0a0975e6a49fdf184c | [
"MIT"
] | null | null | null | classify.py | rothadamg/UPSITE | 80cce9c9dfc097bb5aaecb0a0975e6a49fdf184c | [
"MIT"
] | 1 | 2018-12-21T04:12:59.000Z | 2018-12-21T04:12:59.000Z | #!/usr/bin/env python
"""
Detect events or relations from text.
"""
from train import workdir, getDetector, getSteps
import sys, os
import Utils.Settings as Settings
import Utils.Stream as Stream
import Utils.Download
from Detectors.Preprocessor import Preprocessor
def classify(input, model, output, workDir=None, ste... | 51.67094 | 200 | 0.648168 | #!/usr/bin/env python
"""
Detect events or relations from text.
"""
from train import workdir, getDetector, getSteps
import sys, os
import tempfile
import codecs
import Utils.Settings as Settings
import Utils.Stream as Stream
import Utils.Download
from Utils.Connection.Connection import getConnection
import Utils.Down... | 0 | 0 | 0 | 0 | 0 | 5,343 | 0 | 18 | 180 |
a59ded17348263bc8f03888d65350f5f62929739 | 26,195 | py | Python | pe_tree/runtime.py | lybtongji/pe_tree | 2be607fc55702293cd02cbc6cda5283452464aff | [
"Apache-2.0"
] | 1,271 | 2020-07-27T14:46:44.000Z | 2022-03-30T15:58:24.000Z | pe_tree/runtime.py | lybtongji/pe_tree | 2be607fc55702293cd02cbc6cda5283452464aff | [
"Apache-2.0"
] | 9 | 2020-08-04T13:23:38.000Z | 2021-05-18T16:53:49.000Z | pe_tree/runtime.py | lybtongji/pe_tree | 2be607fc55702293cd02cbc6cda5283452464aff | [
"Apache-2.0"
] | 168 | 2020-07-27T13:56:42.000Z | 2022-03-29T12:48:00.000Z | #
# Copyright (c) 2020 BlackBerry Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 31.790049 | 274 | 0.605001 | #
# Copyright (c) 2020 BlackBerry Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 0 | 14,957 | 0 | 10,031 | 0 | 0 | 0 | -6 | 252 |
41ab13b76744a888101fd6efde15e7403c131fa3 | 11,010 | py | Python | ion/services/sa/observatory/test/test_platform_instrument.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 3 | 2016-09-20T09:50:06.000Z | 2018-08-10T01:41:38.000Z | ion/services/sa/observatory/test/test_platform_instrument.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | null | null | null | ion/services/sa/observatory/test/test_platform_instrument.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 2 | 2016-03-16T22:25:49.000Z | 2016-11-26T14:54:21.000Z | #!/usr/bin/env python
"""
@package ion.services.sa.observatory.test.test_platform_instrument
@file ion/services/sa/observatory/test/test_platform_instrument.py
@author Carlos Rueda, Maurice Manning
@brief Tests involving some more detailed platform-instrument interations
"""
__author__ = 'Carlos Rueda, Maurice ... | 46.455696 | 239 | 0.679473 | #!/usr/bin/env python
"""
@package ion.services.sa.observatory.test.test_platform_instrument
@file ion/services/sa/observatory/test/test_platform_instrument.py
@author Carlos Rueda, Maurice Manning
@brief Tests involving some more detailed platform-instrument interations
"""
__author__ = 'Carlos Rueda, Maurice ... | 0 | 9,361 | 0 | 0 | 0 | 0 | 0 | 340 | 316 |
523193ed8dd76327553e190d697260b45a0f932f | 2,092 | py | Python | desktop/core/src/desktop/lib/test_export_csvxls.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/lib/test_export_csvxls.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/lib/test_export_csvxls.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 38.740741 | 79 | 0.718451 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 0 | 0 | 0 | 0 | 36 | 1,073 | 0 | 54 | 137 |
99936fb51ccf71b834427377bf4477143dd06b55 | 2,044 | py | Python | modules/process.py | hectorapp/hector-agent | 0d7ac3ab8b585aa2cd4effb7c218bb7830be18b7 | [
"BSD-3-Clause"
] | 1 | 2019-10-28T11:50:37.000Z | 2019-10-28T11:50:37.000Z | modules/process.py | hectorapp/hector-agent | 0d7ac3ab8b585aa2cd4effb7c218bb7830be18b7 | [
"BSD-3-Clause"
] | null | null | null | modules/process.py | hectorapp/hector-agent | 0d7ac3ab8b585aa2cd4effb7c218bb7830be18b7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
'''
* Author : Hutter Valentin
* Date : 13.05.2019
* Description : Hector agent monitoring
* Help :
- https://psutil.readthedocs.io/en/latest/#processes
- https://psutil.readthedocs.io/en/latest/#psutil.process_iter
- https://psutil.readthedocs.io/en/latest/#unic... | 37.851852 | 134 | 0.674658 | #!/usr/bin/env python
# coding: utf-8
'''
* Author : Hutter Valentin
* Date : 13.05.2019
* Description : Hector agent monitoring
* Help :
- https://psutil.readthedocs.io/en/latest/#processes
- https://psutil.readthedocs.io/en/latest/#psutil.process_iter
- https://psutil.readthedocs.io/en/latest/#unic... | 0 | 0 | 0 | 1,588 | 0 | 0 | 0 | -15 | 68 |
0127c03d824add7d490dbb30604454d0eb757174 | 668 | py | Python | support/shared_consts.py | victordalla/regression-diagnosis | d0dd04de0dac801726113a93f2a6c833307333ca | [
"MIT"
] | null | null | null | support/shared_consts.py | victordalla/regression-diagnosis | d0dd04de0dac801726113a93f2a6c833307333ca | [
"MIT"
] | null | null | null | support/shared_consts.py | victordalla/regression-diagnosis | d0dd04de0dac801726113a93f2a6c833307333ca | [
"MIT"
] | null | null | null | """
Constants used across all files
"""
# The constants in this file must be defined and checked by the user of the template
import numpy as np
seed = 0
true_params = {"b0": 6, "b1": 1.3, "scale": 50}
n = 300
x_min = -50
x_max = 100
np.random.seed(seed)
x_fix = np.random.uniform(x_min, x_max, n)
np.random.seed... | 23.034483 | 84 | 0.712575 | """
Constants used across all files
"""
# The constants in this file must be defined and checked by the user of the template
import numpy as np
from typing import Dict, List, Optional
from copy import deepcopy
from datetime import date
def from_dict_to_list(dictionary):
from itertools import chain
retu... | 0 | 0 | 0 | 0 | 0 | 90 | 0 | 26 | 90 |
a8589db975cc723af5c71c12006f483dccac9b7c | 14,387 | py | Python | dictionary/dict_yeelight.py | giuliapuntoit/RL-framework-iot | 1c0961f10f0477415198bbee94b6eb3272973004 | [
"MIT"
] | 5 | 2021-01-23T20:47:18.000Z | 2021-09-13T14:37:01.000Z | dictionary/dict_yeelight.py | SmartData-Polito/RL-IoT | d293c8410d6c2e8fcb56f96c346c519dd3a84a28 | [
"MIT"
] | null | null | null | dictionary/dict_yeelight.py | SmartData-Polito/RL-IoT | d293c8410d6c2e8fcb56f96c346c519dd3a84a28 | [
"MIT"
] | 1 | 2021-02-09T17:34:47.000Z | 2021-02-09T17:34:47.000Z | """
Class containing the dictionary for the Yeelight protocol
"""
# COMMAND message {id_pair, method_pair, params_pair}
# id_pair is "id":<number>
# method_pair is "method":"<method>"
# params_pair is "params":["<param1>","<param2>", <numeric_param3>]
# <param1> is "property":<property_value>
... | 42.190616 | 70 | 0.260443 | """
Class containing the dictionary for the Yeelight protocol
"""
# COMMAND message {id_pair, method_pair, params_pair}
# id_pair is "id":<number>
# method_pair is "method":"<method>"
# params_pair is "params":["<param1>","<param2>", <numeric_param3>]
# <param1> is "property":<property_value>
... | 0 | 0 | 0 | 13,901 | 0 | 0 | 0 | 0 | 23 |
e1350dcd5fec81e1aacfcd1ad5964e08627c60d1 | 2,641 | py | Python | _includes/ropes.py | hectorpefo/prepublication | 084a0b331e331f8a56c413bc63ea73c2744076da | [
"MIT"
] | 4 | 2019-02-17T22:26:28.000Z | 2022-03-03T11:23:37.000Z | _includes/ropes.py | hectorpefo/prepublication | 084a0b331e331f8a56c413bc63ea73c2744076da | [
"MIT"
] | null | null | null | _includes/ropes.py | hectorpefo/prepublication | 084a0b331e331f8a56c413bc63ea73c2744076da | [
"MIT"
] | 5 | 2017-02-27T22:34:54.000Z | 2020-10-26T01:23:06.000Z | # Rope Burning Riddler from fivethirtyeight.com
# Main program
# Numbers of ropes to do
MinRopes = 1
MaxRopes = 6
for N in range(MinRopes,MaxRopes+1):
# ropes is a list of pairs. each pair is: [ends-lit
# (0, 1, or 2), time (has been or will be) extinguished].
# We start with extinction time 0 as a dummy value.
... | 28.095745 | 66 | 0.678531 | # Rope Burning Riddler from fivethirtyeight.com
def explore(situation):
ropes = situation[0]
time = situation[1]
# Find unextinguished ropes and make a list of those
# with at least 1 unlit end.
allextinguished = True
ropestochoose = []
for r in range(N):
if ropes[r][1] == 0 or ropes[r][1] > time:
allex... | 0 | 0 | 0 | 0 | 0 | 1,824 | 0 | 0 | 23 |
d9a2e2115dcdf579f02fc328bcbd1f22a3326b91 | 1,818 | py | Python | src/predict.py | Akashcba/ML | 95ecf3e011dcbd6112a4e58312c1656b94e9414d | [
"MIT"
] | null | null | null | src/predict.py | Akashcba/ML | 95ecf3e011dcbd6112a4e58312c1656b94e9414d | [
"MIT"
] | null | null | null | src/predict.py | Akashcba/ML | 95ecf3e011dcbd6112a4e58312c1656b94e9414d | [
"MIT"
] | null | null | null | import os
import time
TEST_DATA = os.environ.get("TEST_DATA")
MODEL = os.environ.get("MODEL")
PATH = os.environ.get("MODEL_PATH")
NUM_FOLDS = int(os.environ.get("NUM_FOLDS"))
if __name__ == "__main__":
print("\nPridicting The Values ......")
time.sleep(7)
submission = predict(test_data_path=TEST_DATA, ... | 31.344828 | 111 | 0.628713 | import os
import pandas as pd
from sklearn import ensemble
from sklearn import preprocessing
from sklearn import metrics
import joblib
import numpy as np
import time
from . import dispatcher
TEST_DATA = os.environ.get("TEST_DATA")
MODEL = os.environ.get("MODEL")
PATH = os.environ.get("MODEL_PATH")
NUM_FOLDS = int(os... | 0 | 0 | 0 | 0 | 0 | 1,079 | 0 | 15 | 182 |
8ad92d5050c75dcd61e8facec28005990ce8c6a4 | 3,369 | py | Python | ackermann_vehicle_gazebo/scripts/commandEncoder.py | testville/ros_gazebo_car | c8e3d149df9f25756e3a002bf080d474e40ad57e | [
"Apache-2.0"
] | 2 | 2020-12-05T11:14:14.000Z | 2022-01-09T20:23:18.000Z | ackermann_vehicle_gazebo/scripts/commandEncoder.py | testville/ros_gazebo_car | c8e3d149df9f25756e3a002bf080d474e40ad57e | [
"Apache-2.0"
] | null | null | null | ackermann_vehicle_gazebo/scripts/commandEncoder.py | testville/ros_gazebo_car | c8e3d149df9f25756e3a002bf080d474e40ad57e | [
"Apache-2.0"
] | 1 | 2022-02-14T23:21:27.000Z | 2022-02-14T23:21:27.000Z | #!/usr/bin/env python
import rospy
if __name__ == '__main__':
rospy.loginfo('we are starting')
commandManager = CommandEncoder(300)
commandManager.provider()
| 45.527027 | 167 | 0.640843 | #!/usr/bin/env python
import rospy
import tf
import roslib
import random
import math
import copy as copy_module
from tf.transformations import euler_from_quaternion, quaternion_from_euler
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
from ackermann_msgs.msg i... | 0 | 0 | 0 | 2,870 | 0 | 0 | 0 | 105 | 223 |
ab583dfc0f7d74b79f55a79c04417e8e1f16a66f | 4,069 | py | Python | tests/unit/test_triton_inference.py | beingaryan/NVTabular | 126c8e38ffe77ce36a228079776410d97580f992 | [
"Apache-2.0"
] | 1 | 2021-08-31T08:21:09.000Z | 2021-08-31T08:21:09.000Z | tests/unit/test_triton_inference.py | beingaryan/NVTabular | 126c8e38ffe77ce36a228079776410d97580f992 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_triton_inference.py | beingaryan/NVTabular | 126c8e38ffe77ce36a228079776410d97580f992 | [
"Apache-2.0"
] | null | null | null | from distutils.spawn import find_executable
import pytest
import nvtabular.ops as ops
triton = pytest.importorskip("nvtabular.inference.triton")
grpcclient = pytest.importorskip("tritonclient.grpc")
tritonclient = pytest.importorskip("tritonclient")
_TRITON_SERVER_PATH = find_executable("tritonserver")
| 34.483051 | 92 | 0.657901 | import contextlib
import os
import signal
import subprocess
import time
from distutils.spawn import find_executable
import cudf
import pytest
from cudf.tests.utils import assert_eq
import nvtabular as nvt
import nvtabular.ops as ops
triton = pytest.importorskip("nvtabular.inference.triton")
grpcclient = pytest.impor... | 0 | 2,621 | 0 | 0 | 0 | 896 | 0 | -29 | 270 |