hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k โ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 โ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 โ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k โ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 โ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 โ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k โ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 โ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 โ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
837b8575698c659fd3dcdef92b379c132e3eb8bf | 296 | py | Python | get_enviroment.py | limusina10/hammer | 6b42697a02f0ddf750170ef2bed49bfa3c823ad0 | [
"MIT"
] | null | null | null | get_enviroment.py | limusina10/hammer | 6b42697a02f0ddf750170ef2bed49bfa3c823ad0 | [
"MIT"
] | null | null | null | get_enviroment.py | limusina10/hammer | 6b42697a02f0ddf750170ef2bed49bfa3c823ad0 | [
"MIT"
] | 1 | 2019-06-28T18:44:44.000Z | 2019-06-28T18:44:44.000Z | import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
COMMAND_PREFIX = os.getenv("PREFIX")
OWNER = os.getenv("OWNER")
ANNOUNCEMENTS_CHANNEL = os.getenv("ANNOUNCEMENTS")
SECURITY_CHANNEL = os.getenv("SECURITY")
SWEAR_WORDS_LIST = os.getenv("BANNEDWORDS").split(",")
| 22.769231 | 54 | 0.756757 | import os
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
COMMAND_PREFIX = os.getenv("PREFIX")
OWNER = os.getenv("OWNER")
ANNOUNCEMENTS_CHANNEL = os.getenv("ANNOUNCEMENTS")
SECURITY_CHANNEL = os.getenv("SECURITY")
SWEAR_WORDS_LIST = os.getenv("BANNEDWORDS").split(",")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
107fc6a18e5d39c505f1ffb15ee488a9e8674bb8 | 625 | py | Python | nltk_setup.py | Yakelixir/bigram_from_text | 96f1abe4c6ed0a98e6f909bdd8318096bb7f4f83 | [
"MIT"
] | null | null | null | nltk_setup.py | Yakelixir/bigram_from_text | 96f1abe4c6ed0a98e6f909bdd8318096bb7f4f83 | [
"MIT"
] | null | null | null | nltk_setup.py | Yakelixir/bigram_from_text | 96f1abe4c6ed0a98e6f909bdd8318096bb7f4f83 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""run and initiate nltk.download('all') """
import nltk
# setup or argparse
PERMISSION = input("Would you like to continue and install all nltk dependanies? [Y/n] ")
if PERMISSION == 'Y':
try:
nltk.download('all')
COMPLETE = """We have completed the initial setup for ntl... | 27.173913 | 89 | 0.6416 | #! /usr/bin/env python
"""run and initiate nltk.download('all') """
import nltk
# setup or argparse
PERMISSION = input("Would you like to continue and install all nltk dependanies? [Y/n] ")
if PERMISSION == 'Y':
try:
nltk.download('all')
COMPLETE = """We have completed the initial setup for ntl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d9831deb49847b6573722cd9f6ee7a462919922 | 178 | py | Python | computer/admin.py | Zomba4okk/EmployeesManager | bff29dec7a7b83db79ef3449e19ad51b6fd4df8d | [
"MIT"
] | null | null | null | computer/admin.py | Zomba4okk/EmployeesManager | bff29dec7a7b83db79ef3449e19ad51b6fd4df8d | [
"MIT"
] | null | null | null | computer/admin.py | Zomba4okk/EmployeesManager | bff29dec7a7b83db79ef3449e19ad51b6fd4df8d | [
"MIT"
] | null | null | null | from django.contrib import admin
from employee.models import Department, Employee, Room
admin.site.register(Department)
admin.site.register(Employee)
admin.site.register(Room)
| 22.25 | 54 | 0.825843 | from django.contrib import admin
from employee.models import Department, Employee, Room
admin.site.register(Department)
admin.site.register(Employee)
admin.site.register(Room)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a38f69026e60b3a8229263ec5320c5f6ab8a91f5 | 25,531 | py | Python | face_sync/generate_srrr.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 40 | 2020-09-21T05:35:17.000Z | 2022-02-06T04:41:34.000Z | face_sync/generate_srrr.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 4 | 2020-05-22T15:44:13.000Z | 2020-07-17T07:41:33.000Z | face_sync/generate_srrr.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 8 | 2020-10-03T06:08:39.000Z | 2021-12-17T15:50:30.000Z | import time
ONE_FRAME_SEC = 0.03336666666666588 # 29.97002997002997fps ! id # 0.03336666666666588??
EYE_MIN_DIFF = 65 # , crossfade .
TOTAL_MIN_DIFF = 200 # ( )
ROTATE_MAX = 7 # , crossfade .
WINDOW_TIME = 10 # WINDOW_TIME . , WINDOW_TIME radom .
PADDED_TIME = 3 # PA... | 57.632054 | 252 | 0.574987 | import os
from moviepy.editor import VideoFileClip, concatenate_videoclips, CompositeVideoClip, TextClip
import random
import numpy as np
import time
from video_facial_landmarks_minmax import calculate_distance
from face_embedding import calculate_euclidean_distance
import cv2
import subprocess
ONE_FRAME_SEC = 0.0333... | 6,030 | 0 | 0 | 11,191 | 0 | 10,866 | 0 | 108 | 267 |
b2a0d8e3aef5256d756e6ea1b81ad2b8592f0ef9 | 2,196 | py | Python | cgi-bin/home.py | JamisHoo/Yagra | edcfe8ae6aadee152023c894bd0b8a0b23b9e5a9 | [
"MIT"
] | null | null | null | cgi-bin/home.py | JamisHoo/Yagra | edcfe8ae6aadee152023c894bd0b8a0b23b9e5a9 | [
"MIT"
] | null | null | null | cgi-bin/home.py | JamisHoo/Yagra | edcfe8ae6aadee152023c894bd0b8a0b23b9e5a9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import cgi
try:
process_input()
except:
cgi.print_exception()
| 28.153846 | 79 | 0.676685 | #!/usr/bin/env python
from __future__ import print_function
from collections import namedtuple
from common import config
from common.response import text_response, populate_html, redirect
import os
import cgi
import hashlib
import MySQLdb
import Cookie
def process_input():
# Load email and password from cookie... | 0 | 0 | 0 | 0 | 0 | 1,831 | 0 | 28 | 202 |
91602bafca408a0b22428838102d8c066829afb5 | 11,657 | py | Python | setup.py | itsabhishekhere/scikit-learn | 8266583d99b5a30c5fc79c3fdad809cc5e8684bc | [
"BSD-3-Clause"
] | 1 | 2021-11-19T06:21:43.000Z | 2021-11-19T06:21:43.000Z | setup.py | Nisar-1234/scikit-learn | 1cd282d600088d2547d827af72a99e036106417a | [
"BSD-3-Clause"
] | 2 | 2021-04-13T12:48:43.000Z | 2021-04-13T16:17:58.000Z | setup.py | hurricane642/scikit-learn | 5c3cb6b0af04344d41d542b718d682604d6aa685 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T06:21:34.000Z | 2021-11-19T06:21:34.000Z | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
import sys
# We need to import setuptools before because it monkey-patches distutils
from distutils.command.sdist import sdist
import trac... | 38.727575 | 79 | 0.611307 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
import sys
import os
import platform
import shutil
# We need to import setuptools before because it monkey-patches distutils
import setupto... | 0 | 0 | 0 | 2,165 | 0 | 4,145 | 0 | 33 | 248 |
eeb66eb14ecea99317fc795c1d7fbfa89e6de230 | 4,107 | py | Python | floxcore/console.py | getflox/flox-core | 128b5f3272384e38881db8fb90c175ce8f44b904 | [
"MIT"
] | null | null | null | floxcore/console.py | getflox/flox-core | 128b5f3272384e38881db8fb90c175ce8f44b904 | [
"MIT"
] | null | null | null | floxcore/console.py | getflox/flox-core | 128b5f3272384e38881db8fb90c175ce8f44b904 | [
"MIT"
] | null | null | null | from functools import partial
from wasabi import Printer, MESSAGES
msg = Printer()
success = partial(msg.text, color=MESSAGES.GOOD, icon=MESSAGES.GOOD)
info = partial(msg.text, color=MESSAGES.INFO, icon=MESSAGES.INFO)
error = partial(msg.text, color=MESSAGES.FAIL, icon=MESSAGES.FAIL)
warning = partial(msg.text, color... | 38.745283 | 112 | 0.634526 | import textwrap
from functools import partial
import click
import tqdm
from wasabi import Printer, MESSAGES
from wasabi.util import ICONS
msg = Printer()
success = partial(msg.text, color=MESSAGES.GOOD, icon=MESSAGES.GOOD)
info = partial(msg.text, color=MESSAGES.INFO, icon=MESSAGES.INFO)
error = partial(msg.text, co... | 0 | 0 | 0 | 2,672 | 0 | 672 | 0 | -17 | 158 |
fb7e182e2a4c39b319dd385379a6767ba86954ae | 1,392 | py | Python | py/2015/19A.py | pedrotari7/advent_of_code | 98d5bc8d903435624a019a5702f5421d7b4ef8c8 | [
"MIT"
] | null | null | null | py/2015/19A.py | pedrotari7/advent_of_code | 98d5bc8d903435624a019a5702f5421d7b4ef8c8 | [
"MIT"
] | null | null | null | py/2015/19A.py | pedrotari7/advent_of_code | 98d5bc8d903435624a019a5702f5421d7b4ef8c8 | [
"MIT"
] | null | null | null | s = 'ORnPBPMgArCaCaCaSiThCaCaSiThCaCaPBSiRnFArRnFArCaCaSiThCaCaSiThCaCaCaCaCaCaSiRnFYFArSiRnMgArCaSiRnPTiTiBFYPBFArSiRnCaSiRnTiRnFArSiAlArPTiBPTiRnCaSiAlArCaPTiTiBPMgYFArPTiRnFArSiRnCaCaFArRnCaFArCaSiRnSiRnMgArFYCaSiRnMgArCaCaSiThPRnFArPBCaSiRnMgArCaCaSiThCaSiRnTiMgArFArSiThSiThCaCaSiRnMgArCaCaSiRnFArTiBPTiRnCaSiAlArCa... | 21.090909 | 512 | 0.721983 | s = 'ORnPBPMgArCaCaCaSiThCaCaSiThCaCaPBSiRnFArRnFArCaCaSiThCaCaSiThCaCaCaCaCaCaSiRnFYFArSiRnMgArCaSiRnPTiTiBFYPBFArSiRnCaSiRnTiRnFArSiAlArPTiBPTiRnCaSiAlArCaPTiTiBPMgYFArPTiRnFArSiRnCaCaFArRnCaFArCaSiRnSiRnMgArFYCaSiRnMgArCaCaSiThPRnFArPBCaSiRnMgArCaCaSiThCaSiRnTiMgArFArSiThSiThCaCaSiRnMgArCaCaSiRnFArTiBPTiRnCaSiAlArCa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f80e39d00765ee017d888d8aaa001d690eeadcf | 3,403 | py | Python | API_caller_example.py | TBFY/crosslinguality | d20c2b7fef02be923a76e471bd27262252bd3aa2 | [
"Apache-2.0"
] | null | null | null | API_caller_example.py | TBFY/crosslinguality | d20c2b7fef02be923a76e471bd27262252bd3aa2 | [
"Apache-2.0"
] | null | null | null | API_caller_example.py | TBFY/crosslinguality | d20c2b7fef02be923a76e471bd27262252bd3aa2 | [
"Apache-2.0"
] | 2 | 2018-06-15T09:18:06.000Z | 2019-11-14T15:00:20.000Z | import urllib.parse
CompareDocs("""
All human beings are born free and equal in dignity and rights.
They are endowed with reason and conscience and should act towards
one another in a spirit of brotherhood.
Everyone is entitled to all the rights and freedoms set forth in
this Declaration, withou... | 52.353846 | 83 | 0.693212 | import urllib.parse, urllib.request, json
def CompareDocs(text1, lang1, text2, lang2):
# Prepare the request.
data = urllib.parse.urlencode([
("doc1", text1), ("lang1", lang1),
("doc2", text2), ("lang2", lang2),
# ("azureKey", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), # insert your key her... | 0 | 0 | 0 | 0 | 0 | 1,642 | 0 | 22 | 23 |
774456242ae119b2dede055522353259d90fdb74 | 8,792 | py | Python | hw/ip/otbn/util/rig/gens/straight_line_insn.py | wxjstz/opentitan | 6ff4397bac9c07373d735bd859c7ef8de39c2af8 | [
"Apache-2.0"
] | null | null | null | hw/ip/otbn/util/rig/gens/straight_line_insn.py | wxjstz/opentitan | 6ff4397bac9c07373d735bd859c7ef8de39c2af8 | [
"Apache-2.0"
] | 1 | 2020-10-30T06:30:51.000Z | 2020-10-30T06:30:51.000Z | hw/ip/otbn/util/rig/gens/straight_line_insn.py | wxjstz/opentitan | 6ff4397bac9c07373d735bd859c7ef8de39c2af8 | [
"Apache-2.0"
] | 1 | 2019-12-13T00:52:40.000Z | 2019-12-13T00:52:40.000Z | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
| 41.866667 | 80 | 0.578253 | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import random
from typing import Optional, Tuple
from shared.insn_yaml import Insn, InsnsFile
from shared.lsu_desc import LSUDesc
from shared.operand import ImmOperandType... | 0 | 0 | 0 | 8,297 | 0 | 0 | 0 | 123 | 224 |
8c645ea7eea7f9d79701357200e3200adcd89283 | 850 | py | Python | shortit/shortener/tests/test_views.py | m7salam/shortit | c575acb4e8b447ac62abdf899063357f1569e93d | [
"MIT"
] | null | null | null | shortit/shortener/tests/test_views.py | m7salam/shortit | c575acb4e8b447ac62abdf899063357f1569e93d | [
"MIT"
] | 2 | 2022-03-01T00:07:15.000Z | 2022-03-02T00:17:58.000Z | shortit/shortener/tests/test_views.py | m7salam/shortit | c575acb4e8b447ac62abdf899063357f1569e93d | [
"MIT"
] | null | null | null | # from django.http import request
# import pytest
# from django.contrib.auth.models import AnonymousUser
# from django.http.response import Http404, HttpResponse
# from django.shortcuts import get_object_or_404
# from django.test import RequestFactory
# from shortit.shortener.models import ShortUrl
# from shortit.shor... | 29.310345 | 79 | 0.734118 | # from django.http import request
# import pytest
# from django.contrib.auth.models import AnonymousUser
# from django.http.response import Http404, HttpResponse
# from django.shortcuts import get_object_or_404
# from django.test import RequestFactory
# from shortit.shortener.models import ShortUrl
# from shortit.shor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1f9a2fdba7ba7f61e0c08e6682726a0a538ad878 | 341 | py | Python | avalon/compiler/__init__.py | nehz/avalon | 1c53d4c1e115a8c31b7170cf3948c870a33e4e56 | [
"MIT"
] | null | null | null | avalon/compiler/__init__.py | nehz/avalon | 1c53d4c1e115a8c31b7170cf3948c870a33e4e56 | [
"MIT"
] | 2 | 2015-10-09T19:21:07.000Z | 2019-08-03T13:50:51.000Z | avalon/compiler/__init__.py | nehz/avalon | 1c53d4c1e115a8c31b7170cf3948c870a33e4e56 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#==============================================================================
# Copyright: Hybrid Labs
# Licence: See LICENSE
#==============================================================================
"""
Python to Javascript compiler
"""
| 28.416667 | 80 | 0.331378 | # -*- coding: utf-8 -*-
#==============================================================================
# Copyright: Hybrid Labs
# Licence: See LICENSE
#==============================================================================
"""
Python to Javascript compiler
"""
from .compiler import js_compi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 25 |
f7c1a9a48fbd29d1dce14cb6d7a9d838bab9f312 | 202 | py | Python | foe_pool.py | QwerTech/foe-automation | 9978cd365097a2c9ebec9039642c4e5f6c361018 | [
"MIT"
] | null | null | null | foe_pool.py | QwerTech/foe-automation | 9978cd365097a2c9ebec9039642c4e5f6c361018 | [
"MIT"
] | 3 | 2021-09-08T02:13:20.000Z | 2022-03-12T00:36:40.000Z | foe_pool.py | QwerTech/foe-automation | 9978cd365097a2c9ebec9039642c4e5f6c361018 | [
"MIT"
] | null | null | null |
pool = None
| 15.538462 | 65 | 0.722772 | import multiprocessing
pool = None
def initPool():
global pool
pool = multiprocessing.Pool(int(multiprocessing.cpu_count()))
def execInPool(func, params):
return pool.map(func, params)
| 0 | 0 | 0 | 0 | 0 | 118 | 0 | 1 | 68 |
422fb245184cf85a029ccd26bd2b6fcba9c6b6b6 | 4,569 | py | Python | scope/__init__.py | FlorianLudwig/scope | 013b7010a55cf7d377abdaf75cea882f984f02d8 | [
"Apache-2.0"
] | null | null | null | scope/__init__.py | FlorianLudwig/scope | 013b7010a55cf7d377abdaf75cea882f984f02d8 | [
"Apache-2.0"
] | null | null | null | scope/__init__.py | FlorianLudwig/scope | 013b7010a55cf7d377abdaf75cea882f984f02d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Florian Ludwig
#
# 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 writing, s... | 28.55625 | 85 | 0.606041 | # Copyright 2015 Florian Ludwig
#
# 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 writing, s... | 0 | 956 | 0 | 2,274 | 0 | 345 | 0 | -10 | 296 |
33be01006ef0ec73b7f5c416d8c3f7cb4e81caef | 306 | py | Python | source/genPrimes.py | ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python | a2e3960c8e703148e6c8d5d397baea7283f209dc | [
"MIT"
] | null | null | null | source/genPrimes.py | ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python | a2e3960c8e703148e6c8d5d397baea7283f209dc | [
"MIT"
] | null | null | null | source/genPrimes.py | ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python | a2e3960c8e703148e6c8d5d397baea7283f209dc | [
"MIT"
] | null | null | null |
gen = genPrimes()
print gen.next()
print gen.next()
print gen.next()
print gen.next() | 18 | 27 | 0.434641 | def genPrimes():
prime = []
x = 1
while True:
x += 1
for p in prime:
if x % p == 0:
break
else:
prime.append(x)
yield x
gen = genPrimes()
print gen.next()
print gen.next()
print gen.next()
print gen.next() | 0 | 0 | 0 | 0 | 186 | 0 | 0 | 0 | 22 |
90fd839f97089e06ea9ead00b3f2ea9dc8c1e909 | 7,692 | py | Python | src/magplan/migrations/0002_auto_20201115_1140.py | f1nnix/magplan | 1bda6b53c6e96129e6634bff786b3052d04b0cef | [
"Unlicense"
] | 21 | 2018-12-14T09:08:11.000Z | 2022-01-28T14:33:24.000Z | src/magplan/migrations/0002_auto_20201115_1140.py | f1nnix/magplan | 1bda6b53c6e96129e6634bff786b3052d04b0cef | [
"Unlicense"
] | 20 | 2019-01-11T20:40:01.000Z | 2022-01-30T16:01:38.000Z | src/magplan/migrations/0002_auto_20201115_1140.py | f1nnix/magplan | 1bda6b53c6e96129e6634bff786b3052d04b0cef | [
"Unlicense"
] | 5 | 2019-02-08T01:21:51.000Z | 2021-11-25T17:43:04.000Z | # Generated by Django 3.1.2 on 2020-11-15 11:40
import django.contrib.auth.models
import django.contrib.postgres.fields.jsonb
| 44.462428 | 277 | 0.587493 | # Generated by Django 3.1.2 on 2020-11-15 11:40
import django.contrib.auth.models
import django.contrib.postgres.fields.jsonb
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 370 | 0 | 0 | 7,249 | 0 | 0 | 0 | 41 | 89 |
b3dbca7a9f41a05f752f4b1bb64b60dc81d219cf | 123 | py | Python | pi_camera_capture/cli.py | yoyota-pose-estimation/pi-camera-capture | c77ed1691dafbec9b8e1932a0493ba5c4acc2048 | [
"MIT"
] | null | null | null | pi_camera_capture/cli.py | yoyota-pose-estimation/pi-camera-capture | c77ed1691dafbec9b8e1932a0493ba5c4acc2048 | [
"MIT"
] | 1 | 2020-02-10T07:02:45.000Z | 2020-02-10T08:16:25.000Z | pi_camera_capture/cli.py | yoyota-pose-estimation/pi-camera-capture | c77ed1691dafbec9b8e1932a0493ba5c4acc2048 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
cli()
| 11.181818 | 38 | 0.674797 | import fire
from pi_camera_capture.app import main
def cli():
fire.Fire(main)
if __name__ == "__main__":
cli()
| 0 | 0 | 0 | 0 | 0 | 9 | 0 | 7 | 67 |
6cb7ebb492fcdeb41c1c34796345e72ad718f0b1 | 27,257 | py | Python | words.py | nailtonvital/python-projects | dff440fe0aaebfedbf9622d2daae0b53d972e438 | [
"MIT"
] | 2 | 2022-03-21T23:03:51.000Z | 2022-03-21T23:18:02.000Z | words.py | nailtonvital/python-projects | dff440fe0aaebfedbf9622d2daae0b53d972e438 | [
"MIT"
] | null | null | null | words.py | nailtonvital/python-projects | dff440fe0aaebfedbf9622d2daae0b53d972e438 | [
"MIT"
] | null | null | null | # Word list for hangman
words = ["aback", "abaft", "abandoned", "abashed", "aberrant", "abhorrent", "abiding", "abject", "ablaze", "able",
"abnormal", "aboard", "aboriginal", "abortive", "abounding", "abrasive", "abrupt", "absent", "absorbed",
"absorbing", "abstracted", "absurd", "abundant", "abusive... | 116.482906 | 121 | 0.56048 | # Word list for hangman
words = ["aback", "abaft", "abandoned", "abashed", "aberrant", "abhorrent", "abiding", "abject", "ablaze", "able",
"abnormal", "aboard", "aboriginal", "abortive", "abounding", "abrasive", "abrupt", "absent", "absorbed",
"absorbing", "abstracted", "absurd", "abundant", "abusive... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2cc51e71d5adbbc105d3688d047f7bf6f06e078 | 1,874 | py | Python | run_raml_exp.py | pcyin/pytorch_nmt | bf28dae8a4c71e1f3f3fcb51e989fab905886f44 | [
"CC-BY-4.0"
] | 122 | 2017-04-17T18:36:43.000Z | 2022-02-09T06:24:13.000Z | run_raml_exp.py | pcyin/pytorch_nmt | bf28dae8a4c71e1f3f3fcb51e989fab905886f44 | [
"CC-BY-4.0"
] | 5 | 2017-10-08T14:13:52.000Z | 2018-10-11T04:43:11.000Z | run_raml_exp.py | pcyin/pytorch_nmt | bf28dae8a4c71e1f3f3fcb51e989fab905886f44 | [
"CC-BY-4.0"
] | 29 | 2017-04-27T18:26:47.000Z | 2021-04-08T05:58:10.000Z | import os
train_src="../dynet_nmt/data/train.de-en.de.wmixerprep"
train_tgt="../dynet_nmt/data/train.de-en.en.wmixerprep"
dev_src="../dynet_nmt/data/valid.de-en.de"
dev_tgt="../dynet_nmt/data/valid.de-en.en"
test_src="../dynet_nmt/data/test.de-en.de"
test_tgt="../dynet_nmt/data/test.de-en.en"
for temp in [0.6, 0.8]: ... | 30.225806 | 74 | 0.640875 | import os
train_src="../dynet_nmt/data/train.de-en.de.wmixerprep"
train_tgt="../dynet_nmt/data/train.de-en.en.wmixerprep"
dev_src="../dynet_nmt/data/valid.de-en.de"
dev_tgt="../dynet_nmt/data/valid.de-en.en"
test_src="../dynet_nmt/data/test.de-en.de"
test_tgt="../dynet_nmt/data/test.de-en.en"
for temp in [0.6, 0.8]: ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cd38b22d3922c73b19709343da9d3b773aea1fa9 | 2,509 | py | Python | utils/ranking/least_confidence_softmax.py | kkontras/Sleep_net | a6a83d4624989cc8a79238e491da06dc22d562b8 | [
"MIT"
] | 1 | 2022-02-22T02:40:41.000Z | 2022-02-22T02:40:41.000Z | utils/ranking/least_confidence_softmax.py | kkontras/Sleep_net | a6a83d4624989cc8a79238e491da06dc22d562b8 | [
"MIT"
] | null | null | null | utils/ranking/least_confidence_softmax.py | kkontras/Sleep_net | a6a83d4624989cc8a79238e491da06dc22d562b8 | [
"MIT"
] | null | null | null | import numpy as np
def calculate_probs(predicted_classes, num_classes):
'''
This function is to calculate the probabilities for each class given the softmax output
:param predicted_classes: matrix num_datapoints X num_ensembles (or dropout_iterations)
:param num_classes:
:return: For each datapoin... | 41.816667 | 109 | 0.730969 | import numpy as np
def least_conf(data,num_classes):
num_labels = float(num_classes)
least_conf_ranks = []
prob_dist = calculate_probs(data,num_labels)
simple_least_conf = np.nanmax(prob_dist) # most confident prediction, ignoring NaNs
normalized_least_conf = (1 - simple_least_conf) * (num_labels ... | 0 | 0 | 0 | 0 | 0 | 1,922 | 0 | 0 | 115 |
e45eecc040c259a441c1826aebf97467c4f6b867 | 4,669 | py | Python | awards/models.py | OscarGichana/awards | f07d67d6ba210753a6559ca2584a14c8596200d7 | [
"Unlicense"
] | null | null | null | awards/models.py | OscarGichana/awards | f07d67d6ba210753a6559ca2584a14c8596200d7 | [
"Unlicense"
] | null | null | null | awards/models.py | OscarGichana/awards | f07d67d6ba210753a6559ca2584a14c8596200d7 | [
"Unlicense"
] | null | null | null | from __future__ import unicode_literals
from django.dispatch import receiver
from django.db.models.signals import (post_save)
# from PIL import Image
from django.contrib.auth.models import User
# Create your models here.
post_save.connect(create_profile, sender = User)
| 32.880282 | 163 | 0.699293 | from __future__ import unicode_literals
from django.db import models
import datetime as dt
from django.contrib.auth.mixins import LoginRequiredMixin
from django.dispatch import receiver
from django.db.models.signals import (post_save,pre_save,)
# from PIL import Image
from django.core.files import File
from django.disp... | 0 | 718 | 0 | 3,090 | 0 | 89 | 0 | 160 | 335 |
b1934e332538a24404e96910b363154f4b60ff79 | 1,127 | py | Python | deeplab_features.py | gmum/proto-segmentation | e84e9e8e91711f664ffd1db26c8dabc111d17fdc | [
"MIT"
] | 1 | 2022-02-26T17:10:05.000Z | 2022-02-26T17:10:05.000Z | deeplab_features.py | gmum/proto-segmentation | e84e9e8e91711f664ffd1db26c8dabc111d17fdc | [
"MIT"
] | null | null | null | deeplab_features.py | gmum/proto-segmentation | e84e9e8e91711f664ffd1db26c8dabc111d17fdc | [
"MIT"
] | null | null | null | import torchvision
def deeplabv3_resnet50_features(pretrained=False, **kwargs):
"""Constructs a ResNet-50 model.
Args:
pretrained (bool): If True, returns a model pre-trained on Coco
"""
model = torchvision.models.segmentation.deeplabv3_resnet50(pretrained=pretrained)
model.classifier._mo... | 31.305556 | 118 | 0.662822 | import torchvision
from torch import nn
class DeeplabV3_features(nn.Module):
def __init__(self, model, layers, **kwargs):
super(DeeplabV3_features, self).__init__()
self.model = model
self.layers = layers
# comes from the first conv and the following max pool
self.kernel_s... | 0 | 0 | 0 | 606 | 0 | 0 | 0 | -1 | 45 |
4d26fa18f6869f7bce8e81bfdd5a86f5eabc9619 | 651 | py | Python | pysurf/__init__.py | MFSJMenger/pysurf | 99c6a94d4cb5046f16a0961b907061d989ffb6dc | [
"Apache-2.0"
] | 7 | 2020-10-28T13:46:08.000Z | 2021-05-27T06:41:56.000Z | pysurf/__init__.py | MFSJMenger/pysurf | 99c6a94d4cb5046f16a0961b907061d989ffb6dc | [
"Apache-2.0"
] | 2 | 2020-10-27T19:15:12.000Z | 2020-10-27T19:15:25.000Z | pysurf/__init__.py | MFSJMenger/pysurf | 99c6a94d4cb5046f16a0961b907061d989ffb6dc | [
"Apache-2.0"
] | 2 | 2021-04-15T05:54:30.000Z | 2022-02-08T00:10:10.000Z | # -*- coding: utf-8 -*-
"""Top-level package for pysurf."""
__author__ = """Maximilian F.S.J. Menger, Johannes Ehrmaier"""
__email__ = 'menger.maximilian@gmail.com'
__version__ = '0.1.0'
#
import os
#
from colt import PluginLoader
# load plugins
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
core... | 28.304348 | 66 | 0.751152 | # -*- coding: utf-8 -*-
"""Top-level package for pysurf."""
__author__ = """Maximilian F.S.J. Menger, Johannes Ehrmaier"""
__email__ = 'menger.maximilian@gmail.com'
__version__ = '0.1.0'
#
import os
#
from colt import PluginLoader
from .spp.spp import SurfacePointProvider
from .spp import AbinitioBase, Model, Inter... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 44 |
0cb4e9f9ef1c4a23223d6fde648bc00b342cdbc2 | 1,363 | py | Python | docker/dockerfile/genie-parser/docker_app_run/modules/command_parse/command_parse.py | btr1975/automation-framework | b0ba661cb6bae193bd5c6531c08d9dba55c4099e | [
"MIT"
] | 8 | 2021-06-02T23:08:40.000Z | 2022-02-11T16:50:24.000Z | docker/dockerfile/genie-parser/docker_app_run/modules/command_parse/command_parse.py | btr1975/automation-framework | b0ba661cb6bae193bd5c6531c08d9dba55c4099e | [
"MIT"
] | null | null | null | docker/dockerfile/genie-parser/docker_app_run/modules/command_parse/command_parse.py | btr1975/automation-framework | b0ba661cb6bae193bd5c6531c08d9dba55c4099e | [
"MIT"
] | 2 | 2021-09-30T14:46:03.000Z | 2021-11-14T23:47:35.000Z | """
This holds functionality to get commands, and parse commands
"""
from quick_netmiko import QuickNetmiko
from pyats_genie_command_parse import GenieCommandParse
def command_parse(python_dict, fifo_queue, thread_lock): # pylint: disable=inconsistent-return-statements
"""Function to get and parse commands from... | 33.243902 | 106 | 0.707263 | """
This holds functionality to get commands, and parse commands
"""
from quick_netmiko import QuickNetmiko
from pyats_genie_command_parse import GenieCommandParse
def command_parse(python_dict, fifo_queue, thread_lock): # pylint: disable=inconsistent-return-statements
"""Function to get and parse commands from... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e79847edbdbcc10ef24602c8316e5826238d9256 | 31,015 | py | Python | modules/commons/transformer.py | leminhnguyen/NATSpeech | 66b7b5c27b43523952b4edf1413d7cedb8c9310e | [
"MIT"
] | 561 | 2022-02-13T04:57:38.000Z | 2022-03-28T03:16:15.000Z | modules/commons/transformer.py | zjumml/NATSpeech | b1cf33e336a69e8550953bf8091e1b5ac6c0608e | [
"MIT"
] | 9 | 2022-02-14T05:17:11.000Z | 2022-03-31T02:06:13.000Z | modules/commons/transformer.py | zjumml/NATSpeech | b1cf33e336a69e8550953bf8091e1b5ac6c0608e | [
"MIT"
] | 51 | 2022-02-13T04:50:36.000Z | 2022-03-25T23:22:35.000Z |
DEFAULT_MAX_SOURCE_POSITIONS = 2000
DEFAULT_MAX_TARGET_POSITIONS = 2000
| 41.463904 | 115 | 0.591391 | import math
import torch
from torch import nn
from torch.nn import Parameter, Linear
from modules.commons.layers import LayerNorm, Embedding
from utils.nn.seq_utils import get_incremental_state, set_incremental_state, softmax, make_positions
import torch.nn.functional as F
DEFAULT_MAX_SOURCE_POSITIONS = 2000
DEFAULT_M... | 0 | 838 | 0 | 29,590 | 0 | 0 | 0 | 120 | 384 |
e1cad1ebfe20d22de3794c61dbee9e731e565f93 | 959 | py | Python | src/infi/storagemodel/windows/device_helpers.py | Infinidat/infi.storagemodel | 81740970b5b1c0a691472f2e360d3a6e5c4d0875 | [
"Python-2.0",
"BSD-3-Clause"
] | 6 | 2015-07-29T11:22:36.000Z | 2019-01-22T19:07:42.000Z | src/infi/storagemodel/windows/device_helpers.py | Infinidat/infi.storagemodel | 81740970b5b1c0a691472f2e360d3a6e5c4d0875 | [
"Python-2.0",
"BSD-3-Clause"
] | null | null | null | src/infi/storagemodel/windows/device_helpers.py | Infinidat/infi.storagemodel | 81740970b5b1c0a691472f2e360d3a6e5c4d0875 | [
"Python-2.0",
"BSD-3-Clause"
] | 3 | 2015-01-05T13:55:38.000Z | 2018-07-07T05:05:36.000Z | from logging import getLogger
MPIO_BUS_DRIVER_INSTANCE_ID = u"Root\\MPIO\\0000".lower()
logger = getLogger(__name__)
| 26.638889 | 118 | 0.708029 | from logging import getLogger
MPIO_BUS_DRIVER_INSTANCE_ID = u"Root\\MPIO\\0000".lower()
logger = getLogger(__name__)
def is_disk_drive_managed_by_windows_mpio(disk_drive):
try:
return disk_drive.parent._instance_id.lower() == MPIO_BUS_DRIVER_INSTANCE_ID
except KeyError:
logger.debug("failed t... | 0 | 0 | 0 | 0 | 0 | 745 | 0 | 0 | 92 |
01f29183e23e0bb3aad8b5b52c6dcadcb0b11833 | 4,070 | py | Python | analysis/post_fmriprep.py | VU-Cog-Sci/SB-ref | 6779fd5015aea49f37f47550dc6375ebe25c36f2 | [
"MIT"
] | null | null | null | analysis/post_fmriprep.py | VU-Cog-Sci/SB-ref | 6779fd5015aea49f37f47550dc6375ebe25c36f2 | [
"MIT"
] | null | null | null | analysis/post_fmriprep.py | VU-Cog-Sci/SB-ref | 6779fd5015aea49f37f47550dc6375ebe25c36f2 | [
"MIT"
] | null | null | null |
# extra processing after fmriprep, for all tasks
import os, json
import sys, glob
# define participant number and open json parameter file
if len(sys.argv)<2:
raise NameError('Please add subject number (ex:01) '
'as 1st argument in the command line!')
else:
sj = str(sys.argv[1])... | 38.396226 | 162 | 0.610565 |
# extra processing after fmriprep, for all tasks
import os, json
import sys, glob
import re
import numpy as np
import pandas as pd
from utils import * #import script to use relevante functions
# define participant number and open json parameter file
if len(sys.argv)<2:
raise NameError('Please add subject num... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -19 | 133 |
96f4ff5906600259def1caf22571c3a1ea5953a4 | 141 | py | Python | velhot/admin.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/admin.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/admin.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Profile, FriendRequest
admin.site.register(Profile)
admin.site.register(FriendRequest)
| 23.5 | 42 | 0.836879 | from django.contrib import admin
from .models import Profile, FriendRequest
admin.site.register(Profile)
admin.site.register(FriendRequest)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
50bc082940abce65201e4248b53c055bb82cec0d | 1,032 | py | Python | three_variable_spin_example_lecture3.py | CornerstonesQC/Annealing_Lectures | 1fe2144fc436ced00550f7248f68196a4cf6b135 | [
"Apache-2.0"
] | 3 | 2021-08-13T17:46:49.000Z | 2021-09-19T20:20:03.000Z | three_variable_spin_example_lecture3.py | CornerstonesQC/Annealing_Lectures | 1fe2144fc436ced00550f7248f68196a4cf6b135 | [
"Apache-2.0"
] | null | null | null | three_variable_spin_example_lecture3.py | CornerstonesQC/Annealing_Lectures | 1fe2144fc436ced00550f7248f68196a4cf6b135 | [
"Apache-2.0"
] | 1 | 2021-12-15T13:09:43.000Z | 2021-12-15T13:09:43.000Z | # Copyright 2021 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 35.586207 | 80 | 0.736434 | # Copyright 2021 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ac1b83c12e4dc275421ff7b51521d7518892152 | 6,106 | py | Python | genius/loader.py | duanhongyi/genius | 1bb8a8facd786c59405eb1df982a2f86d7934d61 | [
"BSD-2-Clause"
] | 204 | 2015-01-03T14:00:24.000Z | 2022-01-14T13:25:16.000Z | genius/loader.py | Liweiyanm/genius | 1bb8a8facd786c59405eb1df982a2f86d7934d61 | [
"BSD-2-Clause"
] | 5 | 2017-08-18T03:08:48.000Z | 2018-12-27T07:51:56.000Z | genius/loader.py | Liweiyanm/genius | 1bb8a8facd786c59405eb1df982a2f86d7934d61 | [
"BSD-2-Clause"
] | 63 | 2015-04-08T17:25:24.000Z | 2022-02-10T08:18:32.000Z | #encode:utf-8
from __future__ import unicode_literals
import os
here = os.path.abspath(os.path.dirname(__file__))
library_path = os.path.join(here, 'library')
| 38.1625 | 78 | 0.523092 | #encode:utf-8
from __future__ import unicode_literals
import re
import os
from wapiti import Model
from genius.trie import TrieTree
from genius.word import Word
here = os.path.abspath(os.path.dirname(__file__))
library_path = os.path.join(here, 'library')
class ResourceLoader(object):
_instance = None
de... | 0 | 0 | 0 | 5,823 | 0 | 0 | 0 | 9 | 112 |
8e302637155982b751babacb88f34b8b60462607 | 440 | py | Python | lj2.py | liujing0608lj/spider | 8ef2223be8515a171e5bdc85c801a50cbc793d52 | [
"Apache-2.0"
] | null | null | null | lj2.py | liujing0608lj/spider | 8ef2223be8515a171e5bdc85c801a50cbc793d52 | [
"Apache-2.0"
] | null | null | null | lj2.py | liujing0608lj/spider | 8ef2223be8515a171e5bdc85c801a50cbc793d52 | [
"Apache-2.0"
] | null | null | null | import urllib.request
import urllib.parse
def search(parsmeters)
data = urllib.parse.urlencode(parameters)
print(data)
request_ = urllib.request.Request(url='http://www.baidu.com/s?'+data
,method="GET")
response = urllib.request.urlopen(request_)
print(response.url)
HTML=response.read().decode()
print(HTML)
with o... | 20.952381 | 68 | 0.702273 | import urllib.request
import urllib.parse
def search(parsmeters)
data = urllib.parse.urlencode(parameters)
print(data)
request_ = urllib.request.Request(url='http://www.baidu.com/s?'+data
,method="GET")
response = urllib.request.urlopen(request_)
print(response.url)
HTML=response.read().decode()
print(HTML)
with o... | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e52e41a92b61592b299ead3462229704147e12e3 | 17,865 | py | Python | streamalert_cli/athena/handler.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | streamalert_cli/athena/handler.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | streamalert_cli/athena/handler.py | Meliairon/streamalert | 3b774a59d260b2822cd156e837781bd34f3625f7 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 36.384929 | 100 | 0.646907 | """
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 0 | 4,659 | 0 | 227 | 0 | 0 | 0 | 99 | 45 |
329309c4c9c1629d0252e323492359c67088df37 | 1,937 | py | Python | aws_lambda_builders/workflows/ruby_bundler/actions.py | txase/aws-lambda-builders | c8f2bef73fd7c7943d7c4d54f1c11d3625b5c596 | [
"Apache-2.0"
] | 1 | 2019-08-25T18:41:28.000Z | 2019-08-25T18:41:28.000Z | aws_lambda_builders/workflows/ruby_bundler/actions.py | txase/aws-lambda-builders | c8f2bef73fd7c7943d7c4d54f1c11d3625b5c596 | [
"Apache-2.0"
] | null | null | null | aws_lambda_builders/workflows/ruby_bundler/actions.py | txase/aws-lambda-builders | c8f2bef73fd7c7943d7c4d54f1c11d3625b5c596 | [
"Apache-2.0"
] | null | null | null | """
Actions for Ruby dependency resolution with Bundler
"""
import logging
LOG = logging.getLogger(__name__)
| 32.283333 | 91 | 0.672173 | """
Actions for Ruby dependency resolution with Bundler
"""
import logging
from aws_lambda_builders.actions import BaseAction, Purpose, ActionFailedError
from .bundler import BundlerExecutionError
LOG = logging.getLogger(__name__)
class RubyBundlerInstallAction(BaseAction):
"""
A Lambda Builder Action whic... | 0 | 0 | 0 | 1,657 | 0 | 0 | 0 | 78 | 91 |
1d627793567187279c32442c0d889cc8d1c094ef | 8,939 | py | Python | networkapi/infrastructure/ip_subnet_utils.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | networkapi/infrastructure/ip_subnet_utils.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | networkapi/infrastructure/ip_subnet_utils.py | brunodevel/GloboNetworkAPI | ea8eebc0337636f9250e628cc392514934db8edd | [
"Apache-2.0"
] | null | null | null | # -*- 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 License, Version 2.0
# (the "Li... | 50.219101 | 180 | 0.602752 | # -*- 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 License, Version 2.0
# (the "Li... | 30 | 0 | 0 | 0 | 0 | 271 | 0 | 0 | 75 |
0792965f1c270d48b67717e15eb78c5c0205c783 | 224 | py | Python | 30.11.2019/hamming.py | KruZZy/coderdojo-python | 0f9920de24c0ff8733badb81daed1e590825662c | [
"MIT"
] | null | null | null | 30.11.2019/hamming.py | KruZZy/coderdojo-python | 0f9920de24c0ff8733badb81daed1e590825662c | [
"MIT"
] | null | null | null | 30.11.2019/hamming.py | KruZZy/coderdojo-python | 0f9920de24c0ff8733badb81daed1e590825662c | [
"MIT"
] | null | null | null | from random import randint
n =int(input("n = "))
A =[]
B =[]
for i in range (n):
A.append(randint(1,20))
B.append(randint(1,20))
print(A,B)
dist=0
for i in range (n):
if A[i] != B[i]:
dist+=1
print(dist)
| 16 | 27 | 0.558036 | from random import randint
n =int(input("n = "))
A =[]
B =[]
for i in range (n):
A.append(randint(1,20))
B.append(randint(1,20))
print(A,B)
dist=0
for i in range (n):
if A[i] != B[i]:
dist+=1
print(dist)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
81d43ab85ec341aaf5813b683d0d34aa09a3a77c | 582 | py | Python | platform_info.py | ljm7b2/OBSTstandardDeviation | 5eab7fecd7843a489d6ef5381e28a65aa24853c6 | [
"MIT"
] | null | null | null | platform_info.py | ljm7b2/OBSTstandardDeviation | 5eab7fecd7843a489d6ef5381e28a65aa24853c6 | [
"MIT"
] | null | null | null | platform_info.py | ljm7b2/OBSTstandardDeviation | 5eab7fecd7843a489d6ef5381e28a65aa24853c6 | [
"MIT"
] | null | null | null |
# method copied from STL, not original work of author
| 48.5 | 97 | 0.671821 | import platform
# method copied from STL, not original work of author
def get_platform_info(output_file):
print("\nSYSTEM INFORMATION", file=output_file)
print("{:<20}{:>5}".format('system:', platform.system()), file=output_file)
print("{:<20}{:>5}".format('node:', platform.node()), file=output_file)
... | 0 | 0 | 0 | 0 | 0 | 488 | 0 | -6 | 45 |
7d4736a6d2163bf79bf79d70e9effb9a771809e5 | 7,982 | py | Python | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | null | null | null | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | null | null | null | pbce/tml/examples/flowvisor/ryu_app.py | kit-tm/gcmi-exp | 34d850639a079bf73428bd70ac28cc972d030a7c | [
"BSD-2-Clause"
] | 1 | 2019-11-18T11:35:36.000Z | 2019-11-18T11:35:36.000Z | # Copyright (C) 2011 Nippon Telegraph and Telephone 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 appli... | 40.313131 | 79 | 0.640817 | # Copyright (C) 2011 Nippon Telegraph and Telephone 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 appli... | 0 | 1,709 | 0 | 4,451 | 0 | 309 | 0 | 137 | 159 |
340bd0f34f1475a05d8a08d5a31c0aae250a0e8b | 2,716 | py | Python | 02-am/02-Decision Trees/Decision_tree_3_5.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | 02-am/02-Decision Trees/Decision_tree_3_5.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | 02-am/02-Decision Trees/Decision_tree_3_5.py | Matheusqz/pucpr-ciencia-de-dados | 28a833a902dba41a35dc9d02bc5607a66aca78b0 | [
"MIT"
] | null | null | null | # Este exemplo carrega a base Wine da UCI, treina uma Arvore de decisao usando
# holdout e outra usando validacao cruzada com 10 pastas.
# Importa bibliotecas necessarias
import numpy as np
import urllib
from sklearn import tree
from sklearn import model_selection
from sklearn.metrics import confusion_matrix
from s... | 30.177778 | 98 | 0.765464 | # Este exemplo carrega a base Wine da UCI, treina uma Arvore de decisao usando
# holdout e outra usando validacao cruzada com 10 pastas.
# Importa bibliotecas necessarias
import numpy as np
import urllib
from sklearn import tree
from sklearn import model_selection
from sklearn.metrics import confusion_matrix
from ... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
b3b8bc5092366ad27804dc5ece6a0fd50b476e50 | 1,032 | py | Python | tests/ops/test_snapshot.py | KarimAED/pennylane | d201dd52def0dfa44efd485e06ea06defda22dc0 | [
"Apache-2.0"
] | null | null | null | tests/ops/test_snapshot.py | KarimAED/pennylane | d201dd52def0dfa44efd485e06ea06defda22dc0 | [
"Apache-2.0"
] | null | null | null | tests/ops/test_snapshot.py | KarimAED/pennylane | d201dd52def0dfa44efd485e06ea06defda22dc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 35.586207 | 74 | 0.73062 | # Copyright 2018-2022 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bf5724577612a2d00daec5ca840971656ba19be9 | 2,264 | py | Python | user_profile/views.py | ksarthak4ever/Restrict_API | e53e671965b825fa167b080fe7212ec6f3e4c6ca | [
"MIT"
] | null | null | null | user_profile/views.py | ksarthak4ever/Restrict_API | e53e671965b825fa167b080fe7212ec6f3e4c6ca | [
"MIT"
] | null | null | null | user_profile/views.py | ksarthak4ever/Restrict_API | e53e671965b825fa167b080fe7212ec6f3e4c6ca | [
"MIT"
] | null | null | null | from . permissions import IsAdminUser, IsLoggedInUserOrAdmin
| 41.925926 | 237 | 0.787102 | from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.authtoken.views import ObtainAuthToken
from rest... | 0 | 0 | 0 | 1,724 | 0 | 0 | 0 | 204 | 272 |
d1204259d5d59c637e2ebf4a67f530c5f2e46420 | 272 | py | Python | ceciestunepipe/util/__init__.py | zekearneodo/ceciestunepipe | 7e771783769816f37de44077177152175aecc2b7 | [
"MIT"
] | null | null | null | ceciestunepipe/util/__init__.py | zekearneodo/ceciestunepipe | 7e771783769816f37de44077177152175aecc2b7 | [
"MIT"
] | null | null | null | ceciestunepipe/util/__init__.py | zekearneodo/ceciestunepipe | 7e771783769816f37de44077177152175aecc2b7 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
axes_pars = {'axes.labelpad': 5,
'axes.titlepad': 5,
'axes.titlesize': 'small',
'axes.grid': False,
'axes.xmargin': 0,
'axes.ymargin': 0}
plt.rcParams.update(axes_pars) | 27.2 | 39 | 0.540441 | from matplotlib import pyplot as plt
axes_pars = {'axes.labelpad': 5,
'axes.titlepad': 5,
'axes.titlesize': 'small',
'axes.grid': False,
'axes.xmargin': 0,
'axes.ymargin': 0}
plt.rcParams.update(axes_pars) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e4f6143f7bfb4ed767a788628fa6495930e03951 | 145 | py | Python | servers/run.py | ibalance2005/ocr_server | e7fd190df692a19c8d090950ee9cdd9838b262ba | [
"Apache-2.0"
] | null | null | null | servers/run.py | ibalance2005/ocr_server | e7fd190df692a19c8d090950ee9cdd9838b262ba | [
"Apache-2.0"
] | null | null | null | servers/run.py | ibalance2005/ocr_server | e7fd190df692a19c8d090950ee9cdd9838b262ba | [
"Apache-2.0"
] | null | null | null | import config as C
from servers import app
if __name__ == '__main__':
app_run = app.init()
app_run.run(host='0.0.0.0', port=C.API_PORT) | 20.714286 | 48 | 0.675862 | import config as C
from servers import app
if __name__ == '__main__':
app_run = app.init()
app_run.run(host='0.0.0.0', port=C.API_PORT) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a2b87367dc0dba91b6e90ca9a24a230cb5df047 | 2,115 | py | Python | tweeter_analysis.py | milindparvatia/StockMarketApp | 0a3de9f2b10da0dad524c1ee47db5cfa8f00cdb7 | [
"Apache-2.0"
] | 1 | 2020-08-09T07:36:31.000Z | 2020-08-09T07:36:31.000Z | tweeter_analysis.py | milindparvatia/StockMarketApp | 0a3de9f2b10da0dad524c1ee47db5cfa8f00cdb7 | [
"Apache-2.0"
] | 7 | 2020-02-11T23:10:00.000Z | 2021-06-10T17:37:24.000Z | tweeter_analysis.py | milindparvatia/StockMarketApp | 0a3de9f2b10da0dad524c1ee47db5cfa8f00cdb7 | [
"Apache-2.0"
] | 1 | 2019-06-09T08:10:04.000Z | 2019-06-09T08:10:04.000Z | import os
import json
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import string
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()
if __name__ == '__main__':
os.remove("tweets1234.json")
os.system('twitterscraper #GOOGL --... | 27.115385 | 114 | 0.583924 | import os
import json
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import string
from collections import defaultdict
import re
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()
def leaders(xs, top=500):
counts = defaultdict(in... | 0 | 0 | 0 | 0 | 0 | 152 | 0 | 2 | 67 |
2c61a3cf22fed9100e56ac03ddf5dee0325b911d | 1,409 | py | Python | compare_records.py | KungPaoChick/CovidMonitor | 7b96d170e7583fc395dddd370f03eec0e0b71e0c | [
"MIT"
] | 2 | 2021-01-31T13:27:45.000Z | 2021-02-01T00:06:40.000Z | compare_records.py | KungPaoChick/CovidMonitor | 7b96d170e7583fc395dddd370f03eec0e0b71e0c | [
"MIT"
] | null | null | null | compare_records.py | KungPaoChick/CovidMonitor | 7b96d170e7583fc395dddd370f03eec0e0b71e0c | [
"MIT"
] | null | null | null |
first_file = str(input('First Country: '))
second_file = str(input('Second Country: '))
file_path = str(input('Path:(year/month) '))
find_files(first_file, second_file, file_path)
| 35.225 | 99 | 0.535841 | import os, errno
import pandas as pd
def find_files(file_one, file_two, search_path):
results = []
path = os.getcwd() + '/Records/'
csv_one = file_one + '.csv'
csv_two = file_two + '.csv'
if os.path.isdir(path + search_path):
try:
for root, dirs, files in os.walk(pat... | 0 | 0 | 0 | 0 | 0 | 1,153 | 0 | -7 | 71 |
b4c602a7a6ac6de6dc83545d32aa9910df43a8d1 | 1,968 | py | Python | game-examples-AttilaToth/Minesweeper/main.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | game-examples-AttilaToth/Minesweeper/main.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | game-examples-AttilaToth/Minesweeper/main.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | import pygame
from board import Grid
from player import Player, Stats
import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (400,100)
surface = pygame.display.set_mode((1200, 900))
pygame.display.set_caption('Minesweeper')
state = States.running
player = Player()
grid = Grid(player)
running = True
while runni... | 30.75 | 98 | 0.598069 | import pygame
from board import Grid
from player import Player, Stats
from enum import Enum, auto
import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (400,100)
surface = pygame.display.set_mode((1200, 900))
pygame.display.set_caption('Minesweeper')
class States(Enum):
running = auto()
game_over = auto(... | 0 | 0 | 0 | 59 | 0 | 0 | 0 | 6 | 45 |
7904281c09f285f9f58bfe640ba09dcc99178926 | 20,018 | py | Python | numpy_indexed/grouping.py | EelcoHoogendoorn/Numpy_arraysetops_EP | 84dc8114bf8a79c3acb3f7f59128247b9fc97243 | [
"MIT"
] | 170 | 2016-04-02T07:29:12.000Z | 2022-03-30T02:57:15.000Z | numpy_indexed/grouping.py | EelcoHoogendoorn/Numpy_arraysetops_EP | 84dc8114bf8a79c3acb3f7f59128247b9fc97243 | [
"MIT"
] | 13 | 2016-08-31T14:39:51.000Z | 2022-01-10T16:29:00.000Z | numpy_indexed/grouping.py | EelcoHoogendoorn/Numpy_arraysetops_EP | 84dc8114bf8a79c3acb3f7f59128247b9fc97243 | [
"MIT"
] | 19 | 2016-07-20T18:49:36.000Z | 2021-04-16T06:38:09.000Z | """grouping module"""
from __future__ import absolute_import, division, print_function, unicode_literals
__author__ = "Eelco Hoogendoorn"
__license__ = "LGPL"
__email__ = "hoogendoorn.eelco@gmail.com"
def group_by(keys, values=None, reduction=None, axis=0):
"""construct a grouping object on the given keys, opti... | 32.655791 | 115 | 0.575082 | """grouping module"""
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
import itertools
import numpy as np
from numpy_indexed.index import as_index
import numpy_indexed as npi
__author__ = "Eelco Hoogendoorn"
__license__ = "LGPL"
__email__ = "hoogendoorn.eelco... | 0 | 346 | 0 | 17,912 | 0 | 0 | 0 | 18 | 135 |
87beae9c101a147576d3bb34a1271a7aab30736e | 6,089 | py | Python | plugins/aea-cli-ipfs/aea_cli_ipfs/registry.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | plugins/aea-cli-ipfs/aea_cli_ipfs/registry.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | plugins/aea-cli-ipfs/aea_cli_ipfs/registry.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 31.225641 | 86 | 0.658072 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
61ef1912263dabb8f668d8da6532ccd6c0f92b63 | 639 | py | Python | library/infrastructure_architecture/event_sourced_architecture/event_queue_subscriber.py | piotrkluch/billenium-keras-api-python | 0d7c589dac150ab5363f33f1f6024c44a667d0ae | [
"MIT"
] | null | null | null | library/infrastructure_architecture/event_sourced_architecture/event_queue_subscriber.py | piotrkluch/billenium-keras-api-python | 0d7c589dac150ab5363f33f1f6024c44a667d0ae | [
"MIT"
] | null | null | null | library/infrastructure_architecture/event_sourced_architecture/event_queue_subscriber.py | piotrkluch/billenium-keras-api-python | 0d7c589dac150ab5363f33f1f6024c44a667d0ae | [
"MIT"
] | null | null | null |
# TODO: Turn this into a more general class which can subscribe and unsubscribe from
# TODO: anything, with a context manager interface.
| 27.782609 | 84 | 0.740219 |
# TODO: Turn this into a more general class which can subscribe and unsubscribe from
# TODO: anything, with a context manager interface.
from library.domain.events import subscribe, unsubscribe, DomainEvent
class EventQueueSubscriber:
def __init__(self, event_queue):
self._event_queue = event_queue
... | 0 | 66 | 0 | 340 | 0 | 0 | 0 | 48 | 45 |
909c3b54cecc30d25635aaefe0f6af45baae38eb | 4,821 | py | Python | preprocess.py | lionben89/NLP-3 | 5a0eb40fd40bb1c7c67d38a8e1b3478bac00afbb | [
"MIT"
] | null | null | null | preprocess.py | lionben89/NLP-3 | 5a0eb40fd40bb1c7c67d38a8e1b3478bac00afbb | [
"MIT"
] | null | null | null | preprocess.py | lionben89/NLP-3 | 5a0eb40fd40bb1c7c67d38a8e1b3478bac00afbb | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn import preprocessing
import nltk
nltk.download('punkt')
dataset_structure = None
TIMESTAMP_FEATURES = {
"timestamp": True,
"day_of_week": True,
"day_of_month": True,
"month": True,
"hour": True,
"minute": True,
"year": True
}
def preprocess(filename, tra... | 28.868263 | 115 | 0.602365 | import pandas as pd
from sklearn import preprocessing
import nltk
nltk.download('punkt')
dataset_structure = None
TIMESTAMP_FEATURES = {
"timestamp": True,
"day_of_week": True,
"day_of_month": True,
"month": True,
"hour": True,
"minute": True,
"year": True
}
def preprocess(filename, tra... | 0 | 0 | 0 | 0 | 0 | 183 | 0 | 0 | 69 |
af45aaf0a681c533ca3f1003ffbce78d13e4a35a | 440 | py | Python | course/migrations/0002_auto_20200813_1721.py | Seals6/stucoursetest | 7b8f63ac7bf2b4066a9b7af9672838d03ab859ad | [
"MIT"
] | 11 | 2021-01-13T05:12:24.000Z | 2022-03-17T16:29:30.000Z | course/migrations/0002_auto_20200813_1721.py | Seals6/stucoursetest | 7b8f63ac7bf2b4066a9b7af9672838d03ab859ad | [
"MIT"
] | 1 | 2021-04-21T04:16:11.000Z | 2021-04-21T04:17:14.000Z | course/migrations/0002_auto_20200813_1721.py | Seals6/stucoursetest | 7b8f63ac7bf2b4066a9b7af9672838d03ab859ad | [
"MIT"
] | 4 | 2021-04-26T02:35:49.000Z | 2021-12-12T09:28:23.000Z | # Generated by Django 2.2.11 on 2020-08-13 09:21
| 23.157895 | 113 | 0.584091 | # Generated by Django 2.2.11 on 2020-08-13 09:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='course',
name='semester',
... | 12 | 0 | 0 | 321 | 0 | 0 | 0 | 19 | 46 |
8a5fd65aa659ee11c18cb48fa2c1913634d25078 | 5,647 | py | Python | src/reppy/__init__.py | pombredanne/reppy2 | 757dc5e86ceb647b5bd27a2467e38dd860f5bf0e | [
"MIT"
] | null | null | null | src/reppy/__init__.py | pombredanne/reppy2 | 757dc5e86ceb647b5bd27a2467e38dd860f5bf0e | [
"MIT"
] | 1 | 2015-10-13T12:48:23.000Z | 2015-10-13T12:48:23.000Z | src/reppy/__init__.py | pombredanne/reppy2 | 757dc5e86ceb647b5bd27a2467e38dd860f5bf0e | [
"MIT"
] | null | null | null | #! /usr/bin/env python
#
# Copyright (c) 2011 SEOmoz
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, mer... | 35.968153 | 78 | 0.571454 | #! /usr/bin/env python
#
# Copyright (c) 2011 SEOmoz
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, mer... | 0 | 3,184 | 0 | 165 | 0 | 0 | 0 | -1 | 137 |
7ed29c6bfb8123ac9d4b0d843be8bdc86441d835 | 801 | py | Python | flask/config.py | Index01/GSL-vts | 4d683a3118d21204dd0feef3239ccad9a7a09031 | [
"MIT"
] | null | null | null | flask/config.py | Index01/GSL-vts | 4d683a3118d21204dd0feef3239ccad9a7a09031 | [
"MIT"
] | null | null | null | flask/config.py | Index01/GSL-vts | 4d683a3118d21204dd0feef3239ccad9a7a09031 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_iniconfig import INIConfig
from flask_sqlalchemy import SQLAlchemy
from ConfigParser import SafeConfigParser, NoSectionError
app = Flask(__name__)
parser = SafeConfigParser()
parser.read('../gateConfigs.ini')
app.config['Testing'] = True
app.config['DEBUG'] = True
app.config['WT... | 28.607143 | 76 | 0.765293 | from flask import Flask
from flask_iniconfig import INIConfig
from flask_sqlalchemy import SQLAlchemy
from ConfigParser import SafeConfigParser, NoSectionError
app = Flask(__name__)
parser = SafeConfigParser()
parser.read('../gateConfigs.ini')
app.config['Testing'] = True
app.config['DEBUG'] = True
app.config['WT... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
984949e87794d2666a101048f14f3ca5aa598fb9 | 868 | py | Python | talks/users/urls.py | davan690/talks.ox | a90b034b34600c06bc68cda0e48dd3c0663f4538 | [
"Apache-2.0"
] | null | null | null | talks/users/urls.py | davan690/talks.ox | a90b034b34600c06bc68cda0e48dd3c0663f4538 | [
"Apache-2.0"
] | null | null | null | talks/users/urls.py | davan690/talks.ox | a90b034b34600c06bc68cda0e48dd3c0663f4538 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import patterns, url
from talks.users.views import (manage_collections, list_public_collections, browse_public_collections, view_collection, add_collection, edit_collection, delete_collection, my_talks)
urlpatterns = patterns('',
url(r'^lists$', manage_collections, name='manage-lists'),
... | 54.25 | 181 | 0.715438 | from django.conf.urls import patterns, url
from talks.users.views import (manage_collections, list_public_collections, browse_public_collections, view_collection, add_collection, edit_collection, delete_collection, my_talks)
urlpatterns = patterns('',
url(r'^lists$', manage_collections, name='manage-lists'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
97e5bc9b26a1b779dbc3cc482a168e3ced6f60f1 | 2,095 | py | Python | django/core/serializers/json.py | huicheese/Django-test3 | ac11d2dce245b48392e52d1f4acfd5e7433b243e | [
"BSD-3-Clause"
] | 91 | 2015-01-05T01:10:51.000Z | 2021-09-26T18:01:53.000Z | django/core/serializers/json.py | joetyson/django | c3699190186561d5c216b2a77ecbfc487d42a734 | [
"BSD-3-Clause"
] | 4 | 2015-07-05T21:09:37.000Z | 2019-09-06T14:34:59.000Z | django/core/serializers/json.py | joetyson/django | c3699190186561d5c216b2a77ecbfc487d42a734 | [
"BSD-3-Clause"
] | 32 | 2015-04-03T04:29:45.000Z | 2021-09-14T21:36:02.000Z | """
Serialize data to/from JSON
"""
try:
import decimal
except ImportError:
# Older, deprecated class name (for backwards compatibility purposes).
DateTimeAwareJSONEncoder = DjangoJSONEncoder
| 30.362319 | 89 | 0.683055 | """
Serialize data to/from JSON
"""
import datetime
from StringIO import StringIO
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.utils import datetime_safe
from django.utils import simplejson
try:
... | 0 | 0 | 0 | 1,173 | 305 | 0 | 0 | 164 | 254 |
ae6737103b4bbb20784262cd7a4c6f9a4bcbea1e | 14,531 | py | Python | auv_mission_planner/scripts/mission_planner.py | svbhat/smarc_planning | f2a69129f525aefc56ce29e5deb87a1f087c3c06 | [
"BSD-3-Clause"
] | 1 | 2021-12-13T03:06:52.000Z | 2021-12-13T03:06:52.000Z | auv_mission_planner/scripts/mission_planner.py | svbhat/smarc_planning | f2a69129f525aefc56ce29e5deb87a1f087c3c06 | [
"BSD-3-Clause"
] | null | null | null | auv_mission_planner/scripts/mission_planner.py | svbhat/smarc_planning | f2a69129f525aefc56ce29e5deb87a1f087c3c06 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Nils Bore (nbore@kth.se)
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and th... | 38.441799 | 757 | 0.638291 | #!/usr/bin/env python
# Copyright 2018 Nils Bore (nbore@kth.se)
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and th... | 0 | 0 | 0 | 11,842 | 0 | 532 | 0 | 91 | 402 |
75a7ea22e96f0fd9b60feeabde377cb245cf7c46 | 1,552 | py | Python | copy_rootless.py | clburlison/rootless_diff | daa8b547138e36b1d6ce887f9faa938de873c2d4 | [
"MIT"
] | 2 | 2017-04-06T18:35:40.000Z | 2017-05-20T20:48:29.000Z | copy_rootless.py | clburlison/rootless_diff | daa8b547138e36b1d6ce887f9faa938de873c2d4 | [
"MIT"
] | null | null | null | copy_rootless.py | clburlison/rootless_diff | daa8b547138e36b1d6ce887f9faa938de873c2d4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
A helper script to copy SIP related files.
"""
from __future__ import print_function
import os
import shutil
import sys
import plistlib
def get_version():
'''Obtain system version info from the disk version plist'''
SYSTEM_VERSION = ... | 29.846154 | 78 | 0.673325 | #!/usr/bin/python
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
"""
A helper script to copy SIP related files.
"""
from __future__ import print_function
import os
import shutil
import sys
import plistlib
def get_version():
'''Obtain system version info from the disk version plist'''
SYSTEM_VERSION = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e2a80faa7ec26140be32a4d461ad8db48951bc1 | 80 | py | Python | plugin/exportsymbols/__init__.py | BlackVS/IDA-exportsymbols | ecbd5b34a2a87091cd0ddf8d088f53bb700d6d49 | [
"MIT"
] | 2 | 2020-10-31T06:43:37.000Z | 2022-02-12T15:57:55.000Z | plugin/exportsymbols/__init__.py | BlackVS/IDA-exportsymbols | ecbd5b34a2a87091cd0ddf8d088f53bb700d6d49 | [
"MIT"
] | null | null | null | plugin/exportsymbols/__init__.py | BlackVS/IDA-exportsymbols | ecbd5b34a2a87091cd0ddf8d088f53bb700d6d49 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
#
# HeapViewer - by @danigargu
#
| 8 | 28 | 0.6375 | #!/usr/bin/python
# coding: utf-8
#
# HeapViewer - by @danigargu
#
import os
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 23 |
bcf90eb98f466a86db67b9814a21ceb8773b5463 | 1,987 | py | Python | autosk_dev_test/sparse_read_test.py | hmendozap/master-arbeit-files | 5c1b90bc4a424313234b84bad405799de6f8d2ed | [
"MIT"
] | 2 | 2018-01-18T06:25:21.000Z | 2018-12-11T07:43:09.000Z | autosk_dev_test/sparse_read_test.py | hmendozap/master-arbeit-files | 5c1b90bc4a424313234b84bad405799de6f8d2ed | [
"MIT"
] | 1 | 2016-03-29T07:55:18.000Z | 2016-03-29T07:55:18.000Z | autosk_dev_test/sparse_read_test.py | hmendozap/master-arbeit-files | 5c1b90bc4a424313234b84bad405799de6f8d2ed | [
"MIT"
] | null | null | null | import numpy as np
from autosklearn.pipeline.components.classification import add_classifier
from autosklearn.data import competition_data_manager as askdata
import autosklearn.automl as autosk
from component import DeepFeedNet
aad_dataset_dir = '../datasets/dataset_243/'
automl_dataset_dir = '/data/aad/automl_data/op... | 36.796296 | 83 | 0.744338 | import numpy as np
from sklearn.datasets import load_svmlight_file as lsf
from autosklearn.pipeline.components.classification import add_classifier
from autosklearn.data import competition_data_manager as askdata
import autosklearn.automl as autosk
from component import DeepFeedNet
aad_dataset_dir = '../datasets/datas... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 22 |
a758accc63c2338cfb280f4a7bd5ac766b0517a7 | 2,159 | py | Python | hailo_model_zoo/core/datasets/parse_mot.py | nadaved1/hailo_model_zoo | 42b716f337dde4ec602022a34d6a07a1bbd45539 | [
"MIT"
] | 29 | 2021-07-19T13:53:18.000Z | 2022-01-26T11:20:55.000Z | hailo_model_zoo/core/datasets/parse_mot.py | nadaved1/hailo_model_zoo | 42b716f337dde4ec602022a34d6a07a1bbd45539 | [
"MIT"
] | 1 | 2022-03-18T03:27:24.000Z | 2022-03-20T14:58:41.000Z | hailo_model_zoo/core/datasets/parse_mot.py | nadaved1/hailo_model_zoo | 42b716f337dde4ec602022a34d6a07a1bbd45539 | [
"MIT"
] | 10 | 2021-07-20T03:19:55.000Z | 2022-02-25T13:57:30.000Z | import tensorflow as tf
def parse_mot_record(serialized_example):
"""Parse serialized example of TfRecord and extract dictionary of all the information
"""
features = tf.io.parse_single_example(
serialized_example,
features={
'video_name': tf.io.FixedLenFeature([], tf.string),
... | 49.068182 | 99 | 0.635016 | import tensorflow as tf
def parse_mot_record(serialized_example):
"""Parse serialized example of TfRecord and extract dictionary of all the information
"""
features = tf.io.parse_single_example(
serialized_example,
features={
'video_name': tf.io.FixedLenFeature([], tf.string),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a230961c4d1bf0bd2d1efe7972b4baa33c5d7013 | 20,516 | py | Python | models/stylegan/model.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 1,644 | 2020-04-07T01:00:10.000Z | 2022-03-30T10:27:13.000Z | models/stylegan/model.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 54 | 2020-04-07T23:32:19.000Z | 2022-03-27T15:06:26.000Z | models/stylegan/model.py | mcartagenah/ganspace | f297c090257939dce1eef0eb87e6d9c4c19928a8 | [
"Apache-2.0"
] | 224 | 2020-04-06T22:59:44.000Z | 2022-03-29T14:35:45.000Z | # Copyright 2020 Erik Hrknen. All rights reserved.
# This file is licensed to you 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 applicabl... | 44.991228 | 181 | 0.585543 | # Copyright 2020 Erik Hรคrkรถnen. All rights reserved.
# This file is licensed to you 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... | 4 | 0 | 0 | 18,897 | 0 | 328 | 0 | -10 | 524 |
bd83b68845748ee7a2ef1aeb6236679edf4b0c90 | 743 | py | Python | lib/hiveos.py | SimonLovskog/HiveOS-OffPeak | 7baeaa812d8da415ca6ed5ff6169bff66e501d93 | [
"MIT"
] | null | null | null | lib/hiveos.py | SimonLovskog/HiveOS-OffPeak | 7baeaa812d8da415ca6ed5ff6169bff66e501d93 | [
"MIT"
] | null | null | null | lib/hiveos.py | SimonLovskog/HiveOS-OffPeak | 7baeaa812d8da415ca6ed5ff6169bff66e501d93 | [
"MIT"
] | null | null | null |
apiUrl = "https://api2.hiveos.farm/api/v2"
| 26.535714 | 111 | 0.6393 | import aiohttp
apiUrl = "https://api2.hiveos.farm/api/v2"
async def getMinerStatus(farmID, workerID, APIKey):
session = aiohttp.ClientSession(
headers={"Authorization": "Bearer %s" % APIKey})
data = await session.get("{}/farms/{}/workers/{}".format(apiUrl, farmID, workerID))
data = await data.jso... | 0 | 0 | 637 | 0 | 0 | 0 | 0 | -7 | 68 |
7772dfc7686bc4aed51f7db0eba9d921f1e22f07 | 2,813 | py | Python | alipay/aop/api/response/MybankCreditLoantradePayeeArConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/MybankCreditLoantradePayeeArConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/MybankCreditLoantradePayeeArConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 31.255556 | 116 | 0.67899 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.CreditPayRefuseVO import CreditPayRefuseVO
class MybankCreditLoantradePayeeArConsultResponse(AlipayResponse):
def __init__(self):
super(MybankCreditLoant... | 0 | 984 | 0 | 1,610 | 0 | 0 | 0 | 82 | 90 |
bcd402b633a19185fbd73be1216fa78478a797fb | 681 | py | Python | ledgerplot/ledgerplot/modules/crossover.py | rockwolf/python | 18b4a17136a9c22c77033c5c08a2072df8ed8db0 | [
"BSD-3-Clause"
] | null | null | null | ledgerplot/ledgerplot/modules/crossover.py | rockwolf/python | 18b4a17136a9c22c77033c5c08a2072df8ed8db0 | [
"BSD-3-Clause"
] | null | null | null | ledgerplot/ledgerplot/modules/crossover.py | rockwolf/python | 18b4a17136a9c22c77033c5c08a2072df8ed8db0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
See LICENSE.txt file for copyright and license details.
"""
"""
A plot that shows when break even is reached.
"""
import sys
x_array = []
y_array = []
def load_data():
"""
Load data
"""
var_data = open(sys.argv[1].strip(), 'r').read()
var_data_array = var_da... | 21.28125 | 74 | 0.596182 | #!/usr/bin/env python
"""
See LICENSE.txt file for copyright and license details.
"""
"""
A plot that shows when break even is reached.
"""
import numpy as np
import matplotlib.pyplot as plt
from decimal import Decimal
import sys
x_array = []
y_array = []
def load_data():
"""
Load data
"""
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 66 |
fc9effe4288eae52043395c21d9984136c52e54c | 140 | py | Python | moai/nn/utils/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 10 | 2021-04-02T11:21:33.000Z | 2022-01-18T18:32:32.000Z | moai/nn/utils/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 1 | 2022-03-22T20:10:55.000Z | 2022-03-24T13:11:02.000Z | moai/nn/utils/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 3 | 2021-05-16T20:47:40.000Z | 2021-12-01T21:15:36.000Z | from moai.nn.utils.instantiate import instantiate
from moai.nn.utils.itertools import repeat
__all__ = [
"instantiate",
"repeat",
] | 20 | 49 | 0.735714 | from moai.nn.utils.instantiate import instantiate
from moai.nn.utils.itertools import repeat
__all__ = [
"instantiate",
"repeat",
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
799766b2f4fad5cf607a8e0a9e3f866527c2f66d | 1,392 | py | Python | 938.range-sum-of-bst.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 938.range-sum-of-bst.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | 938.range-sum-of-bst.py | windard/leeeeee | 0107a5f95746592ca4fe78d2b5875cf65b1910e7 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=938 lang=python
#
# [938] Range Sum of BST
#
# https://leetcode.com/problems/range-sum-of-bst/description/
#
# algorithms
# Easy (78.13%)
# Likes: 448
# Dislikes: 85
# Total Accepted: 83.4K
# Total Submissions: 106.7K
# Testcase Example: '[10,5,15,3,7,null,18]\n7\n15'
#
# Given the root n... | 18.810811 | 93 | 0.576149 | #
# @lc app=leetcode id=938 lang=python
#
# [938] Range Sum of BST
#
# https://leetcode.com/problems/range-sum-of-bst/description/
#
# algorithms
# Easy (78.13%)
# Likes: 448
# Dislikes: 85
# Total Accepted: 83.4K
# Total Submissions: 106.7K
# Testcase Example: '[10,5,15,3,7,null,18]\n7\n15'
#
# Given the root n... | 0 | 0 | 0 | 471 | 0 | 0 | 0 | 0 | 46 |
5e680ce72985f18321eacb50a2cb032de2a2bdbc | 499 | py | Python | adls/videoCat_workflow.py | blerp-836/natsandbox | bf6f740d04562f1fc5bac5155a6b2665f212e807 | [
"MIT"
] | 1 | 2022-01-19T16:12:00.000Z | 2022-01-19T16:12:00.000Z | adls/videoCat_workflow.py | blerp-836/natsandbox | bf6f740d04562f1fc5bac5155a6b2665f212e807 | [
"MIT"
] | null | null | null | adls/videoCat_workflow.py | blerp-836/natsandbox | bf6f740d04562f1fc5bac5155a6b2665f212e807 | [
"MIT"
] | null | null | null | # Databricks notebook source
dbutils.notebook.run("notebook_workflow", 0, {'action':'landing_load','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# COMMAND ----------
dbutils.notebook.run("notebook_workflow", 0, {'action':'staging_load_videoCat','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# ... | 29.352941 | 136 | 0.671343 | # Databricks notebook source
dbutils.notebook.run("notebook_workflow", 0, {'action':'landing_load','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# COMMAND ----------
dbutils.notebook.run("notebook_workflow", 0, {'action':'staging_load_videoCat','job':'ytb_videoCat','mode':'dbfs','tbl':'ytb_videoCat'})
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7e2c460c57d61016930a2cd29b733b1220911175 | 329 | py | Python | adventofcode/2020/10/b.py | nevivurn/cp | be2ce55ef6f578cbf606bbc3d85add72993cfde3 | [
"MIT"
] | null | null | null | adventofcode/2020/10/b.py | nevivurn/cp | be2ce55ef6f578cbf606bbc3d85add72993cfde3 | [
"MIT"
] | null | null | null | adventofcode/2020/10/b.py | nevivurn/cp | be2ce55ef6f578cbf606bbc3d85add72993cfde3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
nums = list(sorted([0] + [int(line.rstrip()) for line in sys.stdin]))
nums.append(nums[-1] + 3)
dp = [1]
while len(dp) < len(nums):
cur = len(dp)
i = cur-1
cum = 0
while i >= 0 and nums[cur]-nums[i] <= 3:
cum += dp[i]
i -= 1
dp.append(cum)
print... | 16.45 | 69 | 0.525836 | #!/usr/bin/env python3
import sys
nums = list(sorted([0] + [int(line.rstrip()) for line in sys.stdin]))
nums.append(nums[-1] + 3)
dp = [1]
while len(dp) < len(nums):
cur = len(dp)
i = cur-1
cum = 0
while i >= 0 and nums[cur]-nums[i] <= 3:
cum += dp[i]
i -= 1
dp.append(cum)
print... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f2fe47b358d4d5f20a3e687d02aa1f6487fddd67 | 6,326 | py | Python | ab_test.py | matyasosvath/ab-test | 3ad07a65cc6967284f3c2741460ee14af6564ff9 | [
"MIT"
] | null | null | null | ab_test.py | matyasosvath/ab-test | 3ad07a65cc6967284f3c2741460ee14af6564ff9 | [
"MIT"
] | null | null | null | ab_test.py | matyasosvath/ab-test | 3ad07a65cc6967284f3c2741460ee14af6564ff9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import fire
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
stream_handler = logging.StreamHandler() # messages show up in terminal
formatter = logging.Formatter('%(asctime)s %(levelname)s :: %(message)s') # format the message for the terminal output
stream_handler.s... | 32.947917 | 118 | 0.621088 | #!/usr/bin/env python3
import pandas as pd
import numpy as np
import scipy.stats as ss
import fire
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
stream_handler = logging.StreamHandler() # messages show up in terminal
formatter = logging.Formatter('%(asctime)s %(levelname)s :: %(message)s... | 0 | 0 | 0 | 5,687 | 0 | 0 | 0 | -8 | 135 |
67a2c1bfd6641e9143048cbf8bbb0916508a6035 | 318 | py | Python | IO2.py | vitorgt/SCC0210 | f7689be1b72cbf3066ca051faef995f22f446d90 | [
"MIT"
] | null | null | null | IO2.py | vitorgt/SCC0210 | f7689be1b72cbf3066ca051faef995f22f446d90 | [
"MIT"
] | null | null | null | IO2.py | vitorgt/SCC0210 | f7689be1b72cbf3066ca051faef995f22f446d90 | [
"MIT"
] | null | null | null | #reads each line and adds the entire document
s = 0
try:
while(True):
line = input()
if line != "":
line = (" ".join(line.split())).split(' ')
for i in range(0,len(line)):
s += int(line[i])
else:
break
except EOFError:
pass
print(s)
| 19.875 | 54 | 0.468553 | #reads each line and adds the entire document
s = 0
try:
while(True):
line = input()
if line != "":
line = (" ".join(line.split())).split(' ')
for i in range(0,len(line)):
s += int(line[i])
else:
break
except EOFError:
pass
print(s)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2205e24fdb38333d09c2048c1cb19b0a45a22485 | 2,501 | py | Python | doc/integrations/pytorch/parlai/scripts/vacuum.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2020-09-27T05:00:06.000Z | 2020-09-27T05:00:06.000Z | doc/integrations/pytorch/parlai/scripts/vacuum.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-08-04T11:17:39.000Z | 2021-08-04T11:17:39.000Z | doc/integrations/pytorch/parlai/scripts/vacuum.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-05-03T13:27:14.000Z | 2021-05-03T13:27:14.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Reduces the size of a model file by stripping the optimizer.
Assumes we are working with a TorchAgent
"""... | 33.797297 | 86 | 0.594162 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Reduces the size of a model file by stripping the optimizer.
Assumes we are working with a TorchAgent
"""... | 0 | 1,863 | 0 | 0 | 0 | 0 | 0 | 84 | 190 |
eb9e5d820783831711eed8cb2948ef4b0129eea3 | 349 | py | Python | scripts/management/commands/uncheck_infomail_for_all_guests.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 32 | 2017-02-22T13:38:38.000Z | 2022-03-31T23:29:54.000Z | scripts/management/commands/uncheck_infomail_for_all_guests.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 694 | 2017-02-15T23:09:52.000Z | 2022-03-31T23:16:07.000Z | scripts/management/commands/uncheck_infomail_for_all_guests.py | Kpaubert/onlineweb4 | 9ac79f163bc3a816db57ffa8477ea88770d97807 | [
"MIT"
] | 35 | 2017-09-02T21:13:09.000Z | 2022-02-21T11:30:30.000Z | # -*- coding: utf-8 -*-
| 24.928571 | 57 | 0.664756 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from apps.authentication.models import OnlineUser as User
class Command(BaseCommand):
def handle(self, *args, **kwargs):
guests = User.objects.filter(field_of_study=0)
for guest in guests:
guest.infomail = Fa... | 0 | 0 | 0 | 189 | 0 | 0 | 0 | 66 | 69 |
c98684ffeb7fb21a1987fe04102295cc3242f2c9 | 1,557 | py | Python | ExampleSingleInterferogram.py | rdrews-dev/GPRI_Processing | 3066204177fb5f8739815dc21d1b6be620e34798 | [
"MIT"
] | 1 | 2021-11-25T08:57:23.000Z | 2021-11-25T08:57:23.000Z | ExampleSingleInterferogram.py | rdrews-dev/GPRI_Processing | 3066204177fb5f8739815dc21d1b6be620e34798 | [
"MIT"
] | null | null | null | ExampleSingleInterferogram.py | rdrews-dev/GPRI_Processing | 3066204177fb5f8739815dc21d1b6be620e34798 | [
"MIT"
] | null | null | null |
## In Python3 Shell: exec(open('Main.py').read())
main()
| 33.847826 | 134 | 0.712909 | import os
import numpy as np
from datetime import date, datetime, timedelta
from GPRIBatchProcessFunctions import *
import pickle
import time
import pylab as plt
## In Python3 Shell: exec(open('Main.py').read())
def main():
## All Folderst with "/" at the end
Root = '../proc2/'
#RootDirectoryWithSlcFolder... | 0 | 0 | 0 | 0 | 0 | 1,309 | 0 | 8 | 177 |
d827b2c87f325f7feeece5d7c6c8c54572b0024a | 13,500 | py | Python | tests/make_summary.py | Dexterp37/rappor | ed69c7020cf354d216d51a4bf4d211e1da2bb7bd | [
"Apache-2.0"
] | null | null | null | tests/make_summary.py | Dexterp37/rappor | ed69c7020cf354d216d51a4bf4d211e1da2bb7bd | [
"Apache-2.0"
] | null | null | null | tests/make_summary.py | Dexterp37/rappor | ed69c7020cf354d216d51a4bf4d211e1da2bb7bd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""Given a regtest result tree, prints an HTML summary to a file.
See HTML skeleton in tests/regtest.html.
"""
import os
import re
import sys
import numpy as np
import matplotlib.pyplot as plt
SUMMARY_ROW = """\
<tfoot style="font-weight: bold; text-align: right">
<tr>
<td>
%(name)s
</td>
... | 28.723404 | 78 | 0.644 | #!/usr/bin/python
"""Given a regtest result tree, prints an HTML summary to a file.
See HTML skeleton in tests/regtest.html.
"""
import os
import re
import sys
import numpy as np
import matplotlib.pyplot as plt
SUMMARY_ROW = """\
<tfoot style="font-weight: bold; text-align: right">
<tr>
<td>
%(name)s
</td>
... | 0 | 0 | 0 | 0 | 0 | 4,185 | 0 | 0 | 69 |
32b7c5e71fa96a35bb3b6423674b5759c4640848 | 85 | py | Python | tccli/services/cii/__init__.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | 47 | 2018-05-31T11:26:25.000Z | 2022-03-08T02:12:45.000Z | tccli/services/cii/__init__.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | 23 | 2018-06-14T10:46:30.000Z | 2022-02-28T02:53:09.000Z | tccli/services/cii/__init__.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | 22 | 2018-10-22T09:49:45.000Z | 2022-03-30T08:06:04.000Z | # -*- coding: utf-8 -*-
| 21.25 | 55 | 0.694118 | # -*- coding: utf-8 -*-
from tccli.services.cii.cii_client import action_caller
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 23 |
99539ada5453c5e92cb00460c8d56d4b6550efe1 | 4,552 | py | Python | course_list.py | IIIT-Delhi/HCD-IIITD | eb940560736f5c55bac2dea0cc00b0227e7cf2c4 | [
"MIT"
] | null | null | null | course_list.py | IIIT-Delhi/HCD-IIITD | eb940560736f5c55bac2dea0cc00b0227e7cf2c4 | [
"MIT"
] | null | null | null | course_list.py | IIIT-Delhi/HCD-IIITD | eb940560736f5c55bac2dea0cc00b0227e7cf2c4 | [
"MIT"
] | null | null | null | courseJson=[
{
'Course_Name': 'Introduction to Engineering Design',
'Code': 'DES130',
'Course_Text': 'Introduction to Engineering Design is a core, multidisciplinary course offered with an aim to ignite the young minds with concepts in design and innovation. Using the tools and skills learnt... | 79.859649 | 422 | 0.728032 | courseJson=[
{
'Course_Name': 'Introduction to Engineering Design',
'Code': 'DES130',
'Course_Text': 'Introduction to Engineering Design is a core, multidisciplinary course offered with an aim to ignite the young minds with concepts in design and innovation. Using the tools and skills learnt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e8172569ea6db90a64e2532de8ddbf54122415c8 | 495 | py | Python | ๅฝฑๅ่็/้ๆ่ๆฏ่ฝ็ฝ.py | jell0213/MUNIT_DataHiding | 75cb80a7ee5175c0a2235336e230ce3759f5b296 | [
"Unlicense"
] | null | null | null | ๅฝฑๅ่็/้ๆ่ๆฏ่ฝ็ฝ.py | jell0213/MUNIT_DataHiding | 75cb80a7ee5175c0a2235336e230ce3759f5b296 | [
"Unlicense"
] | null | null | null | ๅฝฑๅ่็/้ๆ่ๆฏ่ฝ็ฝ.py | jell0213/MUNIT_DataHiding | 75cb80a7ee5175c0a2235336e230ce3759f5b296 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
for i in range(10):
image = Image.open('output{:08d}.png'.format(i))
newImage = []
for item in image.getdata():
if item[:4] == (0, 0, 0 , 0): #(0,0,0,0)(255,255,255)
newImage.append((255, 255, 255))
... | 33 | 85 | 0.561616 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image
for i in range(10):
image = Image.open('output{:08d}.png'.format(i))
newImage = []
for item in image.getdata():
if item[:4] == (0, 0, 0 , 0): #ๅฐ้ๆๅ(0,0,0,0)่ฝๆ(255,255,255)
newImage.append((255, 255, 255... | 21 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f1f558d8438912cf0ce7a1910e128cfbfe0504c9 | 2,111 | py | Python | scripts/check_ugc_backups.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 61 | 2015-11-10T17:13:46.000Z | 2021-08-06T17:58:30.000Z | scripts/check_ugc_backups.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 13 | 2015-11-11T07:49:41.000Z | 2021-06-09T03:45:31.000Z | scripts/check_ugc_backups.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 18 | 2015-11-11T04:50:04.000Z | 2021-08-20T00:57:11.000Z | import sys; sys.path += ['/var/canvas/common', '../../common']
# results format
# {
# 'start_time': start_time,
# 'end_time': end_time,
# 'time': (end_time - start_time),
# 'stored': stored,
# 'skipped': skipped,
# 'failed': failed,
# 'size': backup_size_str,
# }
... | 27.415584 | 93 | 0.641402 | from datetime import datetime, date, timedelta
import os
import sys; sys.path += ['/var/canvas/common', '../../common']
import yaml
from boto.s3.connection import S3Connection
from configuration import aws
# results format
# {
# 'start_time': start_time,
# 'end_time': end_time,
# 'time': (end... | 0 | 0 | 0 | 0 | 0 | 1,366 | 0 | 33 | 250 |
ed16cd47815e11fe805c30346bd8dead959b9fdc | 1,467 | py | Python | banana.py | pickfire/banana | b9f307bf8bcadc41f3f7212a25c87a6c274fc7ab | [
"0BSD"
] | null | null | null | banana.py | pickfire/banana | b9f307bf8bcadc41f3f7212a25c87a6c274fc7ab | [
"0BSD"
] | null | null | null | banana.py | pickfire/banana | b9f307bf8bcadc41f3f7212a25c87a6c274fc7ab | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
import sys
print("INIT 1 0")
run = 1
pool = []
while run or pool:
command, id, *name = sys.stdin.readline().split()
if command == "RESOLVE":
Resolve(id, *name)
#print("print", pool)
#pool[-1].start()
elif command == "CANCEL":
pass
| 27.679245 | 76 | 0.546694 | #!/usr/bin/env python3
import sys
from threading import Thread, Event
class TimeoutError(Exception):
pass
class Resolve(Thread):
def __init__(self, id, name):
self.id = id
self.finished = Event()
self.t = Thread.__init__(self, None, self.resolve, name, (id, name))
self.start()
... | 0 | 0 | 0 | 1,085 | 0 | 0 | 0 | 14 | 68 |
be74d10a74b162ac915da849a5178a723256e461 | 3,837 | py | Python | tests/brownie_utils.py | BoostryJP/ibet-SmartContract | dc3f73a708ef145e7200ce58fce4e8171e21d3c2 | [
"Apache-2.0"
] | 10 | 2021-06-12T08:43:50.000Z | 2022-02-17T14:24:48.000Z | tests/brownie_utils.py | BoostryJP/ibet-SmartContract | dc3f73a708ef145e7200ce58fce4e8171e21d3c2 | [
"Apache-2.0"
] | 44 | 2021-04-11T06:43:10.000Z | 2022-03-30T12:42:32.000Z | tests/brownie_utils.py | BoostryJP/ibet-SmartContract | dc3f73a708ef145e7200ce58fce4e8171e21d3c2 | [
"Apache-2.0"
] | 1 | 2022-03-09T07:27:57.000Z | 2022-03-09T07:27:57.000Z | """
Copyright BOOSTRY Co., Ltd.
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 writing,
software distr... | 34.258929 | 112 | 0.738598 | """
Copyright BOOSTRY Co., Ltd.
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 writing,
software distr... | 1,413 | 0 | 0 | 44 | 0 | 251 | 0 | 0 | 69 |
b8be197bccecab3b3368a9cbcf43431337f4796d | 1,984 | py | Python | Maths/perfects.py | Axelancerr/CollegeWork | c0ee6e5a2bcb50a57b38621cbd3602e88d34f570 | [
"MIT"
] | 2 | 2021-11-04T22:21:05.000Z | 2022-03-28T11:28:56.000Z | Maths/perfects.py | Axelancerr/CollegeWork | c0ee6e5a2bcb50a57b38621cbd3602e88d34f570 | [
"MIT"
] | null | null | null | Maths/perfects.py | Axelancerr/CollegeWork | c0ee6e5a2bcb50a57b38621cbd3602e88d34f570 | [
"MIT"
] | null | null | null | # Define a function that will check if the given
# number is perfect and return a boolean value.
# Ask they user how many perfect numbers they want.
count = input("How many perfect numbers do you want? (Recommend less than 4, as any higher can take a loooong time): ")
try:
# Try to convert the user input to an i... | 34.206897 | 120 | 0.674899 | # Define a function that will check if the given
# number is perfect and return a boolean value.
def is_perfect(number: int) -> bool:
# Define a list to store the divisors of the given number in.
divisors = []
# Loop over all the numbers (potential divisors) leading up
# to the given number.
for p... | 0 | 0 | 0 | 0 | 0 | 848 | 0 | 0 | 22 |
77381d9afb40065890dbb1483c4ee0ec2804adba | 2,033 | py | Python | raster_py/raster.py | gregorulm/s-raster-proof-of-concept | a3af41d3d1d6af2445849950a7c89515f75a10d8 | [
"MIT"
] | 1 | 2021-01-11T11:17:10.000Z | 2021-01-11T11:17:10.000Z | raster_py/raster.py | gregorulm/s-raster-proof-of-concept | a3af41d3d1d6af2445849950a7c89515f75a10d8 | [
"MIT"
] | null | null | null | raster_py/raster.py | gregorulm/s-raster-proof-of-concept | a3af41d3d1d6af2445849950a7c89515f75a10d8 | [
"MIT"
] | 1 | 2020-07-05T21:09:12.000Z | 2020-07-05T21:09:12.000Z | """
Contraction Clustering (RASTER):
Reference Implementation in Python with an Example
(c) 2016 - 2020 Fraunhofer-Chalmers Centre for Industrial Mathematics
Algorithm development and implementation:
Gregor Ulm (gregor.ulm@fcc.chalmers.se)
Requirements:
. Python 3
For a description of the algorithm including relevan... | 24.202381 | 72 | 0.636498 | """
Contraction Clustering (RASTER):
Reference Implementation in Python with an Example
(c) 2016 - 2020 Fraunhofer-Chalmers Centre for Industrial Mathematics
Algorithm development and implementation:
Gregor Ulm (gregor.ulm@fcc.chalmers.se)
Requirements:
. Python 3
For a description of the algorithm including relevan... | 0 | 0 | 0 | 0 | 0 | 251 | 0 | -11 | 68 |
0c5c22317589007c9b164054cbc49c53b81744af | 497 | py | Python | src/covid19model/visualization/__init__.py | jalarcon-ale/COVID19-Model | 3efaecf5ffc5d7fb6c47321a82aab0d8f3633765 | [
"MIT"
] | 22 | 2020-04-22T16:42:53.000Z | 2021-05-06T08:44:02.000Z | src/covid19model/visualization/__init__.py | jalarcon-ale/COVID19-Model | 3efaecf5ffc5d7fb6c47321a82aab0d8f3633765 | [
"MIT"
] | 90 | 2020-04-17T19:25:52.000Z | 2022-03-25T12:34:39.000Z | src/covid19model/visualization/__init__.py | jalarcon-ale/COVID19-Model | 3efaecf5ffc5d7fb6c47321a82aab0d8f3633765 | [
"MIT"
] | 26 | 2020-04-06T06:09:04.000Z | 2020-11-21T22:40:40.000Z | from .output import population_status, infected
from .utils import colorscale_okabe_ito
import matplotlib.pyplot as plt
__all__ = ["population_status", "infected"]
# covid 19 specific parameters
plt.rcParams.update({
"axes.prop_cycle": plt.cycler('color',
list(colorscale_okabe_it... | 29.235294 | 71 | 0.65996 | from .output import population_status,infected
from .utils import colorscale_okabe_ito
import matplotlib.pyplot as plt
__all__ = ["population_status", "infected"]
# covid 19 specific parameters
plt.rcParams.update({
"axes.prop_cycle": plt.cycler('color',
list(colorscale_okabe_ito... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
e1b525e4677849c18229ec8a1935f283adc734a2 | 36,489 | py | Python | PyZ3950/oids.py | entu/entu-ester | 9489bab537c9f2186155b7a02ed2b08b68d01c11 | [
"MIT"
] | 21 | 2015-07-08T16:54:06.000Z | 2021-11-30T11:31:03.000Z | PyZ3950/oids.py | entu/entu-ester | 9489bab537c9f2186155b7a02ed2b08b68d01c11 | [
"MIT"
] | 16 | 2015-11-07T12:17:11.000Z | 2022-03-30T03:26:04.000Z | PyZ3950/oids.py | entu/entu-ester | 9489bab537c9f2186155b7a02ed2b08b68d01c11 | [
"MIT"
] | 19 | 2015-03-11T17:17:02.000Z | 2021-11-30T13:20:08.000Z | from PyZ3950 import asn1
oids = {}
oids['Z3950'] = {'oid': asn1.OidVal([1, 2, 840, 10003]), 'val': [1, 2, 840, 10003]}
oids['Z3950']['ATTRS'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 3]), 'val': [1, 2, 840, 10003, 3]}
oids['Z3950']['DIAG'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 4]), 'val': [1, 2, 840, 10003, 4]}
oids... | 76.01875 | 163 | 0.604484 | from PyZ3950 import asn1
oids = {}
oids['Z3950'] = {'oid': asn1.OidVal([1, 2, 840, 10003]), 'val': [1, 2, 840, 10003]}
oids['Z3950']['ATTRS'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 3]), 'val': [1, 2, 840, 10003, 3]}
oids['Z3950']['DIAG'] = {'oid': asn1.OidVal([1, 2, 840, 10003, 4]), 'val': [1, 2, 840, 10003, 4]}
oids... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a251261e5ebd948408f074b6e9deb101c19884c9 | 6,878 | py | Python | Example_V-REP-YouBot-Demo-master_chauby/7_Demo_youBotPickAndPlace/code/vrep/VREP_RemoteAPIs/sendSimultan2MovementSequences-mov.py | dongilc/symbolic_modern_robotics | 2439f26cdc29e73f12a82c7c1e0ac8b4ddc5a353 | [
"BSD-2-Clause"
] | 2 | 2022-03-14T16:01:53.000Z | 2022-03-25T09:14:21.000Z | Example_V-REP-YouBot-Demo-master_chauby/7_Demo_youBotPickAndPlace/code/vrep/VREP_RemoteAPIs/sendSimultan2MovementSequences-mov.py | dongilc/symbolic_modern_robotics | 2439f26cdc29e73f12a82c7c1e0ac8b4ddc5a353 | [
"BSD-2-Clause"
] | null | null | null | Example_V-REP-YouBot-Demo-master_chauby/7_Demo_youBotPickAndPlace/code/vrep/VREP_RemoteAPIs/sendSimultan2MovementSequences-mov.py | dongilc/symbolic_modern_robotics | 2439f26cdc29e73f12a82c7c1e0ac8b4ddc5a353 | [
"BSD-2-Clause"
] | 1 | 2022-03-25T07:16:57.000Z | 2022-03-25T07:16:57.000Z | # Make sure to have CoppeliaSim running, with followig scene loaded:
#
# scenes/movementViaRemoteApi.ttt
#
# Do not launch simulation, then run this script
#
# The client side (i.e. this script) depends on:
#
# sim.py, simConst.py, and the remote API library available
# in programming/remoteApiBindings/lib/lib
# Additi... | 52.907692 | 172 | 0.708782 | # Make sure to have CoppeliaSim running, with followig scene loaded:
#
# scenes/movementViaRemoteApi.ttt
#
# Do not launch simulation, then run this script
#
# The client side (i.e. this script) depends on:
#
# sim.py, simConst.py, and the remote API library available
# in programming/remoteApiBindings/lib/lib
# Additi... | 0 | 0 | 0 | 371 | 0 | 516 | 0 | 0 | 85 |
5365b1a75e6e4065d922ee76ed2d551b3103a993 | 1,187 | py | Python | MulticoreTSNE/test/test_installed.py | vu-minh/Multicore-TSNE | 5a8c51d3357c2df2b0f414bf49cb3e7c57a2bfb6 | [
"BSD-3-Clause"
] | null | null | null | MulticoreTSNE/test/test_installed.py | vu-minh/Multicore-TSNE | 5a8c51d3357c2df2b0f414bf49cb3e7c57a2bfb6 | [
"BSD-3-Clause"
] | null | null | null | MulticoreTSNE/test/test_installed.py | vu-minh/Multicore-TSNE | 5a8c51d3357c2df2b0f414bf49cb3e7c57a2bfb6 | [
"BSD-3-Clause"
] | null | null | null | # test modified version of MulticoreTSNE
from MulticoreTSNE import MulticoreTSNE as TSNE
from sklearn.datasets import load_digits
from sklearn.preprocessing import StandardScaler, MinMaxScaler
import numpy as np
from matplotlib import pyplot as plt
import multiprocessing
print(TSNE.__version__)
ncpu = multiproces... | 23.74 | 66 | 0.755687 | # test modified version of MulticoreTSNE
from MulticoreTSNE import MulticoreTSNE as TSNE
from sklearn.datasets import load_digits
from sklearn.preprocessing import StandardScaler, MinMaxScaler
import numpy as np
from matplotlib import pyplot as plt
import multiprocessing
print(TSNE.__version__)
ncpu = multiproces... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f7dcf344055bbecc074837cdfebbbfe22fb18b8 | 2,364 | py | Python | pythonlearn/Database/TestDBTool.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:30:44.000Z | 2021-01-11T06:30:44.000Z | pythonlearn/Database/TestDBTool.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 23 | 2020-02-12T02:35:49.000Z | 2022-02-11T03:45:40.000Z | pythonlearn/Database/TestDBTool.py | yc19890920/Learn | 3990e75b469225ba7b430539ef9a16abe89eb863 | [
"Apache-2.0"
] | 2 | 2020-04-08T15:39:46.000Z | 2020-10-10T10:13:09.000Z | #-*- coding: utf8 -*-
import sys
from lib import SimpleDBTool, DBTool, DBFactory
if __name__ == "__main__":
sql = 'SELECT username FROM core_customer Limit 1;'
res = SimpleDBTool.query('edm_web', sql)
print res
# (('test',),)
res = SimpleDBTool.redis.incr('test:123', 2)
print re... | 27.172414 | 75 | 0.576565 | #-*- coding: utf8 -*-
import sys
from lib import SimpleDBTool, DBTool, DBFactory
def do_query(dbtype, sql):
try:
res = dbkit.query(dbtype, sql)
except BaseException, e:
res=dbkit.process_exception(dbtype, e)
if not res: return None
res=dbkit.query(dbtype, sql)
... | 0 | 0 | 0 | 0 | 0 | 558 | 0 | 0 | 50 |
10471533365991c020b0b3acfb10c0b0dd460be2 | 367 | py | Python | tests/scraper/urls.py | c3pko/GovScrape | ac58e167539802f7f3b45cdfd4e7a2d99f66bc45 | [
"BSD-3-Clause"
] | null | null | null | tests/scraper/urls.py | c3pko/GovScrape | ac58e167539802f7f3b45cdfd4e7a2d99f66bc45 | [
"BSD-3-Clause"
] | null | null | null | tests/scraper/urls.py | c3pko/GovScrape | ac58e167539802f7f3b45cdfd4e7a2d99f66bc45 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^request_type_method/(?P<test_case>\w+).html$', views.request_type_method),
url(r'^header_body_data/(?P<test_case>\w+).html$', views.header_body_data),
url(r'^form_data/(?P<test_case>\w+).html$', views.form_data),
url(r'^cooki... | 33.363636 | 85 | 0.683924 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^request_type_method/(?P<test_case>\w+).html$', views.request_type_method),
url(r'^header_body_data/(?P<test_case>\w+).html$', views.header_body_data),
url(r'^form_data/(?P<test_case>\w+).html$', views.form_data),
url(r'^cooki... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9b31f6f9fcb19fdd11385ad9feb1454cbacfa59 | 1,217 | py | Python | src/speed.py | joseph-mccarthy/internet-monitor | ad5fefd355588777609c350f4dd1876ffc076d71 | [
"MIT"
] | null | null | null | src/speed.py | joseph-mccarthy/internet-monitor | ad5fefd355588777609c350f4dd1876ffc076d71 | [
"MIT"
] | 3 | 2022-02-25T12:32:00.000Z | 2022-02-25T12:32:43.000Z | src/speed.py | joseph-mccarthy/internet-monitor | ad5fefd355588777609c350f4dd1876ffc076d71 | [
"MIT"
] | null | null | null | from time import sleep
from schedule import run_pending
if __name__ == '__main__':
run_speed_test()
while True:
run_pending()
sleep(1)
| 23.862745 | 113 | 0.695974 | from datetime import datetime
import subprocess
from time import sleep
from models.result import Result
import json
from database import Base, db_session, engine
from schedule import every, repeat, run_pending
def init_db():
Base.metadata.create_all(bind=engine)
@repeat(every(30).minutes)
def run_speed_test():
... | 0 | 166 | 0 | 0 | 0 | 616 | 0 | 44 | 225 |
138b3eb40e45f653eae794f17af495268e2e55c0 | 7,344 | py | Python | ss_baselines/savi/models/visual_cnn.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 171 | 2020-08-21T06:45:19.000Z | 2022-03-30T03:52:15.000Z | ss_baselines/savi/models/visual_cnn.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 69 | 2020-09-19T02:44:10.000Z | 2022-03-17T03:57:55.000Z | ss_baselines/savi/models/visual_cnn.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 41 | 2020-08-25T06:58:24.000Z | 2022-03-23T05:04:47.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
from habitat_sim.utils.common import d3_40_colors_rgb
def conve... | 36.537313 | 108 | 0.564815 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import torch.nn as nn
from ss_baselines.common.utils import Flatten... | 0 | 246 | 0 | 6,212 | 0 | 0 | 0 | 21 | 69 |
30c03032c16fd11c0e154a4288113ee4121aa696 | 11,928 | py | Python | workflows/utils.py | blueicepl/django-workflows | a8d0c2d3c56644c45ede714391d51c78d0bb1660 | [
"BSD-3-Clause"
] | null | null | null | workflows/utils.py | blueicepl/django-workflows | a8d0c2d3c56644c45ede714391d51c78d0bb1660 | [
"BSD-3-Clause"
] | null | null | null | workflows/utils.py | blueicepl/django-workflows | a8d0c2d3c56644c45ede714391d51c78d0bb1660 | [
"BSD-3-Clause"
] | null | null | null | # django imports
from django.contrib.contenttypes.models import ContentType
# permissions imports
import permissions.utils
from permissions.models import Role
# workflows imports
from workflows.conf import settings
from workflows.models import (State, StateObjectHistory, StateObjectRelation, StatePermissionRelation, T... | 32.325203 | 106 | 0.697015 | # django imports
from django.contrib.contenttypes.models import ContentType
# permissions imports
import permissions.utils
from permissions.models import Role
# workflows imports
from workflows.conf import settings
from workflows.models import (StateInheritanceBlock, State, StateObjectHistory, StateObjectRelation,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 83 | 0 |
33905cbd909f88fcf7117f15ddb32118a33659e0 | 22,354 | py | Python | tests/test_compare_dictconfig_vs_dict.py | sugatoray/omegaconf | edf9e86493a14b0e909e956d9bae59b9861ef9c5 | [
"BSD-3-Clause"
] | 1,091 | 2018-09-06T17:27:12.000Z | 2022-03-31T13:47:45.000Z | tests/test_compare_dictconfig_vs_dict.py | sugatoray/omegaconf | edf9e86493a14b0e909e956d9bae59b9861ef9c5 | [
"BSD-3-Clause"
] | 624 | 2019-06-11T20:53:19.000Z | 2022-03-30T20:44:25.000Z | tests/test_compare_dictconfig_vs_dict.py | sugatoray/omegaconf | edf9e86493a14b0e909e956d9bae59b9861ef9c5 | [
"BSD-3-Clause"
] | 71 | 2019-06-14T05:32:45.000Z | 2022-03-27T19:52:35.000Z | """
This file compares DictConfig methods with the corresponding
methods of standard python's dict.
The following methods are compared:
__contains__
__delitem__
__eq__
__getitem__
__setitem__
get
pop
keys
values
items
We have separate test classes for the following cases:
Te... | 34.496914 | 101 | 0.594659 | """
This file compares DictConfig methods with the corresponding
methods of standard python's dict.
The following methods are compared:
__contains__
__delitem__
__eq__
__getitem__
__setitem__
get
pop
keys
values
items
We have separate test classes for the following cases:
Te... | 0 | 21,369 | 0 | 0 | 0 | 0 | 0 | 130 | 317 |
1145b7a8266e2c22d186806589c80fdba3f337f5 | 1,366 | py | Python | GetGradientIndices/GetGradientIndices.py | s2atoru/RayStationScripts | ffdc9217b20b13cc99d3dd52f06b2cc6c5d3fe52 | [
"MIT"
] | 3 | 2020-04-11T14:08:04.000Z | 2021-11-18T05:47:52.000Z | GetGradientIndices/GetGradientIndices.py | s2atoru/RayStationScripts | ffdc9217b20b13cc99d3dd52f06b2cc6c5d3fe52 | [
"MIT"
] | null | null | null | GetGradientIndices/GetGradientIndices.py | s2atoru/RayStationScripts | ffdc9217b20b13cc99d3dd52f06b2cc6c5d3fe52 | [
"MIT"
] | 3 | 2019-12-20T19:23:17.000Z | 2021-01-11T15:20:33.000Z |
import clr
import wpf
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore")
from System.Collections.Generic import List, Dictionary
from System.Windows import MessageBox
import sys, os
import json
RayStationScriptsPath = os.environ["USERPROFILE"] + r"\DeskTop\RayStationScripts" + "\\"
dlls... | 26.784314 | 88 | 0.777452 | from connect import *
import clr
import wpf
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore")
from System.Collections.Generic import List, Dictionary
from System.Windows import MessageBox
import sys, os
import json
RayStationScriptsPath = os.environ["USERPROFILE"] + r"\DeskTop\RayStatio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
c51ca5a63460e6b71b17600a9fc18cf4f02eecdc | 1,016 | py | Python | src/python/pants/backend/jvm/jvm_debug_config.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/jvm_debug_config.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/jvm_debug_config.py | arloherrine/pants | 5f98f7734590eb21a2992a4c28415f838a2e6927 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
# TOOD(Eric Ayers):... | 40.64 | 122 | 0.73622 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
# TOOD(Eric Ayers):... | 0 | 316 | 0 | 161 | 0 | 0 | 0 | 0 | 22 |
93804d0b3ddc0d7aa008ce064cfd1d0214729038 | 2,593 | py | Python | mpylib/mpylib/qstrs.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 126 | 2019-07-19T14:42:41.000Z | 2022-03-21T22:22:19.000Z | mpylib/mpylib/qstrs.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 38 | 2019-08-28T01:46:31.000Z | 2022-03-17T05:46:51.000Z | mpylib/mpylib/qstrs.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 55 | 2019-08-02T09:32:33.000Z | 2021-12-22T11:25:51.000Z | # static qstrs, should be sorted
# extracted from micropython/py/makeqstrdata.py
static_qstr_list = [
"",
"__dir__", # Put __dir__ after empty qstr for builtin dir() to work
"\n",
" ",
"*",
"/",
"<module>",
"_",
"__call__",
"__class__",
"__delitem__",
"__enter__",
"_... | 15.163743 | 71 | 0.473583 | # static qstrs, should be sorted
# extracted from micropython/py/makeqstrdata.py
static_qstr_list = [
"",
"__dir__", # Put __dir__ after empty qstr for builtin dir() to work
"\n",
" ",
"*",
"/",
"<module>",
"_",
"__call__",
"__class__",
"__delitem__",
"__enter__",
"_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ab48e69b127581975afe0c0eae51c555a418412 | 8,658 | py | Python | ryu/tests/integrated/vrrp_common.py | zeinsteinz/ryu | c7614805bb8fff4f2093cd01ece6c6e518ec5f3a | [
"Apache-2.0"
] | 11 | 2015-06-19T03:46:20.000Z | 2020-08-21T02:22:30.000Z | ryu/tests/integrated/vrrp_common.py | zeinsteinz/ryu | c7614805bb8fff4f2093cd01ece6c6e518ec5f3a | [
"Apache-2.0"
] | null | null | null | ryu/tests/integrated/vrrp_common.py | zeinsteinz/ryu | c7614805bb8fff4f2093cd01ece6c6e518ec5f3a | [
"Apache-2.0"
] | 9 | 2015-05-22T09:00:08.000Z | 2021-01-24T02:46:36.000Z | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | 39.898618 | 78 | 0.544468 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | 0 | 0 | 0 | 7,610 | 0 | 0 | 0 | 90 | 201 |
7d266afa6ca16a8b9eba3310dd82268527f64aa4 | 12,926 | py | Python | flsuite/parLaser.py | sfeister/flsuite | 348c207f72f3bea3877afef46ab11cc472722f57 | [
"MIT"
] | 4 | 2018-12-01T18:07:39.000Z | 2019-12-16T12:55:26.000Z | flsuite/parLaser.py | sfeister/flsuite | 348c207f72f3bea3877afef46ab11cc472722f57 | [
"MIT"
] | null | null | null | flsuite/parLaser.py | sfeister/flsuite | 348c207f72f3bea3877afef46ab11cc472722f57 | [
"MIT"
] | 2 | 2019-03-10T05:22:28.000Z | 2019-12-16T12:57:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
parLaser.py: Defines a class for writing laser strings into a flash.par file.
Created by Scott Feister on Wed Feb 14 13:39:38 2018
See two examples towards the bottom of this document.
Note: Make sure to use FLASH setup flags to increase beam and pulse count as need... | 44.116041 | 221 | 0.607071 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
parLaser.py: Defines a class for writing laser strings into a flash.par file.
Created by Scott Feister on Wed Feb 14 13:39:38 2018
See two examples towards the bottom of this document.
Note: Make sure to use FLASH setup flags to increase beam and pulse count as need... | 0 | 0 | 0 | 10,544 | 0 | 0 | 0 | -3 | 73 |
f706c0c3e8cc27ca3edb6a7b17a579cd796d7cc7 | 6,962 | py | Python | tests/test_integration.py | prototypefund/lazycluster | e6fbd69dbd73ec9bf101a502f25f7afdf0579f66 | [
"Apache-2.0"
] | 44 | 2019-08-07T12:01:07.000Z | 2021-09-02T16:50:51.000Z | tests/test_integration.py | prototypefund/lazycluster | e6fbd69dbd73ec9bf101a502f25f7afdf0579f66 | [
"Apache-2.0"
] | 9 | 2020-10-26T13:08:32.000Z | 2021-09-16T02:13:58.000Z | tests/test_integration.py | prototypefund/lazycluster | e6fbd69dbd73ec9bf101a502f25f7afdf0579f66 | [
"Apache-2.0"
] | 9 | 2019-09-18T07:52:09.000Z | 2022-02-11T13:48:19.000Z | import time
from types import ModuleType
import docker
from .config import RUNTIME_NAMES
def setup_module(module: ModuleType) -> None:
""" setup any state specific to the execution of the given module."""
docker_client = docker.from_env()
for runtime_name in RUNTIME_NAMES:
_start_runtime_contai... | 32.685446 | 195 | 0.657282 | import os
import re
import sys
import time
from subprocess import PIPE, run
from types import ModuleType
from typing import Union
import docker
import requests
import storm.__main__ as storm
from lazycluster import Runtime, RuntimeGroup, RuntimeManager, RuntimeTask
from .config import RUNTIME_DOCKER_IMAGE, RUNTIME_N... | 0 | 0 | 0 | 1,970 | 0 | 3,725 | 0 | 73 | 384 |
b4898730c1b69db642035dbd15ca66760a4419c7 | 17,407 | py | Python | pylayers/antprop/channelc.py | ArtashesH/PylayersWith3D | e4c35279a7da121d9a68282a6a0c3decfba696b4 | [
"MIT"
] | null | null | null | pylayers/antprop/channelc.py | ArtashesH/PylayersWith3D | e4c35279a7da121d9a68282a6a0c3decfba696b4 | [
"MIT"
] | null | null | null | pylayers/antprop/channelc.py | ArtashesH/PylayersWith3D | e4c35279a7da121d9a68282a6a0c3decfba696b4 | [
"MIT"
] | null | null | null | # -*- coding:Utf-8 -*-
"""
.. currentmodule:: pylayers.antprop.channelc
VectChannel Class
=================
.. autosummary::
:toctree: generated/
VectChannel.__init__
VectChannel.show3_old
VectChannel.show3
ScalChannel Class
=================
.. autosummary::
:toctree: generated/
ScalChannel.__... | 26.097451 | 106 | 0.481128 | # -*- coding:Utf-8 -*-
"""
.. currentmodule:: pylayers.antprop.channelc
VectChannel Class
=================
.. autosummary::
:toctree: generated/
VectChannel.__init__
VectChannel.show3_old
VectChannel.show3
ScalChannel Class
=================
.. autosummary::
:toctree: generated/
ScalChannel.__... | 2 | 0 | 0 | 16,352 | 0 | 0 | 0 | 69 | 338 |
a1aefec19956aaaf90961f63cc4d8d7af92c3124 | 3,653 | py | Python | src/exceptions.py | 211tbc/synthesis | 55b4dcb85b7a2ed5fbc46b1740c8ca0ab80248a4 | [
"Unlicense"
] | null | null | null | src/exceptions.py | 211tbc/synthesis | 55b4dcb85b7a2ed5fbc46b1740c8ca0ab80248a4 | [
"Unlicense"
] | 7 | 2016-08-12T15:12:43.000Z | 2020-06-07T03:19:13.000Z | src/exceptions.py | 211tbc/synthesis | 55b4dcb85b7a2ed5fbc46b1740c8ca0ab80248a4 | [
"Unlicense"
] | null | null | null |
#The MIT License
#
#Copyright (c) 2011, Alexandria Consulting LLC
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use,... | 40.142857 | 93 | 0.667944 | class Error(Exception):
"""Base class for exceptions in this module."""
pass
class DuplicateXMLDocumentError(Exception):
def __init__(self, *args):
message = "Error %s: \nIndicates: %s\nIn Location: %s" % (args[0], args[1], args[2])
print(message)
self.message = message
class Undef... | 0 | 0 | 0 | 2,129 | 0 | 0 | 0 | 0 | 408 |
9b41f598b01bc9858f8f7f6429f240ca5155b6dd | 2,258 | py | Python | reporting_tool.py | puneetjain-/Log-Analysis-Project | f71c947e02dac9238a9724c8046b90d47f86aaed | [
"MIT"
] | null | null | null | reporting_tool.py | puneetjain-/Log-Analysis-Project | f71c947e02dac9238a9724c8046b90d47f86aaed | [
"MIT"
] | null | null | null | reporting_tool.py | puneetjain-/Log-Analysis-Project | f71c947e02dac9238a9724c8046b90d47f86aaed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import psycopg2
import os
# Database Name
DB_NAME = "news"
# Filename
FILENAME = "log_analysis.txt"
# queries
first_query = "select title,views from view_article limit 3"
second_query = "select * from view_author"
third_query = "select * from view_error_log where percent_error > 1"
# to stor... | 28.225 | 76 | 0.681577 | #!/usr/bin/env python3
import psycopg2
import os
# Database Name
DB_NAME = "news"
# Filename
FILENAME = "log_analysis.txt"
# queries
first_query = "select title,views from view_article limit 3"
second_query = "select * from view_author"
third_query = "select * from view_error_log where percent_error > 1"
# to stor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |