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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2cb176a75a9d45bf615f1f167aa8d3cc9191262f | 1,978 | py | Python | src/utils/send_email.py | HaoJiangGuo/fp-server | 9c00b8f0ee64049eb9f214c3efe1fdee977542a6 | [
"MIT"
] | 173 | 2018-06-10T14:21:05.000Z | 2022-03-24T09:24:35.000Z | src/utils/send_email.py | HaoJiangGuo/fp-server | 9c00b8f0ee64049eb9f214c3efe1fdee977542a6 | [
"MIT"
] | 19 | 2018-06-17T08:33:04.000Z | 2021-02-09T07:10:41.000Z | src/utils/send_email.py | HaoJiangGuo/fp-server | 9c00b8f0ee64049eb9f214c3efe1fdee977542a6 | [
"MIT"
] | 45 | 2018-06-10T14:49:12.000Z | 2022-03-24T09:24:38.000Z | # -*- coding:utf-8 -*-
"""
"""
if __name__ == "__main__":
test()
| 27.472222 | 78 | 0.600607 | # -*- coding:utf-8 -*-
"""
发送邮件
"""
import email
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
class MailSender(object):
def __init__(self, host, username, password, to_emails, subject, content):
""" 初始化
@param host 邮件服务端host
... | 96 | 0 | 0 | 1,437 | 0 | 275 | 0 | 24 | 135 |
457fe4ab3be3a4a162e2f2354e33660cec704ad0 | 4,358 | py | Python | tests/bugs/cisco/test_cscvg76186.py | Dom932/device-bug-checker | f1b04813ac4bddc07cc0c3ce62640246fcaaf34f | [
"MIT"
] | null | null | null | tests/bugs/cisco/test_cscvg76186.py | Dom932/device-bug-checker | f1b04813ac4bddc07cc0c3ce62640246fcaaf34f | [
"MIT"
] | null | null | null | tests/bugs/cisco/test_cscvg76186.py | Dom932/device-bug-checker | f1b04813ac4bddc07cc0c3ce62640246fcaaf34f | [
"MIT"
] | null | null | null |
unaffected_output1 = "Role: Client (SmartInstall Disabled)"
unaffected_output2 = "Capability: Client\nOper Mode: Disabled\nRole: NA"
affected_output1 = "Role: Client (SmartInstall enabled)"
affected_output2 = "Capability: Client\nOper Mode: Enabled\nRole: Client"
not_supported = "Command not supported on platform"
... | 34.864 | 113 | 0.688619 | import pytest
from bugs.cisco import CSCvg76186
from devices.cisco import CiscoIOS
unaffected_output1 = "Role: Client (SmartInstall Disabled)"
unaffected_output2 = "Capability: Client\nOper Mode: Disabled\nRole: NA"
affected_output1 = "Role: Client (SmartInstall enabled)"
affected_output2 = "Capability: Client\nOper... | 0 | 469 | 0 | 3,414 | 0 | 0 | 0 | 17 | 136 |
909cbf44eb040c711d3814dcb9d6dc256f0a5ada | 242 | py | Python | main.py | cbhua/tool-bin2png | ed071c284d0d6a6c0145ea0dae0d9d3ad07aadbe | [
"MIT"
] | 3 | 2021-03-12T16:31:26.000Z | 2021-05-28T10:11:55.000Z | main.py | cbhua/tool-bin2png | ed071c284d0d6a6c0145ea0dae0d9d3ad07aadbe | [
"MIT"
] | null | null | null | main.py | cbhua/tool-bin2png | ed071c284d0d6a6c0145ea0dae0d9d3ad07aadbe | [
"MIT"
] | null | null | null | import os
from src.bin2png import bin2png
for root, dirs, files in os.walk('./bin'):
for file in files:
if not file.endswith('.bin'):
continue
bin2png(os.path.join(root, file), './png')
print('DONE') | 22 | 50 | 0.582645 | import os
from src.bin2png import bin2png
for root, dirs, files in os.walk('./bin'):
for file in files:
if not file.endswith('.bin'):
continue
bin2png(os.path.join(root, file), './png')
print('DONE') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d766f0dff6f8063405f5b2726577d753b3ee1d9 | 3,804 | py | Python | python/test/amstart/parse_log.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | 2 | 2017-06-07T03:20:42.000Z | 2020-01-07T09:14:26.000Z | python/test/amstart/parse_log.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | python/test/amstart/parse_log.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import matplotlib.pyplot as plt
logfile_live = "./android-live.logcat"
logfile_app = "./android-app.logcat"
TIMEFORMAT = "\d{2}-\d{2} (?P<datetime>\d{2}:\d{2}:\d{2}\.\d{3})"
re_keyevent = re.compile(TIMEFORMAT + ".*action=0x0, flags=0x8, keyCode=21.*")
re_l_pau... | 37.294118 | 112 | 0.588591 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
from datetime import datetime
import matplotlib.pyplot as plt
logfile_live = "./android-live.logcat"
logfile_app = "./android-app.logcat"
TIMEFORMAT = "\d{2}-\d{2} (?P<datetime>\d{2}:\d{2}:\d{2}\.\d{3})"
re_keyevent = re.compile(TIMEFORMAT + ".*action=0x0, flag... | 0 | 0 | 0 | 0 | 0 | 2,222 | 0 | 8 | 68 |
817ad7c0e77858d667fc47d3f904ab4b601aff90 | 2,239 | py | Python | examples/ds18b20/main.py | MAH1987/microhomie | e56fda36837e1745402e4c0ffb1642e01dfd3dea | [
"MIT"
] | 61 | 2018-03-12T22:38:12.000Z | 2022-02-19T03:58:35.000Z | examples/ds18b20/main.py | MAH1987/microhomie | e56fda36837e1745402e4c0ffb1642e01dfd3dea | [
"MIT"
] | 32 | 2018-02-25T06:48:59.000Z | 2021-07-13T23:38:59.000Z | examples/ds18b20/main.py | MAH1987/microhomie | e56fda36837e1745402e4c0ffb1642e01dfd3dea | [
"MIT"
] | 17 | 2018-03-29T07:40:09.000Z | 2021-05-30T09:47:59.000Z | import time
import asyncio
from ds18x20 import DS18X20
from homie.node import HomieNode
from homie.device import HomieDevice, await_ready_state
from homie.property import HomieProperty
from homie.constants import FLOAT
from machine import Pin
from onewire import OneWire
if __name__ == "__main__":
main()
| 27.304878 | 78 | 0.609201 | import time
import uasyncio ad asyncio
from ds18x20 import DS18X20
from homie.node import HomieNode
from homie.device import HomieDevice, await_ready_state
from homie.property import HomieProperty
from homie.constants import FLOAT
from machine import Pin
from onewire import OneWire
class DS18B20(HomieNode):
def... | 2 | 418 | 542 | 827 | 0 | 78 | 0 | 12 | 46 |
e24a38cc24327da8cdaa402c02eb7def92013bc2 | 223 | py | Python | appendix/pytorch/nsoltSubbandDeserialization2dLayer.py | nixir/SaivDr | f54bf29ef107916b26f42c0fbd6a23f2ef73b2b7 | [
"BSD-2-Clause"
] | 7 | 2018-11-26T08:49:24.000Z | 2021-09-15T08:46:35.000Z | appendix/pytorch/nsoltSubbandDeserialization2dLayer.py | nixir/SaivDr | f54bf29ef107916b26f42c0fbd6a23f2ef73b2b7 | [
"BSD-2-Clause"
] | 11 | 2019-12-02T11:20:18.000Z | 2022-02-14T05:17:11.000Z | appendix/pytorch/nsoltSubbandDeserialization2dLayer.py | nixir/SaivDr | f54bf29ef107916b26f42c0fbd6a23f2ef73b2b7 | [
"BSD-2-Clause"
] | 7 | 2019-06-05T07:45:20.000Z | 2021-09-15T08:46:36.000Z | import torch.nn as nn | 22.3 | 66 | 0.730942 | import torch
import torch.nn as nn
class NsoltSubbandDeserialization2dLayer(nn.Module):
def __init__(self):
super(NsoltSubbandDeserialization2dLayer, self).__init__()
def forward(self,x):
return x | 0 | 0 | 0 | 166 | 0 | 0 | 0 | -9 | 45 |
1a2fef043bb60b57d450dba7201945e2b51ef1aa | 2,325 | py | Python | sparse_ct/example/n2self_train.py | mozanunal/SparseCT | 97d7f06c0414f934c7fa36023adcf9fe4c071eaf | [
"MIT"
] | 11 | 2020-11-01T11:35:30.000Z | 2022-03-30T02:19:52.000Z | sparse_ct/example/n2self_train.py | mozanunal/SparseCT | 97d7f06c0414f934c7fa36023adcf9fe4c071eaf | [
"MIT"
] | 8 | 2020-12-13T12:17:38.000Z | 2021-12-21T21:04:27.000Z | sparse_ct/example/n2self_train.py | mozanunal/SparseCT | 97d7f06c0414f934c7fa36023adcf9fe4c071eaf | [
"MIT"
] | null | null | null | import glob
import numpy as np
import torch
from sparse_ct.reconstructor_2d.n2self import (N2SelfReconstructor)
from sparse_ct.reconstructor_2d.dataset import (EllipsesDataset)
if __name__ == "__main__":
params= {'batch_size': 8,
'shuffle': True,
'num_workers': 8}
N_PROJ = 64
pwd_... | 28.703704 | 97 | 0.60172 |
import random
from tqdm import tqdm
import glob
import numpy as np
import torch
from sparse_ct.reconstructor_2d.n2self import (
N2SelfReconstructor)
from sparse_ct.reconstructor_2d.dataset import (
DeepLesionDataset, EllipsesDataset)
if __name__ == "__main__":
params= {'batch_si... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 46 |
c59bef9a27c14a841661089c4012f24a6903ac37 | 11,604 | py | Python | pbil.py | duhines/NIC-MAXSAT | faab78fa72740e7dddc1444d5c3d8014f6b1ffe7 | [
"MIT"
] | 1 | 2018-10-18T16:39:03.000Z | 2018-10-18T16:39:03.000Z | pbil.py | duhines/NIC-MAXSAT | faab78fa72740e7dddc1444d5c3d8014f6b1ffe7 | [
"MIT"
] | null | null | null | pbil.py | duhines/NIC-MAXSAT | faab78fa72740e7dddc1444d5c3d8014f6b1ffe7 | [
"MIT"
] | null | null | null | """
Team: d3.js
Authors: David Anderson, Duncan Gans, Dustin Hines
Course: Nature-Inspired Computation
Assignment: Evolutionary Algorithms for MAXSAT: A Comparison of Genetic Algorithms
and Population Based Incremental Learning
Date: 1 October 2018
Description:
This file implements a PBIL approach to finding op... | 38.68 | 119 | 0.662789 | """
Team: d3.js
Authors: David Anderson, Duncan Gans, Dustin Hines
Course: Nature-Inspired Computation
Assignment: Evolutionary Algorithms for MAXSAT: A Comparison of Genetic Algorithms
and Population Based Incremental Learning
Date: 1 October 2018
Description:
This file implements a PBIL approach to finding op... | 0 | 0 | 0 | 3,883 | 0 | 0 | 0 | -2 | 112 |
14addc646899a196e5503353c560289ee548273f | 8,972 | py | Python | dark/diamond/hsp.py | UdoGi/dark-matter | 3d49e89fa5e81f83144119f6216c5774176d203b | [
"MIT"
] | 10 | 2016-03-09T09:43:14.000Z | 2021-04-03T21:46:12.000Z | dark/diamond/hsp.py | terrycojones/dark-matter | 67d16f870db6b4239e17e542bc6e3f072dc29c75 | [
"MIT"
] | 332 | 2015-01-07T12:37:30.000Z | 2022-01-20T15:48:11.000Z | dark/diamond/hsp.py | terrycojones/dark-matter | 67d16f870db6b4239e17e542bc6e3f072dc29c75 | [
"MIT"
] | 4 | 2016-03-08T14:56:39.000Z | 2021-01-27T08:11:27.000Z | from __future__ import division, print_function
import sys
from dark.btop import countGaps
def _debugPrint(hsp, queryLen, localDict, msg=''):
"""
Print debugging information showing the local variables used during
a call to normalizeHSP and the hsp and then raise an C{AssertionError}.
@param hsp: Th... | 45.313131 | 79 | 0.665961 | from __future__ import division, print_function
import sys
from dark.btop import countGaps
def _debugPrint(hsp, queryLen, localDict, msg=''):
"""
Print debugging information showing the local variables used during
a call to normalizeHSP and the hsp and then raise an C{AssertionError}.
@param hsp: Th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
801fc9f57fbc08f68d7eef8897a8e641de814a29 | 126,006 | py | Python | orcid_hub/utils.py | tenet-ac-za/NZ-ORCID-Hub | f1183fbb94509b102fa58d7812ed33d8f35c5d4d | [
"MIT"
] | 15 | 2017-02-06T01:41:57.000Z | 2021-07-22T08:53:40.000Z | orcid_hub/utils.py | tenet-ac-za/NZ-ORCID-Hub | f1183fbb94509b102fa58d7812ed33d8f35c5d4d | [
"MIT"
] | 82 | 2017-03-23T00:30:04.000Z | 2022-02-01T00:10:34.000Z | orcid_hub/utils.py | tenet-ac-za/NZ-ORCID-Hub | f1183fbb94509b102fa58d7812ed33d8f35c5d4d | [
"MIT"
] | 6 | 2017-03-23T07:26:05.000Z | 2021-02-23T11:20:21.000Z | # -*- coding: utf-8 -*-
"""Various utilities."""
import json
import logging
import os
import random
import string
from collections import defaultdict
from datetime import datetime
from itertools import groupby
from urllib.parse import urlencode, urlparse
import emails
import flask
import requests
import yaml
from fla... | 37.647445 | 119 | 0.528808 | # -*- coding: utf-8 -*-
"""Various utilities."""
import json
import logging
import os
import random
import string
import time
from collections import defaultdict
from datetime import date, datetime, timedelta
from itertools import filterfalse, groupby
from urllib.parse import quote, urlencode, urlparse
import emails
... | 0 | 62,969 | 0 | 326 | 662 | 210 | 0 | 313 | 485 |
8753108b880e316f5ac29a3dc2a15a1900dfbfe8 | 374 | py | Python | modulo-2/exercicios/biblioteca_fatorial.py | giselemanuel/programa-Ifood-backend | d12544c30e2a26f7e2e2cd85df38a3f2c8860fe7 | [
"MIT"
] | 3 | 2021-04-25T23:31:13.000Z | 2021-04-26T16:59:12.000Z | modulo-2/exercicios/biblioteca_fatorial.py | giselemanuel/programa-Ifood-backend | d12544c30e2a26f7e2e2cd85df38a3f2c8860fe7 | [
"MIT"
] | null | null | null | modulo-2/exercicios/biblioteca_fatorial.py | giselemanuel/programa-Ifood-backend | d12544c30e2a26f7e2e2cd85df38a3f2c8860fe7 | [
"MIT"
] | null | null | null | # importa a biblioteca factorial existente em math
from math import factorial
# cabealho do programa
print('-' * 30)
print(f'{"Calcula Fatorial":^30}')
print('-' * 30)
# solicita o nmero ao usurio
num = int(input('Digite um nmero: '))
# calcula o fatorial do nmero inserido
fatorial = factorial(num)
# imprime o fato... | 22 | 50 | 0.713904 | # importa a biblioteca factorial existente em math
from math import factorial
# cabeçalho do programa
print('-' * 30)
print(f'{"Calcula Fatorial":^30}')
print('-' * 30)
# solicita o número ao usuário
num = int(input('Digite um número: '))
# calcula o fatorial do número inserido
fatorial = factorial(num)
# imprime o... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c99a6aad64d4bc1dcae50dcacbb687762ade5158 | 279 | py | Python | packages/galapagos/scripts/run_traffic_light.py | 100kimch/ros_galapagos | 8f92cb93246c263b61199aef113e43cefc5f3939 | [
"MIT"
] | 2 | 2020-10-26T05:01:35.000Z | 2022-02-14T10:37:17.000Z | packages/galapagos/scripts/run_traffic_light.py | 100kimch/ros_galapagos | 8f92cb93246c263b61199aef113e43cefc5f3939 | [
"MIT"
] | null | null | null | packages/galapagos/scripts/run_traffic_light.py | 100kimch/ros_galapagos | 8f92cb93246c263b61199aef113e43cefc5f3939 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import rospy
from sensor_msgs.msg import CompressedImage
import processor
from constants import PATH_USBCAM
IS_DEBUG_MODE = True
CURRENT_STATE = 'traffic_light'
rospy.Subscriber(PATH_USBCAM, CompressedImage, processor.process_front_image, queue_size=1)
| 23.25 | 91 | 0.83871 | #!/usr/bin/env python3
import rospy
from sensor_msgs.msg import CompressedImage
import processor
from constants import PATH_USBCAM
IS_DEBUG_MODE = True
CURRENT_STATE = 'traffic_light'
rospy.Subscriber(PATH_USBCAM, CompressedImage, processor.process_front_image, queue_size=1)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
009674357f80908e1762b2aa1b8ef5892feb9fe5 | 5,739 | py | Python | globomap_driver_sample/driver.py | globocom/globomap-driver-sample | 7f49e4cf623da2075e94906142a3a82d3977fab9 | [
"Apache-2.0"
] | null | null | null | globomap_driver_sample/driver.py | globocom/globomap-driver-sample | 7f49e4cf623da2075e94906142a3a82d3977fab9 | [
"Apache-2.0"
] | null | null | null | globomap_driver_sample/driver.py | globocom/globomap-driver-sample | 7f49e4cf623da2075e94906142a3a82d3977fab9 | [
"Apache-2.0"
] | 1 | 2019-10-30T12:28:13.000Z | 2019-10-30T12:28:13.000Z | """
Copyright 2017 Globo.com
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 writ... | 31.190217 | 91 | 0.555323 | """
Copyright 2017 Globo.com
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 writ... | 0 | 1,599 | 0 | 3,273 | 0 | 0 | 0 | 65 | 158 |
a1ccc40256309bd83c5b22af9ac1a4bd1ac3d532 | 10,936 | py | Python | lib/data/datasets.py | Nirvana-fsociety/skip-ganomaly | 0d88b3904c6acec6cd9cb77222bb5467010955b6 | [
"MIT"
] | 158 | 2019-08-14T14:16:16.000Z | 2022-03-26T04:40:02.000Z | lib/data/datasets.py | Nirvana-fsociety/skip-ganomaly | 0d88b3904c6acec6cd9cb77222bb5467010955b6 | [
"MIT"
] | 24 | 2019-08-25T08:10:22.000Z | 2021-11-15T16:32:49.000Z | lib/data/datasets.py | Nirvana-fsociety/skip-ganomaly | 0d88b3904c6acec6cd9cb77222bb5467010955b6 | [
"MIT"
] | 68 | 2019-08-21T08:51:31.000Z | 2022-03-05T07:17:10.000Z | """
CREATE DATASETS
"""
# pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915
import torch.utils.data as data
import torch
import numpy as np
import os
import numpy as np
# pylint: disable=E1101
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
'.tif', ... | 34.939297 | 101 | 0.655541 | """
CREATE DATASETS
"""
# pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915
import torch.utils.data as data
import torch
from random import shuffle
from torchvision.datasets import DatasetFolder
from pathlib import Path
from PIL import Image
import numpy as np
import os
import os.path
import random
import imageio
... | 0 | 0 | 0 | 2,319 | 0 | 1,350 | 0 | 11 | 316 |
867e6dce8c62af6dcb2d30f65bd1ed5909e8b4db | 4,472 | py | Python | code/train.py | EricZhangSCUT/DeepPSC | 19a2b94cfacd6591e8e8c66cc69baf0422b4e9d0 | [
"MIT"
] | null | null | null | code/train.py | EricZhangSCUT/DeepPSC | 19a2b94cfacd6591e8e8c66cc69baf0422b4e9d0 | [
"MIT"
] | null | null | null | code/train.py | EricZhangSCUT/DeepPSC | 19a2b94cfacd6591e8e8c66cc69baf0422b4e9d0 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from model import DeepPSC
import dataset
from torch.utils.data import DataLoader
import pathlib
import os
import time
import logging
import argparse
from test import test
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--loc_dim', type=int, ... | 32.405797 | 80 | 0.605769 | import torch
import torch.nn as nn
from model import DeepPSC
import dataset
from torch.utils.data import DataLoader
import pathlib
import os
import time
import logging
import argparse
from test import test
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--loc_dim', type=int, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16583d58cb50dc29fe87a218adc0eb4eca4728bf | 3,273 | py | Python | src/vmware/azext_vmware/tests/latest/test_datastores_scenario.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-02-18T00:16:47.000Z | 2022-02-18T00:16:47.000Z | src/vmware/azext_vmware/tests/latest/test_datastores_scenario.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/vmware/azext_vmware/tests/latest/test_datastores_scenario.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 60.611111 | 221 | 0.659028 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 2,441 | 0 | 307 | 0 | 0 | 0 | 58 | 113 |
3f15425227aaae16ccd6a42bd73b24824aed6eb8 | 1,605 | py | Python | nicos_mlz/poli/devices/lubrication.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/poli/devices/lubrication.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/poli/devices/lubrication.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 38.214286 | 79 | 0.650467 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 0 | 0 | 0 | 378 | 0 | 0 | 0 | 32 | 68 |
c3f4e33f018b1540699f3d68b9901cb4709286ca | 2,090 | py | Python | src/neochi/brain/fits.py | neochi/brain | 79afa004ac3129645d9d751b8df5a6a9f934b754 | [
"MIT"
] | null | null | null | src/neochi/brain/fits.py | neochi/brain | 79afa004ac3129645d9d751b8df5a6a9f934b754 | [
"MIT"
] | 17 | 2020-01-28T22:51:19.000Z | 2022-03-11T23:51:15.000Z | src/neochi/brain/fits.py | neochi/brain | 79afa004ac3129645d9d751b8df5a6a9f934b754 | [
"MIT"
] | 1 | 2019-04-29T09:22:59.000Z | 2019-04-29T09:22:59.000Z | # MIT License
#
# Copyright (c) 2019 Morning Project Samurai (MPS)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | 43.541667 | 115 | 0.744498 | # MIT License
#
# Copyright (c) 2019 Morning Project Samurai (MPS)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | 0 | 0 | 0 | 0 | 0 | 769 | 0 | 8 | 135 |
0beef295c183b174fa594e2b2f66f198432374c0 | 866 | py | Python | projects/templatetags/include_as_js_str.py | wedk/todomvc-django-ujs | 3909f2448ee32412f0eebe1007d34fb66cbf7185 | [
"MIT"
] | 1 | 2016-01-08T21:58:02.000Z | 2016-01-08T21:58:02.000Z | projects/templatetags/include_as_js_str.py | wedk/todomvc-django-ujs | 3909f2448ee32412f0eebe1007d34fb66cbf7185 | [
"MIT"
] | null | null | null | projects/templatetags/include_as_js_str.py | wedk/todomvc-django-ujs | 3909f2448ee32412f0eebe1007d34fb66cbf7185 | [
"MIT"
] | null | null | null | # templatetags/include_as_js_str.py
from django import template
register = template.Library()
| 30.928571 | 102 | 0.683603 | # templatetags/include_as_js_str.py
from django import template
from django.template.loader_tags import do_include
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
register = template.Library()
def _escape_html_for_js(value):
return mark_safe(force_text(value).lstrip()
... | 0 | 111 | 0 | 201 | 0 | 245 | 0 | 76 | 135 |
69bdf78566b6cf86b3a31da9e8d15c104b9ca683 | 96,186 | py | Python | lenv/lib/python3.6/site-packages/Crypto/SelfTest/Hash/test_vectors/keccak/ShortMsgKAT_384.txt.py | shrey-c/DataLeakageDjango | a827c5a09e5501921f9fb97b656755671238dd63 | [
"BSD-3-Clause"
] | 6 | 2020-05-03T12:03:21.000Z | 2020-09-07T08:33:58.000Z | lenv/lib/python3.6/site-packages/Crypto/SelfTest/Hash/test_vectors/keccak/ShortMsgKAT_384.txt.py | shrey-c/DataLeakageDjango | a827c5a09e5501921f9fb97b656755671238dd63 | [
"BSD-3-Clause"
] | 3 | 2020-04-17T06:50:44.000Z | 2022-01-13T02:16:48.000Z | lenv/lib/python3.6/site-packages/Crypto/SelfTest/Hash/test_vectors/keccak/ShortMsgKAT_384.txt.py | shrey-c/DataLeakageDjango | a827c5a09e5501921f9fb97b656755671238dd63 | [
"BSD-3-Clause"
] | null | null | null | X XXXX XXXXXXXXX XXXX XXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXX
XXX X X
XXX X XX
XX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX X X
XXX X XX
XX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX X XX
XXX... | 93.657254 | 516 | 0.973302 | X XXXX XXXXXXXXX XXXX XXXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXX
XXX X X
XXX X XX
XX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX X X
XXX X XX
XX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXX X XX
XXX... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
23ad61f795e61dca9e73baf60cd302ddae30a928 | 865 | py | Python | old_run.py | csuastt/liusm | 818588f93bf4edeee2ec8eaee9579132943caf5a | [
"MIT"
] | 1 | 2021-12-03T09:05:30.000Z | 2021-12-03T09:05:30.000Z | old_run.py | csuastt/Stereo-Enhancement-of-Thermal-Imaging | 818588f93bf4edeee2ec8eaee9579132943caf5a | [
"MIT"
] | null | null | null | old_run.py | csuastt/Stereo-Enhancement-of-Thermal-Imaging | 818588f93bf4edeee2ec8eaee9579132943caf5a | [
"MIT"
] | null | null | null | import cv2 as cv
from matplotlib import pyplot as plt
imgL = cv.imread('images/example_l.png', 0)
imgR = cv.imread('images/example_r.png', 0)
window_size = 3 # wsize default 3; 5; 7 for SGBM reduced size image; 15 for SGBM full size image (1300px and above); 5 Works nicely
stereo = cv.StereoSGBM_create(
minDispar... | 34.6 | 132 | 0.715607 | import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
imgL = cv.imread('images/example_l.png', 0)
imgR = cv.imread('images/example_r.png', 0)
window_size = 3 # wsize default 3; 5; 7 for SGBM reduced size image; 15 for SGBM full size image (1300px and above); 5 Works nicely
stereo = cv.StereoSGBM_cr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
11384b21e98956d188e35014bcc9f6c4d8e3e3f9 | 2,374 | py | Python | test/test_data_on_home_page.py | SherMary/python_training | 071f9405ffb97ea2243ac2906713c6fa8ac62ba7 | [
"Apache-2.0"
] | null | null | null | test/test_data_on_home_page.py | SherMary/python_training | 071f9405ffb97ea2243ac2906713c6fa8ac62ba7 | [
"Apache-2.0"
] | null | null | null | test/test_data_on_home_page.py | SherMary/python_training | 071f9405ffb97ea2243ac2906713c6fa8ac62ba7 | [
"Apache-2.0"
] | null | null | null |
"""def test_data_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(
contact_from_edit_page)
assert co... | 51.608696 | 114 | 0.720303 | import re
from model.contact import Contact
def test_data_on_home_page_compared_with_bd(app, db):
contact_list_from_db = sorted(db.get_contact_list(), key=Contact.id_or_max)
contact_list_from_home_page = sorted(app.contact.get_contact_list(), key=Contact.id_or_max)
assert len(contact_list_from_home_page) ... | 0 | 0 | 0 | 0 | 0 | 1,565 | 0 | 0 | 136 |
383d3c089a3bb44aac080ea0cddbd7b8e38faac8 | 1,345 | py | Python | bindings/python/tests/__main__.py | finnhaedicke/metaSMT | 949245da0bf0f3c042cb589aaea5d015e2ed9e9a | [
"MIT"
] | 33 | 2015-04-09T14:14:25.000Z | 2022-03-27T08:55:58.000Z | bindings/python/tests/__main__.py | finnhaedicke/metaSMT | 949245da0bf0f3c042cb589aaea5d015e2ed9e9a | [
"MIT"
] | 28 | 2015-03-13T14:21:33.000Z | 2019-04-02T07:59:34.000Z | bindings/python/tests/__main__.py | finnhaedicke/metaSMT | 949245da0bf0f3c042cb589aaea5d015e2ed9e9a | [
"MIT"
] | 9 | 2015-04-22T18:10:51.000Z | 2021-08-06T12:44:12.000Z | import os
import re
import sys
import random
import unittest
test_str_re = re.compile(r'([^ ]+) \((.*)\)')
if __name__ == "__main__":
tests = unittest.defaultTestLoader.discover(os.path.dirname(__file__), pattern='*.py')
if len(sys.argv) == 2 and sys.argv[1] == '--discover':
map_tests(print_test, tests... | 23.189655 | 90 | 0.579926 | import os
import re
import sys
import random
import unittest
test_str_re = re.compile(r'([^ ]+) \((.*)\)')
def test_id(test):
m = test_str_re.match(str(test))
if m is None:
return None
t, h = m.groups()
return tuple(h.split('.')+[t])
def map_tests(fun, test):
if isinstance(test, unittest.suite.TestSu... | 0 | 0 | 0 | 0 | 0 | 350 | 0 | 0 | 92 |
bab7df1647e393fd0bdd4649c9e0b2430d2831de | 2,584 | py | Python | gfapy/line/common/version_conversion.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 44 | 2017-03-18T08:08:04.000Z | 2021-11-10T16:11:15.000Z | gfapy/line/common/version_conversion.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 22 | 2017-04-04T21:20:31.000Z | 2022-03-09T19:05:30.000Z | gfapy/line/common/version_conversion.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 5 | 2017-07-07T02:56:56.000Z | 2020-09-30T20:10:49.000Z | import gfapy
try:
from functools import partialmethod
except ImportError:
#for compatibility with old python versions
for shall_version in ["gfa1", "gfa2"]:
setattr(VersionConversion, "to_"+shall_version+"_s",
partialmethod(VersionConversion.to_version_s,
version = shall_version))
setatt... | 26.639175 | 80 | 0.628483 | import gfapy
try:
from functools import partialmethod
except ImportError:
#for compatibility with old python versions
def partialmethod(method, **kwargs):
return lambda self: method(self, **kwargs)
class VersionConversion:
@property
def version(self):
"""
Returns
-------
gfapy.VERSIONS, ... | 0 | 262 | 0 | 1,607 | 0 | 62 | 0 | 0 | 47 |
b216f08720abc4bf788695cdf4247b5f969a7fc9 | 2,795 | py | Python | run_eval.py | DataManagementLab/thesis-fl_client-side_validation | 0f6a35d08966133e6a8c13a110b9307d91f2d9cb | [
"MIT"
] | null | null | null | run_eval.py | DataManagementLab/thesis-fl_client-side_validation | 0f6a35d08966133e6a8c13a110b9307d91f2d9cb | [
"MIT"
] | null | null | null | run_eval.py | DataManagementLab/thesis-fl_client-side_validation | 0f6a35d08966133e6a8c13a110b9307d91f2d9cb | [
"MIT"
] | null | null | null | import argparse
from cliva_fl.utils import Logger, Plotter
from pathlib import Path
from datetime import datetime
parser = argparse.ArgumentParser(description='Argument parser for log processing and plot creation')
parser.add_argument('-n', '--num', type=int, required=False, help='Index of previously executed experime... | 52.735849 | 166 | 0.734884 | import argparse
from cliva_fl.utils import Logger, Plotter
from pathlib import Path
from datetime import datetime
parser = argparse.ArgumentParser(description='Argument parser for log processing and plot creation')
parser.add_argument('-n', '--num', type=int, required=False, help='Index of previously executed experime... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
514bacf6182bd9fb1311eb155f89189b33e7f933 | 3,279 | py | Python | tmslack/slack.py | arodioukov/tmslack | 65ffc864b6a872b732ae56e9be82ddba31c3fc12 | [
"Apache-2.0"
] | 1 | 2019-01-22T17:36:04.000Z | 2019-01-22T17:36:04.000Z | tmslack/slack.py | arodioukov/tmslack | 65ffc864b6a872b732ae56e9be82ddba31c3fc12 | [
"Apache-2.0"
] | null | null | null | tmslack/slack.py | arodioukov/tmslack | 65ffc864b6a872b732ae56e9be82ddba31c3fc12 | [
"Apache-2.0"
] | 3 | 2019-01-22T17:37:08.000Z | 2019-02-16T18:12:38.000Z | """A tmslack-specific wrapper for the slack client."""
| 39.035714 | 99 | 0.596523 | """A tmslack-specific wrapper for the slack client."""
from pathlib import Path
from typing import Sequence, NoReturn
from slackclient import SlackClient
from tmslack.cache import Cache
from tmslack.config import Config
class ClientException(Exception):
"""Class for exceptions in the slack client."""
class Cl... | 0 | 247 | 0 | 2,762 | 0 | 0 | 0 | 55 | 158 |
c05b33f448fe7de1d1b7f01c3cc36f49caa3912c | 70 | py | Python | python/cudf/cudf/api/__init__.py | ssayyah/cudf | b5ffdf5ffb398adef25435bc696df3ff30c4aa9a | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/api/__init__.py | ssayyah/cudf | b5ffdf5ffb398adef25435bc696df3ff30c4aa9a | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/api/__init__.py | ssayyah/cudf | b5ffdf5ffb398adef25435bc696df3ff30c4aa9a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION.
| 17.5 | 41 | 0.757143 | # Copyright (c) 2020, NVIDIA CORPORATION.
from cudf.api import types
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
99a25c4e0efc56a60bb968bffb7bc4d4fc0ffdeb | 11,015 | py | Python | openmdao/components/subproblem.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 17 | 2018-01-11T20:13:59.000Z | 2022-03-22T03:46:05.000Z | openmdao/components/subproblem.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 6 | 2017-10-19T23:14:14.000Z | 2020-11-22T17:30:57.000Z | openmdao/components/subproblem.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 10 | 2018-04-12T22:13:33.000Z | 2020-05-07T10:02:59.000Z |
from __future__ import print_function
from six import reraise
def _reraise(pathname, exc):
"""
Rather than adding the sub-Problem pathname to every system and variable
in the sub-Problem (and causing more complication w.r.t. promoted names),
just put a try block around all of the calls to the sub-Pr... | 34.421875 | 109 | 0.594462 |
from __future__ import print_function
import sys
import os
from collections import OrderedDict
from itertools import chain
import numpy
from six import iteritems, itervalues, reraise
from openmdao.core.component import Component
from openmdao.util.dict_util import _jac_to_flat_dict
from openmdao.core.mpi_wrap impo... | 0 | 0 | 0 | 10,217 | 0 | 0 | 0 | 84 | 202 |
058a4cd65ed4296366b25981a9b2ed20934bd738 | 2,056 | py | Python | reachy_pyluos_hal/joint.py | pollen-robotics/reachy_pyluos_hal | dcd2ddc937c60170907f258994590fc9ecfe5d7f | [
"Apache-2.0"
] | null | null | null | reachy_pyluos_hal/joint.py | pollen-robotics/reachy_pyluos_hal | dcd2ddc937c60170907f258994590fc9ecfe5d7f | [
"Apache-2.0"
] | 2 | 2021-04-07T15:34:45.000Z | 2022-01-26T09:03:44.000Z | reachy_pyluos_hal/joint.py | pollen-robotics/reachy_pyluos_hal | dcd2ddc937c60170907f258994590fc9ecfe5d7f | [
"Apache-2.0"
] | null | null | null | """Joint abstraction.
It can be any DynamixelMotor or an OrbitaMotor.
"""
| 33.16129 | 84 | 0.589008 | """Joint abstraction.
It can be any DynamixelMotor or an OrbitaMotor.
"""
from abc import ABC
from logging import Logger
from typing import Callable, Dict, Optional, Tuple
from .register import Register
class Joint(ABC):
"""Joint abstraction.
Should define the following registers:
'torque_enable'
... | 0 | 0 | 0 | 1,826 | 0 | 0 | 0 | 41 | 113 |
cd44b8b799c36096d1eb83a3415c97f081905bc6 | 2,116 | py | Python | prototypes/usb_audio.py | Exus1/alfa-blue-me | 4b2f9f549967b44688e753a64b0578ebbfedf430 | [
"MIT"
] | null | null | null | prototypes/usb_audio.py | Exus1/alfa-blue-me | 4b2f9f549967b44688e753a64b0578ebbfedf430 | [
"MIT"
] | 1 | 2020-07-06T14:36:18.000Z | 2021-01-27T09:13:12.000Z | prototypes/usb_audio.py | Exus1/alfa-blue-me | 4b2f9f549967b44688e753a64b0578ebbfedf430 | [
"MIT"
] | null | null | null | import can
import asyncio
can0 = can.ThreadSafeBus(channel = 'can0', bustype = 'socketcan_ctypes')
loop = asyncio.get_event_loop()
ready = False
przelaczone = False
counter = 0;
can.Notifier(can0, [
on_message
], loop=loop)
loop.call_soon(send_status)
loop.run_forever()
| 37.122807 | 151 | 0.655955 | import can
import asyncio
import time
can0 = can.ThreadSafeBus(channel = 'can0', bustype = 'socketcan_ctypes')
loop = asyncio.get_event_loop()
ready = False
przelaczone = False
def on_message(msg: can.Message):
global przelaczone
if(msg.arbitration_id == 0x405 and msg.data == bytearray([0x0C, 0x00, 0x00, 0x... | 0 | 0 | 0 | 0 | 0 | 1,777 | 0 | -10 | 66 |
82b3c088b0b897efda02d574bdd89eb14aca259f | 832 | py | Python | src/main.py | Ross-Morgan/Video-Project-Building-Tutorial | 802d97ecff838bbb6da127797215fb64177f3876 | [
"BSD-3-Clause"
] | null | null | null | src/main.py | Ross-Morgan/Video-Project-Building-Tutorial | 802d97ecff838bbb6da127797215fb64177f3876 | [
"BSD-3-Clause"
] | null | null | null | src/main.py | Ross-Morgan/Video-Project-Building-Tutorial | 802d97ecff838bbb6da127797215fb64177f3876 | [
"BSD-3-Clause"
] | null | null | null |
if __name__ == "__main__":
main()
| 20.8 | 73 | 0.627404 | import sys
from PyQt6 import QtCore, QtGui, QtWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, size: QtCore.QSize, title: str, icon: QtGui.QIcon,
parent: QtWidgets.QWidget = None):
super().__init__(parent=parent)
self.resize(size)
self.setWindowTitle(t... | 0 | 0 | 0 | 488 | 0 | 201 | 0 | 10 | 91 |
67ff00c200f9767432af05a3c27135f192ddc0f7 | 156,558 | py | Python | bigmler/resources.py | mmerce/bigmler | e411bb292a3c8db4cac6754b2b744ffe27fdb47a | [
"Apache-2.0"
] | null | null | null | bigmler/resources.py | mmerce/bigmler | e411bb292a3c8db4cac6754b2b744ffe27fdb47a | [
"Apache-2.0"
] | null | null | null | bigmler/resources.py | mmerce/bigmler | e411bb292a3c8db4cac6754b2b744ffe27fdb47a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2012-2020 BigML
#
# 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 ... | 38.381466 | 81 | 0.616149 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2020 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0 |
ed2cca3bf12105002e31b5cf7ef2ec86dbfabae0 | 8,185 | py | Python | src/build/fuchsia/run_package.py | goochen/naiveproxy | 1d0682ee5bae6e648cd43c65f49b4eefd224f206 | [
"BSD-3-Clause"
] | 643 | 2021-08-02T05:04:20.000Z | 2022-03-27T22:56:02.000Z | src/build/fuchsia/run_package.py | goochen/naiveproxy | 1d0682ee5bae6e648cd43c65f49b4eefd224f206 | [
"BSD-3-Clause"
] | 18 | 2021-05-13T05:53:06.000Z | 2022-03-31T21:24:25.000Z | src/build/fuchsia/run_package.py | goochen/naiveproxy | 1d0682ee5bae6e648cd43c65f49b4eefd224f206 | [
"BSD-3-Clause"
] | 16 | 2021-08-31T07:08:45.000Z | 2022-02-14T12:36:15.000Z | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Contains a helper function for deploying and executing a packaged
executable on a Target."""
from __future__ import print_function
import common
import ... | 32.224409 | 83 | 0.668907 | # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Contains a helper function for deploying and executing a packaged
executable on a Target."""
from __future__ import print_function
import common
import ... | 0 | 151 | 0 | 3,766 | 0 | 152 | 0 | -25 | 180 |
6a892f8bf2a1e819f349e187a7a5c6c0f795e772 | 728 | py | Python | _scripts/_hacked_labextension.py | deathbeds/wxyz | 9d46375ffa1b5dfe8ed8231d20f7951c0e6172bc | [
"BSD-3-Clause"
] | 23 | 2019-02-25T18:55:17.000Z | 2021-11-14T21:56:40.000Z | _scripts/_hacked_labextension.py | deathbeds/wxyz | 9d46375ffa1b5dfe8ed8231d20f7951c0e6172bc | [
"BSD-3-Clause"
] | 33 | 2019-02-23T08:37:41.000Z | 2022-03-18T23:17:02.000Z | _scripts/_hacked_labextension.py | deathbeds/wxyz | 9d46375ffa1b5dfe8ed8231d20f7951c0e6172bc | [
"BSD-3-Clause"
] | 3 | 2020-03-20T20:32:24.000Z | 2020-09-17T17:56:30.000Z | """ handle PEP 420 implicit namespace packages for labextensions
"""
# pylint: disable=protected-access
import sys
from pathlib import Path
from jupyterlab import federated_labextensions
from jupyterlab.labextensions import LabExtensionApp
HERE = Path(__file__).parent
ROOT = HERE.parent
NODE_MODULES = ROOT / "node_mo... | 26 | 84 | 0.791209 | """ handle PEP 420 implicit namespace packages for labextensions
"""
# pylint: disable=protected-access
import importlib
import sys
from pathlib import Path
from jupyterlab import federated_labextensions
from jupyterlab.labextensions import LabExtensionApp
HERE = Path(__file__).parent
ROOT = HERE.parent
NODE_MODULES ... | 0 | 0 | 0 | 0 | 0 | 104 | 0 | -5 | 45 |
58feca2644f73943efdfc0fb4b46b584c12e0cb8 | 1,684 | py | Python | Sender/capture.py | shashanksangu/AV-Encryption-Using-Cellular-Automata | 4433b08bf491f3f9a63f36b77e46c0540ece8c1b | [
"MIT"
] | null | null | null | Sender/capture.py | shashanksangu/AV-Encryption-Using-Cellular-Automata | 4433b08bf491f3f9a63f36b77e46c0540ece8c1b | [
"MIT"
] | null | null | null | Sender/capture.py | shashanksangu/AV-Encryption-Using-Cellular-Automata | 4433b08bf491f3f9a63f36b77e46c0540ece8c1b | [
"MIT"
] | null | null | null | # For faster and efficient mathematical evaluations we use numpy
# For image proccesing we use openCV
import cv2
# For creating and manipulating files
import os
# the time package provides various time-related functions
import time
# Create a video capture object to capture a video using device(camera) or from an exis... | 29.034483 | 155 | 0.686461 | # For faster and efficient mathematical evaluations we use numpy
import numpy as np
# For image proccesing we use openCV
import cv2
# For creating and manipulating files
import os
# the time package provides various time-related functions
import time
# Create a video capture object to capture a video using device(came... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
ce62cf755c6bddb1eed51d9760feab185da1392c | 1,723 | py | Python | make_heatmaps.py | aas-integration/integration-test2 | dc9a9b4593cd59841f0d8348056cbff80a9c2a21 | [
"MIT"
] | 3 | 2016-10-10T20:18:51.000Z | 2018-05-01T19:42:10.000Z | make_heatmaps.py | aas-integration/integration-test2 | dc9a9b4593cd59841f0d8348056cbff80a9c2a21 | [
"MIT"
] | 38 | 2016-08-22T03:20:25.000Z | 2018-06-11T19:13:05.000Z | make_heatmaps.py | aas-integration/integration-test2 | dc9a9b4593cd59841f0d8348056cbff80a9c2a21 | [
"MIT"
] | 7 | 2016-08-29T17:37:42.000Z | 2022-01-28T00:30:10.000Z | import sys
import matplotlib.colors as colors
if __name__ == '__main__':
main(sys.argv[1])
| 25.338235 | 80 | 0.596634 | import sys, os, shutil
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import numpy as np
def main(file_name):
print("Opening {}".format(file_name))
w,h = 10, 10
matrix = [[0 for x in range(w)] for y in range(h)]
with open(file_name, 'r') as f:
content = f.readli... | 0 | 0 | 0 | 0 | 0 | 1,516 | 0 | 19 | 90 |
49b941ace7988d588a69482a493fa7beee3c31d8 | 2,978 | py | Python | HLTriggerOffline/Common/test/hltSourceHarvestCompare_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | HLTriggerOffline/Common/test/hltSourceHarvestCompare_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | HLTriggerOffline/Common/test/hltSourceHarvestCompare_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("HLTCOMPARE")
process.load("HLTriggerOffline.Common.HLTValidation_cff")
process.load("HLTriggerOffline.Common.HLTValidationHarvest_cff")
process.load("HLTriggerOffline.Common.HLTValidationQT_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtCon... | 31.680851 | 119 | 0.775353 | import FWCore.ParameterSet.Config as cms
process = cms.Process("HLTCOMPARE")
process.load("HLTriggerOffline.Common.HLTValidation_cff")
process.load("HLTriggerOffline.Common.HLTValidationHarvest_cff")
process.load("HLTriggerOffline.Common.HLTValidationQT_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.L1GtCon... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
627ad4d425398892b9e9e46ff6f0a4cbfad92daf | 8,892 | py | Python | app/user/tests/test_user_api.py | tahmadvand/recipe_app_api | 40b4cc6960d7dc4858373b5f6ccca980ed0eeac8 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | tahmadvand/recipe_app_api | 40b4cc6960d7dc4858373b5f6ccca980ed0eeac8 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | tahmadvand/recipe_app_api | 40b4cc6960d7dc4858373b5f6ccca980ed0eeac8 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
# so we can generate our API URL.
# rest framework test helper tools:
# test client that we can use to make requests to our API and
# then check what the response is.
# a module that contains some status codes that we can see in
# basically... | 40.976959 | 77 | 0.681062 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
# so we can generate our API URL.
# rest framework test helper tools:
from rest_framework.test import APIClient
# test client that we can use to make requests to our API and
# then check what the response is... | 0 | 0 | 0 | 7,436 | 0 | 0 | 0 | 43 | 112 |
2b24205d366a77d862af2dc0a0f3fb4826fa970e | 860 | py | Python | xrypto/markets/_okcoin.py | AlphaPerfect/Xrypto | fcb7b3b79c1f5ec0393d1795bcfa6556fd3e0dd9 | [
"Unlicense"
] | 10 | 2018-03-24T23:14:13.000Z | 2020-04-22T15:56:05.000Z | xrypto/markets/_okcoin.py | a04512/crypto-raven | e8ebba319f8f04314b4c21d6bc4c8901bf358281 | [
"Unlicense"
] | null | null | null | xrypto/markets/_okcoin.py | a04512/crypto-raven | e8ebba319f8f04314b4c21d6bc4c8901bf358281 | [
"Unlicense"
] | 10 | 2020-01-29T05:43:33.000Z | 2021-12-13T07:02:39.000Z | # Copyright (C) 2017, Philsong <songbohr@gmail.com> | 31.851852 | 76 | 0.680233 | # Copyright (C) 2017, Philsong <songbohr@gmail.com>
import json
import config
from .market import Market
from exchanges.okcoin.OkcoinSpotAPI import OKCoinSpot
class OKCoin(Market):
def __init__(self, pair_code):
base_currency, market_currency = self.get_tradeable_pairs(pair_code)
super().__init__... | 0 | 0 | 0 | 678 | 0 | 0 | 0 | 19 | 112 |
f30ab0f1c8eb1930ac3969b6e83e2d1a3c31f0a3 | 8,265 | py | Python | Demo/sockets/gopher.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/sockets/gopher.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/sockets/gopher.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | #! /usr/local/bin/python
# A simple gopher client.
#
# Usage: gopher [ [selector] host [port] ]
# Default selector, host and port
DEF_SELECTOR = ''
DEF_HOST = 'gopher.micro.umn.edu'
DEF_PORT = 70
# Recognized file types
T_TEXTFILE = '0'
T_MENU = '1'
T_CSO = '2'
T_ERROR = '3'
T_BINHEX = '4'... | 23.75 | 79 | 0.641379 | #! /usr/local/bin/python
# A simple gopher client.
#
# Usage: gopher [ [selector] host [port] ]
import string
import sys
import os
import socket
# Default selector, host and port
DEF_SELECTOR = ''
DEF_HOST = 'gopher.micro.umn.edu'
DEF_PORT = 70
# Recognized file types
T_TEXTFILE = '0'
T_MENU = '1'
T_C... | 0 | 0 | 0 | 383 | 0 | 5,447 | 0 | -39 | 485 |
c0d47a1eae91a5eef6747a5c4afebfeec0f733b0 | 1,727 | py | Python | BinarySearchTree/easy/isSymmetric.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | BinarySearchTree/easy/isSymmetric.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | BinarySearchTree/easy/isSymmetric.py | linminhtoo/algorithms | 884422a7c9f531e7ccaae03ba1ccbd6966b23dd3 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/symmetric-tree/solution/
# Definition for a binary tree node. | 31.981481 | 57 | 0.49392 | # https://leetcode.com/problems/symmetric-tree/solution/
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution_recursive:
# recursive, by comparing two copies of the tree
... | 0 | 0 | 0 | 1,536 | 0 | 0 | 0 | 8 | 90 |
1c6a2903e1d499c805f3066155cb0832c1308d7d | 817 | py | Python | steps/step18.py | choiking10/mytorch | 67140b608b14e2ec6ecca1638705af91d2d71b6b | [
"MIT"
] | null | null | null | steps/step18.py | choiking10/mytorch | 67140b608b14e2ec6ecca1638705af91d2d71b6b | [
"MIT"
] | null | null | null | steps/step18.py | choiking10/mytorch | 67140b608b14e2ec6ecca1638705af91d2d71b6b | [
"MIT"
] | null | null | null |
import mytorch
ex1()
ex2()
ex3()
| 17.382979 | 53 | 0.580171 | import contextlib
import numpy as np
import mytorch
import mytorch.simple_core
from mytorch.simple_core import Variable, square, add
def ex1():
x0 = Variable(np.array(2.0))
x1 = Variable(np.array(3.0))
t = add(x0, x1)
y = add(x0, t)
y.backward()
print(y.grad, t.grad)
print(x0.grad, x1.g... | 9 | 129 | 0 | 0 | 0 | 458 | 0 | 30 | 158 |
7c909e58212423f8947dc24e1ea8efe3adf63239 | 9,174 | py | Python | nlpir/doc_extractor.py | yangyaofei/nlpir-python | af7bca9e2c3ba5f07316364da8f5e46a2bbc7c52 | [
"MIT"
] | 3 | 2020-10-13T08:42:26.000Z | 2020-10-23T05:29:05.000Z | nlpir/doc_extractor.py | yangyaofei/nlpir-python | af7bca9e2c3ba5f07316364da8f5e46a2bbc7c52 | [
"MIT"
] | null | null | null | nlpir/doc_extractor.py | yangyaofei/nlpir-python | af7bca9e2c3ba5f07316364da8f5e46a2bbc7c52 | [
"MIT"
] | null | null | null | #! coding=utf-8
"""
high-level toolbox for Document Extractor
"""
import typing
from nlpir import native
# class and class instance
__cls__ = native.doc_extractor.DocExtractor
__instance__: typing.Optional[native.doc_extractor.DocExtractor] = None
# Location of DLL
__lib__ = None
# Data directory
__data__ = None
# lic... | 34.359551 | 118 | 0.653259 | #! coding=utf-8
"""
high-level toolbox for Document Extractor
"""
import re
import typing
import nlpir
from nlpir import get_instance as __get_instance__
from nlpir import native
# class and class instance
__cls__ = native.doc_extractor.DocExtractor
__instance__: typing.Optional[native.doc_extractor.DocExtractor] = No... | 132 | 4,088 | 0 | 4,305 | 0 | 0 | 0 | 8 | 319 |
56e0389354e0755a6dd537bd014b8b73b969c4c2 | 2,113 | py | Python | scripts/javierre2016_format.py | thehyve/genetics-v2g-data | 96544d075955282ab0f8bef287a11bb782942cf7 | [
"Apache-2.0"
] | 7 | 2019-01-30T01:08:15.000Z | 2022-03-07T20:43:53.000Z | scripts/javierre2016_format.py | thehyve/genetics-v2g-data | 96544d075955282ab0f8bef287a11bb782942cf7 | [
"Apache-2.0"
] | null | null | null | scripts/javierre2016_format.py | thehyve/genetics-v2g-data | 96544d075955282ab0f8bef287a11bb782942cf7 | [
"Apache-2.0"
] | 5 | 2019-07-11T09:37:58.000Z | 2021-07-30T23:05:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Ed Mountjoy (June 2018)
Formats the output of bedtools into final format for loading
'''
import argparse
def parse_args():
''' Load command line args '''
parser = argparse.ArgumentParser()
parser.add_argument('--inf', metavar='<file>', help=('Input file')... | 31.537313 | 115 | 0.630383 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Ed Mountjoy (June 2018)
Formats the output of bedtools into final format for loading
'''
import argparse
import pandas as pd
def main():
# Parse args
args = parse_args()
# Load
df = pd.read_csv(args.inf, sep='\t', header=None, low_memory=False)
... | 0 | 0 | 0 | 0 | 0 | 1,428 | 0 | -2 | 45 |
3de391af7f43ef5085f07c3952111098eb27c56b | 23,701 | py | Python | src/nlpia/book_parser.py | AAAI-DISIM-UnivAQ/nlpia | 39bf2ceff2128e5bb7ad233ced55cb55fe70be4a | [
"MIT"
] | 532 | 2016-11-30T03:51:13.000Z | 2022-03-29T13:40:43.000Z | src/nlpia/book_parser.py | AAAI-DISIM-UnivAQ/nlpia | 39bf2ceff2128e5bb7ad233ced55cb55fe70be4a | [
"MIT"
] | 30 | 2017-12-12T12:18:41.000Z | 2022-03-23T14:44:45.000Z | src/nlpia/book_parser.py | AAAI-DISIM-UnivAQ/nlpia | 39bf2ceff2128e5bb7ad233ced55cb55fe70be4a | [
"MIT"
] | 241 | 2017-06-20T11:51:31.000Z | 2022-03-28T09:42:38.000Z | """ Functions for reading ascidoc files (*.adoc, *.asc, *.asciidoc) and tagging each line """
import os
import sys
import glob
import re
import logging
from shutil import copyfile
from nlpia.regexes import CRE_ACRONYM
# from nlpia.data_utils import iter_lines # FIXME: reuse
from nlpia.constants import BOOK_PATH
from n... | 45.843327 | 130 | 0.628792 | """ Functions for reading ascidoc files (*.adoc, *.asc, *.asciidoc) and tagging each line """
import os
import sys
import glob
import re
import logging
from shutil import copyfile
from pugnlp import futil
from nlpia.regexes import CRE_ACRONYM
# from nlpia.data_utils import iter_lines # FIXME: reuse
from nlpia.constan... | 8 | 0 | 0 | 0 | 1,276 | 903 | 0 | 17 | 131 |
9b87c9c4019e9dd2f23a08d165e4d38ca60a67db | 966 | py | Python | leetcode/139_Word_Break.py | thiakx/leetcode | cda5b3844331fb244c336bce7a551eafe946531d | [
"MIT"
] | null | null | null | leetcode/139_Word_Break.py | thiakx/leetcode | cda5b3844331fb244c336bce7a551eafe946531d | [
"MIT"
] | null | null | null | leetcode/139_Word_Break.py | thiakx/leetcode | cda5b3844331fb244c336bce7a551eafe946531d | [
"MIT"
] | null | null | null | import unittest
# Given a non-empty string s and a dictionary wordDict containing a list of non-empty words,
# determine if s can be segmented into a space-separated sequence of one or more dictionary words.
s = "leetcode"
wordDict = ["leet", "code"]
output_value = True
if __name__ == '__main__':
unittest.mai... | 27.6 | 101 | 0.587992 | import unittest
# Given a non-empty string s and a dictionary wordDict containing a list of non-empty words,
# determine if s can be segmented into a space-separated sequence of one or more dictionary words.
s = "leetcode"
wordDict = ["leet", "code"]
output_value = True
class funcTest(unittest.TestCase):
def te... | 0 | 0 | 0 | 514 | 0 | 0 | 0 | 0 | 46 |
4debe122d78ed3434c05a0ee05862422506ec84e | 1,552 | py | Python | common/caching/cache.py | DemocracyLab/DemocracyLab-CivicTechExchange | eec4715373679259318ff6c384c815acebf0831f | [
"MIT"
] | 64 | 2017-09-30T16:23:43.000Z | 2022-03-30T23:26:50.000Z | common/caching/cache.py | DemocracyLab/DemocracyLab-CivicTechExchange | eec4715373679259318ff6c384c815acebf0831f | [
"MIT"
] | 339 | 2017-10-26T06:59:14.000Z | 2022-03-10T22:34:29.000Z | common/caching/cache.py | DemocracyLab/DemocracyLab-CivicTechExchange | eec4715373679259318ff6c384c815acebf0831f | [
"MIT"
] | 58 | 2017-09-16T17:25:10.000Z | 2022-03-04T18:14:02.000Z | from django.core.cache import cache
Cache = CacheWrapper(cache)
| 33.73913 | 105 | 0.659794 | from django.core.cache import cache
from enum import Enum
class CacheWrapper:
_cache_generators = {}
def __init__(self, cache_backend):
self._cache = cache_backend
def get(self, key, generator_func=None):
"""
Retrieve cached value, and cache the value if it is not already cached
... | 0 | 0 | 0 | 1,440 | 0 | 0 | 0 | 0 | 45 |
37f9bb3f88182f67d0e5881bab0f1d09a4040aa1 | 601 | py | Python | recognize_main_summary_table_1.py | code4nagoya/covid19-aichi-tools | 27d16f77b23bce212df81312151f8e0a9b66015b | [
"MIT"
] | 6 | 2020-04-07T01:53:54.000Z | 2021-09-15T14:25:16.000Z | recognize_main_summary_table_1.py | code4nagoya/covid19-aichi-tools | 27d16f77b23bce212df81312151f8e0a9b66015b | [
"MIT"
] | 49 | 2020-03-30T14:26:05.000Z | 2022-03-10T08:37:00.000Z | recognize_main_summary_table_1.py | code4nagoya/covid19-aichi-tools | 27d16f77b23bce212df81312151f8e0a9b66015b | [
"MIT"
] | 5 | 2020-04-07T06:25:53.000Z | 2021-01-02T10:09:30.000Z | '''
'''
| 26.130435 | 111 | 0.63228 | '''
「検査陽性者の状況」画像から数値データを抽出する処理 パターン1
'''
import re
import pytesseract
import cv2
def recognize(jpg_path):
src = cv2.imread(str(jpg_path))
img = cv2.inRange(src, (150, 120, 130), (255, 255, 255))
# 範囲指定
img_crop = img[0:550]
# ref http://blog.machine-powers.net/2018/08/02/learning-tesseract-comma... | 144 | 0 | 0 | 0 | 0 | 478 | 0 | -26 | 91 |
b387e7199668212c73f63ac03d9cacc7570911c4 | 1,701 | py | Python | scouter.host/scouter/host/meminfo.py | lunastar12/scouter | 715f7edda67e5450d43122fef2707d3585d049e6 | [
"Apache-2.0"
] | 1 | 2021-09-09T09:56:11.000Z | 2021-09-09T09:56:11.000Z | scouter.host/scouter/host/meminfo.py | lunastar12/scouter | 715f7edda67e5450d43122fef2707d3585d049e6 | [
"Apache-2.0"
] | null | null | null | scouter.host/scouter/host/meminfo.py | lunastar12/scouter | 715f7edda67e5450d43122fef2707d3585d049e6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# original code from
# https://github.com/giampaolo/psutil/blob/master/examples/
#
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print system memory information.
"""
i... | 24.652174 | 72 | 0.603175 | #!/usr/bin/env python
#
# original code from
# https://github.com/giampaolo/psutil/blob/master/examples/
#
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Print system memory information.
"""
i... | 0 | 0 | 0 | 0 | 0 | 1,096 | 0 | 21 | 137 |
c5cb97262302fa28b889b7552bd9a4407fe3ba4c | 1,041 | py | Python | prediction_flow/pytorch/din.py | dydcfg/prediction-flow | 332068f521bba51acc8600fe72e36e92c331bef1 | [
"MIT"
] | 211 | 2019-08-02T23:04:40.000Z | 2022-03-18T06:36:25.000Z | prediction_flow/pytorch/din.py | dydcfg/prediction-flow | 332068f521bba51acc8600fe72e36e92c331bef1 | [
"MIT"
] | 18 | 2019-08-10T07:13:05.000Z | 2022-03-17T10:45:30.000Z | prediction_flow/pytorch/din.py | dydcfg/prediction-flow | 332068f521bba51acc8600fe72e36e92c331bef1 | [
"MIT"
] | 51 | 2019-08-02T23:04:41.000Z | 2021-12-24T02:48:58.000Z | """
Deep Interest Network.
"""
| 22.148936 | 62 | 0.643612 | """
Deep Interest Network.
"""
from .nn import Attention
from .interest_net import InterestNet
class DIN(InterestNet):
"""Deep Interest Network.
Parameters
----------
features : Features
attention_groups : list of AttentionGroup
num_classes : int
Number of classes.
embedding_s... | 0 | 0 | 0 | 921 | 0 | 0 | 0 | 20 | 68 |
bbd2395815327f3c1981d9835eba367033befe97 | 6,076 | py | Python | call_scripts/reorder/max_bipartitle_match.py | valexsyu/Reorder_nat | c9ed2d55164e7cccd225def867a71b1a1a45a3f4 | [
"MIT"
] | null | null | null | call_scripts/reorder/max_bipartitle_match.py | valexsyu/Reorder_nat | c9ed2d55164e7cccd225def867a71b1a1a45a3f4 | [
"MIT"
] | null | null | null | call_scripts/reorder/max_bipartitle_match.py | valexsyu/Reorder_nat | c9ed2d55164e7cccd225def867a71b1a1a45a3f4 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
"""
# maximal Bipartite matching.
# python program to find
if __name__ == "__main__":
main()
| 37.04878 | 143 | 0.60813 | # coding=utf-8
import os
from tqdm import tqdm
import networkx as nx
from networkx.algorithms import bipartite
import argparse
import torch
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
"""
# maximal Bipartite matching.
# python program to find
def read_data(data_type, root_path, src_lan... | 0 | 0 | 0 | 0 | 0 | 5,662 | 0 | -7 | 225 |
5c6879885153d1e3967897784932fee2096b958e | 6,516 | py | Python | IOLinkAnalyzer.py | hboshnak/saleae-hla-io-link | 5a4f802c7b50d883cd6f4841c7825fd59478e216 | [
"MIT"
] | null | null | null | IOLinkAnalyzer.py | hboshnak/saleae-hla-io-link | 5a4f802c7b50d883cd6f4841c7825fd59478e216 | [
"MIT"
] | null | null | null | IOLinkAnalyzer.py | hboshnak/saleae-hla-io-link | 5a4f802c7b50d883cd6f4841c7825fd59478e216 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
#
# The MIT License (MIT)
#
# Copyright (c) <2021> Hottinger Brel & Kjaer GmbH, Im Tiefen See 45, 64293 Darmstadt, Germany
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in ... | 41.503185 | 131 | 0.604052 | # SPDX-License-Identifier: MIT
#
# The MIT License (MIT)
#
# Copyright (c) <2021> Hottinger Brüel & Kjaer GmbH, Im Tiefen See 45, 64293 Darmstadt, Germany
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in... | 2 | 0 | 0 | 4,514 | 0 | 0 | 0 | 88 | 89 |
95ead18961640ac7ba0d061bfbd23e70072af4c1 | 1,555 | py | Python | utils/handle_wordpress.py | kcrt/pages | 304ad8245f19c51c9138ef3e2b1a362c880c67d2 | [
"MIT"
] | null | null | null | utils/handle_wordpress.py | kcrt/pages | 304ad8245f19c51c9138ef3e2b1a362c880c67d2 | [
"MIT"
] | null | null | null | utils/handle_wordpress.py | kcrt/pages | 304ad8245f19c51c9138ef3e2b1a362c880c67d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == "__main__":
main()
| 28.272727 | 77 | 0.574277 | #!/usr/bin/env python3
import pathlib
from typing import Set
import frontmatter
import datetime
import re
import urllib.request
import os
def download_file(url, datestr):
print(f"Downloading {url}...")
filename = os.path.basename(url)
# skip urllib.request.urlretrieve(url, f"../images/{datestr}_{filename}... | 9 | 0 | 0 | 0 | 0 | 1,326 | 0 | -39 | 200 |
385be9d91500d832e323a6a1573cfce8f7a10920 | 2,151 | py | Python | meta_ultra/modules/humann2.py | dcdanko/MetaUltra | 600df03dd4aaf95268bf0062de2ad3d9ac480842 | [
"MIT"
] | null | null | null | meta_ultra/modules/humann2.py | dcdanko/MetaUltra | 600df03dd4aaf95268bf0062de2ad3d9ac480842 | [
"MIT"
] | null | null | null | meta_ultra/modules/humann2.py | dcdanko/MetaUltra | 600df03dd4aaf95268bf0062de2ad3d9ac480842 | [
"MIT"
] | 1 | 2018-11-02T14:14:38.000Z | 2018-11-02T14:14:38.000Z | import meta_ultra.config as config
modules.append(Humann2Module)
| 29.875 | 70 | 0.635053 | import meta_ultra.config as config
from meta_ultra.utils import *
from meta_ultra.modules import *
from meta_ultra.data_type import *
class Humann2Module( Module):
def __init__(self, **kwargs):
super(Humann2Module, self).__init__(**kwargs)
self.time = self.getParamOrDefault('time', 1)
self.ram = self.getParam... | 0 | 30 | 0 | 1,931 | 0 | 0 | 0 | 33 | 89 |
117c6caed0886eec8c0aac5561ccec9deb809112 | 577 | py | Python | run.py | littlebai3618/bproxypool | 358cf5c14164dadbd0d9bdf7cc3932b46ec81812 | [
"MIT"
] | 2 | 2019-12-26T02:49:59.000Z | 2020-02-11T09:22:07.000Z | run.py | littlebai3618/bproxypool | 358cf5c14164dadbd0d9bdf7cc3932b46ec81812 | [
"MIT"
] | 3 | 2021-03-31T19:33:59.000Z | 2021-12-13T20:29:21.000Z | run.py | littlebai3618/bproxypool | 358cf5c14164dadbd0d9bdf7cc3932b46ec81812 | [
"MIT"
] | 2 | 2020-01-25T12:05:47.000Z | 2020-07-19T02:57:12.000Z | import sys
import traceback
from bproxypool.scheduler import run
from bproxypool.server import create_app
from bproxypool.utils.notify import ding
app = create_app()
if __name__ == '__main__':
# app.run(debug=True)
if len(sys.argv) == 2:
if sys.argv[1] == 'scheduler':
try:
... | 26.227273 | 73 | 0.577123 | import sys
import traceback
from bproxypool.scheduler import run
from bproxypool.server import create_app
from bproxypool.utils.notify import ding
app = create_app()
if __name__ == '__main__':
# app.run(debug=True)
if len(sys.argv) == 2:
if sys.argv[1] == 'scheduler':
try:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9aa8299a5b6d0e871446d942b4e7815a43a9371 | 1,404 | py | Python | fable/fable_sources/libtbx/tst_easy_pickle.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 4 | 2016-09-30T15:03:39.000Z | 2021-03-25T13:27:08.000Z | fable/fable_sources/libtbx/tst_easy_pickle.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 1 | 2018-04-18T14:41:18.000Z | 2018-04-20T19:33:52.000Z | fable/fable_sources/libtbx/tst_easy_pickle.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 3 | 2016-04-19T18:20:30.000Z | 2019-04-03T14:54:29.000Z | from __future__ import division
if (__name__ == "__main__"):
import sys
run(args=sys.argv[1:])
| 26 | 64 | 0.614672 | from __future__ import division
def exercise(n, use_dumps=False):
from libtbx import easy_pickle
import time
obj = []
for i in xrange(n):
obj.append([i,i])
for dgz in ["", ".gz"]:
t0 = time.time()
if (use_dumps):
print "dumps/loads"
pickle_string = easy_pickle.dumps(obj=obj)
else:
... | 0 | 0 | 0 | 0 | 0 | 1,259 | 0 | 0 | 45 |
3cca83b19bf8c9f61ae5e1053ec7aadeeecbdd45 | 1,104 | py | Python | strategypy/bots/happiness.py | davide-ceretti/strategypy | 37df9569e3a9fc8a0f1487a29a7897db6363c42e | [
"MIT"
] | 8 | 2015-03-03T17:40:41.000Z | 2020-11-08T19:02:23.000Z | strategypy/bots/happiness.py | davide-ceretti/strategypy | 37df9569e3a9fc8a0f1487a29a7897db6363c42e | [
"MIT"
] | 19 | 2015-01-14T12:07:05.000Z | 2015-03-19T11:53:11.000Z | strategypy/bots/happiness.py | davide-ceretti/strategypy | 37df9569e3a9fc8a0f1487a29a7897db6363c42e | [
"MIT"
] | 6 | 2015-03-16T18:17:06.000Z | 2021-11-04T23:44:47.000Z |
"""
...........
.....3.....
....323....
...32123...
..321H123..
...32X23...
....323....
.....3.....
...........
...........
...........
"""
bot = Bot()
| 20.072727 | 74 | 0.569746 | import random
import sys
from copy import deepcopy
from .happines_base import Bot as HappinessBaseBot
"""
...........
.....3.....
....323....
...32123...
..321H123..
...32X23...
....323....
.....3.....
...........
...........
...........
"""
class Bot(HappinessBaseBot):
def calc_happiness(self, friend_dist, ... | 0 | 0 | 0 | 776 | 0 | 22 | 0 | 14 | 135 |
07573237f0ac1e8c2409a2a818e87a59070a1fae | 5,035 | py | Python | deployment/clusterCmd.py | NunoEdgarGFlowHub/pai | 0eb286f029d78865c24feb6aabcc990c44336c11 | [
"MIT"
] | 1 | 2019-04-28T23:30:27.000Z | 2019-04-28T23:30:27.000Z | deployment/clusterCmd.py | 289202471/pai | 07177b18c5b780457d633be1691f34bfb7f64523 | [
"MIT"
] | null | null | null | deployment/clusterCmd.py | 289202471/pai | 07177b18c5b780457d633be1691f34bfb7f64523 | [
"MIT"
] | 1 | 2019-11-18T13:27:07.000Z | 2019-11-18T13:27:07.000Z | import logging
import logging.config
logger = logging.getLogger(__name__)
| 50.858586 | 139 | 0.581927 | import os
import sys
import time
import logging
import logging.config
from k8sPaiLibrary.maintainlib import add as k8s_add
from k8sPaiLibrary.maintainlib import remove as k8s_remove
from k8sPaiLibrary.maintainlib import etcdfix as k8s_etcd_fix
from k8sPaiLibrary.maintainlib import kubectl_conf_check
from k8sPaiLibrary... | 0 | 0 | 0 | 4,437 | 0 | 0 | 0 | 255 | 267 |
bbabc0754df471ab973c778450033fe80a2750d6 | 158 | py | Python | Python Scripts/randomQuotes.py | lazydinoz/HackFest21 | 84bfbfbb2c75a6511226a87d2e947984db878ba1 | [
"MIT"
] | 1 | 2021-11-12T10:51:19.000Z | 2021-11-12T10:51:19.000Z | Python Scripts/randomQuotes.py | lazydinoz/HackFest21 | 84bfbfbb2c75a6511226a87d2e947984db878ba1 | [
"MIT"
] | null | null | null | Python Scripts/randomQuotes.py | lazydinoz/HackFest21 | 84bfbfbb2c75a6511226a87d2e947984db878ba1 | [
"MIT"
] | null | null | null | import requests
url = 'https://api.quotable.io/random'
r = requests.get(url)
quote = r.json()
print(quote['content'])
print(' -',quote['author']) | 19.75 | 39 | 0.626582 | import requests
url = 'https://api.quotable.io/random'
r = requests.get(url)
quote = r.json()
print(quote['content'])
print(' -',quote['author']) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0cc6b3b162731a53a1206b334e0e21e3a7cabf83 | 131 | py | Python | ptvp3/__main__.py | timotheyca/persistence3 | 6a7094b0e84dfb5be47099a16717558e02329e00 | [
"BSD-3-Clause"
] | 1 | 2019-04-22T20:49:20.000Z | 2019-04-22T20:49:20.000Z | ptvp3/__main__.py | timotheyca/persistence3 | 6a7094b0e84dfb5be47099a16717558e02329e00 | [
"BSD-3-Clause"
] | 3 | 2019-04-22T19:52:45.000Z | 2019-09-13T17:53:48.000Z | ptvp3/__main__.py | timotheyca/persistence3 | 6a7094b0e84dfb5be47099a16717558e02329e00 | [
"BSD-3-Clause"
] | null | null | null | from ptvp3 import P3terpreter
import sys
import json
p3p = P3terpreter.from_param_dict(json.load(open(sys.argv[1])))
p3p.start()
| 16.375 | 63 | 0.778626 | from ptvp3 import P3terpreter
import sys
import json
p3p = P3terpreter.from_param_dict(json.load(open(sys.argv[1])))
p3p.start()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
093af4196ce072cdb8850441d877dd75d6976695 | 1,334 | py | Python | fea_sim.py | GuohongLi/simclr-pytorch | 7e08b2433a623fdbc1c097402fded4cc69d1b54e | [
"BSD-3-Clause"
] | null | null | null | fea_sim.py | GuohongLi/simclr-pytorch | 7e08b2433a623fdbc1c097402fded4cc69d1b54e | [
"BSD-3-Clause"
] | null | null | null | fea_sim.py | GuohongLi/simclr-pytorch | 7e08b2433a623fdbc1c097402fded4cc69d1b54e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
#
# Copyright (c) 2018 Baidu.com, Inc. All Rights Reserved
#
########################################################################
"""
File: feature.py
Author: zhenglinhai(zhenglinhai@baidu.com)... | 30.318182 | 172 | 0.567466 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
########################################################################
#
# Copyright (c) 2018 Baidu.com, Inc. All Rights Reserved
#
########################################################################
"""
File: feature.py
Author: zhenglinhai(zhenglinhai@baidu.com)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -59 | 133 |
4729ab2a639ac58292927dee77b2b1b6543805b8 | 1,372 | py | Python | AlgoExpert/binary_search_trees/reconstructBst.py | Muzque/Leetcode | d06365792c9ef48e0a290da00ba5e71f212554d5 | [
"MIT"
] | 1 | 2021-05-11T09:52:38.000Z | 2021-05-11T09:52:38.000Z | AlgoExpert/binary_search_trees/reconstructBst.py | Muzque/Leetcode | d06365792c9ef48e0a290da00ba5e71f212554d5 | [
"MIT"
] | null | null | null | AlgoExpert/binary_search_trees/reconstructBst.py | Muzque/Leetcode | d06365792c9ef48e0a290da00ba5e71f212554d5 | [
"MIT"
] | 1 | 2021-05-05T04:13:17.000Z | 2021-05-05T04:13:17.000Z | # This is an input class. Do not edit.
"""
def traversal(node, array):
if not array:
return
left, right = -1, -1
for i in range(len(array)):
if left == -1 and array[i] < node.value:
left = i
if right == -1 and array[i] >= node.value:
right = i
if left !=... | 28.583333 | 58 | 0.615889 | # This is an input class. Do not edit.
class BST:
def __init__(self, value, left=None, right=None):
self.value = value
self.left = left
self.right = right
"""
def traversal(node, array):
if not array:
return
left, right = -1, -1
for i in range(len(array)):
if le... | 0 | 0 | 0 | 122 | 0 | 450 | 0 | 0 | 45 |
11a960274da363ba993f403fe5953d2a280dac62 | 57 | py | Python | graph_adapter_tests/h_spark/__init__.py | jameslamb/hamilton | 49f11ede9a79478f31b8ded2673ec0f977033562 | [
"BSD-3-Clause-Clear"
] | 298 | 2021-10-14T20:56:45.000Z | 2022-03-30T12:55:05.000Z | graph_adapter_tests/h_spark/__init__.py | jameslamb/hamilton | 49f11ede9a79478f31b8ded2673ec0f977033562 | [
"BSD-3-Clause-Clear"
] | 58 | 2021-10-18T17:54:41.000Z | 2022-03-31T00:19:36.000Z | graph_adapter_tests/h_spark/__init__.py | jameslamb/hamilton | 49f11ede9a79478f31b8ded2673ec0f977033562 | [
"BSD-3-Clause-Clear"
] | 15 | 2021-10-30T17:45:59.000Z | 2022-03-09T14:55:53.000Z | __author__ = 'Stefan Krawczyk <stefank@cs.stanford.edu>'
| 28.5 | 56 | 0.77193 | __author__ = 'Stefan Krawczyk <stefank@cs.stanford.edu>'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04200d7cd9b433d985340a3dac35e036f626cf4f | 2,604 | py | Python | nlp_architect/models/most_common_word_sense.py | laugustyniak/nlp-architect | 7e9068657b575595a1f279eae59a172853cb4fe1 | [
"Apache-2.0"
] | null | null | null | nlp_architect/models/most_common_word_sense.py | laugustyniak/nlp-architect | 7e9068657b575595a1f279eae59a172853cb4fe1 | [
"Apache-2.0"
] | null | null | null | nlp_architect/models/most_common_word_sense.py | laugustyniak/nlp-architect | 7e9068657b575595a1f279eae59a172853cb4fe1 | [
"Apache-2.0"
] | 1 | 2019-12-30T14:42:54.000Z | 2019-12-30T14:42:54.000Z | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 39.454545 | 89 | 0.65745 | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 0 | 0 | 0 | 1,524 | 0 | 0 | 0 | 155 | 178 |
468117e32a0214679932e30d2c427c8902f0282a | 1,325 | py | Python | pcc/websocket_writer.py | ACoolUsername9001/python-computercraft | 47c7a97dd013a75ee8e6f9e0718fb702c189df90 | [
"Unlicense"
] | null | null | null | pcc/websocket_writer.py | ACoolUsername9001/python-computercraft | 47c7a97dd013a75ee8e6f9e0718fb702c189df90 | [
"Unlicense"
] | null | null | null | pcc/websocket_writer.py | ACoolUsername9001/python-computercraft | 47c7a97dd013a75ee8e6f9e0718fb702c189df90 | [
"Unlicense"
] | null | null | null | from typing import TypeVar
WebSocket = TypeVar('WebSocket')
| 24.090909 | 84 | 0.630943 | from dataclasses import dataclass, field
from typing import TypeVar
import websocket
from io import IOBase
import json
WebSocket = TypeVar('WebSocket')
class ComputerCraftException(Exception):
pass
@dataclass
class CCWebsocketWriter(IOBase):
url: str
c_id: str
c_pass: str
websocket: WebSocket =... | 0 | 720 | 0 | 380 | 0 | 0 | 0 | 4 | 157 |
555596172cf212e4f391806d87e9b2e6a7d8e3ee | 59 | py | Python | investments/__init__.py | neewy/TinkoffInvestmentsAnalyser | 049b419ea090d17c49016ebfa1ae0f8cde738b65 | [
"Apache-2.0"
] | 3 | 2020-06-13T16:29:23.000Z | 2022-02-11T19:40:07.000Z | investments/__init__.py | neewy/TinkoffInvestmentsAnalyser | 049b419ea090d17c49016ebfa1ae0f8cde738b65 | [
"Apache-2.0"
] | null | null | null | investments/__init__.py | neewy/TinkoffInvestmentsAnalyser | 049b419ea090d17c49016ebfa1ae0f8cde738b65 | [
"Apache-2.0"
] | 1 | 2020-06-22T18:42:04.000Z | 2020-06-22T18:42:04.000Z |
manager = InvestmentsManager()
| 14.75 | 30 | 0.779661 | from .investments import *
manager = InvestmentsManager()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
22c66a9a28cd90e8c60bd459fb52e873cbed9ee3 | 14,978 | py | Python | hio-yocto-bsp/sources/poky/bitbake/lib/toaster/orm/models.py | qiangzai00001/hio-prj | 060ff97fe21093b1369db78109d5b730b2b181c8 | [
"MIT"
] | null | null | null | hio-yocto-bsp/sources/poky/bitbake/lib/toaster/orm/models.py | qiangzai00001/hio-prj | 060ff97fe21093b1369db78109d5b730b2b181c8 | [
"MIT"
] | null | null | null | hio-yocto-bsp/sources/poky/bitbake/lib/toaster/orm/models.py | qiangzai00001/hio-prj | 060ff97fe21093b1369db78109d5b730b2b181c8 | [
"MIT"
] | null | null | null | #
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# pub... | 39.209424 | 279 | 0.706837 | #
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# pub... | 0 | 512 | 0 | 13,038 | 0 | 0 | 0 | 56 | 550 |
180699e09004bdeab130800bdcc53eee329669db | 737 | py | Python | setup.py | jorgeviz/robosuite | 7fca50214dfa4978c9f3b5db0016b35a2920b0c9 | [
"MIT"
] | null | null | null | setup.py | jorgeviz/robosuite | 7fca50214dfa4978c9f3b5db0016b35a2920b0c9 | [
"MIT"
] | null | null | null | setup.py | jorgeviz/robosuite | 7fca50214dfa4978c9f3b5db0016b35a2920b0c9 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="robosuite",
packages=[
package for package in find_packages() if package.startswith("robosuite")
],
install_requires=[
"numpy>=1.13.3",
"scipy>=1.3.1",
"opencv-python>=3.4.3.18",
# "mujoco-py<1.50.2,>=1.50... | 30.708333 | 121 | 0.652646 | from setuptools import setup, find_packages
setup(
name="robosuite",
packages=[
package for package in find_packages() if package.startswith("robosuite")
],
install_requires=[
"numpy>=1.13.3",
"scipy>=1.3.1",
"opencv-python>=3.4.3.18",
# "mujoco-py<1.50.2,>=1.50... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d17f15fc3600e6e17ac9cae2e6c9b5d0dcf93b3f | 58 | py | Python | pyRoute13/api/generators/__init__.py | ianphil/pyRoute13 | 6aa830ebb0adb563fc3023527140664c4ac9e1b1 | [
"MIT"
] | null | null | null | pyRoute13/api/generators/__init__.py | ianphil/pyRoute13 | 6aa830ebb0adb563fc3023527140664c4ac9e1b1 | [
"MIT"
] | null | null | null | pyRoute13/api/generators/__init__.py | ianphil/pyRoute13 | 6aa830ebb0adb563fc3023527140664c4ac9e1b1 | [
"MIT"
] | null | null | null | __all__ = ["jobs", "staffing_plan", "transfer_generator"]
| 29 | 57 | 0.724138 | __all__ = ["jobs", "staffing_plan", "transfer_generator"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bfbd89c1b2f813171069a9700420ea26b48c6585 | 4,625 | py | Python | ssc.py | zmcneilly/animated-journey | 74baaee3d03dbbb45451d9ab5592023f92927ded | [
"MIT"
] | null | null | null | ssc.py | zmcneilly/animated-journey | 74baaee3d03dbbb45451d9ab5592023f92927ded | [
"MIT"
] | null | null | null | ssc.py | zmcneilly/animated-journey | 74baaee3d03dbbb45451d9ab5592023f92927ded | [
"MIT"
] | null | null | null | import paramiko
import getpass
def open_ssh_key(path: str, password: str=None) -> (paramiko.pkey.PKey, str):
"""
Function will return the Pkey object for the path specified
:param path: The path to the Pkey object
:param password: (Optional) The password for the private key
:return: Loaded Pkey
... | 39.87069 | 129 | 0.643243 | import argparse
import re
import os
import ssh_config
import paramiko
import getpass
from pathlib import Path
from ssh_config.hosts import ping
def prompt_for_input(prompt: str="Continue? [y/n]"):
resp = input(prompt).lower().strip()
if resp[0] == "y":
return True
elif resp[0] == "n":
ret... | 0 | 0 | 0 | 0 | 0 | 3,583 | 0 | -19 | 202 |
90db707433251f5390a99d5b753741016af32f77 | 298 | py | Python | backend/treeckle/organizations/models.py | CAPTxTreeckle/Treeckle-3.0 | 0c8a1a1db5685a22968644deabdd79b525ff0140 | [
"MIT"
] | null | null | null | backend/treeckle/organizations/models.py | CAPTxTreeckle/Treeckle-3.0 | 0c8a1a1db5685a22968644deabdd79b525ff0140 | [
"MIT"
] | 1 | 2021-11-28T06:18:51.000Z | 2021-11-28T06:18:51.000Z | backend/treeckle/organizations/models.py | CAPTxTreeckle/Treeckle-3.0 | 0c8a1a1db5685a22968644deabdd79b525ff0140 | [
"MIT"
] | 1 | 2021-08-02T09:20:10.000Z | 2021-08-02T09:20:10.000Z |
# Create your models here.
| 22.923077 | 56 | 0.718121 | from django.db import models
from treeckle.common.models import TimestampedModel
# Create your models here.
class Organization(TimestampedModel):
name = models.CharField(max_length=255, unique=True)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
| 0 | 0 | 0 | 167 | 0 | 0 | 0 | 37 | 66 |
757845efd7aed6aba41a24fa9b9c62d23336816e | 1,471 | py | Python | classes/tdevent.py | tshrove/technicaldebtprediction | 11c5d84b4976cc7e93cf79294403c7615cce81bd | [
"MIT"
] | null | null | null | classes/tdevent.py | tshrove/technicaldebtprediction | 11c5d84b4976cc7e93cf79294403c7615cce81bd | [
"MIT"
] | null | null | null | classes/tdevent.py | tshrove/technicaldebtprediction | 11c5d84b4976cc7e93cf79294403c7615cce81bd | [
"MIT"
] | null | null | null | from configs import ConfigFactory
config = ConfigFactory.factory()
| 23.725806 | 86 | 0.624745 | from dateutil.parser import parse
from configs import ConfigFactory
config = ConfigFactory.factory()
class TDEvent:
###
# Private Variables
###
__raw_issue = None
__is_resolved = None
###
# Public Methods
###
def __init__(self, jira_issue, is_resolved):
self.__raw_issue ... | 0 | 653 | 0 | 692 | 0 | 0 | 0 | 12 | 45 |
c042d99239011a58990a2b2c696a0be2d222ca09 | 484 | py | Python | ssc/python/f/fdi.py | xonoer/tssc | c53e76f22e3c496bcd2123fd2765bb7e461dd8ef | [
"MIT"
] | 13 | 2015-04-24T18:42:39.000Z | 2021-01-08T04:09:33.000Z | examples/fdi.py | arlionn/python-in-stata | 49046a270a5cc3ffdfdd634043277584dad13638 | [
"MIT"
] | 1 | 2018-05-22T12:28:48.000Z | 2018-05-22T12:28:48.000Z | examples/fdi.py | arlionn/python-in-stata | 49046a270a5cc3ffdfdd634043277584dad13638 | [
"MIT"
] | 8 | 2015-08-28T20:20:14.000Z | 2021-01-08T04:09:38.000Z | try:
# this kind of import puts a lot of stuff in global namespace;
# usually better to import what you need or import sympy
except ImportError:
st_local("importerror", "True")
raise
x = Symbol('x')
f = Function('f')
f = eval(st_local("anything").replace('^','**'))
st_local("anything", st_local("anyt... | 28.470588 | 66 | 0.632231 | try:
from sympy import *
# this kind of import puts a lot of stuff in global namespace;
# usually better to import what you need or import sympy
except ImportError:
st_local("importerror", "True")
raise
x = Symbol('x')
f = Function('f')
f = eval(st_local("anything").replace('^','**'))
st_local("a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 26 |
fea552e114eb820acec0c82c3f08e997cca0a6a5 | 287 | py | Python | python-sense-hat-temp-hum.py | leon-anavi/python-sense-hat-scripts | 63bb966b7b2db44c8cef9f4434a2bba067a473a0 | [
"MIT"
] | null | null | null | python-sense-hat-temp-hum.py | leon-anavi/python-sense-hat-scripts | 63bb966b7b2db44c8cef9f4434a2bba067a473a0 | [
"MIT"
] | null | null | null | python-sense-hat-temp-hum.py | leon-anavi/python-sense-hat-scripts | 63bb966b7b2db44c8cef9f4434a2bba067a473a0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from sense_hat import SenseHat
sense = SenseHat()
sense.clear()
temp = sense.get_temperature_from_pressure()
temp = round(temp, 1)
print("Temperature: %s C" % temp)
humidity = sense.get_humidity()
humidity = round(humidity, 2)
print("Humidity: %s %%rH" % humidity)
| 19.133333 | 44 | 0.721254 | #!/usr/bin/python
from sense_hat import SenseHat
sense = SenseHat()
sense.clear()
temp = sense.get_temperature_from_pressure()
temp = round(temp, 1)
print("Temperature: %s C" % temp)
humidity = sense.get_humidity()
humidity = round(humidity, 2)
print("Humidity: %s %%rH" % humidity)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
496455074737adf0cd223268168d746bc2b16dbd | 1,662 | py | Python | Day 38/NonDivisibleSubset.py | sandeep-krishna/100DaysOfCode | af4594fb6933e4281d298fa921311ccc07295a7c | [
"MIT"
] | null | null | null | Day 38/NonDivisibleSubset.py | sandeep-krishna/100DaysOfCode | af4594fb6933e4281d298fa921311ccc07295a7c | [
"MIT"
] | null | null | null | Day 38/NonDivisibleSubset.py | sandeep-krishna/100DaysOfCode | af4594fb6933e4281d298fa921311ccc07295a7c | [
"MIT"
] | null | null | null | '''
Given a set of distinct integers, print the size of a maximal subset of where the sum of any numbers in is not evenly divisible by .
For example, the array and . One of the arrays that can be created is . Another is . After testing all permutations, the maximum length solution array has elements.
Function Desc... | 24.80597 | 166 | 0.687124 | '''
Given a set of distinct integers, print the size of a maximal subset of where the sum of any numbers in is not evenly divisible by .
For example, the array and . One of the arrays that can be created is . Another is . After testing all permutations, the maximum length solution array has elements.
Function Desc... | 0 | 0 | 0 | 0 | 0 | 260 | 0 | -41 | 112 |
02546173bb38fe0ed46188dd29c53ee414c43b00 | 1,070 | py | Python | Tareas/PrimerBimestre/TareaNro1Ficheros/ReadFiles/main.py | renatojobal/python_sol | d8d0434755679d62caa34d0ea227aacc2aa1ad6d | [
"MIT"
] | null | null | null | Tareas/PrimerBimestre/TareaNro1Ficheros/ReadFiles/main.py | renatojobal/python_sol | d8d0434755679d62caa34d0ea227aacc2aa1ad6d | [
"MIT"
] | null | null | null | Tareas/PrimerBimestre/TareaNro1Ficheros/ReadFiles/main.py | renatojobal/python_sol | d8d0434755679d62caa34d0ea227aacc2aa1ad6d | [
"MIT"
] | 2 | 2021-02-02T03:33:44.000Z | 2021-02-02T03:34:20.000Z | # Parte 1
# with open('message.txt','r') as file:
# print(file.read())
#
# Parte 2
# with open('alice.txt','r') as file:
# (file.read())
# Parte 2
#with open('alice.txt','r') as file:
# line_counter = 0
# for line in file:
# print(line, end="")
#
# if (line_counter != 0) and (line_counter % 20 =... | 22.291667 | 136 | 0.580374 | # Parte 1
# with open('message.txt','r') as file:
# print(file.read())
#
# Parte 2
# with open('alice.txt','r') as file:
# (file.read())
# Parte 2
#with open('alice.txt','r') as file:
# line_counter = 0
# for line in file:
# print(line, end="")
#
# if (line_counter != 0) and (line_counter % 20 =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c99b149b9ae976820d9493ad0e46b286a2dabe91 | 2,033 | py | Python | pybitcoin/services/blockchain_info.py | sea212/pybitcoin | d34a1179ee23c5fe72bc3b555d7b86e533fcfd31 | [
"MIT"
] | 220 | 2015-06-26T08:04:53.000Z | 2021-12-31T02:03:03.000Z | pybitcoin/services/blockchain_info.py | sea212/pybitcoin | d34a1179ee23c5fe72bc3b555d7b86e533fcfd31 | [
"MIT"
] | 33 | 2015-06-25T22:15:51.000Z | 2021-03-12T21:17:19.000Z | pybitcoin/services/blockchain_info.py | sea212/pybitcoin | d34a1179ee23c5fe72bc3b555d7b86e533fcfd31 | [
"MIT"
] | 113 | 2015-07-24T13:04:56.000Z | 2021-12-27T23:56:59.000Z | # -*- coding: utf-8 -*-
"""
pybitcoin
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
import json, requests, traceback
from ..hash import reverse_hash
BLOCKCHAIN_API_BASE_URL = "https://blockchain.info"
from .blockchain_client import BlockchainClient
def... | 29.042857 | 76 | 0.651254 | # -*- coding: utf-8 -*-
"""
pybitcoin
~~~~~
:copyright: (c) 2014 by Halfmoon Labs
:license: MIT, see LICENSE for more details.
"""
import json, requests, traceback
from ..hash import reverse_hash
BLOCKCHAIN_API_BASE_URL = "https://blockchain.info"
from .blockchain_client import BlockchainClient
cla... | 0 | 0 | 0 | 201 | 0 | 271 | 0 | 0 | 46 |
8a5beb1c9fb75a319a48bf20f1e2551bce799064 | 4,753 | py | Python | backend/api/permissions/DocumentComment.py | amichard/tfrs | ed3973016cc5c2ae48999d550a23b41a5ddad807 | [
"Apache-2.0"
] | 18 | 2017-05-10T21:55:11.000Z | 2021-03-01T16:41:32.000Z | backend/api/permissions/DocumentComment.py | amichard/tfrs | ed3973016cc5c2ae48999d550a23b41a5ddad807 | [
"Apache-2.0"
] | 1,167 | 2017-03-04T00:18:43.000Z | 2022-03-03T22:31:51.000Z | backend/api/permissions/DocumentComment.py | amichard/tfrs | ed3973016cc5c2ae48999d550a23b41a5ddad807 | [
"Apache-2.0"
] | 48 | 2017-03-09T17:19:39.000Z | 2022-02-24T16:38:17.000Z | """
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: ... | 36.844961 | 79 | 0.658531 | """
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline
compliance reporting for transportation fuel suppliers in accordance with
the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: ... | 0 | 1,379 | 0 | 2,273 | 0 | 0 | 0 | 100 | 112 |
d9dc4062252847333991d9770c3290d474222423 | 1,850 | py | Python | src/evaluation/eval_pawsx.py | cr1m5onk1ng/text_similarity | 2123621bf153683b35e9433835237812605bd42f | [
"Apache-2.0"
] | 1 | 2021-07-08T16:14:46.000Z | 2021-07-08T16:14:46.000Z | src/evaluation/eval_pawsx.py | cr1m5onk1ng/text_similarity | 2123621bf153683b35e9433835237812605bd42f | [
"Apache-2.0"
] | null | null | null | src/evaluation/eval_pawsx.py | cr1m5onk1ng/text_similarity | 2123621bf153683b35e9433835237812605bd42f | [
"Apache-2.0"
] | null | null | null | from src.utils import utils
from src.configurations import classifier_config as config
from src.configurations import embeddings_config as embeddings_config
from src.evaluation.evaluators import ParaphraseEvaluator
from src.models.modeling import MBERTClassifier
from src.utils.metrics import AccuracyMeter
MODEL_NAMES ... | 28.461538 | 120 | 0.808649 | from src.utils import utils
from src.configurations import classifier_config as config
from src.configurations import embeddings_config as embeddings_config
from src.dataset.dataset import *
from src.modules.contextual_embedder import ContextualEmbedder
from src.evaluation.evaluators import ParaphraseEvaluator
from src... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 157 | 132 |
438e4a300e3fcc923820a2ab88c9dec20230e055 | 2,092 | py | Python | OLSS/news20/ParamChoice/get_feature_mapping_and_appearance.py | zsdlightning/OLSS | 7fc5d8621adfcaab61defb61719b82aeb05cc1b3 | [
"MIT"
] | 1 | 2018-06-29T10:02:29.000Z | 2018-06-29T10:02:29.000Z | OLSS/news20/get_feature_mapping_and_appearance.py | zsdlightning/OLSS | 7fc5d8621adfcaab61defb61719b82aeb05cc1b3 | [
"MIT"
] | null | null | null | OLSS/news20/get_feature_mapping_and_appearance.py | zsdlightning/OLSS | 7fc5d8621adfcaab61defb61719b82aeb05cc1b3 | [
"MIT"
] | null | null | null | #!/bin/python
import os
import sys
import numpy as np
''' input: VW training file '''
''' output: feature_to_id.txt, feature_appearence_pos.npy, feature_appearence_neg.npy '''
''' note for data with sample weight feature_off = 3, otherwise feature_off = 2'''
feature_off = 3
#calculate the appearche of each featur... | 29.464789 | 97 | 0.513384 | #!/bin/python
import os
import sys
import numpy as np
''' input: VW training file '''
''' output: feature_to_id.txt, feature_appearence_pos.npy, feature_appearence_neg.npy '''
''' note for data with sample weight feature_off = 3, otherwise feature_off = 2'''
feature_off = 3
#calculate the appearche of each featur... | 0 | 0 | 0 | 0 | 0 | 846 | 0 | 0 | 22 |
247b0f2580310cad3e1f381e524fdce487e2bc44 | 212 | py | Python | students/K33422/Larionova Anastasia/lab 1/task1_client.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 4 | 2020-09-03T15:41:42.000Z | 2021-12-24T15:28:20.000Z | students/K33422/Larionova Anastasia/lab 1/task1_client.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 48 | 2020-09-13T20:22:42.000Z | 2021-04-30T11:13:30.000Z | students/K33422/Larionova Anastasia/lab 1/task1_client.py | ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021 | bb91c91a56d21cec2b12ae4cc722eaa652a88420 | [
"MIT"
] | 69 | 2020-09-06T10:32:37.000Z | 2021-11-28T18:13:17.000Z | import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 7777))
sock.send('Hello, server! :)'.encode('utf-8'))
d = sock.recv(1024)
print(d.decode('utf-8'))
sock.close() | 21.2 | 56 | 0.70283 | import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('localhost', 7777))
sock.send('Hello, server! :)'.encode('utf-8'))
d = sock.recv(1024)
print(d.decode('utf-8'))
sock.close() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
64b0ec99725da4d831528c9fb82671f8b6e998ee | 2,406 | py | Python | pybank/main.py | sadafmehds/Python-Challenge | 9244220d58879e4d72004b0dddcebe31f88f47c3 | [
"MIT"
] | null | null | null | pybank/main.py | sadafmehds/Python-Challenge | 9244220d58879e4d72004b0dddcebe31f88f47c3 | [
"MIT"
] | null | null | null | pybank/main.py | sadafmehds/Python-Challenge | 9244220d58879e4d72004b0dddcebe31f88f47c3 | [
"MIT"
] | null | null | null | import os
import csv
#maxi function identified to get the maximum number in a list and give its index in the list together as a list
#min function identified to get the minimum number in a list and give its index in the list together as a list
#initiating lists
list_date=[]
list_rev=[]
list_change=[]
csv_path=os.pat... | 41.482759 | 149 | 0.669576 | import os
import csv
#maxi function identified to get the maximum number in a list and give its index in the list together as a list
def maxi(any_list):
s=any_list[0]
for i in any_list:
if i>s:
maxi=i
date_index=any_list.index(i)
return([date_index,maxi])
#min function ident... | 0 | 0 | 0 | 0 | 0 | 287 | 0 | 0 | 44 |
e6f6247ca2fde79aa04c30ca02345aacf5ecbb2b | 5,324 | py | Python | forecite/topic_identification/generate_dataset.py | allenai/ForeCite | 4c41203d8692de40f018819a78c4fc56d2cf2d7b | [
"Apache-2.0"
] | 24 | 2020-06-15T09:28:16.000Z | 2021-08-09T14:06:43.000Z | forecite/topic_identification/generate_dataset.py | allenai/ForeCite | 4c41203d8692de40f018819a78c4fc56d2cf2d7b | [
"Apache-2.0"
] | 2 | 2020-09-08T16:28:04.000Z | 2021-01-25T17:25:42.000Z | forecite/topic_identification/generate_dataset.py | allenai/ForeCite | 4c41203d8692de40f018819a78c4fc56d2cf2d7b | [
"Apache-2.0"
] | 5 | 2020-06-21T07:20:57.000Z | 2020-11-26T07:35:34.000Z | from typing import List
import json
import argparse
from forecite import s2_utils
def compute_noun_phrases_worker(input_text: str) -> List:
"""Returns the noun phrases in a string"""
doc = s2_utils.nlp_md(input_text[:1000000])
return [span.text.lower() for span in doc.noun_chunks]
def get_date_key_from_... | 35.731544 | 95 | 0.679189 | from typing import List, Dict
import json
import spacy
import pickle
import multiprocessing
import argparse
from scispacy.abbreviation import AbbreviationDetector
from tqdm import tqdm
from collections import defaultdict
from forecite.consts import *
from forecite import s2_utils
def compute_noun_phrases_worker(inp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 156 |
891d783cb0672d3fd69134836f2f60e7655b06fc | 1,946 | py | Python | accounts/admin.py | yusufom/marlymart | 06088af43e6f78b7385c1cf7ea5b4b68337360d8 | [
"Unlicense"
] | null | null | null | accounts/admin.py | yusufom/marlymart | 06088af43e6f78b7385c1cf7ea5b4b68337360d8 | [
"Unlicense"
] | null | null | null | accounts/admin.py | yusufom/marlymart | 06088af43e6f78b7385c1cf7ea5b4b68337360d8 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Customer, Product, Category, Order
# Register your models here.
admin.site.register(Customer, CustomerAdmin)
admin.site.register(Product, Productdmin)
admin.site.register(Category, CategoryAdmin)
admin.site.register(Order, OrderAdmin)
| 36.037037 | 95 | 0.666495 | from django.contrib import admin
from mptt.admin import DraggableMPTTAdmin
from .models import Customer, Product, Category, Order
# Register your models here.
class CategoryAdmin(DraggableMPTTAdmin):
mptt_indent_field = "name"
list_display = ('tree_actions', 'indented_title',
'relat... | 0 | 0 | 0 | 1,500 | 0 | 0 | 0 | 20 | 123 |
575e8a28a9cb731a41c4f08831d42dad11d4517a | 2,374 | py | Python | main.py | ValerioDISano/CarND-Advanced-Lane-Lines | 6dcad9e3a89fff575a9be4365ef77dd402994668 | [
"MIT"
] | null | null | null | main.py | ValerioDISano/CarND-Advanced-Lane-Lines | 6dcad9e3a89fff575a9be4365ef77dd402994668 | [
"MIT"
] | null | null | null | main.py | ValerioDISano/CarND-Advanced-Lane-Lines | 6dcad9e3a89fff575a9be4365ef77dd402994668 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == "__main__":
main()
| 35.432836 | 114 | 0.672283 | #!/usr/bin/env python3
from utilities import ImagesLoader
from utilities import VideoLoader
from utilities import Visualizer
from Line import ImageProcessor
import argparse
import sys
def main():
# enput arguments to main script to select data source data type (images or videos)
# and select the source data ... | 0 | 0 | 0 | 0 | 0 | 2,125 | 0 | 29 | 156 |
2864318e77a41277bea38fe038b27d9bacdd2e8a | 136 | py | Python | programme.py | RekingAV/pingscriptpython | 5e5ba0d661b11ce90b75a52471c726f3836a89d7 | [
"Apache-2.0"
] | null | null | null | programme.py | RekingAV/pingscriptpython | 5e5ba0d661b11ce90b75a52471c726f3836a89d7 | [
"Apache-2.0"
] | null | null | null | programme.py | RekingAV/pingscriptpython | 5e5ba0d661b11ce90b75a52471c726f3836a89d7 | [
"Apache-2.0"
] | null | null | null | if ping('52.113.194.132', verbose = True):
print('ping occuring was succesful')
else:
print('website is vulnerable to be hacked')
| 27.2 | 45 | 0.698529 | if ping('52.113.194.132', verbose = True):
print('ping occuring was succesful')
else:
print('website is vulnerable to be hacked')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
64e631883c9f3502b9d46971270187e75be9997d | 2,442 | py | Python | qtutils/measurements/virtual_instrument.py | albe-jj/qtutils | c515baa6a4ef61de70b883d8bc9feda5c4d259b3 | [
"BSD-2-Clause"
] | null | null | null | qtutils/measurements/virtual_instrument.py | albe-jj/qtutils | c515baa6a4ef61de70b883d8bc9feda5c4d259b3 | [
"BSD-2-Clause"
] | null | null | null | qtutils/measurements/virtual_instrument.py | albe-jj/qtutils | c515baa6a4ef61de70b883d8bc9feda5c4d259b3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 15:08:51 2020
@author: Albo
"""
| 35.911765 | 96 | 0.59869 | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 15:08:51 2020
@author: Albo
"""
from qcodes import Instrument
from qcodes.utils.validators import Numbers
from functools import reduce
class VirtualInstrument(Instrument):
"""
Implements a device as a virtual instrument for QCoDeS
"""
def __init__(se... | 0 | 0 | 0 | 2,232 | 0 | 0 | 0 | 37 | 90 |
bcfbd567ed08786b87b9a99550d434769f5476b2 | 22,876 | py | Python | Meta-heuristic project/Algorithm Codes/Project 3 - GA- V01.py | nusstu-dz/IE5600-Applied-Programming-for-Industrial-Systems | 2289d9a63f49d8d730a671de1b491acdbdca9650 | [
"MIT"
] | null | null | null | Meta-heuristic project/Algorithm Codes/Project 3 - GA- V01.py | nusstu-dz/IE5600-Applied-Programming-for-Industrial-Systems | 2289d9a63f49d8d730a671de1b491acdbdca9650 | [
"MIT"
] | null | null | null | Meta-heuristic project/Algorithm Codes/Project 3 - GA- V01.py | nusstu-dz/IE5600-Applied-Programming-for-Industrial-Systems | 2289d9a63f49d8d730a671de1b491acdbdca9650 | [
"MIT"
] | null | null | null | import os
'''inputs'''
os.chdir('input/')
questionInput = open('Prob-30A-50.txt', 'r')
questionInput = questionInput.readlines()
noOfVehicles = int(questionInput[0])
maxCapacity = int(questionInput[1])
Tmax = int(questionInput[2])
depot = questionInput[5].replace(',', '.').split()
depot = Node(... | 31.816412 | 121 | 0.552588 | import copy
import os
import math
import numpy as np
import random
class Node(object):
def __init__(self, idx, x, y, load, minTime, maxTime):
super(Node, self).__init__()
self.idx = idx
self.x = x
self.y = y
self.load = load
self.minTime = minTime
... | 93 | 0 | 0 | 275 | 0 | 16,206 | 0 | -31 | 567 |
8ae7507b30f5c4ecb28d1b677c6c124461738cf7 | 6,945 | py | Python | opencood/data_utils/post_processor/ciassd_postprocessor.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | opencood/data_utils/post_processor/ciassd_postprocessor.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | opencood/data_utils/post_processor/ciassd_postprocessor.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | """
3D Anchor Generator for Voxel
"""
| 40.852941 | 108 | 0.57077 | """
3D Anchor Generator for Voxel
"""
import math
import sys
import numpy as np
import torch
import torch.nn.functional as F
from opencood.data_utils.post_processor.voxel_postprocessor \
import VoxelPostprocessor
from opencood.utils import box_utils
class CiassdPostprocessor(VoxelPostprocessor):
def __init_... | 0 | 0 | 0 | 6,664 | 0 | 0 | 0 | 62 | 179 |
4d6035a4fc60599c146da678702a9ea1e5501f20 | 417 | py | Python | src/python/pants/backend/python/lint/black/register.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/backend/python/lint/black/register.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/black/register.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
| 27.8 | 78 | 0.731415 | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.python.lint import python_format_target, python_lint_target
from pants.backend.python.lint.black import rules as black_rules
def rules():
return (
*black_... | 0 | 0 | 0 | 0 | 0 | 116 | 0 | 100 | 68 |
ecc5045a1aea6b00cccf6b261440eedff9b159c0 | 2,921 | py | Python | Thomson_spectrometer_charge_to_mass_number_def.py | Similarities/Thomson-Parabola-analytical-plot | bd2761960ace28068efcd7eafbb4520c44b43994 | [
"MIT"
] | null | null | null | Thomson_spectrometer_charge_to_mass_number_def.py | Similarities/Thomson-Parabola-analytical-plot | bd2761960ace28068efcd7eafbb4520c44b43994 | [
"MIT"
] | null | null | null | Thomson_spectrometer_charge_to_mass_number_def.py | Similarities/Thomson-Parabola-analytical-plot | bd2761960ace28068efcd7eafbb4520c44b43994 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 01 11:56:10 2015
@author: Zombie.Soc//similarities
"""
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
print ("Reconstruction of Thomson spectrometer parabolas - to check parameters")
#Parameters
# !!! 0 point coordinates in ... | 19.473333 | 81 | 0.5481 |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 01 11:56:10 2015
@author: Zombie.Soc//similarities
"""
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
print ("Reconstruction of Thomson spectrometer parabolas - to check parameters")
#Parameters
# !!! 0 point coordinates in ... | 2 | 0 | 0 | 0 | 0 | 349 | 0 | 0 | 58 |
c013bc222bc2bb135874674a676063550952f9bd | 3,470 | py | Python | tests/browser.py | nickmeet/kanvas | 0fed091aa1b4011fc688ecc074e8525dd550b31d | [
"Apache-2.0"
] | null | null | null | tests/browser.py | nickmeet/kanvas | 0fed091aa1b4011fc688ecc074e8525dd550b31d | [
"Apache-2.0"
] | 5 | 2020-02-12T00:00:34.000Z | 2021-06-10T19:37:45.000Z | tests/browser.py | nicosmaris/kanvas | 0fed091aa1b4011fc688ecc074e8525dd550b31d | [
"Apache-2.0"
] | null | null | null | import logging
logging.basicConfig(filename="python.log", level=logging.DEBUG)
| 41.807229 | 138 | 0.65562 | from selenium import webdriver
import sys
from os.path import join, abspath, dirname
import logging
from selenium.webdriver.remote.remote_connection import LOGGER as ghostdriver_logger
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from locators import homePage
from selenium.webdriver.su... | 0 | 0 | 0 | 2,875 | 0 | 0 | 0 | 249 | 265 |
5c2419e80cf571fe31532b5945a81bf47c134391 | 8,043 | py | Python | research/object_detection_app/mlb_detection/prepare_numpy.py | szhaofelicia/models-1.13.0-app | 6213767f02ecf309d2af91989b4c081bf85f3bf9 | [
"Apache-2.0"
] | null | null | null | research/object_detection_app/mlb_detection/prepare_numpy.py | szhaofelicia/models-1.13.0-app | 6213767f02ecf309d2af91989b4c081bf85f3bf9 | [
"Apache-2.0"
] | null | null | null | research/object_detection_app/mlb_detection/prepare_numpy.py | szhaofelicia/models-1.13.0-app | 6213767f02ecf309d2af91989b4c081bf85f3bf9 | [
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import numpy as np
import tensorflow.compat.v2 as tf
from absl import logging
from absl import app
from absl import flags
import cv2
flags.DEFINE_string('acivity', 'swing', 'The cla... | 34.519313 | 113 | 0.659704 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import io
import json
import math
import os
import numpy as np
from PIL import Image
from PIL import ImageFile
import tensorflow.compat.v2 as tf
from absl import logging
from absl import app
from absl import... | 0 | 0 | 0 | 0 | 0 | 309 | 0 | -18 | 112 |
dbed26663e7828bd1d7de6032d7366ca4fa81a22 | 3,386 | py | Python | crypto/crypto_test_old.py | JohnOmernik/raspfarm | b187a81adea95dd39fe804a238105191f784c9be | [
"Apache-2.0"
] | null | null | null | crypto/crypto_test_old.py | JohnOmernik/raspfarm | b187a81adea95dd39fe804a238105191f784c9be | [
"Apache-2.0"
] | null | null | null | crypto/crypto_test_old.py | JohnOmernik/raspfarm | b187a81adea95dd39fe804a238105191f784c9be | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
keysdir = "./keys"
pubdir = keysdir + "/public"
pvtdir = keysdir + "/private"
pubkey = pubdir + "/mypub.pem"
pvtkey = pvtdir + "/mypvt.pem"
srvkey = pubdir + "/srvpub.pem"
public_key = ""
private_key = ""
server_public_key = ""
if __name__ == "__main__":
main()
| 35.642105 | 181 | 0.700827 | #!/usr/bin/python3
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
import sys
impor... | 0 | 0 | 0 | 0 | 0 | 2,717 | 0 | 151 | 223 |
9149780a2fe4d9f493fbf30d587e4c87a5240349 | 1,645 | py | Python | backend/vehicules/migrations/0001_initial.py | RodrigoBLima/parking-project | 4444033980aec03f0cd7ba1947b24d487bff9131 | [
"MIT"
] | null | null | null | backend/vehicules/migrations/0001_initial.py | RodrigoBLima/parking-project | 4444033980aec03f0cd7ba1947b24d487bff9131 | [
"MIT"
] | 3 | 2021-09-12T01:03:31.000Z | 2022-02-27T06:47:30.000Z | backend/vehicules/migrations/0001_initial.py | RodrigoBLima/parking-project | 4444033980aec03f0cd7ba1947b24d487bff9131 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-06-15 22:15
| 47 | 198 | 0.647416 | # Generated by Django 3.0.7 on 2020-06-15 22:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('employees', '0001_initial'),
migrations.swappable_dependency(se... | 0 | 0 | 0 | 1,465 | 0 | 0 | 0 | 41 | 90 |
7cbca312c6107409ee289dcff735a96fab311dd3 | 733 | py | Python | projects/speech_translation/lr_scheduler/subepoch_lr_scheduler.py | tran-khoa/fairseq | 558366b3c6970a5dd85ad1909581d43e41fdce9f | [
"MIT"
] | null | null | null | projects/speech_translation/lr_scheduler/subepoch_lr_scheduler.py | tran-khoa/fairseq | 558366b3c6970a5dd85ad1909581d43e41fdce9f | [
"MIT"
] | null | null | null | projects/speech_translation/lr_scheduler/subepoch_lr_scheduler.py | tran-khoa/fairseq | 558366b3c6970a5dd85ad1909581d43e41fdce9f | [
"MIT"
] | null | null | null |
from fairseq.dataclass import ChoiceEnum
STEP_MODE_CHOICE = ChoiceEnum(['epoch', 'subepoch'])
| 26.178571 | 84 | 0.697135 | from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from fairseq.dataclass import ChoiceEnum, FairseqDataclass
STEP_MODE_CHOICE = ChoiceEnum(['epoch', 'subepoch'])
@dataclass
class SubepochLRSchedulerConfig(FairseqDataclass):
step_mode: STEP_MODE_CHOICE = field(
default="subepoc... | 0 | 330 | 0 | 164 | 0 | 0 | 0 | 51 | 90 |
853dc461e03b4829448d8970e799270c6aec43d6 | 179 | py | Python | Exercicios/ex006.py | Vitmambro/Python9 | d084e6fd8230b71e4dade87086a411210e131320 | [
"MIT"
] | null | null | null | Exercicios/ex006.py | Vitmambro/Python9 | d084e6fd8230b71e4dade87086a411210e131320 | [
"MIT"
] | null | null | null | Exercicios/ex006.py | Vitmambro/Python9 | d084e6fd8230b71e4dade87086a411210e131320 | [
"MIT"
] | null | null | null | n = int(input('Digite um numero: '))
a = n * 2
b = n * 3
c = n ** (1/2)
print('O dobro do numero seria {} \n O triplo seria {} \n A raiz quadrada seria {:.2f}'.format(a, b, c))
| 22.375 | 104 | 0.558659 | n = int(input('Digite um numero: '))
a = n * 2
b = n * 3
c = n ** (1/2)
print('O dobro do numero seria {} \n O triplo seria {} \n A raiz quadrada seria {:.2f}'.format(a, b, c))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1bed624c8eee0da3cdb05b47bd146d6d0a02a7d0 | 342 | py | Python | Feature/corner_fast.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Feature/corner_fast.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Feature/corner_fast.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | # FASTOpencvskimage
from skimage import feature, img_as_float, io
image = img_as_float(io.imread('/home/qiao/PythonProjects/Scikit-image_On_CT/Test_Img/10.jpg'))
gamma_corrected = feature.corner_fast(image)
points = feature.corner_peaks(gamma_corrected)
print(points)
io.imshow(image)
io.show()
| 31.090909 | 95 | 0.812865 | # FAST拐点检测,拐点检测Opencv有七种,且比skimage的方法快的多
from skimage import data, feature, img_as_float, io
import numpy as np
image = img_as_float(io.imread('/home/qiao/PythonProjects/Scikit-image_On_CT/Test_Img/10.jpg'))
gamma_corrected = feature.corner_fast(image)
points = feature.corner_peaks(gamma_corrected)
print(points)
io.ims... | 63 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 22 |
4f5c7ba674e75571c35d8a525e280d946419130f | 2,090 | py | Python | hpimdm/packet/ReceivedPacket.py | pedrofran12/hpim_dm | fe949294b5e75ab544dcd40ff51ceafc1d3b2f0c | [
"MIT"
] | 1 | 2020-02-04T20:59:03.000Z | 2020-02-04T20:59:03.000Z | hpimdm/packet/ReceivedPacket.py | pedrofran12/hpim_dm | fe949294b5e75ab544dcd40ff51ceafc1d3b2f0c | [
"MIT"
] | 3 | 2020-06-09T16:37:01.000Z | 2021-08-30T00:31:12.000Z | hpimdm/packet/ReceivedPacket.py | pedrofran12/hpim_dm | fe949294b5e75ab544dcd40ff51ceafc1d3b2f0c | [
"MIT"
] | 1 | 2020-11-23T06:47:46.000Z | 2020-11-23T06:47:46.000Z | from hpimdm.tree.hpim_globals import MSG_FORMAT
from hpimdm.utils import TYPE_CHECKING
if TYPE_CHECKING:
if MSG_FORMAT == "BINARY":
from .PacketHPIMHeader import PacketHPIMHeader, PacketHPIMHeader_v6
else:
| 40.192308 | 117 | 0.742105 | import socket
from .Packet import Packet
from .PacketIpHeader import PacketIpv4Header, PacketIpv6Header
from hpimdm.tree.hpim_globals import MSG_FORMAT
from hpimdm.utils import TYPE_CHECKING
if TYPE_CHECKING:
from hpimdm.Interface import Interface
if MSG_FORMAT == "BINARY":
from .PacketHPIMHeader import Packe... | 0 | 0 | 0 | 1,530 | 0 | 0 | 0 | 156 | 190 |
aa36ea2d7b5f61fd6a7f233730049f57e2580dd0 | 2,349 | py | Python | sensor/scripts/top_phat_button.py | steviebd/bme680-container | 9d3fb10e39d70f1e287ba3003f5567295b3da946 | [
"MIT"
] | null | null | null | sensor/scripts/top_phat_button.py | steviebd/bme680-container | 9d3fb10e39d70f1e287ba3003f5567295b3da946 | [
"MIT"
] | null | null | null | sensor/scripts/top_phat_button.py | steviebd/bme680-container | 9d3fb10e39d70f1e287ba3003f5567295b3da946 | [
"MIT"
] | null | null | null | import time
import RPi.GPIO as GPIO #Python Package Reference: https://pypi.org/project/RPi.GPIO/
# Code taken from https://learn.sparkfun.com/tutorials/raspberry-pi-safe-reboot-and-shutdown-button using the last example to minimize resources used (sleep function)
# Pin definition
reset_shutdown_pin = 17
# Suppress ... | 32.625 | 166 | 0.696041 | import time
import RPi.GPIO as GPIO #Python Package Reference: https://pypi.org/project/RPi.GPIO/
# Code taken from https://learn.sparkfun.com/tutorials/raspberry-pi-safe-reboot-and-shutdown-button using the last example to minimize resources used (sleep function)
# Pin definition
reset_shutdown_pin = 17
# Suppress ... | 0 | 0 | 0 | 0 | 0 | 446 | 0 | 0 | 44 |