hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fc84a545b9160630d3e9cfef5c5df972c5b656 | 27 | py | Python | livegraph/__init__.py | dav-ell/JupyterDraw | e571bc7c1044c61a75c272edd67f23048f124928 | [
"MIT"
] | 1 | 2020-04-03T19:41:06.000Z | 2020-04-03T19:41:06.000Z | livegraph/__init__.py | dav-ell/JupyterDraw | e571bc7c1044c61a75c272edd67f23048f124928 | [
"MIT"
] | null | null | null | livegraph/__init__.py | dav-ell/JupyterDraw | e571bc7c1044c61a75c272edd67f23048f124928 | [
"MIT"
] | null | null | null | from .livegraph import Draw | 27 | 27 | 0.851852 | from .livegraph import Draw | true | true |
f7fc84b56e5d586c52b33f29c03ed1d722cffa54 | 2,237 | py | Python | neutron/agent/l3/link_local_allocator.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 1 | 2016-03-25T21:13:13.000Z | 2016-03-25T21:13:13.000Z | neutron/agent/l3/link_local_allocator.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-27T00:48:55.000Z | 2015-04-21T05:29:37.000Z | neutron/agent/l3/link_local_allocator.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-26T00:55:17.000Z | 2020-03-01T17:05:40.000Z | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | 42.207547 | 79 | 0.680823 |
import netaddr
from neutron.agent.l3.item_allocator import ItemAllocator
class LinkLocalAddressPair(netaddr.IPNetwork):
def __init__(self, addr):
super(LinkLocalAddressPair, self).__init__(addr)
def get_pair(self):
return (netaddr.IPNetwork("%s/%s" % (self.net... | true | true |
f7fc84f573aa97d3b828afe66e29e4f49f7bb79c | 1,393 | py | Python | quantlab/COCO/utils/inference.py | lukasc-ch/QuantLab | 7ddcc51ec1131a58269768cd898ce04e8b49beb6 | [
"Apache-2.0"
] | 6 | 2019-05-24T17:39:07.000Z | 2021-11-06T22:19:55.000Z | quantlab/COCO/utils/inference.py | lukasc-ch/QuantLab | 7ddcc51ec1131a58269768cd898ce04e8b49beb6 | [
"Apache-2.0"
] | null | null | null | quantlab/COCO/utils/inference.py | lukasc-ch/QuantLab | 7ddcc51ec1131a58269768cd898ce04e8b49beb6 | [
"Apache-2.0"
] | 4 | 2019-05-24T17:39:15.000Z | 2021-04-02T07:13:11.000Z | import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
def view_instance(img, gt_label, pr_label=None):
img = img.cpu()
# gt_label = gt_label.cpu()
# pr_label = pr_label.cpu()
# c, h, w = img.shape
# with open('/home/spmatteo/MSDocuments/QuantLab/COCO/coco.names', ... | 42.212121 | 128 | 0.580761 | import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
def view_instance(img, gt_label, pr_label=None):
img = img.cpu()
| true | true |
f7fc854ec16d842085b3bd24d1afacdfaac412f9 | 833 | py | Python | binary-indexed-tree/Python/5211-path-with-maximum-probability.py | Ivan-07/LeetCode-Solutions-in-Good-Style | b17bf19b13c9d9f52b7029a732d4d8a8be212dd4 | [
"Apache-2.0"
] | 1 | 2020-09-27T04:18:05.000Z | 2020-09-27T04:18:05.000Z | binary-indexed-tree/Python/5211-path-with-maximum-probability.py | Ivan-07/LeetCode-Solutions-in-Good-Style | b17bf19b13c9d9f52b7029a732d4d8a8be212dd4 | [
"Apache-2.0"
] | null | null | null | binary-indexed-tree/Python/5211-path-with-maximum-probability.py | Ivan-07/LeetCode-Solutions-in-Good-Style | b17bf19b13c9d9f52b7029a732d4d8a8be212dd4 | [
"Apache-2.0"
] | null | null | null | from typing import List
from collections import defaultdict
from collections import deque
class Solution:
def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float:
d = defaultdict(list)
for (x, y), p in zip(edges, succProb):
d[x].ap... | 29.75 | 115 | 0.506603 | from typing import List
from collections import defaultdict
from collections import deque
class Solution:
def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float:
d = defaultdict(list)
for (x, y), p in zip(edges, succProb):
d[x].ap... | true | true |
f7fc86ba9dfee99156e60ce481c84c3531910e5f | 730 | py | Python | worker.py | Nicholas-Morton/DutyScheduler | 681241a46e38e74e37f92bce832c378781e3c488 | [
"MIT"
] | null | null | null | worker.py | Nicholas-Morton/DutyScheduler | 681241a46e38e74e37f92bce832c378781e3c488 | [
"MIT"
] | null | null | null | worker.py | Nicholas-Morton/DutyScheduler | 681241a46e38e74e37f92bce832c378781e3c488 | [
"MIT"
] | null | null | null | class Worker:
def __init__(self):
self.name = ""
self.thisWeekGeneral = 0
self.thisWeekDetail = 0
self.jobs = []
self.counts = {
'east': 0,
'gcb': 0,
'second': 0,
'third': 0,
'dinner': 0,
'wakings': 0,
... | 20.857143 | 32 | 0.347945 | class Worker:
def __init__(self):
self.name = ""
self.thisWeekGeneral = 0
self.thisWeekDetail = 0
self.jobs = []
self.counts = {
'east': 0,
'gcb': 0,
'second': 0,
'third': 0,
'dinner': 0,
'wakings': 0,
... | true | true |
f7fc86ef6167230e5d3fc2c182cd900b04d1928a | 476 | py | Python | demo_flat/flatpage_control/admin.py | emelianovss-yandex-praktikum/01_pythonplus_template_engine_and_flatpages | ef6b35099200145c90a15597a2646bb279f43ffa | [
"MIT"
] | null | null | null | demo_flat/flatpage_control/admin.py | emelianovss-yandex-praktikum/01_pythonplus_template_engine_and_flatpages | ef6b35099200145c90a15597a2646bb279f43ffa | [
"MIT"
] | null | null | null | demo_flat/flatpage_control/admin.py | emelianovss-yandex-praktikum/01_pythonplus_template_engine_and_flatpages | ef6b35099200145c90a15597a2646bb279f43ffa | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.db import models
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from ckeditor.widgets import CKEditorWidget
# Define a new FlatPageAdmin
class FlatPageAdmin(FlatPageAdmin):
formfield_overrides = {
m... | 28 | 56 | 0.804622 | from django.contrib import admin
from django.db import models
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from ckeditor.widgets import CKEditorWidget
class FlatPageAdmin(FlatPageAdmin):
formfield_overrides = {
models.TextField: {'widget': ... | true | true |
f7fc87404d06e94918baa6e2b98e3e61c6d926e1 | 3,912 | py | Python | check-nordvpn-latency.py | rileyweber13/check-nordvpn-latency | 5946078eae8fb2c67dc1f26125f6a6748b157e50 | [
"MIT"
] | null | null | null | check-nordvpn-latency.py | rileyweber13/check-nordvpn-latency | 5946078eae8fb2c67dc1f26125f6a6748b157e50 | [
"MIT"
] | null | null | null | check-nordvpn-latency.py | rileyweber13/check-nordvpn-latency | 5946078eae8fb2c67dc1f26125f6a6748b157e50 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import datetime
import os
import re
import subprocess
import sys
import time
import urllib.request
from bs4 import BeautifulSoup as bs
# constants
VPN_FILE_NAME = 'vpn-urls'
def get_servers_soup():
site = 'https://nordvpn.com/ovpn/'
hdr = {'User-Agent': 'Mozilla/5.0'}
req = urllib.req... | 31.804878 | 78 | 0.585634 |
import datetime
import os
import re
import subprocess
import sys
import time
import urllib.request
from bs4 import BeautifulSoup as bs
VPN_FILE_NAME = 'vpn-urls'
def get_servers_soup():
site = 'https://nordvpn.com/ovpn/'
hdr = {'User-Agent': 'Mozilla/5.0'}
req = urllib.request.Request(site, headers=hd... | true | true |
f7fc887379fdc09daf70baf42870115b78467f70 | 4,432 | py | Python | examples/keyword_watcher/keyword_watcher.py | iragamagoori/redditlib | e4efcde1ed53e6f684eae57b172263f15cfece86 | [
"MIT"
] | null | null | null | examples/keyword_watcher/keyword_watcher.py | iragamagoori/redditlib | e4efcde1ed53e6f684eae57b172263f15cfece86 | [
"MIT"
] | null | null | null | examples/keyword_watcher/keyword_watcher.py | iragamagoori/redditlib | e4efcde1ed53e6f684eae57b172263f15cfece86 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Requirements:
# subprocess32 python package
# nodejs
# puppeteer npm package
# sleep npm package
CREDS_FILENAME = 'creds.json'
import json, os, re, sys, time
sys.path.append(os.getcwd())
from redditlib import *
mydir, _ = os.path.split(os.path.abspath(sys.argv[0]))
def pref... | 32.82963 | 143 | 0.610785 |
CREDS_FILENAME = 'creds.json'
import json, os, re, sys, time
sys.path.append(os.getcwd())
from redditlib import *
mydir, _ = os.path.split(os.path.abspath(sys.argv[0]))
def preflight():
try:
import subprocess32 as subprocess
except ImportError:
print >>sys.stderr, "This example requir... | false | true |
f7fc88ccef31475bce09b6ff3d017c76d9b074c4 | 655 | py | Python | bot_cmds/cmd_fragments/_time_parse.py | jmeel14/yt-databot-discord | 82c54acce87546039853307389b711c3f36284aa | [
"Apache-2.0"
] | null | null | null | bot_cmds/cmd_fragments/_time_parse.py | jmeel14/yt-databot-discord | 82c54acce87546039853307389b711c3f36284aa | [
"Apache-2.0"
] | null | null | null | bot_cmds/cmd_fragments/_time_parse.py | jmeel14/yt-databot-discord | 82c54acce87546039853307389b711c3f36284aa | [
"Apache-2.0"
] | null | null | null | from re import search as re_s
def convert_duration(time_str):
resp_obj = { "H": None, "M": None, "S": None }
re_match = re_s('^PT(\d*H)?(\d*M)?(\d*S)?', time_str)
if re_match:
re_str = re_match.groups()
for grp in re_str:
if grp and grp[-1] in resp_obj:
if "H" in... | 31.190476 | 57 | 0.445802 | from re import search as re_s
def convert_duration(time_str):
resp_obj = { "H": None, "M": None, "S": None }
re_match = re_s('^PT(\d*H)?(\d*M)?(\d*S)?', time_str)
if re_match:
re_str = re_match.groups()
for grp in re_str:
if grp and grp[-1] in resp_obj:
if "H" in... | true | true |
f7fc89c6a93f642bee3f460863e07915e30b28d9 | 312 | py | Python | ctypes/hello/__init__.py | AllGloryToTheHypnotoad/python-ctypes | 4b855349ecd614b929d435953a819603a7a11f03 | [
"MIT"
] | null | null | null | ctypes/hello/__init__.py | AllGloryToTheHypnotoad/python-ctypes | 4b855349ecd614b929d435953a819603a7a11f03 | [
"MIT"
] | null | null | null | ctypes/hello/__init__.py | AllGloryToTheHypnotoad/python-ctypes | 4b855349ecd614b929d435953a819603a7a11f03 | [
"MIT"
] | null | null | null | # import os
from hello.hello import cos
from hello.hello import test
from hello.hello import testarray
from hello.hello import ClassTest
__version__ = '0.1.0'
__author__ = 'bob'
__license__ = 'MIT'
# lib_path = os.path.join(os.path.dirname(__file__), 'libhello.dylib')
# lib = CDLL(lib_path)
# print(lib_path)
| 22.285714 | 70 | 0.75 |
from hello.hello import cos
from hello.hello import test
from hello.hello import testarray
from hello.hello import ClassTest
__version__ = '0.1.0'
__author__ = 'bob'
__license__ = 'MIT'
| true | true |
f7fc8aee8081880ef026c7110e128269d5ef17b5 | 2,234 | py | Python | timelapse.py | ocdude/raspberry-pi-timelapse | b9a3a941af6ae1b4e6aed51ae0df7c8a7172b4fd | [
"MIT"
] | 3 | 2020-05-17T00:06:00.000Z | 2021-11-17T00:22:23.000Z | timelapse.py | ocdude/raspberry-pi-timelapse | b9a3a941af6ae1b4e6aed51ae0df7c8a7172b4fd | [
"MIT"
] | null | null | null | timelapse.py | ocdude/raspberry-pi-timelapse | b9a3a941af6ae1b4e6aed51ae0df7c8a7172b4fd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import time
import picamera
import configparser
import sys
import paramiko
import scp
from os import path
# set a default resolution to the max resolution of the HQ camera module
default_resolution = (4056,3040)
def set_camera(res):
camera = picamera.PiCamera()
camera.resolution = res
camera.ex... | 31.914286 | 87 | 0.739481 |
import time
import picamera
import configparser
import sys
import paramiko
import scp
from os import path
default_resolution = (4056,3040)
def set_camera(res):
camera = picamera.PiCamera()
camera.resolution = res
camera.exposure_mode = 'auto'
time.sleep(1)
return camera
def ssh_client(server, port, user, pas... | true | true |
f7fc8b95ab1117c9600140f7fc97c01a927786f4 | 977 | py | Python | FundProg/Aula21-Arquivos/ex08-vamospraticar.py | Bhclira/NExT | 192353a139089d0fed003bfb7e2523aa02a0a737 | [
"MIT"
] | null | null | null | FundProg/Aula21-Arquivos/ex08-vamospraticar.py | Bhclira/NExT | 192353a139089d0fed003bfb7e2523aa02a0a737 | [
"MIT"
] | null | null | null | FundProg/Aula21-Arquivos/ex08-vamospraticar.py | Bhclira/NExT | 192353a139089d0fed003bfb7e2523aa02a0a737 | [
"MIT"
] | null | null | null | '''
Crie um programa simples que pergunta se a pessoa deseja ler um
arquivo ou escrever algo nele."
Nosso script vai funcionar assim:
Aparece um menu de opções (sair, ler ou escrever). Se digitar ler, lê
o conteúdo do arquivo e exibe na tela.
Se optar por escrever, escreve algo no arquivo.
'''
import os.path
op=1
wh... | 26.405405 | 69 | 0.579324 |
import os.path
op=1
while op:
if os.path.isfile('teste.txt') is false:
print('Arquivo teste.txt não existe. Criando ...')
meuArquivo = open('teste.txt', 'w')
meuArquivo = open('teste.txt', 'r+')
print('\n\tMenu de Opções\n')
op=int(input('0. sair \n'
'1. Ler\n... | true | true |
f7fc8c07675a6f56eb25905e500243ce93167982 | 172 | py | Python | polyaxon_deploy/schemas/service_types.py | gideonbros/polyaxon-deploy | 77828e028670c43cc74704a4d7b9ec2e661e10a4 | [
"MIT"
] | null | null | null | polyaxon_deploy/schemas/service_types.py | gideonbros/polyaxon-deploy | 77828e028670c43cc74704a4d7b9ec2e661e10a4 | [
"MIT"
] | null | null | null | polyaxon_deploy/schemas/service_types.py | gideonbros/polyaxon-deploy | 77828e028670c43cc74704a4d7b9ec2e661e10a4 | [
"MIT"
] | null | null | null | class ServiceTypes(object):
LOAD_BALANCER = 'LoadBalancer'
NODE_PORT = 'NodePort'
CLUSTER_IP = 'ClusterIP'
VALUES = [LOAD_BALANCER, NODE_PORT, CLUSTER_IP]
| 24.571429 | 51 | 0.709302 | class ServiceTypes(object):
LOAD_BALANCER = 'LoadBalancer'
NODE_PORT = 'NodePort'
CLUSTER_IP = 'ClusterIP'
VALUES = [LOAD_BALANCER, NODE_PORT, CLUSTER_IP]
| true | true |
f7fc8c8159d12a85fdde1380bf14d96d4db9500f | 206 | py | Python | Python/100Excersises/76 to 100/85/.history/85_20201119144321.py | magusikrak/NAMI-TERM-I-GroupWork | f0a9a5f219ccbec024eb5316361db3fca46e171c | [
"MIT"
] | null | null | null | Python/100Excersises/76 to 100/85/.history/85_20201119144321.py | magusikrak/NAMI-TERM-I-GroupWork | f0a9a5f219ccbec024eb5316361db3fca46e171c | [
"MIT"
] | 1 | 2021-07-24T03:18:30.000Z | 2021-07-24T12:45:07.000Z | Python/100Excersises/76 to 100/85/.history/85_20201119144321.py | magusikrak/NAMI-TERM-I-GroupWork | f0a9a5f219ccbec024eb5316361db3fca46e171c | [
"MIT"
] | null | null | null | myFile=open("c.txt","r")
countriesRaw=myFile.read()
countriesNeat=''
countriesRaw.split()
list1=list(map(list,countriesRaw))
print(countriesRaw)
# print((list1))
# for country in list1:
# print(country) | 22.888889 | 34 | 0.73301 | myFile=open("c.txt","r")
countriesRaw=myFile.read()
countriesNeat=''
countriesRaw.split()
list1=list(map(list,countriesRaw))
print(countriesRaw)
| true | true |
f7fc8c9a9cd05c9d57738e97c285667615cc6e93 | 1,346 | py | Python | python/pyarmnn/src/pyarmnn/_version.py | tuanhe/armnn | 8a4bd6671d0106dfb788b8c9019f2f9646770f8d | [
"MIT"
] | 1 | 2021-07-03T23:46:08.000Z | 2021-07-03T23:46:08.000Z | python/pyarmnn/src/pyarmnn/_version.py | tuanhe/armnn | 8a4bd6671d0106dfb788b8c9019f2f9646770f8d | [
"MIT"
] | null | null | null | python/pyarmnn/src/pyarmnn/_version.py | tuanhe/armnn | 8a4bd6671d0106dfb788b8c9019f2f9646770f8d | [
"MIT"
] | null | null | null | # Copyright © 2020 Arm Ltd. All rights reserved.
# Copyright 2020 NXP
# SPDX-License-Identifier: MIT
import os
version_info = (25, 0, 0)
__dev_version_env = os.getenv("PYARMNN_DEV_VER", "")
if __dev_version_env:
__dev_version = "dev0"
try:
__dev_version = "dev{}".format(int(__dev_version_env))
ex... | 34.512821 | 128 | 0.705795 |
import os
version_info = (25, 0, 0)
__dev_version_env = os.getenv("PYARMNN_DEV_VER", "")
if __dev_version_env:
__dev_version = "dev0"
try:
__dev_version = "dev{}".format(int(__dev_version_env))
except ValueError:
__dev_version = str(__dev_version_env)
version_info = (*version_info... | true | true |
f7fc8d25337c8366e77792eef08c8e79b8558676 | 1,228 | py | Python | django/AdeKurniawan/mysite/mysite/blog/migrations/0001_initial.py | profMsaif/web_applications_2022 | 849cfeb396b82551e2553028d03fe9693773fc49 | [
"MIT"
] | 1 | 2022-03-12T10:17:55.000Z | 2022-03-12T10:17:55.000Z | django/matarmaa/mysite/mysite/blog/migrations/0001_initial.py | adekoerniawan/web_applications_2022 | 2a4347be6537c3982436bdd362ad13ee1868ede0 | [
"MIT"
] | null | null | null | django/matarmaa/mysite/mysite/blog/migrations/0001_initial.py | adekoerniawan/web_applications_2022 | 2a4347be6537c3982436bdd362ad13ee1868ede0 | [
"MIT"
] | 4 | 2022-03-12T10:17:00.000Z | 2022-03-26T08:40:43.000Z | # Generated by Django 4.0.2 on 2022-02-26 10:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 36.117647 | 147 | 0.598534 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f7fc8d9d150098c187a2f9d047fabe6bef077994 | 1,182 | py | Python | pyvisdk/do/dvs_port_reconfigured_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/dvs_port_reconfigured_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/dvs_port_reconfigured_event.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def DvsPortReconfiguredEvent(vim, *args, **kwargs):
'''Existing ports are reconfigured in... | 34.764706 | 124 | 0.612521 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
| true | true |
f7fc8e15833d76dda08e5e73599360926c2834e4 | 4,230 | py | Python | qi-server/main.py | Grey0520/Qi | f6c5ecf6089fa748cc4a77b7fa7be6a82841921d | [
"MIT"
] | null | null | null | qi-server/main.py | Grey0520/Qi | f6c5ecf6089fa748cc4a77b7fa7be6a82841921d | [
"MIT"
] | null | null | null | qi-server/main.py | Grey0520/Qi | f6c5ecf6089fa748cc4a77b7fa7be6a82841921d | [
"MIT"
] | null | null | null | import codecs
import json
import sys
import tempfile
import flask
from flask import Flask, request
from auth3 import Auth
from course_excel import course_excel_handler
from exam import exam_handler
from semester import get_semester
from transposition import get_college_and_grade_list, get_major_list, transposition
#... | 26.111111 | 110 | 0.539007 | import codecs
import json
import sys
import tempfile
import flask
from flask import Flask, request
from auth3 import Auth
from course_excel import course_excel_handler
from exam import exam_handler
from semester import get_semester
from transposition import get_college_and_grade_list, get_major_list, transposition
... | true | true |
f7fc903c47ecc8b58dda0afbd0fe9cdd74d9d9ea | 267 | py | Python | geeksaga/archive/controller/__init__.py | geekflow/archive | a94bd50363d1cc0004d8d0984599432a31e70035 | [
"MIT"
] | null | null | null | geeksaga/archive/controller/__init__.py | geekflow/archive | a94bd50363d1cc0004d8d0984599432a31e70035 | [
"MIT"
] | null | null | null | geeksaga/archive/controller/__init__.py | geekflow/archive | a94bd50363d1cc0004d8d0984599432a31e70035 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
.controller
~~~~~~~~~~~~~~~~~~~
archive controller initialize module.
:copyright: (c) 2014 by geeksaga.
:license: MIT LICENSE 2.0, see license for more details.
"""
__all__ = ['login', 'user', 'admin', 'ArchiveAPI'] | 22.25 | 60 | 0.565543 |
__all__ = ['login', 'user', 'admin', 'ArchiveAPI'] | true | true |
f7fc9191a7bc25429ff4e0a44d28fb74b23a4622 | 3,371 | py | Python | setup.py | sequana/rnaseq | 470e3e5e2563596fc37515d0b38a7024e178a7a3 | [
"BSD-3-Clause"
] | 6 | 2021-03-24T15:49:23.000Z | 2022-01-05T17:00:43.000Z | setup.py | sequana/rnaseq | 470e3e5e2563596fc37515d0b38a7024e178a7a3 | [
"BSD-3-Clause"
] | 6 | 2020-12-08T12:58:04.000Z | 2022-01-18T10:23:11.000Z | setup.py | sequana/rnaseq | 470e3e5e2563596fc37515d0b38a7024e178a7a3 | [
"BSD-3-Clause"
] | 1 | 2021-03-24T15:49:24.000Z | 2021-03-24T15:49:24.000Z | from setuptools import setup, find_namespace_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import subprocess
_MAJOR = 0
_MINOR = 14
_MICRO = 2
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
release ... | 36.641304 | 80 | 0.592999 | from setuptools import setup, find_namespace_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import subprocess
_MAJOR = 0
_MINOR = 14
_MICRO = 2
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
release ... | true | true |
f7fc92c235ebec4cf3c31c64c347236171dd95d7 | 5,694 | py | Python | test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py | elastic/elasticsearch-py | c0d9bd1b0bd94f6819172199bebc338358410496 | [
"Apache-2.0"
] | 3,353 | 2015-03-12T17:41:01.000Z | 2022-03-31T05:03:02.000Z | test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py | elastic/elasticsearch-py | c0d9bd1b0bd94f6819172199bebc338358410496 | [
"Apache-2.0"
] | 1,356 | 2015-03-11T14:27:35.000Z | 2022-03-30T22:57:07.000Z | test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py | elastic/elasticsearch-py | c0d9bd1b0bd94f6819172199bebc338358410496 | [
"Apache-2.0"
] | 1,193 | 2015-03-11T15:13:26.000Z | 2022-03-29T02:45:55.000Z | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 30.945652 | 107 | 0.556902 |
import io
import logging
import re
import pytest
from elasticsearch import AsyncElasticsearch, RequestError
pytestmark = pytest.mark.asyncio
@pytest.fixture(scope="function")
async def mvt_setup(async_client):
await async_client.indices.create(
index="museums",
body={
... | true | true |
f7fc930266ac03a687af9e78d34759000cc0f843 | 2,264 | py | Python | third_party/gsutil/gslib/cloud_api_helper.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/gsutil/gslib/cloud_api_helper.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 1 | 2021-02-23T22:20:14.000Z | 2021-02-23T22:20:14.000Z | third_party/gsutil/gslib/cloud_api_helper.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 31.887324 | 78 | 0.740283 |
from __future__ import absolute_import
import json
from gslib.cloud_api import ArgumentException
def ValidateDstObjectMetadata(dst_obj_metadata):
if not dst_obj_metadata:
raise ArgumentException(
'No object metadata supplied for destination object.')
if not dst_obj_metadata.name:
... | true | true |
f7fc93675fdb651d83bc2bd95e43eac2de5ac4d6 | 250 | py | Python | Assignments/2.2/C5.py | cRohda/Comp-Sci | 07e36fdcca242f5aa4f3e11440e9c77616973031 | [
"Apache-2.0"
] | null | null | null | Assignments/2.2/C5.py | cRohda/Comp-Sci | 07e36fdcca242f5aa4f3e11440e9c77616973031 | [
"Apache-2.0"
] | null | null | null | Assignments/2.2/C5.py | cRohda/Comp-Sci | 07e36fdcca242f5aa4f3e11440e9c77616973031 | [
"Apache-2.0"
] | null | null | null | my_string = "incredible" # Create string
s3 = (my_string*3) # Make new string that is 3x the first string
print(s3) # Print new string
cred3 = (s3[2:6]*3) # Make new string which is cred 3x, (indies 2,3,4,5)
print(cred3) # Print the new string | 35.714286 | 73 | 0.688 | my_string = "incredible"
s3 = (my_string*3)
print(s3)
cred3 = (s3[2:6]*3)
print(cred3) | true | true |
f7fc94f7ae7a3b4a646a520144a83d1846d54f56 | 6,405 | py | Python | configs/tile/fastercnn_r50_se_syncbn.py | NEUdeep/TileDetection | f453ac868de195a7859b9bf07c813e46eb35d2d0 | [
"Apache-2.0"
] | 41 | 2021-03-23T23:43:00.000Z | 2022-03-22T12:42:53.000Z | configs/tile/fastercnn_r50_se_syncbn.py | hlcedu/TileDetection | 77b5ef4bb4db29f5ffe6a6fa9f87b4bfe8516e4c | [
"Apache-2.0"
] | 3 | 2021-09-12T13:04:34.000Z | 2022-03-23T07:29:43.000Z | configs/tile/fastercnn_r50_se_syncbn.py | hlcedu/TileDetection | 77b5ef4bb4db29f5ffe6a6fa9f87b4bfe8516e4c | [
"Apache-2.0"
] | 7 | 2021-03-31T03:21:43.000Z | 2021-12-27T08:50:13.000Z | model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
add_se=True,
norm_cfg=dict(type='SyncBN', requires_grad=True),
norm_eval=Fals... | 31.551724 | 83 | 0.591101 | model = dict(
type='FasterRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
add_se=True,
norm_cfg=dict(type='SyncBN', requires_grad=True),
norm_eval=Fals... | true | true |
f7fc954534974574566a2551115cd4093a054165 | 7,236 | py | Python | app/venv/lib/python2.7/site-packages/numpy/fft/info.py | anaheino/Ufo-sightings-map | 64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc | [
"MIT"
] | 195 | 2016-01-14T16:03:02.000Z | 2021-12-29T09:15:02.000Z | app/venv/lib/python2.7/site-packages/numpy/fft/info.py | anaheino/Ufo-sightings-map | 64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc | [
"MIT"
] | 75 | 2016-01-14T16:03:02.000Z | 2020-04-29T22:51:53.000Z | app/venv/lib/python2.7/site-packages/numpy/fft/info.py | anaheino/Ufo-sightings-map | 64af02093f97737cbbdfd8af9e1aeb4d8aa8fcdc | [
"MIT"
] | 11 | 2016-01-15T17:30:16.000Z | 2020-07-30T03:58:42.000Z | """
Discrete Fourier Transform (:mod:`numpy.fft`)
=============================================
.. currentmodule:: numpy.fft
Standard FFTs
-------------
.. autosummary::
:toctree: generated/
fft Discrete Fourier transform.
ifft Inverse discrete Fourier transform.
fft2 Discrete Fourier tr... | 38.489362 | 84 | 0.714345 | from __future__ import division, absolute_import, print_function
depends = ['core']
| true | true |
f7fc954965f6f2d56e67279732ba141ca1874560 | 6,125 | py | Python | rmgpy/molecule/atomtypedatabase.py | mbprend/RMG-Py | 29e111d683f2daa0b376417be60e76b32ce8a993 | [
"MIT"
] | null | null | null | rmgpy/molecule/atomtypedatabase.py | mbprend/RMG-Py | 29e111d683f2daa0b376417be60e76b32ce8a993 | [
"MIT"
] | null | null | null | rmgpy/molecule/atomtypedatabase.py | mbprend/RMG-Py | 29e111d683f2daa0b376417be60e76b32ce8a993 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 36.458333 | 113 | 0.56098 | true | true | |
f7fc955fa7ad8cf42db2449242ce3d3b7a563b21 | 14,495 | py | Python | hax/hax/handler.py | nikhilpatil2995/cortx-hare | b240a919a082d1078178c50983b0cbfab17c6742 | [
"Apache-2.0"
] | null | null | null | hax/hax/handler.py | nikhilpatil2995/cortx-hare | b240a919a082d1078178c50983b0cbfab17c6742 | [
"Apache-2.0"
] | null | null | null | hax/hax/handler.py | nikhilpatil2995/cortx-hare | b240a919a082d1078178c50983b0cbfab17c6742 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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 appl... | 51.219081 | 79 | 0.538462 |
import logging
from typing import List
from hax.message import (BroadcastHAStates, Die, EntrypointRequest,
FirstEntrypointRequest, HaNvecGetEvent, ProcessEvent,
SnsRebalancePause, SnsRebalanceResume,
SnsRebalanceStart, SnsReba... | true | true |
f7fc960d91c5422dcbbd9f9a05fe4d96bc3fc0a4 | 806 | py | Python | LC_problems/396.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/396.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | LC_problems/396.py | Howardhuang98/Blog | cf58638d6d0bbf55b95fe08e43798e7dd14219ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 396.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2022/4/22 10:42
------------
"""
from functools import reduce
from typing import List
class Solution:
def maxRotateFunction(self, nums: List[int]) -> int:
current = su... | 26.866667 | 78 | 0.53598 |
from functools import reduce
from typing import List
class Solution:
def maxRotateFunction(self, nums: List[int]) -> int:
current = sum(map(lambda x: x[0] * x[1], zip(nums, range(len(nums)))))
ans = current
for i in range(1, len(nums)):
n = nums[len(nums) - i]
cur... | true | true |
f7fc98ec7f441ddc03443202d0d6b1ebedb9f742 | 22,140 | py | Python | tensorflow_probability/python/distributions/batch_reshape_test.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 4 | 2019-03-07T05:15:13.000Z | 2019-06-13T20:35:45.000Z | tensorflow_probability/python/distributions/batch_reshape_test.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 2 | 2019-08-01T18:31:41.000Z | 2019-08-01T19:42:15.000Z | tensorflow_probability/python/distributions/batch_reshape_test.py | nagachika/probability | 2a5609ceec01a388ec03b583b4f8e813cfbad981 | [
"Apache-2.0"
] | 1 | 2019-09-18T15:17:53.000Z | 2019-09-18T15:17:53.000Z | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36 | 95 | 0.68523 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import test_util as tfp_test_util
from tensorflow.python.framework i... | true | true |
f7fc9acb3cf896cce563706f13ec251c84f6d097 | 991 | py | Python | setup.py | c4mb0t/django-setman | 6551e3f6367bf8ee7c8f91e893c9e8439428f28a | [
"BSD-3-Clause"
] | 1 | 2015-05-30T15:05:14.000Z | 2015-05-30T15:05:14.000Z | setup.py | c4mb0t/django-setman | 6551e3f6367bf8ee7c8f91e893c9e8439428f28a | [
"BSD-3-Clause"
] | null | null | null | setup.py | c4mb0t/django-setman | 6551e3f6367bf8ee7c8f91e893c9e8439428f28a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
from distutils.core import setup
DIRNAME = os.path.dirname(__file__)
readme = open(os.path.join(DIRNAME, 'README.rst'), 'r')
README = readme.read()
readme.close()
version = __import__('setman').get_version()
setup(
name='django-setman',
version=version,
description='D... | 23.595238 | 55 | 0.649849 |
import os
from distutils.core import setup
DIRNAME = os.path.dirname(__file__)
readme = open(os.path.join(DIRNAME, 'README.rst'), 'r')
README = readme.read()
readme.close()
version = __import__('setman').get_version()
setup(
name='django-setman',
version=version,
description='Django settings manage... | true | true |
f7fc9b6e153681769d3d8dbaa847b67443661a46 | 4,909 | py | Python | src/SA.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | src/SA.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | src/SA.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | """
Script to perform sobol analysis of the model.
Modified from the example sobol analysis notebook on canvas.
The variable parameters are specified in the problem dictionary.
"""
from SALib.sample import saltelli
from SALib.analyze import sobol
from mesa.batchrunner import BatchRunnerMP
from modelgrid import *
from ... | 36.634328 | 100 | 0.599919 | from SALib.sample import saltelli
from SALib.analyze import sobol
from mesa.batchrunner import BatchRunnerMP
from modelgrid import *
from IPython.display import clear_output
from tqdm import tqdm
import matplotlib.pyplot as plt
from itertools import combinations
from matplotlib import rcParams
def plot_index(s, params... | true | true |
f7fc9b83187d5e2fb23503516327381f9e5864bc | 397 | py | Python | others/typical90/061.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | others/typical90/061.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | others/typical90/061.py | fumiyanll23/AtCoder | 362ca9fcacb5415c1458bc8dee5326ba2cc70b65 | [
"MIT"
] | null | null | null | from collections import deque
def main():
# input
Q = int(input())
txs = [[*map(int, input().split())] for _ in range(Q)]
# compute
deq = deque()
# output
for tx in txs:
t, x = tx
if t == 1:
deq.appendleft(x)
elif t == 2:
deq.append(x)
... | 16.541667 | 58 | 0.460957 | from collections import deque
def main():
Q = int(input())
txs = [[*map(int, input().split())] for _ in range(Q)]
deq = deque()
for tx in txs:
t, x = tx
if t == 1:
deq.appendleft(x)
elif t == 2:
deq.append(x)
else:
pri... | true | true |
f7fc9bf5a14ce8ee47be86a514a8516d8b951b9a | 8,267 | py | Python | sdk/python/pulumi_digitalocean/dns_record.py | andrewsomething/pulumi-digitalocean | 0b481e2cbf6084e69789b288870a574ef2a801fc | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_digitalocean/dns_record.py | andrewsomething/pulumi-digitalocean | 0b481e2cbf6084e69789b288870a574ef2a801fc | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_digitalocean/dns_record.py | andrewsomething/pulumi-digitalocean | 0b481e2cbf6084e69789b288870a574ef2a801fc | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables
class DnsReco... | 45.423077 | 217 | 0.627676 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables
class DnsRecord(pulumi.CustomResource):
domain: pulumi.Output[str]
flags: pulumi.Output[float]
fqdn: pulumi.Output[str]
name: pulumi.Output[str]
port: pulumi.Output[float]
... | true | true |
f7fc9df83f09b91adb2b7b7112fe7efeeb5c5128 | 6,627 | py | Python | argo/workflows/client/models/v1alpha1_workflow_list.py | fvdnabee/argo-client-python-1 | 4264e063e31865c55418e0b242dd21ba6d19ed64 | [
"Apache-2.0"
] | null | null | null | argo/workflows/client/models/v1alpha1_workflow_list.py | fvdnabee/argo-client-python-1 | 4264e063e31865c55418e0b242dd21ba6d19ed64 | [
"Apache-2.0"
] | null | null | null | argo/workflows/client/models/v1alpha1_workflow_list.py | fvdnabee/argo-client-python-1 | 4264e063e31865c55418e0b242dd21ba6d19ed64 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Argo
Python client for Argo Workflows # noqa: E501
OpenAPI spec version: 2.5.0-rc10
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from kubernetes.client.models import V1ListMeta
class V1alpha1Workfl... | 32.970149 | 312 | 0.618228 |
import pprint
import re
import six
from kubernetes.client.models import V1ListMeta
class V1alpha1WorkflowList(object):
swagger_types = {
'api_version': 'str',
'items': 'list[V1alpha1Workflow]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'ap... | true | true |
f7fc9e4e2112a5a70bcb9439c71a6b04f66e3cc3 | 1,209 | py | Python | smallinvoice/tests/accounts_tests.py | dreipol/smallinvoice | d56850c70542d92ca23385876ecb02f20b620077 | [
"MIT"
] | 1 | 2016-06-09T18:45:47.000Z | 2016-06-09T18:45:47.000Z | smallinvoice/tests/accounts_tests.py | dreipol/smallinvoice | d56850c70542d92ca23385876ecb02f20b620077 | [
"MIT"
] | null | null | null | smallinvoice/tests/accounts_tests.py | dreipol/smallinvoice | d56850c70542d92ca23385876ecb02f20b620077 | [
"MIT"
] | null | null | null | # coding=utf-8
import unittest
from smallinvoice.accounts import Account
from smallinvoice.tests import get_smallinvoice
def generate_account():
return Account(title='Testaccount',
institute='Familie Test',
number='Number123',
iban='Iban123',
... | 29.487805 | 65 | 0.616212 |
import unittest
from smallinvoice.accounts import Account
from smallinvoice.tests import get_smallinvoice
def generate_account():
return Account(title='Testaccount',
institute='Familie Test',
number='Number123',
iban='Iban123',
swiftbic=... | true | true |
f7fc9f4bcfd7c4307d32c9e7bea0a0e0cfaab8bc | 17,079 | py | Python | src/nglui/easyviewer/base.py | seung-lab/NeuroglancerAnnotationUI | 0429b93330b7aa83f4c591564978b3ceb9229374 | [
"Apache-2.0"
] | 7 | 2018-09-04T23:19:02.000Z | 2022-03-09T13:48:53.000Z | src/nglui/easyviewer/base.py | seung-lab/NeuroglancerAnnotationUI | 0429b93330b7aa83f4c591564978b3ceb9229374 | [
"Apache-2.0"
] | 7 | 2019-03-08T18:55:51.000Z | 2020-09-04T19:11:30.000Z | src/nglui/easyviewer/base.py | seung-lab/NeuroglancerAnnotationUI | 0429b93330b7aa83f4c591564978b3ceb9229374 | [
"Apache-2.0"
] | null | null | null | from .. import nglite as neuroglancer
from . import annotation, utils
from numpy import issubdtype, integer, uint64, vstack
from collections import OrderedDict
import copy
import re
SEGMENTATION_LAYER_TYPES = ["segmentation", "segmentation_with_graph"]
class EasyViewer(neuroglancer.Viewer):
"""
Extends the n... | 36.967532 | 464 | 0.584168 | from .. import nglite as neuroglancer
from . import annotation, utils
from numpy import issubdtype, integer, uint64, vstack
from collections import OrderedDict
import copy
import re
SEGMENTATION_LAYER_TYPES = ["segmentation", "segmentation_with_graph"]
class EasyViewer(neuroglancer.Viewer):
def __init__(self):
... | true | true |
f7fca0007a85048132a1d74f56af87865002739a | 6,328 | py | Python | traj/scripts/synchronized_traj_example.py | jonbinney/trajectory_smoothing | 0e2b8d7d646c96c0c22eef1371bcd42d169121dc | [
"Apache-2.0"
] | null | null | null | traj/scripts/synchronized_traj_example.py | jonbinney/trajectory_smoothing | 0e2b8d7d646c96c0c22eef1371bcd42d169121dc | [
"Apache-2.0"
] | 1 | 2021-01-04T00:37:34.000Z | 2021-01-21T22:02:07.000Z | traj/scripts/synchronized_traj_example.py | jonbinney/trajectory_smoothing | 0e2b8d7d646c96c0c22eef1371bcd42d169121dc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''
example to check the joint motion synchronization algorithm [full trajectory]
'''
import numpy as np
import math
import traj
from matplotlib import pyplot as plt
import rospy
rospy.init_node('traj_synchronization', log_level=rospy.DEBUG)
# limits, option_1: same limits that Jon used in firs... | 43.342466 | 122 | 0.647124 |
import numpy as np
import math
import traj
from matplotlib import pyplot as plt
import rospy
rospy.init_node('traj_synchronization', log_level=rospy.DEBUG)
abs_max_pos = np.deg2rad(np.array([ 185.0, 60.0, 132.0, 360.0, 125.0, 360.0]))
abs_max_vel = np.deg2rad(np.array([ 150.0, 150.0, 200.0, 300.0, 300.0... | true | true |
f7fca014f83931eac8a2ed38763d468c3c283851 | 909 | py | Python | setup.py | gurteshwar/plivo-python | 0b475c2b5f1acc052dcdbe0b587c1031982bc5e5 | [
"MIT"
] | null | null | null | setup.py | gurteshwar/plivo-python | 0b475c2b5f1acc052dcdbe0b587c1031982bc5e5 | [
"MIT"
] | null | null | null | setup.py | gurteshwar/plivo-python | 0b475c2b5f1acc052dcdbe0b587c1031982bc5e5 | [
"MIT"
] | null | null | null | from setuptools import setup
import sys
requires = ['requests>=0.10.8']
if sys.version_info < (2, 6):
requires.append('simplejson')
setup(
name = "plivo",
py_modules = ['plivo', "plivoxml"],
version = "0.9",
description = "Plivo Python library",
author = "Plivo Team",
author_email = "hello... | 30.3 | 71 | 0.60066 | from setuptools import setup
import sys
requires = ['requests>=0.10.8']
if sys.version_info < (2, 6):
requires.append('simplejson')
setup(
name = "plivo",
py_modules = ['plivo', "plivoxml"],
version = "0.9",
description = "Plivo Python library",
author = "Plivo Team",
author_email = "hello... | true | true |
f7fca2128c1bf1d136f2b78fd70b9046b1f16bda | 3,792 | py | Python | intersight/models/pci_device_list.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/pci_device_list.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/pci_device_list.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PciDeviceList(object):
"""
NOTE: This class i... | 24.623377 | 78 | 0.542458 |
from pprint import pformat
from six import iteritems
import re
class PciDeviceList(object):
swagger_types = {
'count': 'int',
'results': 'list[PciDevice]'
}
attribute_map = {
'count': 'Count',
'results': 'Results'
}
def __init__(self, count=None, results=Non... | true | true |
f7fca25e4995c759a70dc0edc7b67986023f0f60 | 3,023 | py | Python | src/OTLMOW/PostenMapping/Model/Post050404110.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/PostenMapping/Model/Post050404110.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/PostenMapping/Model/Post050404110.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
from OTLMOW.PostenMapping.StandaardPostMapping import StandaardPostMapping
# Generated with PostenCreator. To modify: extend, do not edit
class Post050404110(StandaardPost):
def __init__(self):
super().__init__(
nummer... | 46.507692 | 126 | 0.571948 |
from OTLMOW.PostenMapping.StandaardPost import StandaardPost
from OTLMOW.PostenMapping.StandaardPostMapping import StandaardPostMapping
class Post050404110(StandaardPost):
def __init__(self):
super().__init__(
nummer='0504.04110',
beschrijving='Steenslagfundering met continue kor... | true | true |
f7fca2f953e75c10b514841bca483523e317a64e | 2,735 | py | Python | Unet/test.py | 1129ljc/video-inpainting-detection | 9a1aea6268f3ab2ba2f60c526ddf35ccc8350e04 | [
"Apache-2.0"
] | 2 | 2022-03-29T02:56:07.000Z | 2022-03-29T06:46:19.000Z | Unet/test.py | 1129ljc/video-inpainting-detection | 9a1aea6268f3ab2ba2f60c526ddf35ccc8350e04 | [
"Apache-2.0"
] | null | null | null | Unet/test.py | 1129ljc/video-inpainting-detection | 9a1aea6268f3ab2ba2f60c526ddf35ccc8350e04 | [
"Apache-2.0"
] | null | null | null | import os
import cv2
import numpy as np
import torch
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
from postprocessing import post_deal
class IID_Dataset(Dataset):
def __init__(self, dataset):
self.input_size = (512, 512)
self.image... | 34.620253 | 94 | 0.610603 | import os
import cv2
import numpy as np
import torch
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
from postprocessing import post_deal
class IID_Dataset(Dataset):
def __init__(self, dataset):
self.input_size = (512, 512)
self.image... | true | true |
f7fca36f1517932cc8c133213489c8a1e339786f | 20,645 | py | Python | mrjob/step.py | lydian/mrjob | 13028274296f5618d63ffc00301537fd385eef82 | [
"Apache-2.0"
] | null | null | null | mrjob/step.py | lydian/mrjob | 13028274296f5618d63ffc00301537fd385eef82 | [
"Apache-2.0"
] | null | null | null | mrjob/step.py | lydian/mrjob | 13028274296f5618d63ffc00301537fd385eef82 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Yelp and Contributors
# Copyright 2013 David Marin and Contributors
# Copyright 2015-2017 Yelp
# Copyright 2018 Yelp
#
# 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:... | 37.198198 | 79 | 0.61303 |
import logging
from mrjob.py2 import string_types
from mrjob.util import cmd_line
STEP_TYPES = ('jar', 'spark', 'spark_jar', 'spark_script', 'streaming')
_MAPPER_FUNCS = ('mapper', 'mapper_init', 'mapper_final', 'mapper_cmd',
'mapper_pre_filter', 'mapper_raw')
_COMBINER_FUNCS = ('c... | true | true |
f7fca4940e32556179329965b4aff27bc692c7ae | 16,327 | py | Python | eznlp/model/decoder/boundary_selection.py | syuoni/eznlp | c0380c6c30d68b4df1769150424735c04ea9d714 | [
"Apache-2.0"
] | 9 | 2021-08-06T07:12:55.000Z | 2022-03-26T08:20:59.000Z | eznlp/model/decoder/boundary_selection.py | Hhx1999/eznlp | 9d1397d8e9630c099295712cbcffa495353a3268 | [
"Apache-2.0"
] | 1 | 2022-03-11T13:27:29.000Z | 2022-03-16T11:52:14.000Z | eznlp/model/decoder/boundary_selection.py | Hhx1999/eznlp | 9d1397d8e9630c099295712cbcffa495353a3268 | [
"Apache-2.0"
] | 3 | 2021-11-15T03:24:24.000Z | 2022-03-09T09:36:05.000Z | # -*- coding: utf-8 -*-
from typing import List, Tuple
from collections import Counter
import logging
import torch
from ...wrapper import TargetWrapper, Batch
from ...utils.chunk import detect_nested, filter_clashed_by_priority
from ...nn.modules import CombinedDropout, SoftLabelCrossEntropyLoss
from ...nn.init import... | 48.737313 | 168 | 0.62412 |
from typing import List, Tuple
from collections import Counter
import logging
import torch
from ...wrapper import TargetWrapper, Batch
from ...utils.chunk import detect_nested, filter_clashed_by_priority
from ...nn.modules import CombinedDropout, SoftLabelCrossEntropyLoss
from ...nn.init import reinit_embedding_, rei... | true | true |
f7fca5bc3a3c278f7367d976fa6970e212a18c61 | 627 | py | Python | lib/mplterm/_kitty.py | anntzer/mplterm | 90c7e44f0038632c37ef65c0096caf3b381533b0 | [
"Zlib"
] | null | null | null | lib/mplterm/_kitty.py | anntzer/mplterm | 90c7e44f0038632c37ef65c0096caf3b381533b0 | [
"Zlib"
] | null | null | null | lib/mplterm/_kitty.py | anntzer/mplterm | 90c7e44f0038632c37ef65c0096caf3b381533b0 | [
"Zlib"
] | null | null | null | from io import BytesIO
import subprocess
import PIL
from ._util import Protocol
def _icat(args, **kwargs):
return subprocess.run(["kitty", "+kitten", "icat", *args], **kwargs)
class Kitty(Protocol):
supports_transparency = True
@staticmethod
def get_pixel_size():
cp = _icat(["--print-wind... | 22.392857 | 73 | 0.610845 | from io import BytesIO
import subprocess
import PIL
from ._util import Protocol
def _icat(args, **kwargs):
return subprocess.run(["kitty", "+kitten", "icat", *args], **kwargs)
class Kitty(Protocol):
supports_transparency = True
@staticmethod
def get_pixel_size():
cp = _icat(["--print-wind... | true | true |
f7fca6bd51d06c513fd58932a58f69cd8491093e | 375 | py | Python | kitsune/search/v2/__init__.py | terrorizer1980/kitsune | 15e0cdc4e941c352b2892010479df9190e9c0035 | [
"BSD-3-Clause"
] | 1 | 2021-07-18T00:41:16.000Z | 2021-07-18T00:41:16.000Z | kitsune/search/v2/__init__.py | hafixo/kitsune | d7756872e16590eea1c6adaeb5bc78f83414d753 | [
"BSD-3-Clause"
] | 13 | 2021-04-13T18:02:21.000Z | 2022-03-12T00:54:51.000Z | kitsune/search/v2/__init__.py | Whoerr/kitsune | 2428573b4920a824c3e712b8a4870f8c1ada8f64 | [
"BSD-3-Clause"
] | null | null | null | import imp
import sys
# Monkey patch PYTHONPATH to temporarily work with multiple
# versions of elasticsearch
sys.path.insert(0, "/vendor")
# Manually import elasticsearch v7.x
f, filename, description = imp.find_module("elasticsearch")
elasticsearch7 = imp.load_module("elasticsearch7", f, filename, description)
def... | 28.846154 | 76 | 0.797333 | import imp
import sys
sys.path.insert(0, "/vendor")
f, filename, description = imp.find_module("elasticsearch")
elasticsearch7 = imp.load_module("elasticsearch7", f, filename, description)
default_app_config = "kitsune.search.apps.SearchV2Config"
| true | true |
f7fca72e52232376356f35434e420a846dc84c45 | 850 | py | Python | backend/utils.py | DenX/pixyship | b8c75d18bfcaf86e1d1c4d7de5b58a51175b9110 | [
"MIT"
] | null | null | null | backend/utils.py | DenX/pixyship | b8c75d18bfcaf86e1d1c4d7de5b58a51175b9110 | [
"MIT"
] | null | null | null | backend/utils.py | DenX/pixyship | b8c75d18bfcaf86e1d1c4d7de5b58a51175b9110 | [
"MIT"
] | null | null | null | import time
from config import CONFIG
def float_range(values, start_key, end_key):
start = 0
if values[start_key]:
start = float(values[start_key])
end = 0
if values[end_key]:
end = float(values[end_key])
return start, end
def int_range(values, start_key, end_key):
start =... | 20.238095 | 81 | 0.635294 | import time
from config import CONFIG
def float_range(values, start_key, end_key):
start = 0
if values[start_key]:
start = float(values[start_key])
end = 0
if values[end_key]:
end = float(values[end_key])
return start, end
def int_range(values, start_key, end_key):
start =... | true | true |
f7fca84031269e2ffea03bfb1841f7237e156990 | 2,551 | py | Python | space_invader_wrappers/wrappers.py | drmeerkat/IQN-and-Extensions | 1cc024c0eedd6cbad62e6db0aae21157847a7e85 | [
"MIT"
] | null | null | null | space_invader_wrappers/wrappers.py | drmeerkat/IQN-and-Extensions | 1cc024c0eedd6cbad62e6db0aae21157847a7e85 | [
"MIT"
] | null | null | null | space_invader_wrappers/wrappers.py | drmeerkat/IQN-and-Extensions | 1cc024c0eedd6cbad62e6db0aae21157847a7e85 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import *
import gym
from toybox import Input
from toybox.envs.atari.base import ToyboxBaseEnv
# thin layer for feature-based toybox environment
# ToyboxBaseEnv is already a gym wrapper as a subclass of gym.atari.AtariEnv
class FeatureVecWrapper(gym.ObservationWrapper):
... | 34.013333 | 87 | 0.648373 | from abc import abstractmethod
from typing import *
import gym
from toybox import Input
from toybox.envs.atari.base import ToyboxBaseEnv
class FeatureVecWrapper(gym.ObservationWrapper):
def __init__(self, tbenv: ToyboxBaseEnv, verbose=0):
super().__init__(tbenv)
self.env = tbenv
... | true | true |
f7fca84cc760a407ce91c1a0d9c56e11845def28 | 675 | py | Python | configs/tood/tood_r101_fpn_1x_minicoco.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | configs/tood/tood_r101_fpn_1x_minicoco.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | configs/tood/tood_r101_fpn_1x_minicoco.py | ruiningTang/mmdetection | 100b0b5e0edddc45af0812b9f1474493c61671ef | [
"Apache-2.0"
] | null | null | null | _base_ = './tood_r50_fpn_1x_minicoco.py'
model = dict(
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch',
init_cfg=dic... | 32.142857 | 80 | 0.657778 | _base_ = './tood_r50_fpn_1x_minicoco.py'
model = dict(
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch',
init_cfg=dic... | true | true |
f7fca9036e079f007b760a1788941bd757dab13d | 6,383 | py | Python | nayan/live_server_tests/selenium_test.py | patilnayan92/etonlinetest | 42b57cb6f10e518be99faa47e3f9f57a1a54b413 | [
"Python-2.0"
] | 2 | 2019-03-06T02:17:25.000Z | 2019-10-03T17:43:26.000Z | nayan/live_server_tests/selenium_test.py | patilnayan92/etonlinetest | 42b57cb6f10e518be99faa47e3f9f57a1a54b413 | [
"Python-2.0"
] | null | null | null | nayan/live_server_tests/selenium_test.py | patilnayan92/etonlinetest | 42b57cb6f10e518be99faa47e3f9f57a1a54b413 | [
"Python-2.0"
] | 4 | 2019-02-01T16:10:40.000Z | 2020-08-30T02:44:39.000Z | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import WebDriverException
import multiproce... | 35.659218 | 97 | 0.639668 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import WebDriverException
import multiproce... | true | true |
f7fca937ba6f1800091c1da17d99217c3e5e48f9 | 1,919 | py | Python | solvers/cave.py | kevinychen/nikoli-puzzle-solver | be288566e9b864d7acd0c063a6d2bc1fc067a32c | [
"MIT"
] | 4 | 2022-01-03T04:21:08.000Z | 2022-02-25T05:51:59.000Z | solvers/cave.py | kevinychen/nikoli-puzzle-solver | be288566e9b864d7acd0c063a6d2bc1fc067a32c | [
"MIT"
] | null | null | null | solvers/cave.py | kevinychen/nikoli-puzzle-solver | be288566e9b864d7acd0c063a6d2bc1fc067a32c | [
"MIT"
] | 1 | 2022-01-12T00:03:48.000Z | 2022-01-12T00:03:48.000Z | from solvers.utils import *
class CaveSolver(AbstractSolver):
def __init__(self, pzprv3):
matched = match('pzprv3/cave/(\\d+)/(\\d+)/(.*)/', pzprv3)
self.height = int(matched.group(1))
self.width = int(matched.group(2))
self.grid = parse_table(matched.group(3))[:self.height]
... | 43.613636 | 109 | 0.574779 | from solvers.utils import *
class CaveSolver(AbstractSolver):
def __init__(self, pzprv3):
matched = match('pzprv3/cave/(\\d+)/(\\d+)/(.*)/', pzprv3)
self.height = int(matched.group(1))
self.width = int(matched.group(2))
self.grid = parse_table(matched.group(3))[:self.height]
... | true | true |
f7fca9d0b259e65f68ab0e51ff56191260c3c4e1 | 16,928 | py | Python | erroranalysis/erroranalysis/_internal/surrogate_error_tree.py | alexquach/responsible-ai-widgets | 6208f72a5dc14b955f0e8b7b2203d0cd74f32497 | [
"MIT"
] | null | null | null | erroranalysis/erroranalysis/_internal/surrogate_error_tree.py | alexquach/responsible-ai-widgets | 6208f72a5dc14b955f0e8b7b2203d0cd74f32497 | [
"MIT"
] | null | null | null | erroranalysis/erroranalysis/_internal/surrogate_error_tree.py | alexquach/responsible-ai-widgets | 6208f72a5dc14b955f0e8b7b2203d0cd74f32497 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import numpy as np
import pandas as pd
from lightgbm import LGBMClassifier, LGBMRegressor
from enum import Enum
from erroranalysis._internal.cohort_filter import filter_from_cohort
from erroranalysis._internal.constants import (PRED_Y,
... | 39.644028 | 77 | 0.562618 |
import numpy as np
import pandas as pd
from lightgbm import LGBMClassifier, LGBMRegressor
from enum import Enum
from erroranalysis._internal.cohort_filter import filter_from_cohort
from erroranalysis._internal.constants import (PRED_Y,
TRUE_Y,
... | true | true |
f7fca9fe73979efb9e1581a8605974f57eca8614 | 1,239 | py | Python | upcfcardsearch/c316.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c316.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c316.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.utils import get
class c316(commands.Cog, name="c316"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Alexander_the_Impenetrable', aliases=['c316'])
async def example_embed(self, ctx):
embed = disc... | 51.625 | 286 | 0.69088 | import discord
from discord.ext import commands
from discord.utils import get
class c316(commands.Cog, name="c316"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Alexander_the_Impenetrable', aliases=['c316'])
async def example_embed(self, ctx):
embed = disc... | true | true |
f7fcab09e39bcb24eda8adad618411cc290c9410 | 4,086 | py | Python | Codes/MLP/MLP.py | eipm/CIN | 1cde66166f40a1921eaec4d65bea5d2da201ca8b | [
"MIT"
] | 2 | 2021-06-21T14:00:09.000Z | 2021-12-07T16:01:49.000Z | Codes/MLP/MLP.py | eipm/CIN | 1cde66166f40a1921eaec4d65bea5d2da201ca8b | [
"MIT"
] | null | null | null | Codes/MLP/MLP.py | eipm/CIN | 1cde66166f40a1921eaec4d65bea5d2da201ca8b | [
"MIT"
] | 5 | 2021-04-01T17:23:21.000Z | 2022-03-22T16:24:40.000Z | # Train top MLP and evaluate model performance
# %%
import numpy as np
import pandas as pd
import random as rand
import skimage
from skimage import io,feature, filters,color
from skimage.exposure import rescale_intensity
import re
import os
import shutil
import matplotlib.pyplot as plt
import tensorflow as tf
from te... | 43.935484 | 255 | 0.758933 |
import numpy as np
import pandas as pd
import random as rand
import skimage
from skimage import io,feature, filters,color
from skimage.exposure import rescale_intensity
import re
import os
import shutil
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models... | true | true |
f7fcabc340e182c359d57a9e8b73911c0d0f3642 | 1,636 | py | Python | usaspending_api/awards/migrations/0058_auto_20170206_2032.py | toolness/usaspending-api | ed9a396e20a52749f01f43494763903cc371f9c2 | [
"CC0-1.0"
] | 1 | 2021-06-17T05:09:00.000Z | 2021-06-17T05:09:00.000Z | usaspending_api/awards/migrations/0058_auto_20170206_2032.py | toolness/usaspending-api | ed9a396e20a52749f01f43494763903cc371f9c2 | [
"CC0-1.0"
] | null | null | null | usaspending_api/awards/migrations/0058_auto_20170206_2032.py | toolness/usaspending-api | ed9a396e20a52749f01f43494763903cc371f9c2 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-02-06 20:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awards', '0057_merge_20170124_1927'),
]
operations = [
migrations.AddField(... | 45.444444 | 533 | 0.633863 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awards', '0057_merge_20170124_1927'),
]
operations = [
migrations.AddField(
model_name='procurement',
name='type_of_contra... | true | true |
f7fcabe87946145c30b1ce205314f58bbb5385ea | 7,289 | py | Python | Zabbix_scripts/Json2sender.py | Runamook/PyCharmProjects | 1b1a063345e052451f00e3fdea82e31bdd2a0cae | [
"MIT"
] | null | null | null | Zabbix_scripts/Json2sender.py | Runamook/PyCharmProjects | 1b1a063345e052451f00e3fdea82e31bdd2a0cae | [
"MIT"
] | null | null | null | Zabbix_scripts/Json2sender.py | Runamook/PyCharmProjects | 1b1a063345e052451f00e3fdea82e31bdd2a0cae | [
"MIT"
] | null | null | null | from pyzabbix import ZabbixMetric, ZabbixSender
from datetime import datetime as dt
import requests
import argparse
try:
from Zabbix_scripts.Helpers.create_logger import create_logger
except ImportError:
from Helpers.create_logger import create_logger
try:
from Zabbix_scripts.Helpers.helpers import make_d... | 43.386905 | 119 | 0.651667 | from pyzabbix import ZabbixMetric, ZabbixSender
from datetime import datetime as dt
import requests
import argparse
try:
from Zabbix_scripts.Helpers.create_logger import create_logger
except ImportError:
from Helpers.create_logger import create_logger
try:
from Zabbix_scripts.Helpers.helpers import make_d... | true | true |
f7fcac3d4f8cb441c154ffc03903561bbbca6406 | 108,407 | py | Python | Lib/test/pickletester.py | kristjanvalur/stackless | 4b817a8b19dd0d02153700641877e7a021807a0c | [
"PSF-2.0"
] | null | null | null | Lib/test/pickletester.py | kristjanvalur/stackless | 4b817a8b19dd0d02153700641877e7a021807a0c | [
"PSF-2.0"
] | null | null | null | Lib/test/pickletester.py | kristjanvalur/stackless | 4b817a8b19dd0d02153700641877e7a021807a0c | [
"PSF-2.0"
] | null | null | null | import collections
import copyreg
import dbm
import io
import functools
import pickle
import pickletools
import struct
import sys
import unittest
import weakref
from http.cookies import SimpleCookie
from test import support
from test.support import (
TestFailed, TESTFN, run_with_locale, no_tracing,
_2G, _4G, b... | 35.601642 | 96 | 0.528757 | import collections
import copyreg
import dbm
import io
import functools
import pickle
import pickletools
import struct
import sys
import unittest
import weakref
from http.cookies import SimpleCookie
from test import support
from test.support import (
TestFailed, TESTFN, run_with_locale, no_tracing,
_2G, _4G, b... | true | true |
f7fcac985188b5590a78764e293685efb6fa8536 | 449 | py | Python | dbf_przystanki.py | RafalKucharskiPK/PTVVisum_Python_Snippets | 08700ac9ff8dd8d0db01ed9b65550a15105cff17 | [
"MIT"
] | 3 | 2020-02-14T19:43:23.000Z | 2021-04-26T06:39:33.000Z | dbf_przystanki.py | RafalKucharskiPK/PTVVisum_Python_Snippets | 08700ac9ff8dd8d0db01ed9b65550a15105cff17 | [
"MIT"
] | null | null | null | dbf_przystanki.py | RafalKucharskiPK/PTVVisum_Python_Snippets | 08700ac9ff8dd8d0db01ed9b65550a15105cff17 | [
"MIT"
] | 2 | 2020-05-03T13:53:05.000Z | 2020-10-13T17:11:02.000Z | from dbfpy.dbf import Dbf
#
#przystanki = Dbf("C:\dane\PRZYSTANKI_AUTOBUSOWE.dbf")
#linie = Dbf("C:\dane\LINIE_PRZEWOZNIK.dbf")
#
#from shapefile import Reader as shpr
#
#przystanki =shpr("C:\dane\PRZYSTANKI_AUTOBUSOWE.shp")
#Przystanki= przystanki.shapeRecords()
#
#
#for przystanek in Przystanki:
# prin... | 23.631579 | 106 | 0.706013 | from dbfpy.dbf import Dbf
td = Dbf("D:\\Dropbox\\i2\\Prace\\___Nie Visumowe\\2012, Malopolska\\Dane Wejsciowe\\PBS_styczen\\a.dbf")
| true | true |
f7fcb07c787fb7e210c66d8a3f386ba27d6ebc8d | 5,036 | py | Python | imblearn/over_sampling/tests/test_adasyn.py | laurallu/imbalanced-learn | 321b751f90ef8faaec6b39218f8c531893e9e79f | [
"MIT"
] | 2 | 2019-11-17T22:32:23.000Z | 2020-06-06T10:37:05.000Z | imblearn/over_sampling/tests/test_adasyn.py | MattEding/imbalanced-learn | 9a1191e1369f688903649b4342b24e0041c6cf33 | [
"MIT"
] | null | null | null | imblearn/over_sampling/tests/test_adasyn.py | MattEding/imbalanced-learn | 9a1191e1369f688903649b4342b24e0041c6cf33 | [
"MIT"
] | null | null | null | """Test the module under sampler."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import pytest
import numpy as np
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import assert_array_equal
from sklearn.neighbors import NearestNeighbors... | 26.366492 | 76 | 0.474782 |
import pytest
import numpy as np
from sklearn.utils._testing import assert_allclose
from sklearn.utils._testing import assert_array_equal
from sklearn.neighbors import NearestNeighbors
from imblearn.over_sampling import ADASYN
RND_SEED = 0
X = np.array(
[
[0.11622591, -0.0317206],
[0.77481731... | true | true |
f7fcb1d2d40190592945ed379557110bb3720e57 | 3,143 | py | Python | src/post_restart_message.py | sven-borden/bandwidth-monitor | 060f52bb377c9c05d5b92528759ca5ab44d02afa | [
"Apache-2.0"
] | null | null | null | src/post_restart_message.py | sven-borden/bandwidth-monitor | 060f52bb377c9c05d5b92528759ca5ab44d02afa | [
"Apache-2.0"
] | null | null | null | src/post_restart_message.py | sven-borden/bandwidth-monitor | 060f52bb377c9c05d5b92528759ca5ab44d02afa | [
"Apache-2.0"
] | null | null | null | # * | File : post_restart_message.py
# * | Author : HoChri (aka Legufix)
# * | Function : Write restart message to Ubidots dashboard
# * | Info :
# *----------------
# * | This version: V0.4
# * | Date : 2018-05-18
# **************************************************************... | 32.402062 | 81 | 0.666879 |
import requests
import time
import RPi.GPIO as GPIO
import json
with open('config.json') as f:
j = json.load(f)
TOKEN = j['token']
DEVICE = j["device"]
VARIABLE = "killswitch"
VARIABLE_2 = "reset-code"
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GREEN = 5
BLUE = 6
RE... | true | true |
f7fcb2bffe891999d7d10e40442413ad9d4bcea8 | 11,189 | py | Python | Lib/test/test_unparse.py | eduardanghel/cpython | 1382c3289bcfd34ac6811fdf9aa5bc09ca8c320e | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/test/test_unparse.py | eduardanghel/cpython | 1382c3289bcfd34ac6811fdf9aa5bc09ca8c320e | [
"CNRI-Python-GPL-Compatible"
] | 2 | 2019-07-11T03:38:43.000Z | 2019-07-16T05:19:22.000Z | Lib/test/test_unparse.py | aeros167/cpython | 114081f8adafa16283df30c456716a1bef4758d0 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """Tests for the unparse.py script in the Tools/parser directory."""
import unittest
import test.support
import pathlib
import random
import tokenize
import ast
def read_pyfile(filename):
"""Read and return the contents of a Python source file (as a
string), taking into account the file encoding."""
with... | 28.912145 | 83 | 0.607829 |
import unittest
import test.support
import pathlib
import random
import tokenize
import ast
def read_pyfile(filename):
with open(filename, "rb") as pyfile:
encoding = tokenize.detect_encoding(pyfile.readline)[0]
with open(filename, "r", encoding=encoding) as pyfile:
source = pyfile.read()
... | true | true |
f7fcb2d33c13e48fed6248480de3cfd82bbfd05a | 8,442 | py | Python | otter/integration/lib/nova.py | codebyravi/otter | d58077ba4af24a586ae0a0becaf6da96b716a597 | [
"Apache-2.0"
] | 20 | 2015-02-11T16:32:07.000Z | 2019-11-12T03:27:54.000Z | otter/integration/lib/nova.py | codebyravi/otter | d58077ba4af24a586ae0a0becaf6da96b716a597 | [
"Apache-2.0"
] | 1,145 | 2015-01-01T00:00:47.000Z | 2022-02-11T03:40:39.000Z | otter/integration/lib/nova.py | codebyravi/otter | d58077ba4af24a586ae0a0becaf6da96b716a597 | [
"Apache-2.0"
] | 29 | 2015-01-08T15:00:11.000Z | 2021-02-16T16:33:53.000Z | """Contains reusable classes relating to nova."""
import json
from operator import itemgetter
from characteristic import Attribute, attributes
import treq
from twisted.internet import reactor
from twisted.internet.defer import gatherResults, inlineCallbacks, returnValue
from twisted.python.log import msg
from otte... | 35.029046 | 79 | 0.636816 | import json
from operator import itemgetter
from characteristic import Attribute, attributes
import treq
from twisted.internet import reactor
from twisted.internet.defer import gatherResults, inlineCallbacks, returnValue
from twisted.python.log import msg
from otter.integration.lib.utils import diagnose
from otte... | true | true |
f7fcb355bc752460a08cb2c7d7e343fd973db080 | 9,804 | py | Python | ci/safe_docker_run.py | larroy/mxnet | a6a85bd066387ba735150491b248b54951653395 | [
"Apache-2.0"
] | 1 | 2017-09-14T09:25:16.000Z | 2017-09-14T09:25:16.000Z | ci/safe_docker_run.py | larroy/mxnet | a6a85bd066387ba735150491b248b54951653395 | [
"Apache-2.0"
] | null | null | null | ci/safe_docker_run.py | larroy/mxnet | a6a85bd066387ba735150491b248b54951653395 | [
"Apache-2.0"
] | 1 | 2019-09-24T17:49:29.000Z | 2019-09-24T17:49:29.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | 39.059761 | 139 | 0.621889 |
import argparse
import atexit
import logging
import os
import signal
import sys
from functools import reduce
from itertools import chain
from typing import Dict, Any
import docker
import docker.constants
from docker.errors import NotFound
from docker.models.containers import Container
from util i... | true | true |
f7fcb3a706968af6612a52186e99599ada677299 | 3,610 | py | Python | custom_components/hella_onyx/api_connector.py | muhlba91/onyx-homeassistant-integration | f50f17d827947984778634f8b162ae0a31de01e1 | [
"MIT"
] | 1 | 2021-02-10T13:44:47.000Z | 2021-02-10T13:44:47.000Z | custom_components/hella_onyx/api_connector.py | muhlba91/onyx-homeassistant-integration | f50f17d827947984778634f8b162ae0a31de01e1 | [
"MIT"
] | 10 | 2021-02-12T11:42:35.000Z | 2021-11-25T14:56:44.000Z | custom_components/hella_onyx/api_connector.py | muhlba91/onyx-homeassistant-integration | f50f17d827947984778634f8b162ae0a31de01e1 | [
"MIT"
] | null | null | null | """API connector for the ONYX integration."""
import logging
from aiohttp import ClientSession, ClientTimeout
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from onyx_client.client import create
from onyx_client.data.device_command import DeviceCommand
from onyx_client.enum.action import Acti... | 34.711538 | 87 | 0.644598 | import logging
from aiohttp import ClientSession, ClientTimeout
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from onyx_client.client import create
from onyx_client.data.device_command import DeviceCommand
from onyx_client.enum.action import Action
_LOGGER = logging.getLogger(__name__)
cl... | true | true |
f7fcb4a60ad7af87b18cd37e5c81407d09f0dd52 | 405 | py | Python | BOT/chat_texto.py | sergiopiresbarra/BOT-CHAT | 4317b5ecc1e60dda28b9ef9803a0d217c6d7bc01 | [
"MIT"
] | null | null | null | BOT/chat_texto.py | sergiopiresbarra/BOT-CHAT | 4317b5ecc1e60dda28b9ef9803a0d217c6d7bc01 | [
"MIT"
] | null | null | null | BOT/chat_texto.py | sergiopiresbarra/BOT-CHAT | 4317b5ecc1e60dda28b9ef9803a0d217c6d7bc01 | [
"MIT"
] | null | null | null | from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
bot = ChatBot('Chatbot')
conversa = ['oi','olá']
trainer = ListTrainer(bot)
trainer.train(conversa)
while True:
pergunta = input("Usuário: ")
resposta = bot.get_response(pergunta)
if float(resposta.confidence) > 0.5:
prin... | 19.285714 | 50 | 0.679012 | from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
bot = ChatBot('Chatbot')
conversa = ['oi','olá']
trainer = ListTrainer(bot)
trainer.train(conversa)
while True:
pergunta = input("Usuário: ")
resposta = bot.get_response(pergunta)
if float(resposta.confidence) > 0.5:
prin... | true | true |
f7fcb6175c11dd31804df927a350775884ffb0e7 | 1,688 | py | Python | tests/indexes/models.py | danhayden/django | 49b470b9187b6be60e573fed08c8f4a87f133750 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | tests/indexes/models.py | danhayden/django | 49b470b9187b6be60e573fed08c8f4a87f133750 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | tests/indexes/models.py | danhayden/django | 49b470b9187b6be60e573fed08c8f4a87f133750 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | from django.db import models
class CurrentTranslation(models.ForeignObject):
"""
Creates virtual relation to the translation with model cache enabled.
"""
# Avoid validation
requires_unique_target = False
def __init__(self, to, on_delete, from_fields, to_fields, **kwargs):
# Disable ... | 29.103448 | 80 | 0.692536 | from django.db import models
class CurrentTranslation(models.ForeignObject):
requires_unique_target = False
def __init__(self, to, on_delete, from_fields, to_fields, **kwargs):
kwargs["related_name"] = "+"
kwargs["unique"] = True
super().__init__(to, on_delete,... | true | true |
f7fcb65ebca7450a426e3be1e7b65cc1fc0b46f8 | 30,716 | py | Python | sdk/python/pulumi_gcp/containeranalysis/occurence.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/containeranalysis/occurence.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/containeranalysis/occurence.py | sisisin/pulumi-gcp | af6681d70ea457843409110c1324817fe55f68ad | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 45.5727 | 159 | 0.644811 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['OccurenceArgs', 'Occurence']
@pulumi.input_type
class OccurenceArgs:
def __init__(__self__, *,
... | true | true |
f7fcb681d045a3bc90693ef6be1a366a766eb756 | 4,721 | py | Python | L1Trigger/ME0Trigger/test/runME0_Reco_L1.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | L1Trigger/ME0Trigger/test/runME0_Reco_L1.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | L1Trigger/ME0Trigger/test/runME0_Reco_L1.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | # Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: step2 --conditions auto:phase2_realistic -s DIGI:pdigi_valid,L1,L1TrackTrigger,DIGI2RAW,HLT:@fake2 --datatier GEN-SIM-DIGI-RAW -n 10 --geom... | 37.768 | 280 | 0.775259 |
import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Phase2_cff import Phase2
process = cms.Process('L1',Phase2)
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.l... | true | true |
f7fcb6a5b207b440e8b51f2a3b3be559b7c53b71 | 858 | py | Python | Python/Libraries&Modules/sendEmail.py | vdrey/Toolbox | d268ad08c50d1dfaa9589a8f6269deead60a7f80 | [
"MIT"
] | null | null | null | Python/Libraries&Modules/sendEmail.py | vdrey/Toolbox | d268ad08c50d1dfaa9589a8f6269deead60a7f80 | [
"MIT"
] | 4 | 2015-02-16T00:36:06.000Z | 2015-02-16T23:52:54.000Z | Python/Libraries&Modules/sendEmail.py | vdrey/Toolbox | d268ad08c50d1dfaa9589a8f6269deead60a7f80 | [
"MIT"
] | null | null | null | # This uses Email Yak to send an email
import requests
import json
import os
def sendEmail(API_KEY=None, To=None, From=None, CC=None, BCC=None, Subject=None, Message=None):
# Still need to add all Email Yak fields
url = 'https://api.emailyak.com/v1/' + API_KEY + '/json/send/email/'
headers = {'Conte... | 42.9 | 103 | 0.63986 |
import requests
import json
import os
def sendEmail(API_KEY=None, To=None, From=None, CC=None, BCC=None, Subject=None, Message=None):
url = 'https://api.emailyak.com/v1/' + API_KEY + '/json/send/email/'
headers = {'Content-Type' : 'application/json'}
... | true | true |
f7fcb6da50dd252e53759b1a00067d50fb708c28 | 3,782 | py | Python | roles/openshift_preflight/base/library/aos_version.py | ramkrsna/openshift-ansible | fc96d8d22f6c277b599e6e2fa4e9cc06814a9460 | [
"Apache-2.0"
] | 2 | 2015-02-04T07:24:39.000Z | 2015-05-03T10:27:56.000Z | roles/openshift_preflight/base/library/aos_version.py | ramkrsna/openshift-ansible | fc96d8d22f6c277b599e6e2fa4e9cc06814a9460 | [
"Apache-2.0"
] | null | null | null | roles/openshift_preflight/base/library/aos_version.py | ramkrsna/openshift-ansible | fc96d8d22f6c277b599e6e2fa4e9cc06814a9460 | [
"Apache-2.0"
] | 1 | 2019-10-28T15:03:29.000Z | 2019-10-28T15:03:29.000Z | #!/usr/bin/python
# vim: expandtab:tabstop=4:shiftwidth=4
'''
An ansible module for determining if more than one minor version
of any atomic-openshift package is available, which would indicate
that multiple repos are enabled for different versions of the same
thing which may cause problems.
Also, determine if the ver... | 37.445545 | 115 | 0.674775 |
import yum
from ansible.module_utils.basic import AnsibleModule
def main():
module = AnsibleModule(
argument_spec=dict(
version=dict(required=True)
),
supports_check_mode=True
)
# for when it is actually necessary. Leaving it commented out for now,
# ... | true | true |
f7fcb6dab1605834d4b5410331424eee473cbda6 | 24,965 | py | Python | nipype/pipeline/plugins/base.py | BenjaminMey/nipype | 954fd4d29249d1bd4ce7460e5585da04479049da | [
"Apache-2.0"
] | 1 | 2019-03-25T14:11:18.000Z | 2019-03-25T14:11:18.000Z | nipype/pipeline/plugins/base.py | josephmje/nipype | 0225a4555cb262626f2fcad2a5df54fe2722f2a8 | [
"Apache-2.0"
] | 1 | 2017-01-05T01:24:33.000Z | 2017-01-05T01:24:33.000Z | nipype/pipeline/plugins/base.py | wtriplett/nipype | 388f140fceaf55438a987e9cdfa2a8e995428afd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Common graph operations for execution
"""
import sys
from copy import deepcopy
from glob import glob
import os
import shutil
from time import sleep, time
from traceback import for... | 38.886293 | 88 | 0.54264 |
import sys
from copy import deepcopy
from glob import glob
import os
import shutil
from time import sleep, time
from traceback import format_exception
import numpy as np
from ... import logging
from ...utils.misc import str2bool
from ..engine.utils import topological_sort, load_resultfile
from ..engine import MapN... | true | true |
f7fcb70a2de5d7e73b50c1307eefb511df9c3870 | 14,766 | py | Python | vulnerabilities/package_managers.py | trendkim/Snyk-Demo-vulnerablecode | 22af5701dfbd15deee5da463f0f9b7d1537291ef | [
"Apache-2.0"
] | null | null | null | vulnerabilities/package_managers.py | trendkim/Snyk-Demo-vulnerablecode | 22af5701dfbd15deee5da463f0f9b7d1537291ef | [
"Apache-2.0"
] | 9 | 2021-03-30T14:29:36.000Z | 2021-08-02T17:11:08.000Z | vulnerabilities/package_managers.py | AmitGupta7580/vulnerablecode | e6e6b9050141842568ce0a88e298bd8f7dd11525 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in compliance... | 35.580723 | 140 | 0.594542 |
import asyncio
import dataclasses
import xml.etree.ElementTree as ET
from datetime import datetime
from json import JSONDecodeError
from subprocess import check_output
from typing import List
from typing import Mapping
from typing import Set
from aiohttp import ClientSession
from aiohttp.client_ex... | true | true |
f7fcb768c78d8aba3efd428eddbaf486e980f8f3 | 4,432 | py | Python | zynthesiser/sygus_spec.py | thomasfsteeples/zynthesiser | 1bb2ff0f6fb3386dc2522db6db727b70236f0842 | [
"MIT"
] | null | null | null | zynthesiser/sygus_spec.py | thomasfsteeples/zynthesiser | 1bb2ff0f6fb3386dc2522db6db727b70236f0842 | [
"MIT"
] | null | null | null | zynthesiser/sygus_spec.py | thomasfsteeples/zynthesiser | 1bb2ff0f6fb3386dc2522db6db727b70236f0842 | [
"MIT"
] | null | null | null | import z3
from lark import Lark, Transformer
import zynthesiser.util as util
class SygusSpec:
def __init__(self, spec: str):
with open('sygus.lark') as f:
sygus_grammar = f.read()
sygus_parser = Lark(sygus_grammar, start="sygus", parser='lalr')
sygus_parser.parse(spec)
... | 35.456 | 79 | 0.602662 | import z3
from lark import Lark, Transformer
import zynthesiser.util as util
class SygusSpec:
def __init__(self, spec: str):
with open('sygus.lark') as f:
sygus_grammar = f.read()
sygus_parser = Lark(sygus_grammar, start="sygus", parser='lalr')
sygus_parser.parse(spec)
... | true | true |
f7fcb7ae4a29b34594bca55ad6c662e8dce851ed | 34,225 | py | Python | tensorboard/loader.py | svpcoder/tensorboard | 70753476c7aad3a5cb3eb4047994af1bcf3524b6 | [
"Apache-2.0"
] | 4 | 2018-02-16T16:12:21.000Z | 2020-08-19T19:53:57.000Z | tensorboard/loader.py | svpcoder/tensorboard | 70753476c7aad3a5cb3eb4047994af1bcf3524b6 | [
"Apache-2.0"
] | null | null | null | tensorboard/loader.py | svpcoder/tensorboard | 70753476c7aad3a5cb3eb4047994af1bcf3524b6 | [
"Apache-2.0"
] | 2 | 2020-06-02T22:35:20.000Z | 2020-10-26T06:35:58.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.029012 | 80 | 0.668225 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
import functools
import locale
import logging
import os
import re
import sys
import time
import threading
import types
import six
import tensorflow as tf
... | true | true |
f7fcb833a98f048348c37616cd8c46a99bc9ff66 | 1,200 | py | Python | convert2svg.py | shiyunon/openqasm | 6bc6ff11e67cd1b9cec989f6369981e13baa0717 | [
"Apache-2.0"
] | 603 | 2018-07-11T03:45:15.000Z | 2022-03-30T17:19:10.000Z | convert2svg.py | shiyunon/openqasm | 6bc6ff11e67cd1b9cec989f6369981e13baa0717 | [
"Apache-2.0"
] | 240 | 2018-07-17T18:38:44.000Z | 2022-03-30T05:57:29.000Z | convert2svg.py | shiyunon/openqasm | 6bc6ff11e67cd1b9cec989f6369981e13baa0717 | [
"Apache-2.0"
] | 195 | 2018-07-12T17:13:02.000Z | 2022-03-29T15:38:32.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
CONVERT_COMMAND = 'pdftocairo'
def main(relative_tex_filepath):
if not os.path.exists(relative_tex_filepath):
print(
'File %s does not exist.' % relative_tex_filepath, file=sys.stderr)
return -1
... | 26.666667 | 79 | 0.645833 |
import os
import sys
import subprocess
CONVERT_COMMAND = 'pdftocairo'
def main(relative_tex_filepath):
if not os.path.exists(relative_tex_filepath):
print(
'File %s does not exist.' % relative_tex_filepath, file=sys.stderr)
return -1
absolute_tex_filepath = os.path.abspath(rel... | true | true |
f7fcb8d9c8c076de239855212c57469313d13aa1 | 260 | py | Python | pyvol/experimental/__init__.py | eiriks/pyvol | 983c6821d9eea3cb1d5e4c217c990fb1dfcf5f22 | [
"MIT"
] | null | null | null | pyvol/experimental/__init__.py | eiriks/pyvol | 983c6821d9eea3cb1d5e4c217c990fb1dfcf5f22 | [
"MIT"
] | null | null | null | pyvol/experimental/__init__.py | eiriks/pyvol | 983c6821d9eea3cb1d5e4c217c990fb1dfcf5f22 | [
"MIT"
] | null | null | null | """Package for experimental code that is not part of core pyvol distribution.
This is generally where you should put your own estimators so you can
experiment with them or submit them to pyvol contests without
interfering with the main source tree.
"""
| 37.142857 | 78 | 0.780769 | true | true | |
f7fcba9683843296ee112881b8a2b4d45f77e3f4 | 1,705 | py | Python | recursive_cut.py | Rokid/better_jieba | b5b897044acc8c423ce37aeabebc6ffde333176f | [
"MIT"
] | 16 | 2018-06-20T11:19:10.000Z | 2019-07-25T01:39:30.000Z | recursive_cut.py | rokid/better_jieba | b5b897044acc8c423ce37aeabebc6ffde333176f | [
"MIT"
] | 6 | 2018-06-19T07:31:39.000Z | 2019-09-23T07:03:53.000Z | recursive_cut.py | Rokid/better_jieba | b5b897044acc8c423ce37aeabebc6ffde333176f | [
"MIT"
] | 2 | 2018-06-26T01:14:03.000Z | 2019-11-02T03:20:20.000Z | # coding=UTF-8
#全部切成四字及以下
import jieba
def clean_and_append(result_list,word):
# word = word.replace("\n","")
if word == " " or word == "":
return result_list
result_list.append(word)
return result_list
def recursive_cut(line):
line = line.replace("\n", "")
result = []
for big_word... | 27.95082 | 98 | 0.603519 |
import jieba
def clean_and_append(result_list,word):
if word == " " or word == "":
return result_list
result_list.append(word)
return result_list
def recursive_cut(line):
line = line.replace("\n", "")
result = []
for big_word in jieba.lcut(line,HMM=False):
subword_li... | true | true |
f7fcba9cd4df33076109987ef33243f2058f0224 | 15,414 | py | Python | osbuild/objectstore.py | PaulWay/osbuild | 3731a323084896dd172733ac72f6b8f4ac42c318 | [
"Apache-2.0"
] | null | null | null | osbuild/objectstore.py | PaulWay/osbuild | 3731a323084896dd172733ac72f6b8f4ac42c318 | [
"Apache-2.0"
] | null | null | null | osbuild/objectstore.py | PaulWay/osbuild | 3731a323084896dd172733ac72f6b8f4ac42c318 | [
"Apache-2.0"
] | null | null | null | import contextlib
import errno
import hashlib
import os
import subprocess
import tempfile
from typing import Optional
from osbuild.util.types import PathLike
from osbuild.util import ctx, jsoncomm, rmrf
from . import api
from . import treesum
__all__ = [
"ObjectStore",
]
def mount(source, target, bind=True, ro... | 29.416031 | 75 | 0.562735 | import contextlib
import errno
import hashlib
import os
import subprocess
import tempfile
from typing import Optional
from osbuild.util.types import PathLike
from osbuild.util import ctx, jsoncomm, rmrf
from . import api
from . import treesum
__all__ = [
"ObjectStore",
]
def mount(source, target, bind=True, ro... | true | true |
f7fcbb9eb740bad7978d80231501f86bd64b1b37 | 16,726 | py | Python | vjemmie/cogs/avatar_cog.py | PederHA/vjemmie | e3742380d3ea06de90f8227a0934569f8fd02b5c | [
"MIT"
] | 1 | 2018-07-30T02:43:27.000Z | 2018-07-30T02:43:27.000Z | vjemmie/cogs/avatar_cog.py | PederHA/vjemmie | e3742380d3ea06de90f8227a0934569f8fd02b5c | [
"MIT"
] | 5 | 2020-09-20T14:07:28.000Z | 2022-01-13T01:18:23.000Z | vjemmie/cogs/avatar_cog.py | PederHA/vjemmie | e3742380d3ea06de90f8227a0934569f8fd02b5c | [
"MIT"
] | null | null | null | from __future__ import annotations
import io
from itertools import zip_longest
from typing import List, Tuple, Union, Optional, Callable
from unidecode import unidecode
from dataclasses import dataclass, field
from pathlib import Path
from copy import deepcopy
import discord
from discord.ext import commands
from PIL ... | 32.352031 | 141 | 0.537128 | from __future__ import annotations
import io
from itertools import zip_longest
from typing import List, Tuple, Union, Optional, Callable
from unidecode import unidecode
from dataclasses import dataclass, field
from pathlib import Path
from copy import deepcopy
import discord
from discord.ext import commands
from PIL ... | true | true |
f7fcbbebf4f5c66c6b9da2023edb02c5e07bddd0 | 293 | py | Python | src/settings/development.py | cstenkamp/django_server_template | a4646cffd2b96cea239924290fdbff02f8a37db7 | [
"CC0-1.0"
] | null | null | null | src/settings/development.py | cstenkamp/django_server_template | a4646cffd2b96cea239924290fdbff02f8a37db7 | [
"CC0-1.0"
] | null | null | null | src/settings/development.py | cstenkamp/django_server_template | a4646cffd2b96cea239924290fdbff02f8a37db7 | [
"CC0-1.0"
] | null | null | null | import os
from settings.settings_base import *
from settings.settings_base import BASE_DIR
ALLOWED_HOSTS = ["0.0.0.0", "127.0.0.1", "localhost"]
DEBUG = True
STATIC_ROOT = os.path.join(BASE_DIR, "django_data", "collected_static")
MEDIA_ROOT = os.path.join(BASE_DIR, "django_data", "media")
| 26.636364 | 71 | 0.74744 | import os
from settings.settings_base import *
from settings.settings_base import BASE_DIR
ALLOWED_HOSTS = ["0.0.0.0", "127.0.0.1", "localhost"]
DEBUG = True
STATIC_ROOT = os.path.join(BASE_DIR, "django_data", "collected_static")
MEDIA_ROOT = os.path.join(BASE_DIR, "django_data", "media")
| true | true |
f7fcbc8a88878fe34e97666aa553e01193169af6 | 6,558 | py | Python | sdk/python/pulumi_azure_nextgen/apimanagement/v20191201/certificate.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/apimanagement/v20191201/certificate.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/apimanagement/v20191201/certificate.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 45.541667 | 791 | 0.65584 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['Certificate']
class Certificate(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pu... | true | true |
f7fcbe2240d5caa8ef1fa76eb36343404f02ac9f | 3,326 | py | Python | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/tests/test_misc_util.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 145 | 2017-01-19T23:33:03.000Z | 2021-06-05T05:34:55.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/tests/test_misc_util.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 17 | 2017-02-03T20:51:39.000Z | 2020-05-21T11:33:52.000Z | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/tests/test_misc_util.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 44 | 2017-02-04T19:40:03.000Z | 2020-10-01T19:24:19.000Z | from __future__ import division, absolute_import, print_function
from os.path import join, sep, dirname
from numpy.distutils.misc_util import (
appendpath, minrelpath, gpaths, get_shared_lib_extension, get_info
)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal
)
ajoin = lambda *... | 38.674419 | 78 | 0.601323 | from __future__ import division, absolute_import, print_function
from os.path import join, sep, dirname
from numpy.distutils.misc_util import (
appendpath, minrelpath, gpaths, get_shared_lib_extension, get_info
)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal
)
ajoin = lambda *... | true | true |
f7fcbef729a96d7105aa13dece74b9d07836dbb8 | 1,090 | py | Python | debug_toolbar/panels/__init__.py | paltman/django-debug-toolbar | 36be38b422ab630abacc46fb2f4b2924337d88bc | [
"BSD-3-Clause"
] | 2 | 2015-12-31T08:11:21.000Z | 2016-05-08T14:54:14.000Z | debug_toolbar/panels/__init__.py | paltman/django-debug-toolbar | 36be38b422ab630abacc46fb2f4b2924337d88bc | [
"BSD-3-Clause"
] | null | null | null | debug_toolbar/panels/__init__.py | paltman/django-debug-toolbar | 36be38b422ab630abacc46fb2f4b2924337d88bc | [
"BSD-3-Clause"
] | 2 | 2015-12-31T08:11:23.000Z | 2019-08-02T13:27:12.000Z | """Base DebugPanel class"""
class DebugPanel(object):
"""
Base class for debug panels.
"""
# name = Base
has_content = False # If content returns something, set to true in subclass
# Panel methods
def __init__(self):
pass
def dom_id(self):
return 'djDebug%sPanel' % (se... | 23.191489 | 79 | 0.625688 |
class DebugPanel(object):
has_content = False
def __init__(self):
pass
def dom_id(self):
return 'djDebug%sPanel' % (self.name.replace(' ', ''))
def title(self):
raise NotImplementedError
def url(self):
raise NotImplementedError
def content(self):
... | true | true |
f7fcbf0eff30e2601a0ae640091715a2143a832d | 1,452 | py | Python | qstrader/alpha_model/fixed_signals.py | Dynami/qstrader-1 | 394f19d0ca96a1ee6e0e222f44e571f31ad815a8 | [
"MIT"
] | null | null | null | qstrader/alpha_model/fixed_signals.py | Dynami/qstrader-1 | 394f19d0ca96a1ee6e0e222f44e571f31ad815a8 | [
"MIT"
] | null | null | null | qstrader/alpha_model/fixed_signals.py | Dynami/qstrader-1 | 394f19d0ca96a1ee6e0e222f44e571f31ad815a8 | [
"MIT"
] | null | null | null | from qstrader.data.backtest_data_handler import DataHandler
from qstrader.asset.universe.universe import Universe
from qstrader.alpha_model.alpha_model import AlphaModel
class FixedSignalsAlphaModel(AlphaModel):
"""
A simple AlphaModel that provides a single scalar forecast
value for each Asset in the Uni... | 29.632653 | 78 | 0.646006 | from qstrader.data.backtest_data_handler import DataHandler
from qstrader.asset.universe.universe import Universe
from qstrader.alpha_model.alpha_model import AlphaModel
class FixedSignalsAlphaModel(AlphaModel):
def __init__(
self,
signal_weights,
universe:Universe=None,
data_hand... | true | true |
f7fcbf4b327a62a52b1b53edb544b114d98f5ada | 2,898 | py | Python | gen_3/model.py | Horki/CarND-Behavioral-Cloning-P3 | d6c7a3d35749f4e995fb14d38bf370755b60a466 | [
"MIT"
] | null | null | null | gen_3/model.py | Horki/CarND-Behavioral-Cloning-P3 | d6c7a3d35749f4e995fb14d38bf370755b60a466 | [
"MIT"
] | null | null | null | gen_3/model.py | Horki/CarND-Behavioral-Cloning-P3 | d6c7a3d35749f4e995fb14d38bf370755b60a466 | [
"MIT"
] | null | null | null | import csv
import numpy as np
from scipy import ndimage
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda
from keras.layers.convolutional import Convolution2D
from keras.layers.pooling import MaxPooling2D
DATA_PATH='../data'
# DATA_PATH='../behavioral_data/all'
DRIVING_LOG='driving_... | 32.2 | 103 | 0.669082 | import csv
import numpy as np
from scipy import ndimage
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda
from keras.layers.convolutional import Convolution2D
from keras.layers.pooling import MaxPooling2D
DATA_PATH='../data'
DRIVING_LOG='driving_log.csv'
IMG_WIDTH=320
IMG_HEIGHT=16... | true | true |
f7fcbfb41b098618c5dd67925c45271e13ec1976 | 1,857 | py | Python | electroncash_plugins/fusion/__init__.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 208 | 2017-07-25T19:52:15.000Z | 2018-09-21T13:44:58.000Z | electroncash_plugins/fusion/__init__.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 1,478 | 2018-09-24T09:30:13.000Z | 2022-03-29T15:48:17.000Z | electroncash_plugins/fusion/__init__.py | christroutner/Electron-Cash | d5217ed3e878bd56977181f022f9e5c43f449241 | [
"MIT"
] | 159 | 2018-09-24T12:56:47.000Z | 2022-03-28T23:52:17.000Z | #!/usr/bin/env python3
#
# Electron Cash - a lightweight Bitcoin Cash client
# CashFusion - an advanced coin anonymizer
#
# Copyright (C) 2020 Mark B. Lundeberg
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to d... | 45.292683 | 116 | 0.758212 |
from electroncash.i18n import _
fullname = _('CashFusion')
description = [
_('Protect your privacy and anonymize your coins (UTXOs) by shuffling them with other users of CashFusion.'),
"\n\n",
_('A commitment and anonymous announcement scheme is used so that none of the participan... | true | true |
f7fcbfe95c4f1429e6cabcd6d97976dbe3c0a4ef | 153 | py | Python | Python/Programming Fundamentals/Regex/12. Match Phone Number.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | Python/Programming Fundamentals/Regex/12. Match Phone Number.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | Python/Programming Fundamentals/Regex/12. Match Phone Number.py | teodoramilcheva/softuni-software-engineering | 98dc9faa66f42570f6538fd7ef186d2bd1d39bff | [
"MIT"
] | null | null | null | import re
text = input()
pattern = r'(\+359-2-\d{3}-\d{4}\b|\+359 2 \d{3} \d{4})\b'
matches = re.findall(pattern, text)
print(', '.join(matches))
| 21.857143 | 59 | 0.562092 | import re
text = input()
pattern = r'(\+359-2-\d{3}-\d{4}\b|\+359 2 \d{3} \d{4})\b'
matches = re.findall(pattern, text)
print(', '.join(matches))
| true | true |
f7fcc0247bffa7d5ad90651380c319258f099e35 | 633 | py | Python | dockwidhistory.py | kimoamer/Clinic-Manager | 53184a4e8f369bf083109d065b2042fc7cf5bfbd | [
"MIT"
] | 3 | 2021-05-12T01:05:12.000Z | 2022-02-11T15:43:00.000Z | dockwidhistory.py | kimoamer/Clinic-Manager | 53184a4e8f369bf083109d065b2042fc7cf5bfbd | [
"MIT"
] | null | null | null | dockwidhistory.py | kimoamer/Clinic-Manager | 53184a4e8f369bf083109d065b2042fc7cf5bfbd | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import QDialog
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt
from dockwina import Ui_Form as docka
class Dialog(QDialog, docka):
def __init__(self):
super(Dialog, self).__init__()
QDialog.__init__(self)
self.setupUi(self)
self.setWindowFlag... | 33.315789 | 51 | 0.665087 | from PyQt5.QtWidgets import QDialog
from PyQt5.QtGui import QFont
from PyQt5.QtCore import Qt
from dockwina import Ui_Form as docka
class Dialog(QDialog, docka):
def __init__(self):
super(Dialog, self).__init__()
QDialog.__init__(self)
self.setupUi(self)
self.setWindowFlag... | true | true |
f7fcc0722726e6fb50d41cf8e692c23bbb0797b9 | 370 | py | Python | cuenca/resources/service_providers.py | andreshndz/cuenca-python | ca9f0f078584f1458e71baeb4cd15fcc55b40397 | [
"MIT"
] | 6 | 2020-11-02T21:03:11.000Z | 2022-01-13T23:12:01.000Z | cuenca/resources/service_providers.py | andreshndz/cuenca-python | ca9f0f078584f1458e71baeb4cd15fcc55b40397 | [
"MIT"
] | 220 | 2020-05-13T19:20:57.000Z | 2022-03-30T22:03:03.000Z | cuenca/resources/service_providers.py | andreshndz/cuenca-python | ca9f0f078584f1458e71baeb4cd15fcc55b40397 | [
"MIT"
] | 14 | 2020-07-15T15:32:03.000Z | 2021-09-17T19:11:14.000Z | from typing import ClassVar, List
from cuenca_validations.types import ServiceProviderCategory
from pydantic.dataclasses import dataclass
from .base import Queryable, Retrievable
@dataclass
class ServiceProvider(Retrievable, Queryable):
_resource: ClassVar = 'service_providers'
name: str
provider_key: ... | 23.125 | 60 | 0.805405 | from typing import ClassVar, List
from cuenca_validations.types import ServiceProviderCategory
from pydantic.dataclasses import dataclass
from .base import Queryable, Retrievable
@dataclass
class ServiceProvider(Retrievable, Queryable):
_resource: ClassVar = 'service_providers'
name: str
provider_key: ... | true | true |
f7fcc0ad155bf6fffad282e49a68c0b62500b437 | 19,833 | py | Python | api/forms.py | IronTooch/bounca | ad728c39ff8921ec38f924ed8ebcd088516b8438 | [
"Apache-2.0"
] | null | null | null | api/forms.py | IronTooch/bounca | ad728c39ff8921ec38f924ed8ebcd088516b8438 | [
"Apache-2.0"
] | 1 | 2022-02-19T16:21:18.000Z | 2022-02-19T16:21:18.000Z | api/forms.py | IronTooch/bounca | ad728c39ff8921ec38f924ed8ebcd088516b8438 | [
"Apache-2.0"
] | null | null | null | from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, BaseInput, ButtonHolder, Column, Fieldset, Layout, Row
from django import forms
from django.contrib.auth.forms import SetPasswordForm, UserChangeForm
from django.utils.deconstruct import deconstructible
from vuetifyforms.components import... | 34.673077 | 117 | 0.516009 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, BaseInput, ButtonHolder, Column, Fieldset, Layout, Row
from django import forms
from django.contrib.auth.forms import SetPasswordForm, UserChangeForm
from django.utils.deconstruct import deconstructible
from vuetifyforms.components import... | true | true |
f7fcc0ba51da22d909adb03856f3a892aaf2787f | 620 | py | Python | endpoints/dbots.py | PhotoBoxPW/imgsrv | 93bb2b3f7641f9de7af8c55424233d82dec47850 | [
"MIT"
] | null | null | null | endpoints/dbots.py | PhotoBoxPW/imgsrv | 93bb2b3f7641f9de7af8c55424233d82dec47850 | [
"MIT"
] | null | null | null | endpoints/dbots.py | PhotoBoxPW/imgsrv | 93bb2b3f7641f9de7af8c55424233d82dec47850 | [
"MIT"
] | null | null | null | from PIL import Image, ImageOps
from utils import http
from utils.endpoint import Endpoint, setup
@setup
class DBots(Endpoint):
def generate(self, kwargs):
image_url = kwargs['image']
no_overlay = False if not 'no_overlay' in kwargs else bool(kwargs['no_overlay'])
base = Image.open(self.g... | 34.444444 | 88 | 0.648387 | from PIL import Image, ImageOps
from utils import http
from utils.endpoint import Endpoint, setup
@setup
class DBots(Endpoint):
def generate(self, kwargs):
image_url = kwargs['image']
no_overlay = False if not 'no_overlay' in kwargs else bool(kwargs['no_overlay'])
base = Image.open(self.g... | true | true |
f7fcc17a9052ec4d06ff3eba20528c98e20784db | 8,527 | py | Python | API/rossmann/Rossmann.py | brunasenra/Store_Sales_Prediction | 6f7371188e37ebb905e171bd8afaae9e41f5cdf5 | [
"MIT"
] | 1 | 2022-02-13T20:29:53.000Z | 2022-02-13T20:29:53.000Z | API/rossmann/Rossmann.py | brunasenra/Store_Sales_Prediction | 6f7371188e37ebb905e171bd8afaae9e41f5cdf5 | [
"MIT"
] | null | null | null | API/rossmann/Rossmann.py | brunasenra/Store_Sales_Prediction | 6f7371188e37ebb905e171bd8afaae9e41f5cdf5 | [
"MIT"
] | 1 | 2021-08-11T19:25:21.000Z | 2021-08-11T19:25:21.000Z | import pickle
import inflection
import pandas as pd
import numpy as np
import math
import datetime
class Rossmann(object):
def __init__(self):
self.home_path = 'C:/Users/bruna/OneDrive/Favoritos compartilhados\DATA SCIENCE\BRUNA\DATA SCIENCE\PROJECTS\Store_Sales_Prediction'
# loads the res... | 43.953608 | 182 | 0.601736 | import pickle
import inflection
import pandas as pd
import numpy as np
import math
import datetime
class Rossmann(object):
def __init__(self):
self.home_path = 'C:/Users/bruna/OneDrive/Favoritos compartilhados\DATA SCIENCE\BRUNA\DATA SCIENCE\PROJECTS\Store_Sales_Prediction'
self.c... | true | true |
f7fcc1ff561b90dc1b78a67ffbe7c047ed06d0e9 | 16,252 | py | Python | python/paddle/fluid/tests/unittests/test_jit_save_load.py | Huangheyl/Paddle | a1b640bc66a5cc9583de503e7406aeba67565e8d | [
"Apache-2.0"
] | 8 | 2019-06-16T12:36:11.000Z | 2021-03-05T05:33:21.000Z | python/paddle/fluid/tests/unittests/test_jit_save_load.py | zlsh80826/Paddle | c560a7d57aad990f374ebadd330351f18e2ca65f | [
"Apache-2.0"
] | 1 | 2020-09-10T09:05:52.000Z | 2020-09-10T09:06:22.000Z | python/paddle/fluid/tests/unittests/test_jit_save_load.py | zlsh80826/Paddle | c560a7d57aad990f374ebadd330351f18e2ca65f | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.875536 | 79 | 0.646197 |
from __future__ import print_function
import os
import pickle
import unittest
import numpy as np
import paddle
from paddle.static import InputSpec
import paddle.fluid as fluid
from paddle.fluid.dygraph import Linear
from paddle.fluid.dygraph import declarative, ProgramTranslator
from paddle.fluid.dygraph... | true | true |
f7fcc281f7f6a6500b2331ced40e634989aeda1c | 21,591 | py | Python | surgery.py | AlohaBazinga/Surgery-Robot-Detection-Segmentation | f42a3562cbb6a77ba195f5aa4828876afaf02500 | [
"MIT"
] | null | null | null | surgery.py | AlohaBazinga/Surgery-Robot-Detection-Segmentation | f42a3562cbb6a77ba195f5aa4828876afaf02500 | [
"MIT"
] | null | null | null | surgery.py | AlohaBazinga/Surgery-Robot-Detection-Segmentation | f42a3562cbb6a77ba195f5aa4828876afaf02500 | [
"MIT"
] | null | null | null | """
Mask R-CNN
Train on the surgery robot dataset.
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
the ... | 39.835793 | 117 | 0.58793 |
import os
import sys
import json
import datetime
import numpy as np
import skimage.draw
from matplotlib import pyplot as plt
ROOT_DIR = os.path.abspath("../../")
sys.path.append(ROOT_DIR)
from mrcnn.config import Config
from mrcnn import model as modellib, utils
from mrcnn import visualize
COCO_WEIGHTS_PATH = os... | true | true |
f7fcc2eeece09eb126dbd4dd889e1f5e156a60c6 | 100,142 | py | Python | pyglet/extlibs/png.py | Torxed/pyglet | 0a35e67e43d069b952e3b02773cdf5b064124069 | [
"BSD-3-Clause"
] | 1 | 2021-05-26T16:11:21.000Z | 2021-05-26T16:11:21.000Z | pyglet/extlibs/png.py | Torxed/pyglet | 0a35e67e43d069b952e3b02773cdf5b064124069 | [
"BSD-3-Clause"
] | 5 | 2021-01-21T09:46:12.000Z | 2022-02-14T13:54:44.000Z | pyglet/extlibs/png.py | Torxed/pyglet | 0a35e67e43d069b952e3b02773cdf5b064124069 | [
"BSD-3-Clause"
] | 2 | 2021-11-02T11:01:53.000Z | 2022-02-14T10:11:21.000Z | # Retrieved from https://github.com/drj11/pypng
# Revision: f5c4c76d81093b6c3f39f83b203f6832c496c110
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <johann@browsershots.org>
# Portions Copyright (C) 2009 David Jones <drj@pobox.com>
# And probably portions Copyright (C) 2006 Nick... | 37.97573 | 91 | 0.57072 |
__version__ = "0.0.18"
import itertools
import math
import re
import operator
import struct
import sys
import warnings
import zlib
from io import open
from array import array
from functools import reduce
try:
import cpngfilters as pngfilters
except Impor... | true | true |
f7fcc4e17e205afef2697f69efdf88043812acb9 | 2,629 | py | Python | Sawtooth/families/suse/processor/main.py | ishtjot/susereumutep | 56e20c1777e0c938ac42bd8056f84af9e0b76e46 | [
"Apache-2.0"
] | 2 | 2018-11-07T20:52:53.000Z | 2019-10-20T15:57:01.000Z | Sawtooth/families/suse/processor/main.py | ishtjot/susereumutep | 56e20c1777e0c938ac42bd8056f84af9e0b76e46 | [
"Apache-2.0"
] | 3 | 2021-12-14T20:57:54.000Z | 2022-01-21T23:50:36.000Z | Sawtooth/families/suse/processor/main.py | ishtjot/susereumutep | 56e20c1777e0c938ac42bd8056f84af9e0b76e46 | [
"Apache-2.0"
] | 2 | 2018-11-16T04:20:06.000Z | 2019-03-28T23:49:13.000Z | # Copyright 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 27.968085 | 90 | 0.664511 |
import sys
import argparse
from sawtooth_sdk.processor.config import get_log_dir
from sawtooth_sdk.processor.log import log_configuration
from sawtooth_sdk.processor.log import init_console_logging
from sawtooth_sdk.processor.core import TransactionProcessor
from processor.handler import SuseTransa... | true | true |
f7fcc69b926d09654446678e8d99284285e79b1e | 6,329 | py | Python | salt/modules/zenoss.py | mseidl/salt-1 | fbf31295d1544565b7b4199b55fa8c550515fd68 | [
"Apache-2.0"
] | 2 | 2018-11-08T02:59:24.000Z | 2021-01-04T00:30:50.000Z | salt/modules/zenoss.py | mseidl/salt-1 | fbf31295d1544565b7b4199b55fa8c550515fd68 | [
"Apache-2.0"
] | 4 | 2020-09-04T10:19:34.000Z | 2020-11-09T12:55:59.000Z | salt/modules/zenoss.py | mseidl/salt-1 | fbf31295d1544565b7b4199b55fa8c550515fd68 | [
"Apache-2.0"
] | 5 | 2017-06-16T23:48:13.000Z | 2021-04-08T17:43:48.000Z | # -*- coding: utf-8 -*-
'''
Module for working with the Zenoss API
.. versionadded:: 2016.3.0
:depends: requests
:configuration: This module requires a 'zenoss' entry in the master/minion config.
For example:
.. code-block:: yaml
zenoss:
hostname: https://zenoss.example.com
use... | 29.995261 | 121 | 0.630905 |
from __future__ import absolute_import, print_function, unicode_literals
import re
import logging
try:
import requests
HAS_LIBS = True
except ImportError:
HAS_LIBS = False
import salt.utils.json
import salt.utils.http
urllib3_logger = logging.getLogger('urllib3')
urllib3_logger.setLevel(logging.WAR... | true | true |
f7fcc69d89c322c1fef976c8e3607520cb7d8d3f | 445 | py | Python | listening-to-the-lawn/replacelinks.py | victor-shepardson/victor-shepardson.github.io | e8eb21fd6b48efbf101db4cfd008a5832ceae743 | [
"MIT"
] | null | null | null | listening-to-the-lawn/replacelinks.py | victor-shepardson/victor-shepardson.github.io | e8eb21fd6b48efbf101db4cfd008a5832ceae743 | [
"MIT"
] | null | null | null | listening-to-the-lawn/replacelinks.py | victor-shepardson/victor-shepardson.github.io | e8eb21fd6b48efbf101db4cfd008a5832ceae743 | [
"MIT"
] | null | null | null | import sys, string
# remove links from svg hackily
def gen(fname):
lines = [ line.strip() for line in open(fname, 'r').readlines()]
outname = fname+'.replaced'
outfile = open(outname, 'w')
cur_id='lol'
for line in lines:
line0 = string.replace(line, '<a', '<g')
line1 = string.replace(line0, '</a', '</g')
... | 23.421053 | 65 | 0.649438 | import sys, string
def gen(fname):
lines = [ line.strip() for line in open(fname, 'r').readlines()]
outname = fname+'.replaced'
outfile = open(outname, 'w')
cur_id='lol'
for line in lines:
line0 = string.replace(line, '<a', '<g')
line1 = string.replace(line0, '</a', '</g')
outfile.write(line1+'\n')
if _... | false | true |
f7fcc7135bb2a90da76c1ee56a062852cd818cb4 | 2,188 | py | Python | task4.py | vknayak/Imdb-Scraping | 59f363decb7e586de75d4d1934ecd250098afd6c | [
"MIT"
] | null | null | null | task4.py | vknayak/Imdb-Scraping | 59f363decb7e586de75d4d1934ecd250098afd6c | [
"MIT"
] | null | null | null | task4.py | vknayak/Imdb-Scraping | 59f363decb7e586de75d4d1934ecd250098afd6c | [
"MIT"
] | null | null | null | import pprint,os,json,requests,string
from bs4 import BeautifulSoup
with open("position_wise_movies.json","r+") as naik:
python_data=json.load(naik)
def scrape_movie_details(movie_name):
movie_details={"name":"","director":[],"country":"","language":[],"poster_image_url":"","bio":"","runtime":"","genre":[]}
for mov... | 32.176471 | 122 | 0.731261 | import pprint,os,json,requests,string
from bs4 import BeautifulSoup
with open("position_wise_movies.json","r+") as naik:
python_data=json.load(naik)
def scrape_movie_details(movie_name):
movie_details={"name":"","director":[],"country":"","language":[],"poster_image_url":"","bio":"","runtime":"","genre":[]}
for mov... | true | true |
f7fcc8ec873d0e355d4f5eda801ae6697426ef74 | 573 | py | Python | Where my anagrams at.py | FairfieldBW/Code-Wars | 62eb36ade3fdce7b95943bbbeb9ce07e78b561ed | [
"MIT"
] | null | null | null | Where my anagrams at.py | FairfieldBW/Code-Wars | 62eb36ade3fdce7b95943bbbeb9ce07e78b561ed | [
"MIT"
] | null | null | null | Where my anagrams at.py | FairfieldBW/Code-Wars | 62eb36ade3fdce7b95943bbbeb9ce07e78b561ed | [
"MIT"
] | null | null | null | '''
Write a function that will find all the anagrams of a word from a list. You will be given two inputs a word and an array with words. You should return an array of all the anagrams or an empty array if there are none.
'''
def anagrams(word, words):
word = list(word)
word.sort()
anagrams = []
for listWord in ... | 28.65 | 217 | 0.685864 |
def anagrams(word, words):
word = list(word)
word.sort()
anagrams = []
for listWord in words:
listListWord = list(listWord.replace(" ", ""))
listListWord.sort()
print(listListWord)
if listListWord == word:
anagrams.append(listWord.replace(" ", ""))
return anagrams
print(anagrams('abba', ['a abb'... | true | true |
f7fcc909d1166175f9a7c254b39953d051f457b6 | 1,652 | py | Python | gateController/consumers.py | Bicskow/rpiGateOpener | 0a3c9a98e18911d4ba323fdb9ede07d2621a7100 | [
"MIT"
] | null | null | null | gateController/consumers.py | Bicskow/rpiGateOpener | 0a3c9a98e18911d4ba323fdb9ede07d2621a7100 | [
"MIT"
] | null | null | null | gateController/consumers.py | Bicskow/rpiGateOpener | 0a3c9a98e18911d4ba323fdb9ede07d2621a7100 | [
"MIT"
] | null | null | null | import json
from gpiozero import LED
from time import sleep
from channels.generic.websocket import WebsocketConsumer
from .mailSender import MailSender
class GateTriggerConsumer(WebsocketConsumer):
def connect(self):
sleep(0.5)
self.accept()
def disconnect(self, close_code):
... | 35.913043 | 81 | 0.554479 | import json
from gpiozero import LED
from time import sleep
from channels.generic.websocket import WebsocketConsumer
from .mailSender import MailSender
class GateTriggerConsumer(WebsocketConsumer):
def connect(self):
sleep(0.5)
self.accept()
def disconnect(self, close_code):
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.