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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
536b19579d73c0e4cbe26e8ec01458806693f733 | 7,131 | py | Python | torch_em/trainer/spoco_trainer.py | JonasHell/torch-em | 2e008e0cd2f0ea6681581374fce4f9f47b986d55 | [
"MIT"
] | 13 | 2021-03-09T21:31:09.000Z | 2022-03-21T05:24:26.000Z | torch_em/trainer/spoco_trainer.py | JonasHell/torch-em | 2e008e0cd2f0ea6681581374fce4f9f47b986d55 | [
"MIT"
] | 16 | 2021-03-02T23:19:34.000Z | 2022-03-25T19:43:41.000Z | torch_em/trainer/spoco_trainer.py | JonasHell/torch-em | 2e008e0cd2f0ea6681581374fce4f9f47b986d55 | [
"MIT"
] | 4 | 2021-05-18T08:29:33.000Z | 2022-02-11T12:16:20.000Z | import torch.cuda.amp as amp
# TODO over-ride from_checkpoint, load_checkpoint to load the model
| 34.785366 | 106 | 0.565278 | import time
from copy import deepcopy
import torch
import torch.cuda.amp as amp
from .default_trainer import DefaultTrainer
# TODO over-ride from_checkpoint, load_checkpoint to load the model
class SPOCOTrainer(DefaultTrainer):
def __init__(
self,
momentum=0.999,
semisupervised_loss=None,... | 0 | 0 | 0 | 6,914 | 0 | 0 | 0 | 7 | 111 |
703a3f9b440734b6a25afbef9ad6c864c99b994a | 895 | py | Python | phr/establecimiento/migrations/0002_auto_20170301_1027.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/establecimiento/migrations/0002_auto_20170301_1027.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | phr/establecimiento/migrations/0002_auto_20170301_1027.py | richardqa/django-ex | e5b8585f28a97477150ac5daf5e55c74b70d87da | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-01 10:27
from __future__ import unicode_literals
| 33.148148 | 112 | 0.547486 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-01 10:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('establecimiento', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 716 | 0 | 0 | 0 | 19 | 46 |
29c3190e5b0129522f74862b7a3cbafbc7f9f0a7 | 2,653 | py | Python | tests/demos/demo_occurrence.py | xchaoinfo/pyhanlp | d61829a7aa35965e34ca0e220ee7f83bd3e8c5ed | [
"Apache-2.0"
] | 2,792 | 2018-03-19T10:24:23.000Z | 2022-03-29T07:46:53.000Z | pyhanlp-master/tests/demos/demo_occurrence.py | tianmingl/maincode | 724c60d5281ba3911ca065d9e144bb1b09e8257f | [
"MIT"
] | 50 | 2018-03-19T11:08:37.000Z | 2022-01-11T16:34:00.000Z | pyhanlp-master/tests/demos/demo_occurrence.py | tianmingl/maincode | 724c60d5281ba3911ca065d9e144bb1b09e8257f | [
"MIT"
] | 802 | 2018-03-19T11:08:49.000Z | 2022-03-22T07:20:26.000Z | # # -*- coding:utf-8 -*-
# Authorwancong
# Date: 2018-04-30
def demo_occurrence():
"""
>>> demo_occurrence()
=1
=1
=1
=2
=1
=1
=1
=1
=2
=1
=1
=1
<BLANKLINE>
= tf=1 mi=8.856243954648566 le=0.0 re=0.0 score=NaN
= tf=1 mi=6.594180024229758 le=0.0 re=0... | 31.583333 | 78 | 0.636261 | # # -*- coding:utf-8 -*-
# Author:wancong
# Date: 2018-04-30
from pyhanlp import *
def demo_occurrence():
""" 演示词共现统计
>>> demo_occurrence()
信息=1
先进=1
图形图像=1
处理=2
技术=1
方面=1
比较=1
目前=1
算法=2
视频=1
计算机=1
音视频=1
<BLANKLINE>
信息→算法= tf=1 mi=8.856243954648566 le=0... | 753 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
3b5cf92137e1601c582231c1c599e8e265977d4a | 8,297 | py | Python | modulegraph2/__main__.py | xoviat/modulegraph2 | 766d00bdb40e5b2fe206b53a87b1bce3f9dc9c2a | [
"MIT"
] | 9 | 2020-03-22T14:48:01.000Z | 2021-05-30T12:18:12.000Z | modulegraph2/__main__.py | xoviat/modulegraph2 | 766d00bdb40e5b2fe206b53a87b1bce3f9dc9c2a | [
"MIT"
] | 15 | 2020-01-06T10:02:32.000Z | 2021-05-28T12:22:44.000Z | modulegraph2/__main__.py | ronaldoussoren/modulegraph2 | b6ab1766b0098651b51083235ff8a18a5639128b | [
"MIT"
] | 4 | 2020-05-10T18:51:41.000Z | 2021-04-07T14:03:12.000Z | """
Commandline interface
"""
import argparse
import functools
import sys
from typing import Dict, Iterator, List, Sequence, Set, TextIO, Tuple, Union
from . import __version__
from ._depinfo import DependencyInfo
from ._dotbuilder import export_to_dot
from ._htmlbuilder import export_to_html
from ._modulegraph import... | 25.529231 | 85 | 0.608895 | """
Commandline interface
"""
import argparse
import enum
import functools
import sys
from typing import Dict, Iterator, List, Sequence, Set, TextIO, Tuple, Union
from . import __version__
from ._depinfo import DependencyInfo
from ._dotbuilder import export_to_dot
from ._htmlbuilder import export_to_html
from ._module... | 0 | 315 | 0 | 0 | 0 | 0 | 0 | -10 | 68 |
1db2eb94b0713500548e3361a2328f3d56f43d29 | 533 | py | Python | Python/algorithm/List/card_count/card_count.py | sug5806/TIL | 2309d8a270e4a7b8961268a40b6492c5db317e37 | [
"MIT"
] | null | null | null | Python/algorithm/List/card_count/card_count.py | sug5806/TIL | 2309d8a270e4a7b8961268a40b6492c5db317e37 | [
"MIT"
] | 102 | 2020-02-12T00:10:33.000Z | 2022-03-11T23:58:41.000Z | Python/algorithm/List/card_count/card_count.py | sug5806/TIL | 2309d8a270e4a7b8961268a40b6492c5db317e37 | [
"MIT"
] | null | null | null | import sys
sys.stdin = open("card_count_sample_input.txt", "r")
T = int(input())
# , .
for test_case in range(1, T + 1):
cnt = []
card_li = []
num = int(input())
card_num = input()
idx = 0
for i in card_num:
card_li.append(i)
cnt = [0 for _ in range(10)]
for i in rang... | 20.5 | 52 | 0.514071 | import sys
sys.stdin = open("card_count_sample_input.txt", "r")
T = int(input())
# 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다.
for test_case in range(1, T + 1):
cnt = []
card_li = []
num = int(input())
card_num = input()
idx = 0
for i in card_num:
card_li.append(i)
cnt = [0 for _ in range... | 72 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3df950a957a2e60055873b713e7859fff912e396 | 1,275 | py | Python | django/user/migrations/0005_auto_20181209_1322.py | justaname94/bank-app | d16977a3fc8edc52c4271ee24521e543d981cd8a | [
"MIT"
] | 1 | 2018-12-10T00:51:32.000Z | 2018-12-10T00:51:32.000Z | django/user/migrations/0005_auto_20181209_1322.py | justaname94/bank-app | d16977a3fc8edc52c4271ee24521e543d981cd8a | [
"MIT"
] | null | null | null | django/user/migrations/0005_auto_20181209_1322.py | justaname94/bank-app | d16977a3fc8edc52c4271ee24521e543d981cd8a | [
"MIT"
] | null | null | null | # Generated by Django 2.1.4 on 2018-12-09 17:22
| 36.428571 | 218 | 0.614118 | # Generated by Django 2.1.4 on 2018-12-09 17:22
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0004_auto_20181209_1222'),
]
operations = [
migrations.AlterField(
model_name='profile',
... | 0 | 0 | 0 | 1,131 | 0 | 0 | 0 | 27 | 68 |
5c81848434a081a57f30e17c32c0549ee332a67b | 1,017 | py | Python | demo.py | kkristof200/ColoredLogs | 85fa58884f2547559b4842c7bd23e2b98042e200 | [
"MIT"
] | 35 | 2020-05-02T18:25:01.000Z | 2020-05-03T14:40:58.000Z | demo.py | kkristof200/ColoredLogs | 85fa58884f2547559b4842c7bd23e2b98042e200 | [
"MIT"
] | 10 | 2020-05-03T20:40:50.000Z | 2020-05-12T23:02:46.000Z | demo.py | kkristof200/ColoredLogs | 85fa58884f2547559b4842c7bd23e2b98042e200 | [
"MIT"
] | 5 | 2020-05-04T03:17:44.000Z | 2022-03-24T15:38:03.000Z | import time
from colored_logs.logger import Logger, LogType#, LogEnvironmeent
log = Logger(
ID='Test-id-1'
# environment=LogEnvironmeent.HTML, # Override to print html logs
# console_line_char_len=90 # Optionally provide how many chars does fir in one consolee line
)
log.info('This is an info ... | 24.214286 | 106 | 0.718781 | import time
from colored_logs.logger import Logger, LogType#, LogEnvironmeent
log = Logger(
ID='Test-id-1'
# environment=LogEnvironmeent.HTML, # Override to print html logs
# console_line_char_len=90 # Optionally provide how many chars does fir in one consolee line
)
log.info('This is an info ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0759dbd681cb3ae35f9fc403c73bea6b637c87d0 | 306 | py | Python | DQM/L1TMonitor/python/L1TBMTFAlgoSelector_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/L1TMonitor/python/L1TBMTFAlgoSelector_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/L1TMonitor/python/L1TBMTFAlgoSelector_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
l1tBmtfAlgoSelector = cms.EDProducer(
'L1TBMTFAlgoSelector',
# verbose = cms.untracked.bool(False),
bmtfKalman = cms.InputTag("simKBmtfDigis:BMTF"),
bmtfLegacy = cms.InputTag("simBmtfDigis:BMTF"),
feds = cms.InputTag("rawDataCollector")
)
| 27.818182 | 52 | 0.718954 | import FWCore.ParameterSet.Config as cms
l1tBmtfAlgoSelector = cms.EDProducer(
'L1TBMTFAlgoSelector',
# verbose = cms.untracked.bool(False),
bmtfKalman = cms.InputTag("simKBmtfDigis:BMTF"),
bmtfLegacy = cms.InputTag("simBmtfDigis:BMTF"),
feds = cms.InputTag("rawDataCollector")
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
293cf35b3d207e747690e331ae2cf36c16fb275c | 179 | py | Python | GameDB/DBCore.py | sak9188/PythonGameServer | fb4b95b7cc2b04a4236bbb1af1dd3e28e11afc39 | [
"Apache-2.0"
] | null | null | null | GameDB/DBCore.py | sak9188/PythonGameServer | fb4b95b7cc2b04a4236bbb1af1dd3e28e11afc39 | [
"Apache-2.0"
] | null | null | null | GameDB/DBCore.py | sak9188/PythonGameServer | fb4b95b7cc2b04a4236bbb1af1dd3e28e11afc39 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
| 25.571429 | 84 | 0.715084 | # -*- coding: UTF-8 -*-
import MySQLdb
def create_connet(host, user, passwd, db, charset):
return MySQLdb.connect(host=host, user=user, passwd=passwd, db=db, charset=charset)
| 0 | 0 | 0 | 0 | 0 | 115 | 0 | -7 | 47 |
7a6f16ceff7075d8b549a9321d6c5b87822646eb | 1,302 | py | Python | DartFootProject/bipedJump/main.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | 2 | 2020-03-16T05:43:56.000Z | 2021-11-22T05:52:29.000Z | DartFootProject/bipedJump/main.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | DartFootProject/bipedJump/main.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | import sys
import pydart
import math
import controller
print('Example: bipedJump')
pydart.init()
print('pydart initialization OK')
data_dir = pydart.misc.example_data_dir(__file__)
print('data_dir = ' + data_dir)
world = pydart.create_world(1.0 / 2000.0, data_dir + '/skel/fullbody1.skel')
print('pydart create_world... | 26.571429 | 78 | 0.642857 | import sys
import pydart
import math
import controller
print('Example: bipedJump')
pydart.init()
print('pydart initialization OK')
data_dir = pydart.misc.example_data_dir(__file__)
print('data_dir = ' + data_dir)
world = pydart.create_world(1.0 / 2000.0, data_dir + '/skel/fullbody1.skel')
print('pydart create_world... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa72f872a14a122b654f5e3f703156efe0ba60b7 | 1,334 | py | Python | evolver.py | sonnhfit/xedien | c87bf031db87f37d0a2f24de85c7764cb396819c | [
"MIT"
] | 44 | 2017-12-21T01:21:55.000Z | 2021-12-13T10:20:27.000Z | evolver.py | ChandlerGeller/VRPTW-ga | e130428d9262c8df1db4d8d4ff730c381e1ad4c6 | [
"MIT"
] | 1 | 2020-09-10T06:09:34.000Z | 2020-09-10T06:09:53.000Z | evolver.py | ChandlerGeller/VRPTW-ga | e130428d9262c8df1db4d8d4ff730c381e1ad4c6 | [
"MIT"
] | 20 | 2018-01-25T09:46:46.000Z | 2022-03-07T03:02:32.000Z | import population
from nodes import Deport, Customer, CustomerDistanceTable
from csv_reader import csv_read
import ga_params
population.Chromosome = Chromosome
run_file_name = input("Enter run file name [default: C101_200]: ")
if not run_file_name:
run_file_name = ga_params.run_file['name']
print('Running: "' +... | 32.536585 | 116 | 0.769865 | from chromosome import Chromosome as BaseChromosome
import population
from nodes import Deport, Customer, CustomerDistanceTable
from csv_reader import csv_read
import ga_params
class Chromosome(BaseChromosome):
@staticmethod
def get_distance(source: int, dest: int) -> float:
global customers_distance_... | 0 | 279 | 0 | 12 | 0 | 0 | 0 | 30 | 98 |
eaad0a24835defe24b250342a36eb2d8766bcadb | 2,887 | py | Python | examples/rasterizer.py | rdeioris/compushady | a9b01fda5a0439a2296c124cd5cd615ed9a34ece | [
"MIT"
] | 17 | 2022-03-07T15:32:17.000Z | 2022-03-29T18:59:55.000Z | examples/rasterizer.py | rdeioris/compushady | a9b01fda5a0439a2296c124cd5cd615ed9a34ece | [
"MIT"
] | null | null | null | examples/rasterizer.py | rdeioris/compushady | a9b01fda5a0439a2296c124cd5cd615ed9a34ece | [
"MIT"
] | 1 | 2022-03-19T11:27:19.000Z | 2022-03-19T11:27:19.000Z | import glfw
import compushady.config
import compushady.formats
import compushady
from compushady.shaders import hlsl
import struct
import platform
compushady.config.set_debug(True)
print('Using device', compushady.get_current_device().name)
buffer = compushady.Buffer(512 * 512 * 4, compushady.HEAP_UPLOAD)
buffer.upl... | 29.161616 | 105 | 0.682369 | import glfw
import compushady.config
import compushady.formats
import compushady
from compushady.shaders import hlsl
import struct
import platform
compushady.config.set_debug(True)
print('Using device', compushady.get_current_device().name)
buffer = compushady.Buffer(512 * 512 * 4, compushady.HEAP_UPLOAD)
buffer.upl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
da6113a188c903023a7d37426db0bf52105b08f5 | 14,868 | py | Python | bibframe/ingesters/tutt_maps.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 2 | 2015-03-30T16:36:51.000Z | 2016-06-15T01:39:47.000Z | bibframe/ingesters/tutt_maps.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 2 | 2021-06-10T17:43:54.000Z | 2021-12-13T19:40:08.000Z | bibframe/ingesters/tutt_maps.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 1 | 2015-11-08T00:40:11.000Z | 2015-11-08T00:40:11.000Z | #
# Tutt library III location codes
#
FULL_CODE_MAP = {
'dacc': 'Digital Archives of Colorado College',
'ewww':'Online',
'ewwwd':'Online Government Documents',
'ewwwp':'Online Periodcals',
'ewwwn':'Online',
'tarf':'Tutt Reference',
'tarfa':'Tutt 1st Floor South',
'tarfc':'Tutt Reference... | 40.292683 | 70 | 0.615079 | #
# Tutt library III location codes
#
FULL_CODE_MAP = {
'dacc': 'Digital Archives of Colorado College',
'ewww':'Online',
'ewwwd':'Online Government Documents',
'ewwwp':'Online Periodcals',
'ewwwn':'Online',
'tarf':'Tutt Reference',
'tarfa':'Tutt 1st Floor South',
'tarfc':'Tutt Reference... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
24eb80326a6de0ef9acfe7e2f087d53d4c3eb20b | 2,073 | py | Python | portal/lib/dart/portal/blueprints/main/views.py | plockaby/dart | 43f8e471759fb05d9fdfce522ec9976e1e77ee08 | [
"Artistic-2.0"
] | 2 | 2021-06-10T19:18:12.000Z | 2021-11-03T00:35:44.000Z | portal/lib/dart/portal/blueprints/main/views.py | plockaby/dart | 43f8e471759fb05d9fdfce522ec9976e1e77ee08 | [
"Artistic-2.0"
] | null | null | null | portal/lib/dart/portal/blueprints/main/views.py | plockaby/dart | 43f8e471759fb05d9fdfce522ec9976e1e77ee08 | [
"Artistic-2.0"
] | 1 | 2021-10-05T09:52:34.000Z | 2021-10-05T09:52:34.000Z | from ... import requests as r
import dart.common
| 24.678571 | 103 | 0.630487 | from ...app import cache
from ... import requests as r
from . import main
from flask import render_template
from datetime import datetime
import dart.common
import dart.common.html
@main.route("/")
def index():
hosts = r.select_hosts()
processes = r.select_processes()
now = datetime.now()
return rend... | 0 | 1,748 | 0 | 0 | 0 | 0 | 0 | 22 | 248 |
bc51d45abc9bc27fd478ec8b3cc33c82ad20a253 | 3,781 | py | Python | blocklist_aggregator/aggregator.py | dmachard/blocklist-aggregator | 26ad7aaad9f0f0cb3c8da5fa79d25d6ca71af8f5 | [
"MIT"
] | 3 | 2020-11-08T23:15:05.000Z | 2021-01-01T07:48:34.000Z | blocklist_aggregator/aggregator.py | dmachard/blocklist-aggregator | 26ad7aaad9f0f0cb3c8da5fa79d25d6ca71af8f5 | [
"MIT"
] | null | null | null | blocklist_aggregator/aggregator.py | dmachard/blocklist-aggregator | 26ad7aaad9f0f0cb3c8da5fa79d25d6ca71af8f5 | [
"MIT"
] | null | null | null |
import sys
import yaml
import pkgutil
import requests
import logging
import re
from datetime import date
def percent_list(part_list, whole_list):
"""return percent of the part"""
w = len(whole_list)
if not w:
return (w,0)
p = 100 * float(len(part_list))/float(w)
return (w,round(100-p, 2))
... | 30.739837 | 93 | 0.612007 |
import sys
import yaml
import pkgutil
import requests
import logging
import re
import os
from datetime import date
def percent_list(part_list, whole_list):
"""return percent of the part"""
w = len(whole_list)
if not w:
return (w,0)
p = 100 * float(len(part_list))/float(w)
return (w,round(1... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
5b1ea51a4c5192c5a8961c52874a45304677a105 | 2,074 | py | Python | scripts/analytics/user_domain_events.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | scripts/analytics/user_domain_events.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | scripts/analytics/user_domain_events.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | import logging
from dateutil.parser import parse
from website.app import init_app
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
if __name__ == '__main__':
init_app()
user_domain_events = UserDomainEvents()
args = user_domain_events.parse_args()
date = parse(args.date)... | 32.40625 | 112 | 0.66297 | import pytz
import logging
from dateutil.parser import parse
from datetime import datetime, timedelta
from django.db.models import Q
from osf.models import OSFUser
from website.app import init_app
from framework.database import paginated
from scripts.analytics.base import EventAnalytics
logger = logging.getLogger(__... | 0 | 55 | 0 | 1,299 | 0 | 23 | 0 | 74 | 180 |
b16b6dc268c649a74e164129e4b007b511d72568 | 1,593 | py | Python | mp/urls.py | david19871027/education_site | 2599d6a2fee65db82c203511c3e10732efe06b04 | [
"MIT"
] | null | null | null | mp/urls.py | david19871027/education_site | 2599d6a2fee65db82c203511c3e10732efe06b04 | [
"MIT"
] | null | null | null | mp/urls.py | david19871027/education_site | 2599d6a2fee65db82c203511c3e10732efe06b04 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
from front.views import (teacherprofile, studentprofile, recieve_comment, searchoffer, searchneed, home, comment_posted... | 33.1875 | 91 | 0.706215 | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib import admin
from front.views import (
teacherprofile,
studentprofile,
recieve_comment,
searchoffer,
searchneed,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0 |
d5f36c044859ab16b2e52d49e74d127a105b1238 | 980 | py | Python | setup.py | sitaochen/OLSQ | 59ef01ec184e05f866cabea7178c68cdda6bee3c | [
"BSD-3-Clause"
] | 13 | 2020-07-30T17:36:58.000Z | 2022-03-28T07:14:25.000Z | setup.py | sitaochen/OLSQ | 59ef01ec184e05f866cabea7178c68cdda6bee3c | [
"BSD-3-Clause"
] | 2 | 2021-01-11T02:55:02.000Z | 2021-07-20T05:38:14.000Z | setup.py | sitaochen/OLSQ | 59ef01ec184e05f866cabea7178c68cdda6bee3c | [
"BSD-3-Clause"
] | 7 | 2020-07-30T17:37:03.000Z | 2021-05-31T20:51:29.000Z | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="olsq",
version="0.0.4",
license = "BSD",
author="Daniel Bochen Tan",
author_email="bctan@cs.ucla.edu",
description="Optimal Layout Synthesis for Quantum Computing (OL... | 30.625 | 116 | 0.635714 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="olsq",
version="0.0.4",
license = "BSD",
author="Daniel Bochen Tan",
author_email="bctan@cs.ucla.edu",
description="Optimal Layout Synthesis for Quantum Computing (OL... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c7f826f96ac8b5a93a38397ee0869b8b1150e956 | 956 | py | Python | operators/script_call_blend.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 17 | 2021-11-21T09:26:55.000Z | 2022-03-09T06:56:01.000Z | operators/script_call_blend.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 1 | 2021-12-05T13:02:48.000Z | 2021-12-06T08:02:34.000Z | operators/script_call_blend.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 4 | 2021-11-23T14:49:34.000Z | 2021-12-30T15:04:58.000Z | import sys
if __name__ == "__main__":
if "--" not in sys.argv:
argv = [] # as if no args are passed
else:
argv = sys.argv[sys.argv.index("--") + 1:] # get all args after "--"
main(argv)
| 23.317073 | 77 | 0.553347 | import argparse
import bpy
import sys
def main(args):
print("Script args: ", args)
if len(args) > 0:
parser = argparse.ArgumentParser()
parser.add_argument('blend')
parser.add_argument('--pack', action='append')
args = parser.parse_args(args)
blend = args.blend
... | 0 | 0 | 0 | 0 | 0 | 687 | 0 | -17 | 67 |
dd905eb9ff7b99f6e1665e9c5309c1222eb905eb | 36 | py | Python | primeirosProgramas/testeCores.py | LucasHenrique-dev/Exercicios-Python | b1f6ca56ea8e197a89a044245419dc6079bdb9c7 | [
"MIT"
] | 1 | 2020-04-09T23:18:03.000Z | 2020-04-09T23:18:03.000Z | primeirosProgramas/testeCores.py | LucasHenrique-dev/Exercicios-Python | b1f6ca56ea8e197a89a044245419dc6079bdb9c7 | [
"MIT"
] | null | null | null | primeirosProgramas/testeCores.py | LucasHenrique-dev/Exercicios-Python | b1f6ca56ea8e197a89a044245419dc6079bdb9c7 | [
"MIT"
] | null | null | null | print('\033[7;30mOl Mundo!\033[m')
| 18 | 35 | 0.666667 | print('\033[7;30mOlá Mundo!\033[m')
| 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b613ac7fb0508db764262c57f48c66b7996c738c | 1,858 | py | Python | examples/simple_ffa_run_json.py | RMichaelSwan/Pommerman | 0fbec650606df9ab95c2513fed7d5a49d54268a5 | [
"Apache-2.0"
] | null | null | null | examples/simple_ffa_run_json.py | RMichaelSwan/Pommerman | 0fbec650606df9ab95c2513fed7d5a49d54268a5 | [
"Apache-2.0"
] | 1 | 2019-11-26T22:35:50.000Z | 2019-11-26T22:35:50.000Z | examples/simple_ffa_run_json.py | RMichaelSwan/Pommerman | 0fbec650606df9ab95c2513fed7d5a49d54268a5 | [
"Apache-2.0"
] | 2 | 2019-11-16T00:08:08.000Z | 2019-11-27T02:27:12.000Z | '''An example to show how to set up an pommerman game programmatically'''
import pommerman
from pommerman import agents
import sys
sys.path.append("../pommerman")
import fight
def main():
'''Simple function to bootstrap a game.
Use this as an example to set up your training env.
'''
# Print ... | 33.781818 | 162 | 0.642088 | '''An example to show how to set up an pommerman game programmatically'''
import pommerman
from pommerman import agents
import sys
sys.path.append("../pommerman")
import fight
def main():
'''Simple function to bootstrap a game.
Use this as an example to set up your training env.
'''
# Print ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc98bab515a6ca3356996030a6190e794ca77766 | 1,068 | py | Python | onlinemarket-main/api/migrations/0001_initial.py | gungorahmet/django-rest-framework-online-market | bffbca496cae78631d33bf8e2eee04bb21d39777 | [
"MIT"
] | null | null | null | onlinemarket-main/api/migrations/0001_initial.py | gungorahmet/django-rest-framework-online-market | bffbca496cae78631d33bf8e2eee04bb21d39777 | [
"MIT"
] | 5 | 2020-06-06T00:12:41.000Z | 2021-06-09T18:34:12.000Z | onlinemarket-main/api/migrations/0001_initial.py | gungorahmet/django-rest-framework-online-market | bffbca496cae78631d33bf8e2eee04bb21d39777 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-28 20:09
| 34.451613 | 114 | 0.57397 | # Generated by Django 2.2.6 on 2019-10-28 20:09
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(... | 0 | 0 | 0 | 954 | 0 | 0 | 0 | 19 | 46 |
af9920e297c6a6d78e7630483e3d0e391deb63e1 | 987 | py | Python | arpq/message.py | ModBayNet/arpq | 9df1d36fde298163a0a57d1936ca2eb16cd8f9c3 | [
"MIT"
] | 1 | 2020-07-10T18:28:03.000Z | 2020-07-10T18:28:03.000Z | arpq/message.py | ModBayNet/arpq | 9df1d36fde298163a0a57d1936ca2eb16cd8f9c3 | [
"MIT"
] | null | null | null | arpq/message.py | ModBayNet/arpq | 9df1d36fde298163a0a57d1936ca2eb16cd8f9c3 | [
"MIT"
] | null | null | null | from __future__ import annotations
| 25.307692 | 87 | 0.64539 | from __future__ import annotations
from typing import Any
from .abc import ABCEncoder
class Message:
"""Message returned from queue. Should not be created manually."""
__slots__ = frozenset(("_priority", "_data"))
def __init__(self, priority: int, data: Any):
self._priority = priority
... | 0 | 421 | 0 | 454 | 0 | 0 | 0 | 7 | 69 |
b8a61d0779a3255ab4c0fce47303a61e08f137d0 | 1,141 | py | Python | problem_10/problem_10.py | CaioTeixeira95/Euler | 90e98f4110b7e6dc7d36f53eea0b22cf455ac005 | [
"MIT"
] | null | null | null | problem_10/problem_10.py | CaioTeixeira95/Euler | 90e98f4110b7e6dc7d36f53eea0b22cf455ac005 | [
"MIT"
] | null | null | null | problem_10/problem_10.py | CaioTeixeira95/Euler | 90e98f4110b7e6dc7d36f53eea0b22cf455ac005 | [
"MIT"
] | null | null | null |
MAX_VALUE = 2_000_000
THREADS = 50
size = MAX_VALUE // THREADS
childrens = []
if __name__ == "__main__":
main() | 21.12963 | 70 | 0.535495 | import math
import concurrent.futures
from functools import partial
def is_prime(n: int) -> bool:
if n == 2:
return True
if n < 2 or n % 2 == 0:
return False
for i in range(3, int(math.sqrt(n)) + 1, 2):
if n % i == 0:
return False
return True
def calculate(_from: ... | 0 | 0 | 0 | 0 | 0 | 881 | 0 | 2 | 135 |
000b41a596dcb342430d8aa0823516577d73f0ad | 7,126 | py | Python | Unet-liverCT-master/Index.py | Breeze1in1drizzle/MedicalImaging-Master | adf1c4015f03e24f4cb17f6624370de3b0a88210 | [
"MIT"
] | null | null | null | Unet-liverCT-master/Index.py | Breeze1in1drizzle/MedicalImaging-Master | adf1c4015f03e24f4cb17f6624370de3b0a88210 | [
"MIT"
] | null | null | null | Unet-liverCT-master/Index.py | Breeze1in1drizzle/MedicalImaging-Master | adf1c4015f03e24f4cb17f6624370de3b0a88210 | [
"MIT"
] | 1 | 2020-04-22T06:13:17.000Z | 2020-04-22T06:13:17.000Z | import matplotlib
matplotlib.use("TkAgg")
LARGE_FONT = ("Verdana", 12)
if __name__ == '__main__':
app = Main()
app.mainloop()
| 37.308901 | 155 | 0.619422 | import matplotlib
matplotlib.use("TkAgg")
import tkinter as tk
from tkinter import ttk
import cv2
from tkinter.filedialog import *
import tkinter.font as tkFont
from tkinter.ttk import Treeview
import time
from PIL import Image, ImageTk
import threading
from test import *
LARGE_FONT = ("Verdana", 12)
import random
cla... | 309 | 0 | 0 | 6,620 | 0 | 0 | 0 | 3 | 265 |
9c0fd58bf92742b78bda3a6c408fe005900d27a7 | 2,541 | py | Python | InfoHandler.py | k783s4/Vertretungsplan | f432ba0afa1219a4f9cf6ff356122097badd128b | [
"Apache-2.0"
] | 1 | 2018-11-24T23:32:56.000Z | 2018-11-24T23:32:56.000Z | InfoHandler.py | k783s4/Vertretungsplan | f432ba0afa1219a4f9cf6ff356122097badd128b | [
"Apache-2.0"
] | null | null | null | InfoHandler.py | k783s4/Vertretungsplan | f432ba0afa1219a4f9cf6ff356122097badd128b | [
"Apache-2.0"
] | null | null | null | #This program gets the input from the DSB server and processes, then saves it so they can be used by Bot.js
print("STARTING SERVICE....")
import requests
import time
import json
import os
print("LOADING COMPLETE")
print("GETTING DATA")
#PATH OF FILE TO OCR
subscription_key = ""
FILEPATH = "/Users/leonardo/Desktop/ind... | 34.808219 | 107 | 0.700512 | #This program gets the input from the DSB server and processes, then saves it so they can be used by Bot.js
print("STARTING SERVICE....")
from PIL import Image
import urllib.request
import requests
import base64
import filecmp
import time
import json
import os
print("LOADING COMPLETE")
print("GETTING DATA")
#PATH OF F... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -15 | 88 |
22f44800457916f98a750134dca5818dde27be78 | 1,849 | py | Python | app/views/facgov.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | null | null | null | app/views/facgov.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | 1 | 2021-04-20T14:56:31.000Z | 2021-04-20T14:56:31.000Z | app/views/facgov.py | tg2648/cu-reports-app | 851388320be9382d56c0dbdc89c26f761b4e3e7e | [
"MIT"
] | null | null | null | """
Repository of various documents
"""
# Third party imports
from flask import Blueprint
# Local application imports
bp = Blueprint('facgov', __name__, url_prefix='/faculty_governance')
| 31.338983 | 99 | 0.683072 | """
Repository of various documents
"""
# Third party imports
from flask import Blueprint
from flask import Response
from flask import redirect
from flask import current_app
from flask_cas import login_required
# Local application imports
from app.users import User
from app.utils.jinja_filters import file_name, file_... | 0 | 1,325 | 0 | 0 | 0 | 0 | 0 | 133 | 199 |
3f933476e3f52583e41aac265b29a79919a328da | 13,217 | py | Python | code/model/unet/old/resnet.py | fegonda/icon_demo | d2d1b0148989187c1433597f9c3ae4357178c082 | [
"MIT"
] | null | null | null | code/model/unet/old/resnet.py | fegonda/icon_demo | d2d1b0148989187c1433597f9c3ae4357178c082 | [
"MIT"
] | null | null | null | code/model/unet/old/resnet.py | fegonda/icon_demo | d2d1b0148989187c1433597f9c3ae4357178c082 | [
"MIT"
] | null | null | null | # https://raw.githubusercontent.com/raghakot/keras-resnet/master/resnet.py
import os
from keras.optimizers import SGD
from keras.models import Model, model_from_json
from keras.layers import (Input, Activation, merge, Dense, Flatten)
from keras.layers.convolutional import (Convolution2D, MaxPooling2D, AveragePooling2D... | 38.988201 | 140 | 0.66021 | # https://raw.githubusercontent.com/raghakot/keras-resnet/master/resnet.py
import os
from keras.optimizers import SGD
from keras.models import Model, model_from_json
from keras.layers import (
Input,
Activation,
merge,
Dense,
Flatten
)
from keras.layers.convolutional import (
Convolution2D,
... | 0 | 0 | 0 | 0 | 0 | 7,773 | 0 | 42 | 221 |
315f7497d70acbca290e0b4accc8dc495f9bf8bb | 694 | py | Python | SQLi/Lab1.py | pknaul/Portswigger-Lab | e198f7025a77e36bb9b95c7c8ae48121c38f9451 | [
"MIT"
] | null | null | null | SQLi/Lab1.py | pknaul/Portswigger-Lab | e198f7025a77e36bb9b95c7c8ae48121c38f9451 | [
"MIT"
] | null | null | null | SQLi/Lab1.py | pknaul/Portswigger-Lab | e198f7025a77e36bb9b95c7c8ae48121c38f9451 | [
"MIT"
] | null | null | null | url = "https://ac141f861ea930df80a3036f00f10064.web-security-academy.net/filter?category=Accessories"
if __name__ == '__main__':
col_no = get_cols_no(url, 1, 10) | 36.526316 | 102 | 0.60951 | import requests
from pwn import *
url = "https://ac141f861ea930df80a3036f00f10064.web-security-academy.net/filter?category=Accessories"
def get_cols_no(url, lo, hi):
if hi - lo <= 1:
log.success("Found {}".format(lo))
return lo
mid = (lo + hi) // 2
new_url = url + '\' order by {}--'.... | 0 | 0 | 0 | 0 | 0 | 466 | 0 | -10 | 69 |
de909946ca437643bfc2954bdee57fa2fdb77491 | 710 | py | Python | kcode/kcore/_Kobj.py | Leopardob/Kistie | 3ea4e2a4899b852e01171ebad2a638a177ad965d | [
"BSD-3-Clause"
] | 8 | 2016-03-10T23:31:18.000Z | 2021-01-16T06:29:21.000Z | kcode/kcore/_Kobj.py | Leopardob/Kistie | 3ea4e2a4899b852e01171ebad2a638a177ad965d | [
"BSD-3-Clause"
] | 1 | 2016-03-11T10:20:07.000Z | 2016-03-11T10:27:28.000Z | kcode/kcore/_Kobj.py | Leopardob/Kistie | 3ea4e2a4899b852e01171ebad2a638a177ad965d | [
"BSD-3-Clause"
] | 1 | 2020-02-03T21:39:03.000Z | 2020-02-03T21:39:03.000Z | '''
K.I.S.T.I.E (Keep, It, Simple, Take, It, Easy)
Created on 1 Jan 2013
@author: Leonardo Bruni, leo.b2003@gmail.com
Kistie Maya Module Library
This Kistie implementation i's part of project 'Kistie_Autorig' by Leonardo Bruni, leo.b2003@gmail.com
'''
#ToDo: implement a debug mode for print or not
import maya.cmds as ... | 29.583333 | 102 | 0.643662 | '''
K.I.S.T.I.E (Keep, It, Simple, Take, It, Easy)
Created on 1 Jan 2013
@author: Leonardo Bruni, leo.b2003@gmail.com
Kistie Maya Module Library
This Kistie implementation i's part of project 'Kistie_Autorig' by Leonardo Bruni, leo.b2003@gmail.com
'''
#ToDo: implement a debug mode for print or not
import pymel as pm ... | 0 | 0 | 0 | 198 | 0 | 0 | 0 | 2 | 128 |
75f9a9261fe1776891436a8fcd42f0d8c20a6b7e | 2,361 | py | Python | prog_1d_TFI_quench_dynamics_m_field.py | ryuikaneko/exactly_solvable_models | 7ded8d6e32e36801461e8cf18ae60b7804af2362 | [
"MIT"
] | 13 | 2019-11-26T16:00:07.000Z | 2022-03-14T13:11:23.000Z | prog_1d_TFI_quench_dynamics_m_field.py | ryuikaneko/exactly_solvable_models | 7ded8d6e32e36801461e8cf18ae60b7804af2362 | [
"MIT"
] | null | null | null | prog_1d_TFI_quench_dynamics_m_field.py | ryuikaneko/exactly_solvable_models | 7ded8d6e32e36801461e8cf18ae60b7804af2362 | [
"MIT"
] | 1 | 2020-11-07T14:48:40.000Z | 2020-11-07T14:48:40.000Z | #!/usr/bin/env python
from __future__ import print_function
import scipy as scipy
import scipy.integrate as integrate
import matplotlib
matplotlib.use('Agg')
if __name__ == "__main__":
main()
| 33.728571 | 114 | 0.631936 | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
import scipy as scipy
import scipy.integrate as integrate
import argparse
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def parse_args():
parser = argparse.ArgumentParser(description='Dynamics of S=1/2 TFI ch... | 0 | 0 | 0 | 0 | 0 | 1,980 | 0 | 1 | 182 |
a5f598b2b0399905d5402bfb75189b7ddcc7b2cb | 1,479 | py | Python | losses/catecrossentropy_ignore_label.py | edwardyehuang/iSeg | 256b0f7fdb6e854fe026fa8df41d9a4a55db34d5 | [
"MIT"
] | 4 | 2021-12-13T09:49:26.000Z | 2022-02-19T11:16:50.000Z | losses/catecrossentropy_ignore_label.py | edwardyehuang/iSeg | 256b0f7fdb6e854fe026fa8df41d9a4a55db34d5 | [
"MIT"
] | 1 | 2021-07-28T10:40:56.000Z | 2021-08-09T07:14:06.000Z | losses/catecrossentropy_ignore_label.py | edwardyehuang/iSeg | 256b0f7fdb6e854fe026fa8df41d9a4a55db34d5 | [
"MIT"
] | null | null | null | # ================================================================
# MIT License
# Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang)
# ================================================================
| 27.90566 | 93 | 0.617985 | # ================================================================
# MIT License
# Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang)
# ================================================================
import tensorflow as tf
def catecrossentropy_ignore_label_loss(
num_class=21,
ignore_label=... | 0 | 0 | 0 | 0 | 0 | 1,212 | 0 | 2 | 46 |
78bba1d0472d1fda142dde7c0ad85f49ed342561 | 8,304 | py | Python | wowgic/old_builds/wowgic_flask/app.py | chelladurai89/wowgicbackend2.0 | 888676e055abec1f06f1b94e889b577c8bb3bf21 | [
"Apache-2.0"
] | null | null | null | wowgic/old_builds/wowgic_flask/app.py | chelladurai89/wowgicbackend2.0 | 888676e055abec1f06f1b94e889b577c8bb3bf21 | [
"Apache-2.0"
] | null | null | null | wowgic/old_builds/wowgic_flask/app.py | chelladurai89/wowgicbackend2.0 | 888676e055abec1f06f1b94e889b577c8bb3bf21 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
#===============================================================================
# File Name : app.py
# Date : 12-02-2015
# Input Files : Nil
# Author : Satheesh <sathishsms@gmail.com>
# Description :
# How to run :twit_test.py -l info
# :twit_test.py -... | 53.230769 | 1,470 | 0.629456 | #! /usr/bin/python
#===============================================================================
# File Name : app.py
# Date : 12-02-2015
# Input Files : Nil
# Author : Satheesh <sathishsms@gmail.com>
# Description :
# How to run :twit_test.py -l info
# :twit_test.py -... | 0 | 1,460 | 0 | 3,043 | 0 | 104 | 0 | 22 | 181 |
be38b8304459290b41ad09a8f6c0529754c06362 | 9,727 | py | Python | ethereum/tests/test_logging.py | c-castillo/pyethereum | 6e0e9a937c16d67faed16c5fce9a21bdef5a58ee | [
"MIT"
] | null | null | null | ethereum/tests/test_logging.py | c-castillo/pyethereum | 6e0e9a937c16d67faed16c5fce9a21bdef5a58ee | [
"MIT"
] | null | null | null | ethereum/tests/test_logging.py | c-castillo/pyethereum | 6e0e9a937c16d67faed16c5fce9a21bdef5a58ee | [
"MIT"
] | null | null | null | import logging
from ethereum import slogging
def test_lazy_log():
"""
test lacy evaluation of json log data
e.g.
class LogState
class LogMemory
"""
called_print = []
slogging.configure(log_json=True)
log = slogging.get_logger()
log.trace('no', data=Expensive())
as... | 29.929231 | 112 | 0.662383 | import json
import logging
import logging.handlers
import pytest
from ethereum import slogging
@pytest.mark.parametrize('level_name', ['critical', 'error', 'warning', 'info', 'debug', 'trace'])
def test_basic(caplog, level_name):
slogging.configure(":trace")
log = slogging.get_logger()
with caplog.at_leve... | 0 | 1,334 | 0 | 115 | 0 | 6,189 | 0 | -16 | 533 |
a9454ae681518511ae43bd9a7065c7605e8143ab | 7,248 | py | Python | backend/tests/lib/fetch/test_fetch_queries.py | bayesimpact/tds-frontend | a4f47e384ef4fe4dc43c30423a1713c2c93dc87f | [
"Apache-2.0"
] | 15 | 2018-05-08T23:54:38.000Z | 2020-03-07T20:46:37.000Z | backend/tests/lib/fetch/test_fetch_queries.py | akegan/encompass | 85852a91c646c62e8cd05f9c2b0c7cf0079ea7f2 | [
"Apache-2.0"
] | 297 | 2018-02-05T19:04:26.000Z | 2022-02-12T07:52:37.000Z | backend/tests/lib/fetch/test_fetch_queries.py | bayesimpact/tds | a4f47e384ef4fe4dc43c30423a1713c2c93dc87f | [
"Apache-2.0"
] | 6 | 2018-05-21T19:51:15.000Z | 2019-03-21T19:20:27.000Z | """Test fetch queries."""
from backend.lib.database.postgres import connect
engine = connect.create_db_engine()
| 38.967742 | 100 | 0.609547 | """Test fetch queries."""
from backend.lib.database.postgres import connect
from backend.lib.fetch import census, providers, representative_points
import mock
engine = connect.create_db_engine()
class TestFetchRepresentativePoints():
"""Test fetch representative_points."""
@staticmethod
def test_fetch_... | 0 | 3,793 | 0 | 3,162 | 0 | 0 | 0 | 39 | 137 |
aee2db27c58af2ff1a4c228170a5b55fe00522eb | 1,882 | py | Python | resources/dot_PyCharm/system/python_stubs/-762174762/PySide/QtNetwork/QNetworkDiskCache.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | 1 | 2020-04-20T02:27:20.000Z | 2020-04-20T02:27:20.000Z | resources/dot_PyCharm/system/python_stubs/cache/83fffae014956db69fadcc8dc156c529d265a60c3b195dc003754531e5b5eafd/PySide/QtNetwork/QNetworkDiskCache.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | resources/dot_PyCharm/system/python_stubs/cache/83fffae014956db69fadcc8dc156c529d265a60c3b195dc003754531e5b5eafd/PySide/QtNetwork/QNetworkDiskCache.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | # encoding: utf-8
# module PySide.QtNetwork
# from C:\Python27\lib\site-packages\PySide\QtNetwork.pyd
# by generator 1.147
# no doc
# imports
| 27.275362 | 106 | 0.658874 | # encoding: utf-8
# module PySide.QtNetwork
# from C:\Python27\lib\site-packages\PySide\QtNetwork.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
from QAbstractNetworkCache import QAbstractNetworkCache
class QNetworkDiskCache(QAbstractNetworkCache):
... | 0 | 182 | 0 | 1,404 | 0 | 0 | 0 | 60 | 90 |
f64f1faf576ddd20c9d62be43173aab155ee2f00 | 4,314 | py | Python | PyImageCompare.py | shredEngineer/PyImageCompare | 7fcc0f6e66c8c45b60c57790b828e2b0deb551b6 | [
"Unlicense"
] | 1 | 2021-01-31T19:22:32.000Z | 2021-01-31T19:22:32.000Z | PyImageCompare.py | shredEngineer/PyImageCompare | 7fcc0f6e66c8c45b60c57790b828e2b0deb551b6 | [
"Unlicense"
] | null | null | null | PyImageCompare.py | shredEngineer/PyImageCompare | 7fcc0f6e66c8c45b60c57790b828e2b0deb551b6 | [
"Unlicense"
] | null | null | null | # PyImageCompare
# Copyright 2020 by Paul Wilhelm <anfrage@paulwilhelm.de>
# https://github.com/shredEngineer/PyImageCompare
# Compares all JPEG images in a folder and renames (enumerates) duplicates. Differences in resolution and quality don't matter!
# This program loads all images in a folder, generates grayscale... | 38.176991 | 136 | 0.612656 | # PyImageCompare
# Copyright © 2020 by Paul Wilhelm <anfrage@paulwilhelm.de>
# https://github.com/shredEngineer/PyImageCompare
# Compares all JPEG images in a folder and renames (enumerates) duplicates. Differences in resolution and quality don't matter!
# This program loads all images in a folder, generates grayscal... | 17 | 0 | 0 | 0 | 0 | 3,170 | 0 | 10 | 157 |
a8a5855ca78449a93eea428387ce52e5a32e6726 | 10,668 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbvserver_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, 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 or... | 27.494845 | 147 | 0.744844 | #
# Copyright (c) 2021 Citrix Systems, 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 or... | 0 | 6,295 | 0 | 3,314 | 0 | 0 | 0 | 292 | 158 |
853e25b1f8627e6c1d4abb23bf5235a2988289c1 | 4,626 | py | Python | feature_extraction/check_output.py | JiwanChung/acav100m | 51cb948d5682da69334a8d05d2df631971b60215 | [
"MIT"
] | 27 | 2021-10-13T07:49:14.000Z | 2022-03-15T06:58:00.000Z | feature_extraction/check_output.py | JiwanChung/acav100m | 51cb948d5682da69334a8d05d2df631971b60215 | [
"MIT"
] | 3 | 2021-08-30T21:29:45.000Z | 2021-11-18T08:02:32.000Z | feature_extraction/check_output.py | JiwanChung/acav100m | 51cb948d5682da69334a8d05d2df631971b60215 | [
"MIT"
] | 6 | 2021-08-30T18:48:32.000Z | 2021-12-16T22:11:37.000Z | from multiprocessing import Pool
import os
from pathlib import Path
from collections import defaultdict, Counter
import json
import pickle
from tqdm import tqdm
if __name__ == "__main__":
args = parse_args()
print(args)
print("datset feature dir: {}".format(args.feat_dir))
feats_path = sorted(... | 34.014706 | 110 | 0.652832 | import tarfile
from multiprocessing import Pool
import numpy as np
import subprocess
import os
from pathlib import Path
import math
import time
from datetime import datetime
from functools import partial
import argparse
from collections import defaultdict, Counter
import json
import pickle
import csv
import shutil
fro... | 0 | 0 | 0 | 0 | 0 | 1,018 | 0 | -45 | 334 |
0f48015affc7daf239578bb01426fe75a4156784 | 994 | py | Python | model/GroupWeightModel.py | bigheiniu/MWSS-1 | 811af11d0f07f0de7a2ec16c55f5ddb32895c567 | [
"MIT"
] | 10 | 2020-11-29T09:15:06.000Z | 2021-12-16T16:18:15.000Z | model/GroupWeightModel.py | bigheiniu/MWSS-1 | 811af11d0f07f0de7a2ec16c55f5ddb32895c567 | [
"MIT"
] | 1 | 2020-11-28T19:03:09.000Z | 2020-11-28T19:03:09.000Z | model/GroupWeightModel.py | bigheiniu/MWSS-1 | 811af11d0f07f0de7a2ec16c55f5ddb32895c567 | [
"MIT"
] | 7 | 2020-11-28T18:44:44.000Z | 2021-11-10T11:43:38.000Z | import torch.nn as nn
| 27.611111 | 96 | 0.584507 | import torch.nn as nn
import torch
import math
class GroupWeightModel(nn.Module):
def __init__(self, n_groups):
super(GroupWeightModel, self).__init__()
self.n_groups = n_groups
self.pesu_group_weight = nn.Parameter(torch.randn(1, self.n_groups), requires_grad=True)
self.init_weigh... | 0 | 0 | 0 | 922 | 0 | 0 | 0 | -18 | 67 |
4257a9d7cdf8daf3a2c67892ffd0341e914356b6 | 6,812 | py | Python | Sentiment analysis of tweets.py | GireeshS22/IPL-Finals-Sentiment-Analysis | c191ed3f1ed98b8c6fbe8eace6942a715923c703 | [
"Apache-2.0"
] | 1 | 2020-09-01T13:20:28.000Z | 2020-09-01T13:20:28.000Z | Sentiment analysis of tweets.py | GireeshS22/IPL-Finals-Sentiment-Analysis | c191ed3f1ed98b8c6fbe8eace6942a715923c703 | [
"Apache-2.0"
] | null | null | null | Sentiment analysis of tweets.py | GireeshS22/IPL-Finals-Sentiment-Analysis | c191ed3f1ed98b8c6fbe8eace6942a715923c703 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 10 21:43:38 2018
@author: Gireesh Sundaram
"""
#Importing the packages
import pandas as pd
import matplotlib.pyplot as plt
from wordcloud import WordCloud
from nltk.corpus import stopwords
from textblob import TextBlob
import numpy as np
from nltk.sentiment... | 35.113402 | 112 | 0.71697 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 10 21:43:38 2018
@author: Gireesh Sundaram
"""
#Importing the packages
import pandas as pd
import matplotlib.pyplot as plt
from wordcloud import WordCloud
from nltk.corpus import stopwords
from textblob import TextBlob
import numpy as np
from nltk.sentiment... | 0 | 0 | 0 | 0 | 0 | 991 | 0 | 0 | 75 |
33114d0675156d4cada97c8165d72d30d0b5c4c4 | 3,916 | py | Python | empire/server/modules/powershell/lateral_movement/invoke_sqloscmd.py | joewildiml/Empire | d60f36d10c674b51dd60f63efe3b1ae007d5933e | [
"BSD-3-Clause"
] | 1 | 2022-01-31T11:45:47.000Z | 2022-01-31T11:45:47.000Z | empire/server/modules/powershell/lateral_movement/invoke_sqloscmd.py | joewildiml/Empire | d60f36d10c674b51dd60f63efe3b1ae007d5933e | [
"BSD-3-Clause"
] | null | null | null | empire/server/modules/powershell/lateral_movement/invoke_sqloscmd.py | joewildiml/Empire | d60f36d10c674b51dd60f63efe3b1ae007d5933e | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
| 43.032967 | 144 | 0.618233 | from __future__ import print_function
import pathlib
from builtins import object
from builtins import str
from typing import Dict
from empire.server.common import helpers
from empire.server.common.module_models import PydanticModule
from empire.server.database.models import Credential
from empire.server.utils import ... | 0 | 3,471 | 0 | 0 | 0 | 0 | 0 | 157 | 249 |
b8dfde5dfb2b4a9c598f9022db3c0f3bc914f5e1 | 6,238 | py | Python | end_to_end_tests/client_test.py | tomchop/timesketch | 2e4d7040d549e991240251f95050a5080b602e19 | [
"Apache-2.0"
] | 1 | 2021-11-23T15:01:23.000Z | 2021-11-23T15:01:23.000Z | end_to_end_tests/client_test.py | tomchop/timesketch | 2e4d7040d549e991240251f95050a5080b602e19 | [
"Apache-2.0"
] | 12 | 2021-11-30T05:21:08.000Z | 2021-12-03T17:27:54.000Z | end_to_end_tests/client_test.py | LeoAndTheTree/timesketch | cccb5466915d6629ad70d8d19ef5942a6eedff63 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 44.557143 | 79 | 0.695896 | # Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 5,414 | 0 | 0 | 0 | 21 | 69 |
6d3138e7f06ecbc73e8c4b234e900965c6662cc7 | 3,604 | py | Python | f5/bigip/tm/security/test/unit/test_protocol_inspection.py | nghia-tran/f5-common-python | acb23a6e5830a119b460c19a578654113419f5c3 | [
"Apache-2.0"
] | null | null | null | f5/bigip/tm/security/test/unit/test_protocol_inspection.py | nghia-tran/f5-common-python | acb23a6e5830a119b460c19a578654113419f5c3 | [
"Apache-2.0"
] | null | null | null | f5/bigip/tm/security/test/unit/test_protocol_inspection.py | nghia-tran/f5-common-python | acb23a6e5830a119b460c19a578654113419f5c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 F5 Networks 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 or agreed to in writi... | 36.77551 | 91 | 0.733352 | # Copyright 2017 F5 Networks 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 or agreed to in writi... | 0 | 220 | 0 | 1,950 | 0 | 303 | 0 | 204 | 340 |
6699b2ba8ed51b7080019c5a1705c4c48b8cb782 | 1,691 | py | Python | mindbender/tests/test_pipeline.py | mottosso/mindbender-core | 248647167e0fa10d7a52ef3d9f0f9c61c12396bd | [
"MIT"
] | 3 | 2018-01-09T18:50:07.000Z | 2020-09-03T17:17:18.000Z | mindbender/tests/test_pipeline.py | mottosso/avalon-core | 248647167e0fa10d7a52ef3d9f0f9c61c12396bd | [
"MIT"
] | 1 | 2017-04-13T14:49:26.000Z | 2017-04-13T14:49:26.000Z | mindbender/tests/test_pipeline.py | mottosso/mindbender-core | 248647167e0fa10d7a52ef3d9f0f9c61c12396bd | [
"MIT"
] | 1 | 2019-02-22T13:20:26.000Z | 2019-02-22T13:20:26.000Z | """Test pipeline.py
..note: These tests depend on global state and are therefore not reentrant.
"""
import sys
self = sys.modules[__name__]
| 21.1375 | 75 | 0.65819 | """Test pipeline.py
..note: These tests depend on global state and are therefore not reentrant.
"""
import os
import sys
import types
import shutil
import tempfile
from mindbender import pipeline
from nose.tools import (
with_setup,
assert_equals,
assert_raises
)
self = sys.modules[__name__]
def cle... | 0 | 680 | 0 | 0 | 0 | 604 | 0 | 33 | 227 |
bfbbfe6cd5b32ac9b1a7f5fc70304a6f706ba2ec | 10,210 | py | Python | lib/dataset.py | AtlantixJJ/vnpy | 28992c7d5391f6dd42a14b481d01ceafde048b5f | [
"MIT"
] | null | null | null | lib/dataset.py | AtlantixJJ/vnpy | 28992c7d5391f6dd42a14b481d01ceafde048b5f | [
"MIT"
] | null | null | null | lib/dataset.py | AtlantixJJ/vnpy | 28992c7d5391f6dd42a14b481d01ceafde048b5f | [
"MIT"
] | null | null | null | import numpy as np
def label_wavepr(arr, T1=0.30, T2=0.15):
"""Label the wave profit retract to discrete labels.
Args:
arr: (N, 2) array, denoting profit and retract.
T1: The threshold for minimum profit.
T2: The threshold for maximum retract.
"""
P, R = arr[:, 0], arr[:, 1]
... | 36.077739 | 89 | 0.550147 | import pytorch_lightning as pl
import torch
from torch.utils.data import Dataset, DataLoader, TensorDataset
import torchvision.utils as vutils
import numpy as np
import glob
from lib.utils import *
def year_symbol_list(years, dic, min_size=50):
res = []
for y in years:
for s in dic[y]:
if... | 0 | 0 | 0 | 8,253 | 0 | 179 | 0 | 47 | 225 |
7cf7a946377eae2e8a01850e585cb2c30e9f09cf | 39,058 | py | Python | vunit/project.py | Blebowski/vunit | 5f18e834d16fb7ee5e98faa9f689b0b92ae0f9d1 | [
"Artistic-2.0"
] | 1 | 2019-12-11T16:00:02.000Z | 2019-12-11T16:00:02.000Z | vunit/project.py | Blebowski/vunit | 5f18e834d16fb7ee5e98faa9f689b0b92ae0f9d1 | [
"Artistic-2.0"
] | null | null | null | vunit/project.py | Blebowski/vunit | 5f18e834d16fb7ee5e98faa9f689b0b92ae0f9d1 | [
"Artistic-2.0"
] | 3 | 2020-09-07T20:14:50.000Z | 2020-09-12T16:19:09.000Z | # Classes to model a HDL design hierarchy
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com... | 39.532389 | 120 | 0.603001 | # Classes to model a HDL design hierarchy
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com... | 0 | 3,346 | 0 | 33,244 | 0 | 0 | 0 | 389 | 423 |
2ef35a42978b24fd0dc9a332e4f61c545f3597ef | 714 | py | Python | main.py | AndrewRPorter/my-analytics | 1f15329b820eb7357ea53d5b5e3dfbce278b4308 | [
"MIT"
] | 1 | 2021-05-21T08:55:44.000Z | 2021-05-21T08:55:44.000Z | main.py | AndrewRPorter/my-analytics | 1f15329b820eb7357ea53d5b5e3dfbce278b4308 | [
"MIT"
] | null | null | null | main.py | AndrewRPorter/my-analytics | 1f15329b820eb7357ea53d5b5e3dfbce278b4308 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import shutil
import sys
import yaml
from my_analytics.stats import plot
config = yaml.safe_load(open("config.yml"))
def run():
"""
Runs analytics on the places data from firefox
"""
if os.path.exists(config["config"]["places_directory"]):
# create a copy o... | 21.636364 | 94 | 0.651261 | #!/usr/bin/env python3
import os
import shutil
import sys
import yaml
from my_analytics.stats import plot
config = yaml.safe_load(open("config.yml"))
def run():
"""
Runs analytics on the places data from firefox
"""
if os.path.exists(config["config"]["places_directory"]):
# create a copy o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5988e1dc14decc574ba3662a9accb0f7c4ebb34e | 866 | py | Python | setup.py | CharlieNPie/dcsdata | c1935e2cd969494364bd4949d08c558cbec7befd | [
"MIT"
] | null | null | null | setup.py | CharlieNPie/dcsdata | c1935e2cd969494364bd4949d08c558cbec7befd | [
"MIT"
] | null | null | null | setup.py | CharlieNPie/dcsdata | c1935e2cd969494364bd4949d08c558cbec7befd | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dcsdata",
version="0.0.9",
author="Charles E. Jewers",
author_email="charlesejewers@gmail.com",
description="A text data tool for the University of Sheffield.",
long_description=long_d... | 24.742857 | 68 | 0.593533 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="dcsdata",
version="0.0.9",
author="Charles E. Jewers",
author_email="charlesejewers@gmail.com",
description="A text data tool for the University of Sheffield.",
long_description=long_d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25e78923a3e740171b5568ed9e090ad368556146 | 533 | py | Python | djangocms_blog/migrations/0022_auto_20160605_2305.py | ChameleonCloud/djangocms-blog | 4662c97db8796db31944ce65ca13ef32e1f02202 | [
"BSD-3-Clause"
] | 1 | 2020-01-02T16:56:46.000Z | 2020-01-02T16:56:46.000Z | djangocms_blog/migrations/0022_auto_20160605_2305.py | ChameleonCloud/djangocms-blog | 4662c97db8796db31944ce65ca13ef32e1f02202 | [
"BSD-3-Clause"
] | 1 | 2020-04-29T13:28:48.000Z | 2020-05-07T18:06:47.000Z | djangocms_blog/migrations/0022_auto_20160605_2305.py | ChameleonCloud/djangocms-blog | 4662c97db8796db31944ce65ca13ef32e1f02202 | [
"BSD-3-Clause"
] | 1 | 2017-07-24T11:46:37.000Z | 2017-07-24T11:46:37.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-05 21:05
from __future__ import unicode_literals
| 24.227273 | 93 | 0.651032 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-05 21:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('djangocms_blog', '0021_post_liveblog'),
]
operation... | 0 | 0 | 0 | 322 | 0 | 0 | 0 | 30 | 68 |
8a164019f10026f1bbb72ef89d240bf5e549a6e1 | 8,708 | py | Python | homeassistant/components/mqtt/switch.py | csseal/core | 5802d65ef71697e6627b82e1677894d13d0f16d7 | [
"Apache-2.0"
] | 3 | 2019-07-06T08:00:22.000Z | 2021-11-12T23:01:59.000Z | homeassistant/components/mqtt/switch.py | csseal/core | 5802d65ef71697e6627b82e1677894d13d0f16d7 | [
"Apache-2.0"
] | 45 | 2020-07-21T12:58:24.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/mqtt/switch.py | csseal/core | 5802d65ef71697e6627b82e1677894d13d0f16d7 | [
"Apache-2.0"
] | 2 | 2017-09-03T16:06:02.000Z | 2021-01-12T15:07:52.000Z | """Support for MQTT switches."""
import logging
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.const import (CONF_DEVICE, CONF_ICON, CONF_NAME, CONF_OPTIMISTIC, CONF_PAYLOAD_OFF, CONF_PAYLOAD_ON, CONF_UNIQUE_ID)
import homeassistant.helpers.config_validation as cv
_LOGGER = log... | 32.014706 | 88 | 0.657097 | """Support for MQTT switches."""
import logging
import voluptuous as vol
from homeassistant.components import mqtt, switch
from homeassistant.components.switch import SwitchEntity
from homeassistant.const import (
CONF_DEVICE,
CONF_ICON,
CONF_NAME,
CONF_OPTIMISTIC,
CONF_PAYLOAD_OFF,
CONF_PAYLO... | 0 | 991 | 4,007 | 1,604 | 0 | 0 | 0 | 534 | 269 |
a0964a9f53da9c1454355757ab72aaeeb9c557f7 | 446 | py | Python | samples/bind_skill.py | voximplant/apiclient-python | 860fc054f546152a101e29b1af388c381075ac47 | [
"MIT"
] | 8 | 2019-06-11T07:46:38.000Z | 2021-04-02T17:37:08.000Z | samples/bind_skill.py | NikolasMelui/apiclient-python | c94caacc07e2cdc11edd022c6f9dff3feffe8edc | [
"MIT"
] | 5 | 2019-06-05T18:34:40.000Z | 2020-07-23T10:45:19.000Z | samples/bind_skill.py | NikolasMelui/apiclient-python | c94caacc07e2cdc11edd022c6f9dff3feffe8edc | [
"MIT"
] | 6 | 2019-07-09T05:59:35.000Z | 2021-07-08T22:37:59.000Z | from voximplant.apiclient import VoximplantAPI, VoximplantException
if __name__ == "__main__":
voxapi = VoximplantAPI("credentials.json")
# Bind the skills 1, 5 to the users 5, 6, 10.
SKILL_ID = [1, 3]
USER_ID = [5, 6, 10]
try:
res = voxapi.bind_skill(skill_id=SKILL_ID,
... | 24.777778 | 67 | 0.616592 | from voximplant.apiclient import VoximplantAPI, VoximplantException
if __name__ == "__main__":
voxapi = VoximplantAPI("credentials.json")
# Bind the skills 1, 5 to the users 5, 6, 10.
SKILL_ID = [1, 3]
USER_ID = [5, 6, 10]
try:
res = voxapi.bind_skill(skill_id=SKILL_ID,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db88709fc534a7835f3844ad2c301463eb43c3cb | 708 | py | Python | UICPC/21/nwerc2020all/greatexpectations/submissions/accepted/jorke-precise.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | UICPC/21/nwerc2020all/greatexpectations/submissions/accepted/jorke-precise.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | UICPC/21/nwerc2020all/greatexpectations/submissions/accepted/jorke-precise.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
n,r,m = [int(i) for i in input().split()]
data = [input().split() for i in range(m)]
data = [(int(t), float(p), int(d)) for t,p,d in data]
inf = n*50000
lower,upper = 0, inf
while True:
mid = (lower+upper)/2
if mid == lower or mid == upper:
break
DP = [0]*(r-n) # i-th iterati... | 37.263158 | 192 | 0.587571 | #!/usr/bin/env python3
n,r,m = [int(i) for i in input().split()]
data = [input().split() for i in range(m)]
data = [(int(t), float(p), int(d)) for t,p,d in data]
inf = n*50000
lower,upper = 0, inf
while True:
mid = (lower+upper)/2
if mid == lower or mid == upper:
break
DP = [0]*(r-n) # i-th iterati... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7cfafb5541449392a01af5df5dd7442b47f41f7 | 14,486 | py | Python | source/model.py | janzmazek/Wave-propagation | 9176555f4b1b8a93be3fcc502f4f5094c9bb927b | [
"MIT"
] | 1 | 2019-12-17T19:20:11.000Z | 2019-12-17T19:20:11.000Z | source/model.py | janzmazek/Wave-propagation | 9176555f4b1b8a93be3fcc502f4f5094c9bb927b | [
"MIT"
] | null | null | null | source/model.py | janzmazek/Wave-propagation | 9176555f4b1b8a93be3fcc502f4f5094c9bb927b | [
"MIT"
] | null | null | null | """
This module performs probabilistic model on some network of streets given by
the modified adjacency matrix (with dictionary of length, width, alpha, beta,
orientation).
"""
import scipy.integrate as integrate
| 39.687671 | 105 | 0.583391 | """
This module performs probabilistic model on some network of streets given by
the modified adjacency matrix (with dictionary of length, width, alpha, beta,
orientation).
"""
import numpy as np
import scipy.integrate as integrate
from collections import defaultdict
from source.junction import Junction
class Model(o... | 0 | 0 | 0 | 14,157 | 0 | 0 | 0 | 26 | 90 |
078c4c51156f650b85a6e882c8b4eaa999afb1d2 | 1,029 | py | Python | multimodal/test_model.py | cu-asl/multimodal_with_dropout | 4548d42e38f64e5959ecdb9df9ac219688551375 | [
"MIT"
] | null | null | null | multimodal/test_model.py | cu-asl/multimodal_with_dropout | 4548d42e38f64e5959ecdb9df9ac219688551375 | [
"MIT"
] | null | null | null | multimodal/test_model.py | cu-asl/multimodal_with_dropout | 4548d42e38f64e5959ecdb9df9ac219688551375 | [
"MIT"
] | null | null | null | from __future__ import print_function
import argparse
import yaml
from logger import Logger
from test_model.test import selfsupervised
if __name__ == "__main__":
# Load the config file
parser = argparse.ArgumentParser(description="Sensor fusion model")
parser.add_argument("--config", help="YAML config fi... | 27.078947 | 82 | 0.671526 | from __future__ import print_function
import argparse
import yaml
from logger import Logger
from test_model.test import selfsupervised
if __name__ == "__main__":
# Load the config file
parser = argparse.ArgumentParser(description="Sensor fusion model")
parser.add_argument("--config", help="YAML config fi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9792960ede3734e2cf728644a90858be0778608d | 601 | py | Python | routers/geolocation/__init__.py | vald3nir/Python-World-Data | 3412802654c42bd60acd6eb1a30ad04426132f6e | [
"MIT"
] | null | null | null | routers/geolocation/__init__.py | vald3nir/Python-World-Data | 3412802654c42bd60acd6eb1a30ad04426132f6e | [
"MIT"
] | null | null | null | routers/geolocation/__init__.py | vald3nir/Python-World-Data | 3412802654c42bd60acd6eb1a30ad04426132f6e | [
"MIT"
] | null | null | null | from flask import Blueprint
geolocation_router = Blueprint('geolocation_router', __name__)
# ------------------------------------------------------------------
# Routers
# ------------------------------------------------------------------
| 33.388889 | 81 | 0.599002 | from flask import Blueprint, request
from routers.geolocation.use_case_geolocation import get_address_from_geolocation
geolocation_router = Blueprint('geolocation_router', __name__)
# ------------------------------------------------------------------
# Routers
# -----------------------------------------------------... | 0 | 244 | 0 | 0 | 0 | 0 | 0 | 69 | 46 |
24a3725bcb5715c09663ed2a6bb699b5a6833d1c | 114 | py | Python | LL1-Parser/__init__.py | EtoDemerzel0427/LL1-Parser | c43ff09e35f4a1160d61ad31d41a3c2d97f25666 | [
"MIT"
] | 3 | 2019-10-12T08:54:36.000Z | 2020-11-27T13:02:10.000Z | LL1-Parser/__init__.py | EtoDemerzel0427/LL1-Parser | c43ff09e35f4a1160d61ad31d41a3c2d97f25666 | [
"MIT"
] | null | null | null | LL1-Parser/__init__.py | EtoDemerzel0427/LL1-Parser | c43ff09e35f4a1160d61ad31d41a3c2d97f25666 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'Weiran Huang'
__email__ = 'huangweiran1998@gmail.com'
__version__ = '1.0.0' | 22.8 | 39 | 0.675439 | # -*- coding: utf-8 -*-
__author__ = 'Weiran Huang'
__email__ = 'huangweiran1998@gmail.com'
__version__ = '1.0.0' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
31b757faade8d47e5c21d0716236b53a1d3e2196 | 628 | py | Python | deps/zorro/tests/benchmark/methods.py | Xecutor/zorroeditor | 69627f9a555ee739ea4fce0c9eb9f589b1e7f5f9 | [
"MIT"
] | null | null | null | deps/zorro/tests/benchmark/methods.py | Xecutor/zorroeditor | 69627f9a555ee739ea4fce0c9eb9f589b1e7f5f9 | [
"MIT"
] | null | null | null | deps/zorro/tests/benchmark/methods.py | Xecutor/zorroeditor | 69627f9a555ee739ea4fce0c9eb9f589b1e7f5f9 | [
"MIT"
] | null | null | null | f()
| 16.526316 | 48 | 0.571656 | import math
class Point:
def __init__(self,x,y):
self.x=x
self.y=y
def move(self):
self.x+=self.dx
self.y+=self.dy
def isNear(self,p):
vx=self.x-p.x
vx*=vx
vy=self.y-p.y
vy*=vy
return vx+vy<5
def calcDir(self,p):
self.dx=p.x-self.x
self.dy=p.y-self.y
l=math.sqrt... | 0 | 0 | 0 | 446 | 0 | 120 | 0 | -10 | 68 |
3551dc55a635066ac45840f1bcad4c0928a8ad4f | 711 | py | Python | python/2579.py | zheedong/BaekJoon | 7f9e00085276a337d18ee3bb90c98126f7af4d3a | [
"MIT"
] | null | null | null | python/2579.py | zheedong/BaekJoon | 7f9e00085276a337d18ee3bb90c98126f7af4d3a | [
"MIT"
] | null | null | null | python/2579.py | zheedong/BaekJoon | 7f9e00085276a337d18ee3bb90c98126f7af4d3a | [
"MIT"
] | null | null | null | n = int(input())
score = dict([])
max_dict = dict([])
for i in range(1, n + 1):
score[i] = int(input())
# max(n) = max(max(n-2), max(n-3) + score(n-1)) + score(n)
# Key IDEA : .
# Dynamic Programming Recursion . => n . (SICP)
if n >= 1:
max_dict[1] = score[1]
if n >= 2:
max_dict[2... | 24.517241 | 81 | 0.552743 | n = int(input())
score = dict([])
max_dict = dict([])
for i in range(1, n + 1):
score[i] = int(input())
# max(n) = max(max(n-2), max(n-3) + score(n-1)) + score(n)
# Key IDEA : 맨 끝 계단을 밟아야 한다는 조건에 주목. 그러기 위해서는 두 가지 선택지 밖에 없음
# Dynamic Programming과 Recursion을 활용해서 해결. => n보다 작은 수에서는 작동하는 함수가 있다고 가정. (SICP)
def get... | 183 | 0 | 0 | 0 | 0 | 170 | 0 | 0 | 22 |
9a0ad54277be025c1f829971fb5c015efebd3a73 | 1,947 | py | Python | website/apps/tags/api.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 61 | 2015-11-10T17:13:46.000Z | 2021-08-06T17:58:30.000Z | website/apps/tags/api.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 13 | 2015-11-11T07:49:41.000Z | 2021-06-09T03:45:31.000Z | website/apps/tags/api.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 18 | 2015-11-11T04:50:04.000Z | 2021-08-20T00:57:11.000Z | from canvas.api_decorators import api_decorator
urlpatterns = []
api = api_decorator(urlpatterns)
| 27.422535 | 72 | 0.682589 | from django.shortcuts import get_object_or_404
from apps.canvas_auth.models import User
from apps.suggest.models import get_suggested_tags
from apps.tags.models import Tag
from canvas import bgwork, models
from canvas.api_decorators import api_decorator
from canvas.exceptions import ServiceError
from canvas.metrics im... | 0 | 1,390 | 0 | 0 | 0 | 0 | 0 | 189 | 268 |
542251788cdeb5a3011d107464b4ced0af213b04 | 7,511 | py | Python | progress.py | Asplund-Samuelsson/POPPY | 8459b0855294de65ab9d940fc2a1cc73a14ae0aa | [
"MIT"
] | 2 | 2018-09-13T15:05:07.000Z | 2019-03-13T15:29:46.000Z | progress.py | Asplund-Samuelsson/POPPY | 8459b0855294de65ab9d940fc2a1cc73a14ae0aa | [
"MIT"
] | 16 | 2017-04-05T08:12:32.000Z | 2019-01-04T10:13:04.000Z | progress.py | Asplund-Samuelsson/POPPY | 8459b0855294de65ab9d940fc2a1cc73a14ae0aa | [
"MIT"
] | null | null | null | # Progress indicator for Python 3.5.1
# Version 0.1.1
# Johannes Asplund-Samuelsson
| 33.382222 | 79 | 0.541339 | # Progress indicator for Python 3.5.1
# Version 0.1.1
# Johannes Asplund-Samuelsson
class Progress():
"""Progress indication thingamabob"""
# Design variables
__allowed_designs = set(['p','s','b','t','c'])
# Spinner variables
__spin_stages = ['/','-','\\','|']
__spin_stage = 0
__last_spin... | 0 | 0 | 0 | 7,404 | 0 | 0 | 0 | 0 | 23 |
60ab24e36d63e16f8ad430697ee4901dcf191191 | 1,103 | py | Python | stack_test.py | slongfield/simpleStack | ea17cda28fe53590c54355e801ffc852c76a74a9 | [
"Apache-2.0"
] | 3 | 2018-10-27T00:04:07.000Z | 2020-09-12T17:05:27.000Z | stack_test.py | slongfield/simpleStack | ea17cda28fe53590c54355e801ffc852c76a74a9 | [
"Apache-2.0"
] | null | null | null | stack_test.py | slongfield/simpleStack | ea17cda28fe53590c54355e801ffc852c76a74a9 | [
"Apache-2.0"
] | null | null | null | """Simple tests for the simple stack language."""
import simpleStack
def test_hello_world():
"""Tests hello world."""
logs = []
def log_print(val, end=""):
"""Logging print statement."""
logs.append(val + end)
with open("examples/hello.ss") as hello:
simpleStack.run_simple_s... | 25.068182 | 78 | 0.562103 | """Simple tests for the simple stack language."""
import simpleStack
def test_hello_world():
"""Tests hello world."""
logs = []
def log_print(val, end=""):
"""Logging print statement."""
logs.append(val + end)
with open("examples/hello.ss") as hello:
simpleStack.run_simple_s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1262086339395950a4e63e2f85067cec6b8c7340 | 11,565 | py | Python | wiktionarifier/format/core.py | lgessler/wiktionarifier | 7359a946f2dcef08455f9e552d6a1e3875beed63 | [
"MIT"
] | 1 | 2021-02-25T16:22:47.000Z | 2021-02-25T16:22:47.000Z | wiktionarifier/format/core.py | lgessler/wiktionarifier | 7359a946f2dcef08455f9e552d6a1e3875beed63 | [
"MIT"
] | null | null | null | wiktionarifier/format/core.py | lgessler/wiktionarifier | 7359a946f2dcef08455f9e552d6a1e3875beed63 | [
"MIT"
] | null | null | null | from collections import defaultdict
from allennlp.common.logging import logger
from bs4 import BeautifulSoup
import wiktionarifier.scrape.db as db
def discard_empty_elements(soup, exempt=()):
"""Remove HTML elements that have no/whitespace-only content"""
for tag in soup.find_all():
if len(tag.get_t... | 37.548701 | 119 | 0.568958 | import os
from collections import defaultdict
import click
import spacy
from allennlp.common.logging import logger
from spacy.symbols import ORTH
from bs4 import BeautifulSoup, Comment
from tqdm import tqdm
from conllu import TokenList
import wiktionarifier.scrape.db as db
from wiktionarifier.format.const import VALI... | 0 | 0 | 0 | 0 | 0 | 4,937 | 0 | 87 | 411 |
8c7bc9cc4e86bb55c66dd08a098ce0efa340b887 | 3,487 | py | Python | tools/wopicheckfile.py | boost-entropy-repos-org/wopiserver | f42a7faaa14eef91e81296912bf450f4dfb4d2af | [
"Apache-2.0"
] | null | null | null | tools/wopicheckfile.py | boost-entropy-repos-org/wopiserver | f42a7faaa14eef91e81296912bf450f4dfb4d2af | [
"Apache-2.0"
] | null | null | null | tools/wopicheckfile.py | boost-entropy-repos-org/wopiserver | f42a7faaa14eef91e81296912bf450f4dfb4d2af | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
'''
Check the given file for WOPI extended attributes
Author: Giuseppe.LoPresti@cern.ch
CERN IT/ST
'''
import sys, os, getopt, configparser, logging, jwt
storage = None
# usage function
def usage(exitcode):
'''Prints usage'''
print('Usage : ' + sys.argv[0] + ' [-h|--help] <filename>')
sys.e... | 35.948454 | 151 | 0.678233 | #!/usr/bin/python3
'''
Check the given file for WOPI extended attributes
Author: Giuseppe.LoPresti@cern.ch
CERN IT/ST
'''
import sys, os, getopt, configparser, logging, jwt
storage = None
# usage function
def usage(exitcode):
'''Prints usage'''
print('Usage : ' + sys.argv[0] + ' [-h|--help] <filename>')
sys.e... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c9df62750e6fde968636cad8dca31a08a742448 | 374 | py | Python | open_budget_data_api/config.py | omertalmi5/open-budget-data-api | f8f14861f50b2b9a737573017f80f84f863fcaaf | [
"MIT"
] | null | null | null | open_budget_data_api/config.py | omertalmi5/open-budget-data-api | f8f14861f50b2b9a737573017f80f84f863fcaaf | [
"MIT"
] | null | null | null | open_budget_data_api/config.py | omertalmi5/open-budget-data-api | f8f14861f50b2b9a737573017f80f84f863fcaaf | [
"MIT"
] | null | null | null | import os
# Flask settings
FLASK_SERVER_NAME = os.environ.get('SERVER_NAME', 'localhost:8888')
FLASK_DEBUG = True # Do not use debug mode in production
# SQLAlchemy settings
SQLALCHEMY_DATABASE_URI = 'postgresql://readonly:readonly@data-next.obudget.org:5432/budgetkey'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHE... | 34 | 95 | 0.799465 | import os
# Flask settings
FLASK_SERVER_NAME = os.environ.get('SERVER_NAME', 'localhost:8888')
FLASK_DEBUG = True # Do not use debug mode in production
# SQLAlchemy settings
SQLALCHEMY_DATABASE_URI = 'postgresql://readonly:readonly@data-next.obudget.org:5432/budgetkey'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHE... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
057349fd452e4bca3e84341fc2ab7b7a315762dc | 4,992 | py | Python | demos/image_analysis.py | altest-com/dnfal | d1fb15508c5583aeaa0957fcc3e37634d36bf237 | [
"MIT"
] | null | null | null | demos/image_analysis.py | altest-com/dnfal | d1fb15508c5583aeaa0957fcc3e37634d36bf237 | [
"MIT"
] | 1 | 2020-03-31T17:04:09.000Z | 2020-03-31T17:04:09.000Z | demos/image_analysis.py | altest-com/dnfal | d1fb15508c5583aeaa0957fcc3e37634d36bf237 | [
"MIT"
] | null | null | null | import argparse
import sys
from os import path
IMAGE_EXT = ('.jpeg', '.jpg', '.png')
if __name__ == '__main__':
curr_dir = path.dirname(path.abspath(__file__))
parent_dir, _ = path.split(curr_dir)
parser = argparse.ArgumentParser()
parser.add_argument(
'--input',
type=str,
... | 30.625767 | 79 | 0.600962 | import argparse
import sys
from os import path
from time import time
import cv2 as cv
from cvtlib.drawing import Drawer
from cvtlib.files import list_files
from cvtlib.image import resize
IMAGE_EXT = ('.jpeg', '.jpg', '.png')
def run(
image_path: str,
detector_weights_path: str,
marker_weights_path: str... | 0 | 0 | 0 | 0 | 0 | 3,144 | 0 | 31 | 134 |
cbff14888acaa6ae29f42614a52959ac1c7d15c4 | 252 | py | Python | collect_data/getkeys/creatcvs.py | lyzMaster/deepgta5 | c86475e8792fed1bd296e4f455b5472009740720 | [
"MIT"
] | 25 | 2018-10-12T12:11:13.000Z | 2020-12-21T15:13:42.000Z | collect_data/getkeys/creatcvs.py | lyzMaster/deepgta5 | c86475e8792fed1bd296e4f455b5472009740720 | [
"MIT"
] | null | null | null | collect_data/getkeys/creatcvs.py | lyzMaster/deepgta5 | c86475e8792fed1bd296e4f455b5472009740720 | [
"MIT"
] | 4 | 2018-10-12T13:40:02.000Z | 2019-09-01T11:42:16.000Z | import csv
with open('C:\\gta5_console\\keys_data\\keys_data.csv', 'a', newline='') as csvfile:
fieldnames = ['position', 'data']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writerow({'name': 'Baked', 'data': 'Beans'})
| 31.5 | 84 | 0.666667 | import csv
with open('C:\\gta5_console\\keys_data\\keys_data.csv', 'a', newline='') as csvfile:
fieldnames = ['position', 'data']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writerow({'name': 'Baked', 'data': 'Beans'})
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b73026b617cfbfb94fcbfb4a0a3a4e5533928a42 | 7,758 | py | Python | TranskribusDU/tasks/DU_CRF_Task.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 20 | 2017-01-24T20:08:25.000Z | 2021-10-30T15:20:44.000Z | TranskribusDU/tasks/DU_CRF_Task.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 11 | 2017-06-27T11:41:42.000Z | 2020-10-12T04:59:25.000Z | TranskribusDU/tasks/DU_CRF_Task.py | Transkribus/TranskribusDU | 61028ee5f5f39f435bf9c461f8073e75bca344ac | [
"BSD-3-Clause"
] | 5 | 2017-01-12T15:55:34.000Z | 2019-10-10T05:13:20.000Z | # -*- coding: utf-8 -*-
"""
CRF DU task core. Supports classical CRF and Typed CRF
Copyright Xerox(C) 2016, 2017 JL. Meunier
Developed for the EU project READ. The READ project has received funding
from the European Unions Horizon 2020 research and innovation programme
under gra... | 49.101266 | 216 | 0.563161 | # -*- coding: utf-8 -*-
"""
CRF DU task core. Supports classical CRF and Typed CRF
Copyright Xerox(C) 2016, 2017 JL. Meunier
Developed for the EU project READ. The READ project has received funding
from the European Union�s Horizon 2020 research and innovation programme
under gr... | 3 | 3,009 | 0 | 3,484 | 0 | 0 | 0 | 52 | 116 |
0b8af012739f8f600a9f1d64ffd9058d7438281d | 18,313 | py | Python | test/test_packages/objects/testHessian.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | 1 | 2021-12-19T15:11:09.000Z | 2021-12-19T15:11:09.000Z | test/test_packages/objects/testHessian.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | null | null | null | test/test_packages/objects/testHessian.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main(verbosity=2)
| 46.479695 | 135 | 0.587779 | import unittest
import warnings
import pygsti
from pygsti.modelpacks.legacy import std1Q_XYI as stdxyi
from pygsti.modelpacks.legacy import std1Q_XY as stdxy
from pygsti.objects import modelfunction as gsf
from pygsti.objects.mapforwardsim import MapForwardSimulator
from pygsti.objects import Label as L
import numpy a... | 0 | 0 | 0 | 17,809 | 0 | 0 | 0 | 159 | 267 |
83eba4abca4f4dbc193f7e870ffd90e7cc0de716 | 1,392 | py | Python | exercise-django/book/migrations/0001_initial.py | theseana/goodfellas | 9ad9d9759d193cd64ec71876b1dab155bb9ba2c7 | [
"MIT"
] | null | null | null | exercise-django/book/migrations/0001_initial.py | theseana/goodfellas | 9ad9d9759d193cd64ec71876b1dab155bb9ba2c7 | [
"MIT"
] | null | null | null | exercise-django/book/migrations/0001_initial.py | theseana/goodfellas | 9ad9d9759d193cd64ec71876b1dab155bb9ba2c7 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-09-20 15:14
| 33.95122 | 115 | 0.561782 | # Generated by Django 3.1 on 2020-09-20 15:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
... | 0 | 0 | 0 | 1,247 | 0 | 0 | 0 | 30 | 68 |
e6a14712b05bd9df0ddf473be2c160311a8db6d2 | 1,733 | py | Python | tensorflow_learning/tf2/notebooks/tensorboard_profile.py | jeffzhengye/pylearn | a140d0fca8a371faada194cb0126192675cc2045 | [
"Unlicense"
] | 2 | 2016-02-17T06:00:35.000Z | 2020-11-23T13:34:00.000Z | tensorflow_learning/tf2/notebooks/tensorboard_profile.py | jeffzhengye/pylearn | a140d0fca8a371faada194cb0126192675cc2045 | [
"Unlicense"
] | null | null | null | tensorflow_learning/tf2/notebooks/tensorboard_profile.py | jeffzhengye/pylearn | a140d0fca8a371faada194cb0126192675cc2045 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
'''
@author: jeffzhengye
@contact: yezheng@scuec.edu.cn
@file: tensorboard_profile.py.py
@time: 2021/1/23 17:18
@desc:
'''
from datetime import datetime
import tensorflow as tf
print("TensorFlow version: ", tf.__version__)
device_name = tf.test.gpu_device_name()
if n... | 25.485294 | 76 | 0.631852 | # -*- coding: utf-8 -*-
'''
@author: jeffzhengye
@contact: yezheng@scuec.edu.cn
@file: tensorboard_profile.py.py
@time: 2021/1/23 17:18
@desc:
'''
from datetime import datetime
from packaging import version
import os
import tensorflow as tf
print("TensorFlow version: ", tf.__version__)
d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 48 |
b75cc4ea5a6b8f7e847bb915419478dbff4c9779 | 753 | py | Python | jrpc/jrpcServer/SimpleTCPServer.py | umairghani/py-jrpc | 467ba1e1765f7f3a0ad2eabf8c17c98fc9baa11e | [
"MIT"
] | null | null | null | jrpc/jrpcServer/SimpleTCPServer.py | umairghani/py-jrpc | 467ba1e1765f7f3a0ad2eabf8c17c98fc9baa11e | [
"MIT"
] | null | null | null | jrpc/jrpcServer/SimpleTCPServer.py | umairghani/py-jrpc | 467ba1e1765f7f3a0ad2eabf8c17c98fc9baa11e | [
"MIT"
] | null | null | null |
__author__ = 'umairghani'
| 27.888889 | 90 | 0.709163 | import SocketServer
from SimpleTCPDispatcher import SimpleTCPDispatcher
from SimpleTCPRequestHandler import SimpleTCPRequestHandler
__author__ = 'umairghani'
class SimpleTCPServer(SocketServer.TCPServer, SimpleTCPDispatcher):
"""
Simple TCP Server
"""
allow_reuse_address = True
def __init__(se... | 0 | 0 | 0 | 569 | 0 | 0 | 0 | 66 | 90 |
82c5a2802476fe974c1760c021394ca4a8463df9 | 1,099 | py | Python | chapters/chapter5/chapter5.py | nazariinyzhnyk/Nikolenko_Deeplearning | 79cec9b188a5725b96e9a9f3e2fc059dfa251295 | [
"MIT"
] | null | null | null | chapters/chapter5/chapter5.py | nazariinyzhnyk/Nikolenko_Deeplearning | 79cec9b188a5725b96e9a9f3e2fc059dfa251295 | [
"MIT"
] | null | null | null | chapters/chapter5/chapter5.py | nazariinyzhnyk/Nikolenko_Deeplearning | 79cec9b188a5725b96e9a9f3e2fc059dfa251295 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
x_inp = tf.placeholder(tf.float32, [5, 5])
w_inp = tf.placeholder(tf.float32, [3, 3])
x = tf.reshape(x_inp, [1, 5, 5, 1])
w = tf.reshape(w_inp, [3, 3, 1, 1])
x_valid = tf.nn.conv2d(x, w, strides=[1, 1, 1, 1], padding='VALID')
x_same = tf.nn.conv2d(x, w, strides=[1, 1, 1, 1... | 32.323529 | 85 | 0.544131 | import tensorflow as tf
import numpy as np
x_inp = tf.placeholder(tf.float32, [5, 5])
w_inp = tf.placeholder(tf.float32, [3, 3])
x = tf.reshape(x_inp, [1, 5, 5, 1])
w = tf.reshape(w_inp, [3, 3, 1, 1])
x_valid = tf.nn.conv2d(x, w, strides=[1, 1, 1, 1], padding='VALID')
x_same = tf.nn.conv2d(x, w, strides=[1, 1, 1, 1... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bfb702cf9e8fc109e875d1b73c23c65cead97667 | 2,870 | py | Python | fastpitch/alignment.py | eugenemfu/TTS_HW | 34b3a32da2904578ddbd86bfd9529798cc3a1e9f | [
"BSD-3-Clause"
] | null | null | null | fastpitch/alignment.py | eugenemfu/TTS_HW | 34b3a32da2904578ddbd86bfd9529798cc3a1e9f | [
"BSD-3-Clause"
] | null | null | null | fastpitch/alignment.py | eugenemfu/TTS_HW | 34b3a32da2904578ddbd86bfd9529798cc3a1e9f | [
"BSD-3-Clause"
] | 24 | 2021-11-30T14:56:07.000Z | 2021-12-15T22:31:45.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.372093 | 78 | 0.629617 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 2,138 | 0 | 0 | 0 | 0 | 0 | 5 | 114 |
718695487c2319110d26f96f69b9bdff8a22059b | 41,870 | py | Python | hapi/rudder/rudder_pb2.py | guoweikuang/python-helm | 0d11ef169f3f10484029037a3668b36ddb7b71c0 | [
"Apache-2.0"
] | 12 | 2018-08-21T09:00:13.000Z | 2020-02-20T02:07:33.000Z | hapi/rudder/rudder_pb2.py | guoweikuang/python-helm | 0d11ef169f3f10484029037a3668b36ddb7b71c0 | [
"Apache-2.0"
] | 4 | 2018-10-31T05:42:26.000Z | 2019-02-23T05:28:38.000Z | hapi/rudder/rudder_pb2.py | guoweikuang/python-helm | 0d11ef169f3f10484029037a3668b36ddb7b71c0 | [
"Apache-2.0"
] | 7 | 2018-09-20T03:05:33.000Z | 2020-02-06T15:10:56.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hapi/rudder/rudder.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflectio... | 43.209494 | 3,074 | 0.759064 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hapi/rudder/rudder.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflectio... | 0 | 0 | 0 | 6,335 | 0 | 1,762 | 0 | 20 | 173 |
7b6a3ceef09fe9902d70809f173c7cc94d45a79b | 415 | py | Python | unsorted/pythonsnippets_0012.py | fiddlerwoaroof/sandbox | 652acaf710a8b60f005769bde317e7bbf548cc2b | [
"BSD-3-Clause"
] | null | null | null | unsorted/pythonsnippets_0012.py | fiddlerwoaroof/sandbox | 652acaf710a8b60f005769bde317e7bbf548cc2b | [
"BSD-3-Clause"
] | null | null | null | unsorted/pythonsnippets_0012.py | fiddlerwoaroof/sandbox | 652acaf710a8b60f005769bde317e7bbf548cc2b | [
"BSD-3-Clause"
] | null | null | null | from twisted.spread import pb
from twisted.internet import reactor
from twisted.python import util
factory = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, factory)
d = factory.getRootObject()
a = []
d.addCallback(lambda object: object.callRemote("nextQuote"))
d.addCallback(lambda echo: a.append(echo))
d.a... | 31.923077 | 60 | 0.780723 | from twisted.spread import pb
from twisted.internet import reactor
from twisted.python import util
factory = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, factory)
d = factory.getRootObject()
a = []
d.addCallback(lambda object: object.callRemote("nextQuote"))
d.addCallback(lambda echo: a.append(echo))
d.a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00e606cc1e5c05e868edff946b6420b304d71581 | 8,962 | py | Python | yolo_opencv_fun.py | samsu2018/yolov5_6.0_opencvdnn_python | 6d2d350026cd82528820ae4f3a150f53db3ca04d | [
"Apache-2.0"
] | null | null | null | yolo_opencv_fun.py | samsu2018/yolov5_6.0_opencvdnn_python | 6d2d350026cd82528820ae4f3a150f53db3ca04d | [
"Apache-2.0"
] | null | null | null | yolo_opencv_fun.py | samsu2018/yolov5_6.0_opencvdnn_python | 6d2d350026cd82528820ae4f3a150f53db3ca04d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
###################################################################
# Object detection - YOLOv5_6.0 - OpenCV dnn
# From : https://github.com/samsu2018/yolov5_6.0_opencvdnn_python
# Modify : Sam Su (1, 11, 2022)
##################################################################
import cv2
import ... | 47.417989 | 148 | 0.556237 | # -*- coding: utf-8 -*-
###################################################################
# Object detection - YOLOv5_6.0 - OpenCV dnn
# From : https://github.com/samsu2018/yolov5_6.0_opencvdnn_python
# Modify : Sam Su (1, 11, 2022)
##################################################################
import cv2
import ... | 3 | 0 | 0 | 6,814 | 0 | 1,054 | 0 | -9 | 90 |
86dbc2c50c990389c3b7493c68c070657ec59ea2 | 5,597 | py | Python | test_single.py | hsuan197/generative-inpainting-pytorch | 2fa379f5e10ee72b64b4820f1f7ac7160da16e69 | [
"MIT"
] | null | null | null | test_single.py | hsuan197/generative-inpainting-pytorch | 2fa379f5e10ee72b64b4820f1f7ac7160da16e69 | [
"MIT"
] | null | null | null | test_single.py | hsuan197/generative-inpainting-pytorch | 2fa379f5e10ee72b64b4820f1f7ac7160da16e69 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
parser = ArgumentParser()
parser.add_argument('--config', type=str, default='configs/config.yaml',
help="training configuration")
parser.add_argument('--seed',... | 41.154412 | 105 | 0.597999 | import os
import random
from PIL import Image
from argparse import ArgumentParser
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
import torchvision.utils as vutils
from model.networks import Generator
from utils.tools import get_config, is_image_fil... | 0 | 0 | 0 | 0 | 0 | 4,547 | 0 | 83 | 201 |
67073ac34608f3b47fb20c3d4e67d249fa43fa50 | 845 | py | Python | src/connection.py | rodrigofaccioli/drugdesignCassandra | de84590fd781fcea8b9a55d58cf8edcc654a879c | [
"Apache-2.0"
] | null | null | null | src/connection.py | rodrigofaccioli/drugdesignCassandra | de84590fd781fcea8b9a55d58cf8edcc654a879c | [
"Apache-2.0"
] | null | null | null | src/connection.py | rodrigofaccioli/drugdesignCassandra | de84590fd781fcea8b9a55d58cf8edcc654a879c | [
"Apache-2.0"
] | null | null | null |
"""
Function to create a connection object
"""
| 21.125 | 52 | 0.71716 | from cassandra.cluster import Cluster
"""
Function to create a connection object
"""
def create_connection(nodeIP, keyspaceName):
client = Connection()
client.connect([nodeIP])
client.set_keyspace(keyspaceName)
return client
class Connection:
session = None
keyspace = ""
def connect(sel... | 0 | 0 | 0 | 569 | 0 | 142 | 0 | 16 | 67 |
1486a360dd7f4b817b63959172531787c4bc5dff | 1,663 | py | Python | python/mystuff/prime_number_generator.py | DrGaud/Python | 6b9570b78ef5c073d91be17d6ea140f641eb1e30 | [
"MIT"
] | null | null | null | python/mystuff/prime_number_generator.py | DrGaud/Python | 6b9570b78ef5c073d91be17d6ea140f641eb1e30 | [
"MIT"
] | null | null | null | python/mystuff/prime_number_generator.py | DrGaud/Python | 6b9570b78ef5c073d91be17d6ea140f641eb1e30 | [
"MIT"
] | null | null | null | """ This is a script to generate prime numbers from a range of numbers.
Or by checking to see if the input number is prime.
"""
#Calculate the prime numbers between two numbers
#Allow the user to enter in a range of numbers
#Secondly be able to have the user enter a number to check to see if it is prime
#thirdly have ... | 29.696429 | 94 | 0.706554 | """ This is a script to generate prime numbers from a range of numbers.
Or by checking to see if the input number is prime.
"""
#Calculate the prime numbers between two numbers
#Allow the user to enter in a range of numbers
#Secondly be able to have the user enter a number to check to see if it is prime
#thirdly have ... | 0 | 0 | 0 | 0 | 0 | 611 | 0 | 0 | 48 |
69c5c21cd7a3be4bffb1c4180c13a738a27343c9 | 245 | py | Python | CCC/ccc16j4.py | crackersamdjam/DMOJ-Solutions | 97992566595e2c7bf41b5da9217d8ef61bdd1d71 | [
"MIT"
] | null | null | null | CCC/ccc16j4.py | crackersamdjam/DMOJ-Solutions | 97992566595e2c7bf41b5da9217d8ef61bdd1d71 | [
"MIT"
] | null | null | null | CCC/ccc16j4.py | crackersamdjam/DMOJ-Solutions | 97992566595e2c7bf41b5da9217d8ef61bdd1d71 | [
"MIT"
] | null | null | null | h, m = map(int, input().split(':'))
t = h*60+m
for i in range(120):
if (t >= 7*60 and t < 10*60) or (t >= 15*60 and t < 19*60):
t += 2
else:
t += 1
h = t//60%24
m = t%60
# print(f'{h:02d}:{m:02d}')
print('%02d:%02d' % (h, m)) | 18.846154 | 61 | 0.453061 | h, m = map(int, input().split(':'))
t = h*60+m
for i in range(120):
if (t >= 7*60 and t < 10*60) or (t >= 15*60 and t < 19*60):
t += 2
else:
t += 1
h = t//60%24
m = t%60
# print(f'{h:02d}:{m:02d}')
print('%02d:%02d' % (h, m)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c695d019724841cad936320efcbe9ffea1a65010 | 1,064 | py | Python | qiskit-runtime/qiskit_runtime/test_server/worker.py | Avhijit-codeboy/Portfolio-Diversification | b71abd4365a21e4c9939bd8c52cbeb83fd496583 | [
"Apache-2.0"
] | null | null | null | qiskit-runtime/qiskit_runtime/test_server/worker.py | Avhijit-codeboy/Portfolio-Diversification | b71abd4365a21e4c9939bd8c52cbeb83fd496583 | [
"Apache-2.0"
] | null | null | null | qiskit-runtime/qiskit_runtime/test_server/worker.py | Avhijit-codeboy/Portfolio-Diversification | b71abd4365a21e4c9939bd8c52cbeb83fd496583 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# This code is part of qiskit-runtime.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... | 28 | 78 | 0.716165 | #!/usr/bin/env python
# This code is part of qiskit-runtime.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 46 |
62d9574514433ddf368376bfbf58107fe55041eb | 20,631 | py | Python | Tools/wapiti/wapitiCore/net/web.py | Anaswae/ITWSV | a8c3944aa0b44b6c4b520afef15f4a1a2ebe98ce | [
"MIT"
] | 39 | 2019-10-25T07:05:36.000Z | 2022-03-31T23:26:51.000Z | Tools/wapiti/wapitiCore/net/web.py | Anaswae/ITWSV | a8c3944aa0b44b6c4b520afef15f4a1a2ebe98ce | [
"MIT"
] | 1 | 2021-05-27T16:39:21.000Z | 2021-05-27T16:39:21.000Z | Tools/wapiti/wapitiCore/net/web.py | Anaswae/ITWSV | a8c3944aa0b44b6c4b520afef15f4a1a2ebe98ce | [
"MIT"
] | 17 | 2019-10-26T08:03:20.000Z | 2022-02-04T04:11:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of the Wapiti project (http://wapiti.sourceforge.net)
# Copyright (C) 2008-2018 Nicolas Surribas
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | 33.491883 | 117 | 0.585672 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of the Wapiti project (http://wapiti.sourceforge.net)
# Copyright (C) 2008-2018 Nicolas Surribas
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | 0 | 5,088 | 0 | 10,271 | 0 | 169 | 0 | 18 | 112 |
81349bca698b9d986373c64599065f41ed8657f2 | 1,370 | py | Python | y2020/vision/tools/python_code/image_capture.py | AustinSchuh/971-Robot-Code | 99abc66fd2d899c0bdab338dc6f57dc5def9be8d | [
"Apache-2.0"
] | 39 | 2021-06-18T03:22:30.000Z | 2022-03-21T15:23:43.000Z | y2020/vision/tools/python_code/image_capture.py | AustinSchuh/971-Robot-Code | 99abc66fd2d899c0bdab338dc6f57dc5def9be8d | [
"Apache-2.0"
] | 10 | 2021-06-18T03:22:19.000Z | 2022-03-18T22:14:15.000Z | y2020/vision/tools/python_code/image_capture.py | AustinSchuh/971-Robot-Code | 99abc66fd2d899c0bdab338dc6f57dc5def9be8d | [
"Apache-2.0"
] | 4 | 2021-08-19T19:20:04.000Z | 2022-03-08T07:33:18.000Z | #!/usr/bin/python3
import sys
import gflags
FLAGS = gflags.FLAGS
if __name__ == '__main__':
argv = FLAGS(sys.argv)
sys.exit(main(argv))
| 25.849057 | 72 | 0.618978 | #!/usr/bin/python3
import cv2
import datetime
import sys
import gflags
import glog
FLAGS = gflags.FLAGS
def main(argv):
# Open the device at the ID X for /dev/videoX
# NOTE: if camera_reader is running, it will need to be stopped
# since it will have control of the camera.
CAMERA_INDEX = 0
cap ... | 0 | 0 | 0 | 0 | 0 | 1,158 | 0 | -27 | 90 |
b44e90e4abe9789aee680d00a9dcb60ab43e4349 | 700 | py | Python | model_demo/home/views.py | n3k0fi5t/Django_Tutorial | e3953335ca88fe22c68268fd76afb7c4f9bbb55f | [
"MIT"
] | null | null | null | model_demo/home/views.py | n3k0fi5t/Django_Tutorial | e3953335ca88fe22c68268fd76afb7c4f9bbb55f | [
"MIT"
] | null | null | null | model_demo/home/views.py | n3k0fi5t/Django_Tutorial | e3953335ca88fe22c68268fd76afb7c4f9bbb55f | [
"MIT"
] | null | null | null |
# Create your views here.
| 26.923077 | 86 | 0.707143 | from django.shortcuts import render
from django.contrib.auth.models import User
from django.http import HttpResponse
from .models import RestaurantReview, Restaurant
from random import randint
def create_comment():
comment = ''
for _ in range(randint(20, 100)):
comment += chr(randint(0, ord('z')-ord... | 0 | 0 | 0 | 0 | 0 | 433 | 0 | 83 | 157 |
a176d4ff9de017217a4fc8ab125d87d84a5df5ef | 556 | py | Python | algorithms/binary_search.py | chiqj/grokking-algorithms | 4681a4ea806a441d3511c8fb9d91a218b3fc89de | [
"MIT"
] | 1 | 2019-05-04T10:35:08.000Z | 2019-05-04T10:35:08.000Z | algorithms/binary_search.py | chiqj/grokking-algorithms | 4681a4ea806a441d3511c8fb9d91a218b3fc89de | [
"MIT"
] | null | null | null | algorithms/binary_search.py | chiqj/grokking-algorithms | 4681a4ea806a441d3511c8fb9d91a218b3fc89de | [
"MIT"
] | null | null | null | # coding=utf-8
| 27.8 | 73 | 0.573741 | # coding=utf-8
from typing import Union
class BinarySearch:
def search(self, search_list: list, search_item) -> Union[int, None]:
low_idx = 0
high_idx = len(search_list) - 1
while low_idx <= high_idx:
current_idx = (low_idx + high_idx) // 2
if search_list[current_... | 0 | 0 | 0 | 491 | 0 | 0 | 0 | 3 | 46 |
9133a43ebceebfb5193e9b5b90b7edd5a9df7846 | 117 | py | Python | goodman_pipeline/broadcaster/__init__.py | simontorres/goodman-pipeline-live | 0ed20db75b69f973dfa63f94f18d1c6a5e826ea8 | [
"BSD-3-Clause"
] | null | null | null | goodman_pipeline/broadcaster/__init__.py | simontorres/goodman-pipeline-live | 0ed20db75b69f973dfa63f94f18d1c6a5e826ea8 | [
"BSD-3-Clause"
] | 1 | 2018-08-17T17:13:32.000Z | 2018-08-17T17:13:32.000Z | goodman_pipeline/broadcaster/__init__.py | simontorres/goodman-pipeline-live | 0ed20db75b69f973dfa63f94f18d1c6a5e826ea8 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import | 29.25 | 47 | 0.846154 | from __future__ import absolute_import
from .core import (ZmqSubscriber, ZmqPublisher)
from .core import load_config | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 45 |
1e947714fcb73785ed1259737b90361f50f376ab | 3,073 | py | Python | tests/test_s3.py | daleroberts/nrt-predict | 4df580fdc77450f416279893579445d99e0784c6 | [
"Apache-2.0"
] | 2 | 2021-06-23T21:41:08.000Z | 2022-02-15T06:16:40.000Z | tests/test_s3.py | daleroberts/nrt-predict | 4df580fdc77450f416279893579445d99e0784c6 | [
"Apache-2.0"
] | 10 | 2021-04-07T05:05:02.000Z | 2021-06-23T21:49:29.000Z | tests/test_s3.py | GeoscienceAustralia/nrt-predict | 4df580fdc77450f416279893579445d99e0784c6 | [
"Apache-2.0"
] | 2 | 2021-04-07T00:56:32.000Z | 2021-06-23T01:18:02.000Z |
PORT = 9000
HOST = 'localhost'
KEY = "testtesttest"
#def test_ancillary_on_s3(minio, tmp_path):
# f = tmp_path / "test.yaml"
# g = tmp_path / "clip.geojson"
# f.write_text(textwrap.dedent("""
# clipshpfn: {g}
# models:
# - name: NoOp
# output: nbr.tif
# inputs:
# - filename:... | 27.936364 | 139 | 0.656036 | import subprocess
import textwrap
import pytest
import signal
import socket
import time
import os
PORT = 9000
HOST = 'localhost'
KEY = "testtesttest"
@pytest.fixture(scope="session")
def minio():
# Setup
os.environ['MINIO_ACCESS_KEY'] = KEY
os.environ['MINIO_SECRET_KEY'] = KEY
os.environ['MINT_MO... | 0 | 909 | 0 | 0 | 0 | 1,423 | 0 | -56 | 246 |
53c358cb93f6af7ae7a45bcd58015707530ef36a | 3,148 | py | Python | coloring_models.py | Not-aDr/Coloring_Using_CNN | e0a030defb7f03f67cff250ba5b858b864f9a02a | [
"MIT"
] | 1 | 2021-12-14T19:02:33.000Z | 2021-12-14T19:02:33.000Z | coloring_models.py | vis1511/Coloring_Using_CNN | e0a030defb7f03f67cff250ba5b858b864f9a02a | [
"MIT"
] | null | null | null | coloring_models.py | vis1511/Coloring_Using_CNN | e0a030defb7f03f67cff250ba5b858b864f9a02a | [
"MIT"
] | 1 | 2021-12-14T19:05:29.000Z | 2021-12-14T19:05:29.000Z | import torch.nn as nn
import torchvision.models as models
pretrained_model_path = 'pretrained/resnet_gray_weights.pth.tar'
| 46.985075 | 123 | 0.653748 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
pretrained_model_path = 'pretrained/resnet_gray_weights.pth.tar'
class Fusion_Upsample_Net(nn.Module):
def __init__(self,midlevel_input_size=128, global_input_size=512):
super(Fusion_Upsample_Ne... | 0 | 0 | 0 | 2,907 | 0 | 0 | 0 | 1 | 104 |
a83e7bdb3f3a2f8a900e41d3128f09a1bb8e3085 | 10,397 | py | Python | pysph/examples/rigid_body/ellipsoid.py | nilsmeyerkit/pysph | 65c90f63e41e5adf79585e8f479d7fc80a384462 | [
"BSD-3-Clause"
] | null | null | null | pysph/examples/rigid_body/ellipsoid.py | nilsmeyerkit/pysph | 65c90f63e41e5adf79585e8f479d7fc80a384462 | [
"BSD-3-Clause"
] | null | null | null | pysph/examples/rigid_body/ellipsoid.py | nilsmeyerkit/pysph | 65c90f63e41e5adf79585e8f479d7fc80a384462 | [
"BSD-3-Clause"
] | 3 | 2022-03-04T16:07:29.000Z | 2022-03-16T19:28:32.000Z | """Ellipsoid suspended in shear flow (2 hours).
An example to illustrate 3d pysph rigid_body framework
"""
from __future__ import print_function
import numpy as np
# PySPH base and carray imports
def jeffery_ode(phi, t, ar, G):
"""Jeffery's Equation for planar rotation of a rigid ellipsoid."""
lbd = (ar**2-1... | 37 | 78 | 0.52544 | """Ellipsoid suspended in shear flow (2 hours).
An example to illustrate 3d pysph rigid_body framework
"""
from __future__ import print_function
import numpy as np
from scipy.integrate import odeint
from pysph.base.nnps import DomainManager
from pysph.base.utils import (get_particle_array_wcsph,
... | 0 | 0 | 0 | 8,933 | 0 | 0 | 0 | 636 | 334 |
28acc1dd5efff34ef4fa5a4bc4d77e11276846b1 | 4,622 | py | Python | faster-rcnn-base-model/code/tuning.py | shuyiii/A-Hybrid-of-Fast-rcnn-and-Bayesian-Model-for-Object-Detection | 20834a658b416507c7a78d5d0f09b15f9370a802 | [
"Apache-2.0"
] | null | null | null | faster-rcnn-base-model/code/tuning.py | shuyiii/A-Hybrid-of-Fast-rcnn-and-Bayesian-Model-for-Object-Detection | 20834a658b416507c7a78d5d0f09b15f9370a802 | [
"Apache-2.0"
] | null | null | null | faster-rcnn-base-model/code/tuning.py | shuyiii/A-Hybrid-of-Fast-rcnn-and-Bayesian-Model-for-Object-Detection | 20834a658b416507c7a78d5d0f09b15f9370a802 | [
"Apache-2.0"
] | null | null | null | #tuning Parameter
import numpy as np
import glob
import os
import matplotlib.pyplot as plt
import matplotlib.patches as patches
path='/fs/project/PAS1263/src/models/research/object_detection/chairtable/Bndbox/train/'
stat=np.load('../prior/stat.npy')
cn=np.load('../prior/onlychair_num.npy')
tn=np.load('../prior/onlytab... | 41.267857 | 94 | 0.53743 | #tuning Parameter
import numpy as np
import glob
import os
import pandas as pd
import scipy
import matplotlib.pyplot as plt
from sklearn import datasets, linear_model
from scipy.stats import norm
from sklearn.neighbors import KernelDensity
from scipy.stats import poisson
import math
from itertools import permutations
i... | 0 | 0 | 0 | 0 | 0 | 773 | 0 | 75 | 264 |
be07a8071fd470a009ae8cabcdaaf7bbcb9d626a | 45,500 | py | Python | src/larksuiteoapi/service/bitable/v1/api.py | VXenomac/oapi-sdk-python | 156b789b3d20653802f64842c9a26229dd9252d7 | [
"Apache-2.0"
] | 50 | 2021-04-11T05:24:10.000Z | 2022-03-29T10:14:13.000Z | src/larksuiteoapi/service/bitable/v1/api.py | larksuite/oapi-sdk-python | 70fda5b1ccf765938bf207dff0117c0c03a93605 | [
"Apache-2.0"
] | 20 | 2021-04-07T15:17:44.000Z | 2022-03-23T06:27:12.000Z | src/larksuiteoapi/service/bitable/v1/api.py | VXenomac/oapi-sdk-python | 156b789b3d20653802f64842c9a26229dd9252d7 | [
"Apache-2.0"
] | 8 | 2021-04-25T15:02:17.000Z | 2022-03-13T15:00:59.000Z | # -*- coding: UTF-8 -*-
# Code generated by lark suite oapi sdk gen
| 35.939968 | 163 | 0.646901 | # -*- coding: UTF-8 -*-
# Code generated by lark suite oapi sdk gen
from typing import *
from ....api import Request as APIRequest, Response as APIResponse, set_timeout, set_tenant_key, set_user_access_token, set_path_params, \
set_query_params, set_response_stream, set_is_response_stream, FormData, FormDataFile
... | 0 | 0 | 0 | 44,374 | 0 | 0 | 0 | 286 | 733 |
6a29d5ef693f251cd2c38e20548c2b51080069c5 | 1,323 | py | Python | detect_blur.py | Gustafferson/particleVirtualization | 358fc8d9cb8c2e14b2d63b69518ee2d8c009cabf | [
"MIT"
] | null | null | null | detect_blur.py | Gustafferson/particleVirtualization | 358fc8d9cb8c2e14b2d63b69518ee2d8c009cabf | [
"MIT"
] | null | null | null | detect_blur.py | Gustafferson/particleVirtualization | 358fc8d9cb8c2e14b2d63b69518ee2d8c009cabf | [
"MIT"
] | null | null | null | # import the necessary packages
from imutils import paths
import argparse
import cv2
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--images", required=True,
help="path to input directory of images")
ap.add_argument("-t", "--threshold", type=float, defau... | 33.923077 | 78 | 0.733182 | # import the necessary packages
from imutils import paths
import argparse
import cv2
def variance_of_laplacian(image):
# compute the Laplacian of the image and then return the focus
# measure, which is simply the variance of the Laplacian
return cv2.Laplacian(image, cv2.CV_64F).var()
# construct the argument par... | 0 | 0 | 0 | 0 | 0 | 181 | 0 | 0 | 23 |
37369dcd8aed45b290f9bc7ddf36c6da2b70629e | 5,549 | py | Python | img2dataset/writer.py | rom1504/img2dataset | 227ab8a5c2dbb54c702c195b094576a86feec15f | [
"MIT"
] | 482 | 2021-08-12T07:33:03.000Z | 2022-03-31T18:28:01.000Z | img2dataset/writer.py | rom1504/img2dataset | 227ab8a5c2dbb54c702c195b094576a86feec15f | [
"MIT"
] | 118 | 2021-08-12T07:02:37.000Z | 2022-03-31T20:20:18.000Z | img2dataset/writer.py | rom1504/img2dataset | 227ab8a5c2dbb54c702c195b094576a86feec15f | [
"MIT"
] | 39 | 2021-08-21T20:31:46.000Z | 2022-03-30T12:16:49.000Z | """"writer module handle writing the images to disk"""
| 39.635714 | 112 | 0.63597 | """"writer module handle writing the images to disk"""
import webdataset as wds
import json
import pandas as pd
import pyarrow.parquet as pq
import pyarrow as pa
import fsspec
class BufferedParquetWriter:
"""Write samples to parquet files incrementally with a buffer"""
def __init__(self, output_file, buffer... | 0 | 0 | 0 | 5,276 | 0 | 0 | 0 | -11 | 225 |
7748d8fdfd4062ded5084bacdf90b2cfc6c20d75 | 4,738 | py | Python | project/infoWindow.py | yaxzo/electronic_library | 4385d9d1acc8174ad50ef2f2ff06d2806c361dca | [
"MIT"
] | null | null | null | project/infoWindow.py | yaxzo/electronic_library | 4385d9d1acc8174ad50ef2f2ff06d2806c361dca | [
"MIT"
] | null | null | null | project/infoWindow.py | yaxzo/electronic_library | 4385d9d1acc8174ad50ef2f2ff06d2806c361dca | [
"MIT"
] | null | null | null | from PyQt6 import QtWidgets
import sys
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
InfoWindow = QtWidgets.QMainWindow()
ui = UiInfoWindow()
ui.setup_ui(InfoWindow)
InfoWindow.show()
sys.exit(app.exec())
| 43.87037 | 89 | 0.689954 | from PyQt6 import QtCore, QtWidgets
import sys
class UiInfoWindow(object):
# ф-ция с основными настройками окна
def setup_ui(self, info_window):
# название объекта и размер окна
info_window.setObjectName("InfoWindow")
info_window.resize(380, 590)
# создание виджет... | 308 | 0 | 0 | 4,283 | 0 | 0 | 0 | 8 | 25 |
d0444306a9aed3c85300a33a47a81feb575f0061 | 28,509 | py | Python | spearmint/visualizations/progress_curve.py | fernandezdaniel/Spearmint | 3c9e0a4be6108c3d652606bd957f0c9ae1bfaf84 | [
"RSA-MD"
] | 6 | 2021-06-29T11:26:49.000Z | 2022-01-20T18:12:47.000Z | spearmint/visualizations/progress_curve.py | fernandezdaniel/Spearmint | 3c9e0a4be6108c3d652606bd957f0c9ae1bfaf84 | [
"RSA-MD"
] | null | null | null | spearmint/visualizations/progress_curve.py | fernandezdaniel/Spearmint | 3c9e0a4be6108c3d652606bd957f0c9ae1bfaf84 | [
"RSA-MD"
] | 9 | 2018-06-28T13:06:35.000Z | 2021-06-20T18:21:58.000Z | # -*- coding: utf-8 -*-
# spearmint
#
# Academic and Non-Commercial Research Use Software License and Terms
# of Use
#
# Spearmint is a software package to perform Bayesian optimization
# according to specific algorithms (the Software). The Software is
# designed to automatically run experiments (thus the code name
# ... | 45.324324 | 133 | 0.639482 | # -*- coding: utf-8 -*-
# spearmint
#
# Academic and Non-Commercial Research Use Software License and Terms
# of Use
#
# Spearmint is a software package to perform Bayesian optimization
# according to specific algorithms (the “Software”). The Software is
# designed to automatically run experiments (thus the code name
... | 107 | 0 | 0 | 0 | 0 | 14,071 | 0 | 369 | 422 |
0a6f71338c1e185a263af467ec3bf1b85d46b602 | 5,167 | py | Python | robustness_DGI.py | JonnoB/Spring_Embeddings_paper | fe36b1212d533b4b79074d338d945fa6af3b1079 | [
"Apache-2.0"
] | null | null | null | robustness_DGI.py | JonnoB/Spring_Embeddings_paper | fe36b1212d533b4b79074d338d945fa6af3b1079 | [
"Apache-2.0"
] | null | null | null | robustness_DGI.py | JonnoB/Spring_Embeddings_paper | fe36b1212d533b4b79074d338d945fa6af3b1079 | [
"Apache-2.0"
] | null | null | null | import os
import networkx as nx
import pandas as pd
import numpy as np
from stellargraph.mapper import (CorruptedGenerator, FullBatchNodeGenerator)
from stellargraph import StellarGraph
from stellargraph.layer import GCN, DeepGraphInfomax
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.callbacks impo... | 38.849624 | 111 | 0.73234 | import os
import networkx as nx
import pandas as pd
import numpy as np
from stellargraph.mapper import (
CorruptedGenerator,
FullBatchNodeGenerator,
)
from stellargraph import StellarGraph
from stellargraph.layer import GCN, DeepGraphInfomax
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.cal... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 |
36052ea0bda433e5f850b65f759153390b7fb85f | 489 | py | Python | scripts/settings.py | mastercoder82/FlickrIndex | 6710da1bf57a1210b3f4a12a6659f2e2090ae894 | [
"MIT"
] | null | null | null | scripts/settings.py | mastercoder82/FlickrIndex | 6710da1bf57a1210b3f4a12a6659f2e2090ae894 | [
"MIT"
] | 2 | 2021-02-08T20:17:07.000Z | 2021-06-01T21:46:37.000Z | scripts/settings.py | mastercoder82/FlickrIndex | 6710da1bf57a1210b3f4a12a6659f2e2090ae894 | [
"MIT"
] | null | null | null | # Ignore pictures where the tagged concept has a probability below the threshold
THRESHOLD = 0.9
# Number of pictures to index
MAX_MEDIA = 1000
# Clarifai API details - http://www.clarifai.com/api
CLARIFAI_APP_ID = 'xxx'
CLARIFAI_APP_SECRET = 'xxx'
# Algolia API details = http://www.clarifai.com/api
ALGOLIA_APP_ID = ... | 28.764706 | 80 | 0.758691 | # Ignore pictures where the tagged concept has a probability below the threshold
THRESHOLD = 0.9
# Number of pictures to index
MAX_MEDIA = 1000
# Clarifai API details - http://www.clarifai.com/api
CLARIFAI_APP_ID = 'xxx'
CLARIFAI_APP_SECRET = 'xxx'
# Algolia API details = http://www.clarifai.com/api
ALGOLIA_APP_ID = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c7206ee64590a6c9b26e5925643c77cfd32b66e1 | 469 | py | Python | Mundo 2 Estruturas de Controle/ex067.py | costa53/curso_em_video_python3 | 4f859641324f8b35be56d807f40457d7dddc451f | [
"MIT"
] | 1 | 2022-02-17T16:23:52.000Z | 2022-02-17T16:23:52.000Z | Mundo 2 Estruturas de Controle/ex067.py | costa53/curso_em_video_python3 | 4f859641324f8b35be56d807f40457d7dddc451f | [
"MIT"
] | null | null | null | Mundo 2 Estruturas de Controle/ex067.py | costa53/curso_em_video_python3 | 4f859641324f8b35be56d807f40457d7dddc451f | [
"MIT"
] | null | null | null | # DESAFIO 067
# Faa um programa que mostre a tabuada de vrios nmeros, um de cada vez, para cada valor digitado
# pelo usurio. O programa ser interrompido quando o nmero solicitado for negativo.
while True:
num = int(input('Digite um nmero para ver sua tabuada: '))
print('-' * 30)
if num < 0:
break
... | 33.5 | 99 | 0.648188 | # DESAFIO 067
# Faça um programa que mostre a tabuada de vários números, um de cada vez, para cada valor digitado
# pelo usuário. O programa será interrompido quando o número solicitado for negativo.
while True:
num = int(input('Digite um número para ver sua tabuada: '))
print('-' * 30)
if num < 0:
... | 14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
da16458bed5ea8d008d9aa06d2e8df73a85426b6 | 37,910 | py | Python | ubertool/beerex/beerex_exe.py | qed-uber/ubertool | 472a143e110f634afdfe03d503e5f442b1e57b86 | [
"Unlicense"
] | 2 | 2018-01-02T12:58:00.000Z | 2018-04-03T15:40:59.000Z | ubertool/beerex/beerex_exe.py | qed-uber/ubertool | 472a143e110f634afdfe03d503e5f442b1e57b86 | [
"Unlicense"
] | 21 | 2017-08-02T18:00:16.000Z | 2019-08-20T15:57:09.000Z | ubertool/beerex/beerex_exe.py | quanted/ubertool | 472a143e110f634afdfe03d503e5f442b1e57b86 | [
"Unlicense"
] | null | null | null | from __future__ import division #brings in Python 3.0 mixed type calculations
import os
import sys
#find parent directory and import model
parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
sys.path.append(parentddir)
# if __name__ == '__main__':
# pd_in = pd.DataFrame({
# ... | 45.564904 | 178 | 0.634714 | from __future__ import division #brings in Python 3.0 mixed type calculations
import numpy as np
import os
import pandas as pd
import sys
#find parent directory and import model
parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
sys.path.append(parentddir)
from base.uber_model impo... | 0 | 0 | 0 | 35,872 | 0 | 0 | 0 | 30 | 136 |