hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28308ca52a00ce387a5426c39769e05cde52ba57 | 1,026 | py | Python | chapter_one/test_list.py | vyahello/unittest | af24c5c00032ab7265a0c00da5955a26d25dff33 | [
"MIT"
] | 1 | 2020-10-19T21:58:16.000Z | 2020-10-19T21:58:16.000Z | chapter_one/test_list.py | vyahello/unittest | af24c5c00032ab7265a0c00da5955a26d25dff33 | [
"MIT"
] | null | null | null | chapter_one/test_list.py | vyahello/unittest | af24c5c00032ab7265a0c00da5955a26d25dff33 | [
"MIT"
] | null | null | null | from typing import List
from unittest import TestCase
class TestListMethods(TestCase):
""" This test case is verifying basic list data type methods. """
def test_append(self) -> None:
""" Test checks if given elements are adding to array """
flist: List[...] = []
for i in range(1, 4)... | 28.5 | 69 | 0.569201 | from typing import List
from unittest import TestCase
class TestListMethods(TestCase):
""" This test case is verifying basic list data type methods. """
def test_append(self) -> None:
""" Test checks if given elements are adding to array """
flist: List[...] = []
for i in range(1, 4)... | 0 | 0 | 0 |
098516e7968046dba602f3a3b8912c5f5b31e987 | 15,201 | py | Python | ASR_TransV1/Training.py | HariKrishna-Vydana/ASR_Transformer | a37dc7f1add148b14ca1d265d72fc4e9d9dd0fc0 | [
"MIT"
] | 1 | 2020-10-25T00:21:40.000Z | 2020-10-25T00:21:40.000Z | ASR_TransV1/Training.py | HariKrishna-Vydana/ASR_Transformer | a37dc7f1add148b14ca1d265d72fc4e9d9dd0fc0 | [
"MIT"
] | null | null | null | ASR_TransV1/Training.py | HariKrishna-Vydana/ASR_Transformer | a37dc7f1add148b14ca1d265d72fc4e9d9dd0fc0 | [
"MIT"
] | 1 | 2021-09-08T10:32:55.000Z | 2021-09-08T10:32:55.000Z | #!/usr/bin/python
import sys
import os
import subprocess
from os.path import join, isdir
import numpy as np
import fileinput
from numpy.random import permutation
##------------------------------------------------------------------
import torch
from torch import autograd, nn, optim
from torch.autograd import Variable
im... | 51.528814 | 175 | 0.436616 | #!/usr/bin/python
import sys
import os
import subprocess
from os.path import join, isdir
import numpy as np
import fileinput
from numpy.random import permutation
##------------------------------------------------------------------
import torch
from torch import autograd, nn, optim
from torch.autograd import Variable
im... | 8,715 | 0 | 22 |
259d720ea3acdc3d764717c738f63e76aa4499dd | 1,295 | py | Python | tests/graph_builder_test.py | wwx007121/athena-decoder | a2172b41df3ceffebb2d712cd13df53b119ba0df | [
"Apache-2.0"
] | 76 | 2019-12-22T03:21:00.000Z | 2022-02-28T09:26:01.000Z | tests/graph_builder_test.py | ZhengkunTian/athena-decoder | 1ebc557d37606d8a7c9f80b87b422becf7aeb56a | [
"Apache-2.0"
] | 15 | 2020-01-08T09:13:24.000Z | 2021-04-07T02:10:20.000Z | tests/graph_builder_test.py | ZhengkunTian/athena-decoder | 1ebc557d37606d8a7c9f80b87b422becf7aeb56a | [
"Apache-2.0"
] | 25 | 2020-01-02T15:00:16.000Z | 2022-03-18T08:40:15.000Z |
from unittest import TestCase, main
import os
from tempfile import TemporaryDirectory
from absl import logging
import openfst_python as fst
from pydecoders.graph.graph_builder import GraphBuilder
if __name__ == '__main__':
logging.set_verbosity(logging.INFO)
main()
| 38.088235 | 112 | 0.689575 |
from unittest import TestCase, main
import os
from tempfile import TemporaryDirectory
from absl import logging
import openfst_python as fst
from pydecoders.graph.graph_builder import GraphBuilder
class GraphBuilderTestCase(TestCase):
def setUp(self):
self.unittest_dir = TemporaryDirectory()
def test_... | 900 | 16 | 103 |
daac6ab49165b7d687622732ba47897fb18f8759 | 420 | py | Python | setup.py | jpanikulam/cvxbind | 1a655e4b5a2433065b7559d672558caa8ae1f12f | [
"MIT"
] | 9 | 2016-09-08T14:47:49.000Z | 2021-04-07T23:25:39.000Z | setup.py | jpanikulam/cvxbind | 1a655e4b5a2433065b7559d672558caa8ae1f12f | [
"MIT"
] | null | null | null | setup.py | jpanikulam/cvxbind | 1a655e4b5a2433065b7559d672558caa8ae1f12f | [
"MIT"
] | 1 | 2016-09-08T17:10:56.000Z | 2016-09-08T17:10:56.000Z | from setuptools import setup
setup(
name='cvxbind',
version='1.0',
description='Python Oculus Rift DK2 Driver',
author='Jacob Panikulam',
author_email='jpanikulam@ufl.edu',
url='https://www.python.org/',
entry_points={
"console_scripts": ["cvxbind=cvxbind.main:main"]
},
pack... | 19.090909 | 56 | 0.578571 | from setuptools import setup
setup(
name='cvxbind',
version='1.0',
description='Python Oculus Rift DK2 Driver',
author='Jacob Panikulam',
author_email='jpanikulam@ufl.edu',
url='https://www.python.org/',
entry_points={
"console_scripts": ["cvxbind=cvxbind.main:main"]
},
pack... | 0 | 0 | 0 |
31c5f3c0fe58d7a879a5f41d31ad83023ea00b33 | 122 | py | Python | generators/app/templates/_project/_models/my_model.py | jrabary/generator-tf | ef376fcd0f2b968b5b7e18a2d68950243f376432 | [
"Apache-2.0"
] | null | null | null | generators/app/templates/_project/_models/my_model.py | jrabary/generator-tf | ef376fcd0f2b968b5b7e18a2d68950243f376432 | [
"Apache-2.0"
] | null | null | null | generators/app/templates/_project/_models/my_model.py | jrabary/generator-tf | ef376fcd0f2b968b5b7e18a2d68950243f376432 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
def my_model(features):
""" Base model definitions """
return tf.layers.dense(features, 1024) | 24.4 | 40 | 0.737705 | import tensorflow as tf
def my_model(features):
""" Base model definitions """
return tf.layers.dense(features, 1024) | 0 | 0 | 0 |
fa0feab7530b6e32819ad39d833193c4d73abf37 | 5,952 | py | Python | grasp/cfg/fsa.py | wilkeraziz/grasp | 95f5135fd3711eed32cddce2049dd595314fb1f4 | [
"Apache-2.0"
] | 9 | 2015-07-22T18:07:44.000Z | 2021-11-08T11:21:11.000Z | grasp/cfg/fsa.py | wilkeraziz/grasp | 95f5135fd3711eed32cddce2049dd595314fb1f4 | [
"Apache-2.0"
] | null | null | null | grasp/cfg/fsa.py | wilkeraziz/grasp | 95f5135fd3711eed32cddce2049dd595314fb1f4 | [
"Apache-2.0"
] | 1 | 2021-01-12T10:00:22.000Z | 2021-01-12T10:00:22.000Z | """
This module contains class definitions for wFSAs.
:Authors: - Wilker Aziz
"""
from collections import defaultdict
from .symbol import Terminal
class WDFSA(object):
"""
This is a deterministic wFSA.
TODO: extend it to handle nondeterminism.
"""
def n_states(self):
"""Number of s... | 32.883978 | 122 | 0.597278 | """
This module contains class definitions for wFSAs.
:Authors: - Wilker Aziz
"""
from collections import defaultdict
from .symbol import Terminal
class WDFSA(object):
"""
This is a deterministic wFSA.
TODO: extend it to handle nondeterminism.
"""
def __init__(self):
self._arcs = [... | 477 | 0 | 62 |
404d531184d0f4ceb5cbfccd8cbc91ea8e0fa65d | 1,350 | py | Python | src/hommmer/models/Linear.py | hammer-mt/hommmer | a02cb87841395f30911242a019f28f6ac15f27ec | [
"MIT"
] | 4 | 2021-11-09T21:27:30.000Z | 2021-11-23T00:38:20.000Z | src/hommmer/models/Linear.py | hammer-mt/hommmer | a02cb87841395f30911242a019f28f6ac15f27ec | [
"MIT"
] | null | null | null | src/hommmer/models/Linear.py | hammer-mt/hommmer | a02cb87841395f30911242a019f28f6ac15f27ec | [
"MIT"
] | null | null | null | import numpy as np
import statsmodels.api as sm
from timeit import default_timer as timer # https://stackoverflow.com/questions/7370801/how-to-measure-elapsed-time-in-python
from .Model import Model
### EDIT BELOW HERE ###
# fit the model
# get the coefficients
# get the pvalues
# calculate th... | 25.961538 | 125 | 0.64 | import numpy as np
import statsmodels.api as sm
from timeit import default_timer as timer # https://stackoverflow.com/questions/7370801/how-to-measure-elapsed-time-in-python
from .Model import Model
class Linear(Model):
def __init__(self, y, X, media_labels, settings):
# inheritance and start timer
... | 845 | -1 | 153 |
e79f3bc4f692d1b1fc33425de8aae8f7da902daf | 835 | py | Python | dbsp_drp/tests/test_splicing.py | finagle29/DBSP_DRP | d2f869f85e1425507dbc84e4e76fa44a6784f9d1 | [
"BSD-3-Clause"
] | 1 | 2021-05-17T23:28:25.000Z | 2021-05-17T23:28:25.000Z | dbsp_drp/tests/test_splicing.py | finagle29/DBSP_DRP | d2f869f85e1425507dbc84e4e76fa44a6784f9d1 | [
"BSD-3-Clause"
] | 23 | 2020-12-14T17:25:13.000Z | 2022-02-23T09:30:10.000Z | dbsp_drp/tests/test_splicing.py | finagle29/DBSP_DRP | d2f869f85e1425507dbc84e4e76fa44a6784f9d1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from dbsp_drp import splicing
| 33.4 | 67 | 0.650299 | import numpy as np
from dbsp_drp import splicing
def interp_w_error_tester(xmin, xmax, xsize, xpmin, xpmax, xpsize):
x = np.linspace(xmin, xmax, xsize)
xp = np.linspace(xpmin, xpmax, xpsize)
yp = 1 - xp ** 2 + 1.1 * xp + np.sin(xp)
err_yp = np.random.rand(xpsize)
y, yerr = splicing.interp_w_error... | 739 | 0 | 46 |
b042e629ffb4f8039e38ec22d9df1e2bfd9da3e1 | 7,946 | py | Python | c2cgeoportal/lib/dbreflection.py | pgiraud/c2cgeoportal | 3ec955c5c67d16256af726a62d586b3f4ec3b500 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/lib/dbreflection.py | pgiraud/c2cgeoportal | 3ec955c5c67d16256af726a62d586b3f4ec3b500 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/lib/dbreflection.py | pgiraud/c2cgeoportal | 3ec955c5c67d16256af726a62d586b3f4ec3b500 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import functools
import warnings
from sqlalchemy import Table, sql, types, MetaData
from sqlalchemy.orm import relationship
from sqlalchemy.orm.util import class_mapper
from sqlalchemy.exc import SAWarning
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy import Geometry, GeometryColumn
from geo... | 32.699588 | 79 | 0.634659 | import functools
import warnings
from sqlalchemy import Table, sql, types, MetaData
from sqlalchemy.orm import relationship
from sqlalchemy.orm.util import class_mapper
from sqlalchemy.exc import SAWarning
from sqlalchemy.ext.declarative import declarative_base
from geoalchemy import Geometry, GeometryColumn
from geo... | 5,663 | 12 | 242 |
0edcac3d78e048f2bc53ca273ff6c26aa90cfe46 | 908 | py | Python | app/data/usecases/getters/get_user.py | lokaimoma/Bugza | 93ffe344cb0be7dc4c45965f52798e02d05d320b | [
"Unlicense"
] | 2 | 2022-02-14T23:53:00.000Z | 2022-03-24T12:19:49.000Z | app/data/usecases/getters/get_user.py | lokaimoma/Bugza | 93ffe344cb0be7dc4c45965f52798e02d05d320b | [
"Unlicense"
] | null | null | null | app/data/usecases/getters/get_user.py | lokaimoma/Bugza | 93ffe344cb0be7dc4c45965f52798e02d05d320b | [
"Unlicense"
] | null | null | null | # Created by Kelvin_Clark on 1/31/2022, 12:59 PM
from typing import Optional
from sqlalchemy import and_
from sqlalchemy.orm import Session
from app.data.entities.user import User
from app.utils.security.password_util import verify_password_hash
| 34.923077 | 100 | 0.75 | # Created by Kelvin_Clark on 1/31/2022, 12:59 PM
from typing import Optional
from sqlalchemy import and_
from sqlalchemy.orm import Session
from app.data.entities.user import User
from app.utils.security.password_util import verify_password_hash
def get_user_by_username_id(session: Session, username: str, user_id: ... | 588 | 0 | 69 |
f9da0ef59e1e463b7b8c6b59e93da8f2e821618a | 565 | py | Python | ex042.py | thiagobachiega/python | 493b6bdee9c94e1ae8d4db06c8e5295a96f8922c | [
"MIT"
] | null | null | null | ex042.py | thiagobachiega/python | 493b6bdee9c94e1ae8d4db06c8e5295a96f8922c | [
"MIT"
] | null | null | null | ex042.py | thiagobachiega/python | 493b6bdee9c94e1ae8d4db06c8e5295a96f8922c | [
"MIT"
] | null | null | null | r1 = float(input('Primeiro segmento: '))
r2 = float(input('Segundo segmento: '))
r3 = float(input('Terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r2 + r1:
print('Podem formar um triangulo')
if r1 == r2 and r2 == r3 and r1 == r3: #pode ser feito também com: 'if r1 == r2 == r3:', sem utilizar a f... | 37.666667 | 117 | 0.60354 | r1 = float(input('Primeiro segmento: '))
r2 = float(input('Segundo segmento: '))
r3 = float(input('Terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r2 + r1:
print('Podem formar um triangulo')
if r1 == r2 and r2 == r3 and r1 == r3: #pode ser feito também com: 'if r1 == r2 == r3:', sem utilizar a f... | 0 | 0 | 0 |
8b2e774f661b1045946c9f904512d2c115680ebf | 1,906 | py | Python | bot/trial3.py | Nova-Striker/discord-bot | 1c977711f348467bd73e1886c27ad4a9a93c779b | [
"Apache-2.0"
] | 1 | 2020-11-10T06:33:49.000Z | 2020-11-10T06:33:49.000Z | bot/trial3.py | Nova-Striker/discord-bot | 1c977711f348467bd73e1886c27ad4a9a93c779b | [
"Apache-2.0"
] | null | null | null | bot/trial3.py | Nova-Striker/discord-bot | 1c977711f348467bd73e1886c27ad4a9a93c779b | [
"Apache-2.0"
] | 1 | 2020-11-13T17:12:00.000Z | 2020-11-13T17:12:00.000Z | import discord
import random
from discord.ext import commands
token = open("token.txt", "r").read()
client = discord.Client()
bot = commands.Bot(command_prefix='!joker')
@client.event
#didnot work on bot join
@client.event
##@bot.command()
##async def mention(ctx, user : discord.Member):
## await ctx.... | 38.12 | 156 | 0.591291 | import discord
import random
from discord.ext import commands
token = open("token.txt", "r").read()
client = discord.Client()
bot = commands.Bot(command_prefix='!joker')
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
#didnot work on bot join
@client.event
as... | 976 | 0 | 69 |
882861962a838e818a1ebada5db00051b6886583 | 6,310 | py | Python | vray_prop_man/tps/qt_helpers/tree_model_helper.py | mangopipeline/vray_property_manager | 63d0940d6bdf2ead2902f5c99bd735aee620d4ef | [
"MIT"
] | 1 | 2019-01-08T04:16:54.000Z | 2019-01-08T04:16:54.000Z | vray_prop_man/tps/qt_helpers/tree_model_helper.py | mangopipeline/vray_property_manager | 63d0940d6bdf2ead2902f5c99bd735aee620d4ef | [
"MIT"
] | null | null | null | vray_prop_man/tps/qt_helpers/tree_model_helper.py | mangopipeline/vray_property_manager | 63d0940d6bdf2ead2902f5c99bd735aee620d4ef | [
"MIT"
] | 1 | 2019-01-08T04:16:59.000Z | 2019-01-08T04:16:59.000Z | import os
class Node(object):
"""
Convenience class for creating Qt Tree Model Views
:param str name: name of the node
:param Node parent: Node parent
"""
def find_child_by_name(self, name):
"""Get immediate child Node by its full name. This allows for searches
t... | 30.191388 | 118 | 0.575119 | import os
class Node(object):
"""
Convenience class for creating Qt Tree Model Views
:param str name: name of the node
:param Node parent: Node parent
"""
def __init__(self, name, parent=None):
self.expanded = False
self.selected = True
self._name = name... | 2,046 | 0 | 280 |
d9d8c0c81581bbfa1e2c77e4fdc7cb813f2a115a | 642 | py | Python | data-pipeline/bcreg/controller_health.py | esune/von-bc-registries-agent | 712008543e579eee46be23c418f2eeb41626bfcd | [
"Apache-2.0"
] | null | null | null | data-pipeline/bcreg/controller_health.py | esune/von-bc-registries-agent | 712008543e579eee46be23c418f2eeb41626bfcd | [
"Apache-2.0"
] | null | null | null | data-pipeline/bcreg/controller_health.py | esune/von-bc-registries-agent | 712008543e579eee46be23c418f2eeb41626bfcd | [
"Apache-2.0"
] | 1 | 2018-05-12T01:38:38.000Z | 2018-05-12T01:38:38.000Z |
import asyncio
import time
from bcreg.credssubmitter import CONTROLLER_HEALTH_URL, CONTROLLER_HEALTH_WAIT, CONTROLLER_HEALTH_TIMEOUT, check_controller_health
print("Pinging " + CONTROLLER_HEALTH_URL + " ...")
try:
loop = asyncio.get_event_loop()
start_time = time.perf_counter()
while (time.perf_counter(... | 33.789474 | 130 | 0.750779 |
import asyncio
import time
from bcreg.credssubmitter import CONTROLLER_HEALTH_URL, CONTROLLER_HEALTH_WAIT, CONTROLLER_HEALTH_TIMEOUT, check_controller_health
print("Pinging " + CONTROLLER_HEALTH_URL + " ...")
try:
loop = asyncio.get_event_loop()
start_time = time.perf_counter()
while (time.perf_counter(... | 0 | 0 | 0 |
3cfc040039a659d5b797a9a052c5e121cdf2ca3b | 354 | py | Python | utils/base_utils.py | Zhang-VISLab/SBO-RNN-Reformulating-Recurrent-Neural-Networks-via-Stochastic-Bilevel-Optimization | a259b962e7f36277c3a59d1dc0aac51e498d5d50 | [
"MIT"
] | null | null | null | utils/base_utils.py | Zhang-VISLab/SBO-RNN-Reformulating-Recurrent-Neural-Networks-via-Stochastic-Bilevel-Optimization | a259b962e7f36277c3a59d1dc0aac51e498d5d50 | [
"MIT"
] | null | null | null | utils/base_utils.py | Zhang-VISLab/SBO-RNN-Reformulating-Recurrent-Neural-Networks-via-Stochastic-Bilevel-Optimization | a259b962e7f36277c3a59d1dc0aac51e498d5d50 | [
"MIT"
] | null | null | null | import pickle
import os
| 23.6 | 43 | 0.632768 | import pickle
import os
def read_pickle(path):
with open(path, 'rb') as f:
return pickle.load(f)
def save_pickle(data, path):
with open(path, 'wb') as f:
pickle.dump(data, f)
def ensure_dir(file_path):
directory = os.path.dirname(file_path)
if not os.path.exists(directory... | 255 | 0 | 74 |
bf55bb3c31302eb24ba55f42898179c7eba3f666 | 2,523 | py | Python | upydevice/devtools.py | Carglglz/upydevice | 0bd0686b9d729f8c2d5b23482fbc2f7dab990806 | [
"MIT"
] | 8 | 2019-10-24T14:59:35.000Z | 2021-07-09T21:23:48.000Z | upydevice/devtools.py | Carglglz/upydevice | 0bd0686b9d729f8c2d5b23482fbc2f7dab990806 | [
"MIT"
] | 3 | 2019-12-10T05:58:54.000Z | 2022-03-27T12:19:21.000Z | upydevice/devtools.py | Carglglz/upydevice | 0bd0686b9d729f8c2d5b23482fbc2f7dab990806 | [
"MIT"
] | 4 | 2019-11-30T23:07:29.000Z | 2022-03-21T01:32:37.000Z | #!/usr/bin/env python 3
# MIT License
#
# Copyright (c) 2020 Carlos Gil Gonzalez
#
# 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 right... | 37.102941 | 99 | 0.682917 | #!/usr/bin/env python 3
# MIT License
#
# Copyright (c) 2020 Carlos Gil Gonzalez
#
# 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 right... | 1,182 | 0 | 69 |
57e431496954d35b15525cbb817b8c9f2ec73940 | 108 | py | Python | demo.py | edigiacomo/skinnywms | 953ebb637b4d9ef1b78bfcbcfebae4496ec7f9d5 | [
"Apache-2.0"
] | null | null | null | demo.py | edigiacomo/skinnywms | 953ebb637b4d9ef1b78bfcbcfebae4496ec7f9d5 | [
"Apache-2.0"
] | null | null | null | demo.py | edigiacomo/skinnywms | 953ebb637b4d9ef1b78bfcbcfebae4496ec7f9d5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from skinnywms.wmssvr import application
application.run(debug=True, threaded=False)
| 27 | 43 | 0.814815 | #!/usr/bin/env python3
from skinnywms.wmssvr import application
application.run(debug=True, threaded=False)
| 0 | 0 | 0 |
2f2e054bb6efd12637fcd86ee1f9e715b5b62d07 | 1,310 | py | Python | ebay_tweet_bot/tweeter.py | geoffsmiller/ebay_tweet_bot | 32c7ccee67e04c268c8b15256df601b502261e69 | [
"MIT"
] | 4 | 2016-08-16T13:06:24.000Z | 2019-09-02T22:34:34.000Z | ebay_tweet_bot/tweeter.py | geoffsmiller/ebay_tweet_bot | 32c7ccee67e04c268c8b15256df601b502261e69 | [
"MIT"
] | null | null | null | ebay_tweet_bot/tweeter.py | geoffsmiller/ebay_tweet_bot | 32c7ccee67e04c268c8b15256df601b502261e69 | [
"MIT"
] | 1 | 2019-09-30T18:47:32.000Z | 2019-09-30T18:47:32.000Z | # -*- coding: utf-8 -*-
import twitter
import requests
| 35.405405 | 88 | 0.628244 | # -*- coding: utf-8 -*-
import twitter
import requests
class Tweeter():
BITLY_API_BASE_URL = 'https://api-ssl.bitly.com/v3/shorten'
def __init__(self, config_consumer_key, config_consumer_secret,
config_access_token_key, config_access_token_secret,
config_bitly_access_token)... | 1,120 | 113 | 23 |
869afaf72841d583d7ecbf9f55c25f1fb7fbc88c | 10,223 | py | Python | rj_gameplay/rj_gameplay/play/restart.py | RoboJackets/robocup-software | ae2920b8b98213e625d0565dd67005e7a8595fac | [
"Apache-2.0"
] | 200 | 2015-01-26T01:45:34.000Z | 2022-03-19T13:05:31.000Z | rj_gameplay/rj_gameplay/play/restart.py | RoboJackets/robocup-software | ae2920b8b98213e625d0565dd67005e7a8595fac | [
"Apache-2.0"
] | 1,254 | 2015-01-03T01:57:35.000Z | 2022-03-16T06:32:21.000Z | rj_gameplay/rj_gameplay/play/restart.py | RoboJackets/robocup-software | ae2920b8b98213e625d0565dd67005e7a8595fac | [
"Apache-2.0"
] | 206 | 2015-01-21T02:03:18.000Z | 2022-02-01T17:57:46.000Z | import stp.play as play
import stp.tactic as tactic
from rj_gameplay.tactic import pass_tactic, pass_seek, nmark_tactic, goalie_tactic, clear_tactic, wall_tactic
import stp.skill as skill
import stp.role as role
from stp.role.assignment.naive import NaiveRoleAssignment
import stp.rc as rc
from typing import Dict, Gene... | 45.435556 | 109 | 0.604519 | import stp.play as play
import stp.tactic as tactic
from rj_gameplay.tactic import pass_tactic, pass_seek, nmark_tactic, goalie_tactic, clear_tactic, wall_tactic
import stp.skill as skill
import stp.role as role
from stp.role.assignment.naive import NaiveRoleAssignment
import stp.rc as rc
from typing import Dict, Gene... | 9,375 | 0 | 214 |
ad89ebefe25057d4f023bf56acfaa6b21d405ef9 | 3,461 | py | Python | inrange.py | li195111/ObjectFilter | 32392171c2ad698aa6764e1c7abaa063e43d6e64 | [
"Apache-2.0"
] | null | null | null | inrange.py | li195111/ObjectFilter | 32392171c2ad698aa6764e1c7abaa063e43d6e64 | [
"Apache-2.0"
] | null | null | null | inrange.py | li195111/ObjectFilter | 32392171c2ad698aa6764e1c7abaa063e43d6e64 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
if __name__ == "__main__":
img = cv2.imread('/Users/liyue/Desktop/QC/QRCode/土地謄本/0_origin.jpg')
irimg = InRangeImage(img)
cv2.waitKey(0)
cv2.destroyAllWindows() | 42.207317 | 118 | 0.6423 | import cv2
import numpy as np
class InRangeImage:
def __init__(self, image, title='image') -> None:
self.image = image
self.filted = image.copy()
self.control_map = {
'low_r':0,
'low_g':0,
'low_b':0,
'height_r':255,
'height_g':255,... | 2,957 | 266 | 23 |
4384e5486738957e3632386cb5db8189764f5eed | 65,238 | py | Python | raiden/transfer/mediated_transfer/mediator.py | gmarko/raiden | 5d181843b44b7766904120e19077cc6949f17e0c | [
"MIT"
] | 1 | 2020-10-19T15:00:42.000Z | 2020-10-19T15:00:42.000Z | raiden/transfer/mediated_transfer/mediator.py | gmarko/raiden | 5d181843b44b7766904120e19077cc6949f17e0c | [
"MIT"
] | null | null | null | raiden/transfer/mediated_transfer/mediator.py | gmarko/raiden | 5d181843b44b7766904120e19077cc6949f17e0c | [
"MIT"
] | null | null | null | import itertools
import operator
import random
from fractions import Fraction
from typing import Callable
from raiden.exceptions import UndefinedMediationFee
from raiden.transfer import channel, routes, secret_registry
from raiden.transfer.architecture import Event, StateChange, SuccessOrError, TransitionResult
from r... | 39.827839 | 99 | 0.70928 | import itertools
import operator
import random
from fractions import Fraction
from typing import Callable
from raiden.exceptions import UndefinedMediationFee
from raiden.transfer import channel, routes, secret_registry
from raiden.transfer.architecture import Event, StateChange, SuccessOrError, TransitionResult
from r... | 4,273 | 0 | 69 |
3f50e869719e067befeb2fd3ef13f45e563f3f58 | 113 | py | Python | wma_export_example/apps/persons/apps.py | cfra/wagtail-modeladmin-export-example | 494284100528ae0c399bb51df570a16b4f0ec143 | [
"MIT"
] | null | null | null | wma_export_example/apps/persons/apps.py | cfra/wagtail-modeladmin-export-example | 494284100528ae0c399bb51df570a16b4f0ec143 | [
"MIT"
] | null | null | null | wma_export_example/apps/persons/apps.py | cfra/wagtail-modeladmin-export-example | 494284100528ae0c399bb51df570a16b4f0ec143 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 18.833333 | 44 | 0.787611 | from django.apps import AppConfig
class PersonsConfig(AppConfig):
name = 'wma_export_example.apps.persons'
| 0 | 55 | 23 |
981026ea4a4f66c72db656e359443133d64bcc1a | 17,366 | py | Python | NN_NER_tensorFlow/BasicTextPreprocessing_CNN_CRF.py | adapt-sjtu/novelner | a8f54ffe3360a4fdfa4b154a6668e74459a61ec3 | [
"Apache-2.0"
] | 8 | 2017-06-08T09:48:25.000Z | 2020-07-09T10:51:36.000Z | NN_NER_tensorFlow/BasicTextPreprocessing_CNN_CRF.py | adapt-sjtu/novelner | a8f54ffe3360a4fdfa4b154a6668e74459a61ec3 | [
"Apache-2.0"
] | 1 | 2018-07-07T12:38:25.000Z | 2018-07-07T12:38:25.000Z | NN_NER_tensorFlow/BasicTextPreprocessing_CNN_CRF.py | adapt-sjtu/novelner | a8f54ffe3360a4fdfa4b154a6668e74459a61ec3 | [
"Apache-2.0"
] | 4 | 2018-01-13T01:37:51.000Z | 2019-08-05T12:25:32.000Z |
# coding: utf-8
# In[1]:
import tensorflow as tf
import utils as utils
import aux_network_func as af
import data_processor as dp
#Alphabet maps objects to integer ids
from alphabet import Alphabet
import network as network
import dill
import numpy as np
import os
import time
import datetime
from tensorflow.python ... | 51.838806 | 200 | 0.754348 |
# coding: utf-8
# In[1]:
import tensorflow as tf
import utils as utils
import aux_network_func as af
import data_processor as dp
#Alphabet maps objects to integer ids
from alphabet import Alphabet
import network as network
import dill
import numpy as np
import os
import time
import datetime
from tensorflow.python ... | 990 | 0 | 27 |
d97b1009737b55084d7dd0d05054d3ac010967a7 | 371 | py | Python | exam/myMusicApp/myMusicApp/albums/urls.py | M0673N/Python-Web-Basics | cecc27f7a12f990756edcc8885290eb3b2e487b7 | [
"MIT"
] | null | null | null | exam/myMusicApp/myMusicApp/albums/urls.py | M0673N/Python-Web-Basics | cecc27f7a12f990756edcc8885290eb3b2e487b7 | [
"MIT"
] | null | null | null | exam/myMusicApp/myMusicApp/albums/urls.py | M0673N/Python-Web-Basics | cecc27f7a12f990756edcc8885290eb3b2e487b7 | [
"MIT"
] | null | null | null | from django.urls import path
from myMusicApp.albums.views import add_album, edit_album, delete_album, album_details
urlpatterns = [
path('add/', add_album, name='add album'),
path('edit/<int:pk>', edit_album, name='edit album'),
path('delete/<int:pk>', delete_album, name='delete album'),
path('details... | 33.727273 | 86 | 0.703504 | from django.urls import path
from myMusicApp.albums.views import add_album, edit_album, delete_album, album_details
urlpatterns = [
path('add/', add_album, name='add album'),
path('edit/<int:pk>', edit_album, name='edit album'),
path('delete/<int:pk>', delete_album, name='delete album'),
path('details... | 0 | 0 | 0 |
5d1859826db53878385f91a6d101ddc246d567ad | 272 | py | Python | _draft/x_7_7-a.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | _draft/x_7_7-a.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | 1 | 2021-11-13T08:03:04.000Z | 2021-11-13T08:03:04.000Z | _draft/x_7_7-a.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | # x_7_7
#
#
from ast import pattern
import re
pin = '1234' # 暗証番号
pattern1 = r'[0-9]{4}'
pattern2 = r'[2-9]{4}'
pattern3 = r'[0-9]{3}'
pattern4 = r'[0-9]{3, 5}'
print(is_match(r'[0-9]{4}', pin))
| 12.363636 | 39 | 0.591912 | # x_7_7
#
#
from ast import pattern
import re
def is_match(pattern, pin):
return bool(re.match(pattern, pin))
pin = '1234' # 暗証番号
pattern1 = r'[0-9]{4}'
pattern2 = r'[2-9]{4}'
pattern3 = r'[0-9]{3}'
pattern4 = r'[0-9]{3, 5}'
print(is_match(r'[0-9]{4}', pin))
| 46 | 0 | 23 |
3feb7052451d8c4074dbc671afc9e927c7a36f92 | 1,850 | py | Python | blog/admin.py | crazyZSShuo/blog_site | 7f16eac9737f386c11094c3b38f070ad4065a9ff | [
"Apache-2.0"
] | null | null | null | blog/admin.py | crazyZSShuo/blog_site | 7f16eac9737f386c11094c3b38f070ad4065a9ff | [
"Apache-2.0"
] | null | null | null | blog/admin.py | crazyZSShuo/blog_site | 7f16eac9737f386c11094c3b38f070ad4065a9ff | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from django.utils.safestring import mark_safe
# Register your models here.
from .models import UserProfile,Article,Category,Siteinfo,Acimage
admin.site.register(UserProfile,UserProfileAdmin)
admin.site.register(Category,CategoryAdmin)
admin.site.register(Article,ArticleAdmin)
... | 31.355932 | 132 | 0.737297 | from django.contrib import admin
from django.utils.safestring import mark_safe
# Register your models here.
from .models import UserProfile,Article,Category,Siteinfo,Acimage
class UserProfileAdmin(admin.ModelAdmin):
# 后台显示字段
list_display = ['username','user_nick_name','user_detail','email','user_gender','us... | 194 | 1,260 | 115 |
1a9fd842fe647bf4cf424d22c4ea3d6ce43f8708 | 1,577 | py | Python | imagemks/filters/fftgaussian.py | SvenPVoigt/ImageMKS | 7daa8329171c8e3e9cfe379043c7bf3d02950733 | [
"MIT"
] | null | null | null | imagemks/filters/fftgaussian.py | SvenPVoigt/ImageMKS | 7daa8329171c8e3e9cfe379043c7bf3d02950733 | [
"MIT"
] | null | null | null | imagemks/filters/fftgaussian.py | SvenPVoigt/ImageMKS | 7daa8329171c8e3e9cfe379043c7bf3d02950733 | [
"MIT"
] | null | null | null | from ._fftconvolve import fftconvolve2d
from ..structures.weights import gauss
from math import ceil
def fftgauss(img, sigma, theta=0, pad_type=None, **kwargs):
'''
Smooths the input image with a gaussian kernel. Uses the fft method and allows
specifying a custom pad type with **kwargs from numpy.pad docu... | 33.553191 | 86 | 0.674065 | from ._fftconvolve import fftconvolve2d
from ..structures.weights import gauss
from math import ceil
def fftgauss(img, sigma, theta=0, pad_type=None, **kwargs):
'''
Smooths the input image with a gaussian kernel. Uses the fft method and allows
specifying a custom pad type with **kwargs from numpy.pad docu... | 0 | 0 | 0 |
a0d112fcb00d022605f6083da06c816f86920b58 | 1,622 | py | Python | Folder/GPSServer.py | Kuailun/Zhengdong_Survey | 595dba03fa447aa992cd68ed09592ace55003c8c | [
"MIT"
] | null | null | null | Folder/GPSServer.py | Kuailun/Zhengdong_Survey | 595dba03fa447aa992cd68ed09592ace55003c8c | [
"MIT"
] | 1 | 2020-04-22T14:04:30.000Z | 2020-04-22T14:04:30.000Z | Folder/GPSServer.py | Kuailun/Zhengdong_Survey | 595dba03fa447aa992cd68ed09592ace55003c8c | [
"MIT"
] | null | null | null | from flask import Flask,jsonify,request
import os
import json
import codecs
import xlwt
from flask_apscheduler import APScheduler
import time
import random
import math
import xlrd
app = Flask(__name__)
if not os.path.exists("Database"):
os.mkdir("Database")
if not os.path.exists("Backup"):
os.mkdir("Backup")
... | 19.082353 | 57 | 0.637485 | from flask import Flask,jsonify,request
import os
import json
import codecs
import xlwt
from flask_apscheduler import APScheduler
import time
import random
import math
import xlrd
app = Flask(__name__)
if not os.path.exists("Database"):
os.mkdir("Database")
if not os.path.exists("Backup"):
os.mkdir("Backup")
... | 745 | 0 | 90 |
2d0964059393b81d50a76e5198f2cc39df5e7fae | 2,456 | py | Python | retro/tables/pexp_xyz.py | ellohfin/retro | 58ec8f5b698e6140acd215717f051d99e407c4e5 | [
"Apache-2.0"
] | 1 | 2018-03-02T01:05:52.000Z | 2018-03-02T01:05:52.000Z | retro/tables/pexp_xyz.py | ellohfin/retro | 58ec8f5b698e6140acd215717f051d99e407c4e5 | [
"Apache-2.0"
] | 30 | 2018-01-30T21:03:28.000Z | 2019-11-07T16:42:07.000Z | retro/tables/pexp_xyz.py | ellohfin/retro | 58ec8f5b698e6140acd215717f051d99e407c4e5 | [
"Apache-2.0"
] | 6 | 2017-07-27T19:49:13.000Z | 2019-11-19T13:38:27.000Z | # -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position
"""
Function for computing expected number of photons to survive from a
time-independent Cartesian-binned table.
"""
from __future__ import absolute_import, division, print_function
__all__ = ['pexp_xyz']
__author__ = 'P. Eller, J.L. Lanfranchi'
__lice... | 31.088608 | 77 | 0.687296 | # -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position
"""
Function for computing expected number of photons to survive from a
time-independent Cartesian-binned table.
"""
from __future__ import absolute_import, division, print_function
__all__ = ['pexp_xyz']
__author__ = 'P. Eller, J.L. Lanfranchi'
__lice... | 0 | 0 | 0 |
d09879cb746786e08c9d18a1776168a27e52ad00 | 90 | py | Python | viet_ocr/apps.py | trangnm58/DocOCR | 7ec6087323cf2d06906878c55be236fb1950ce57 | [
"Apache-2.0"
] | null | null | null | viet_ocr/apps.py | trangnm58/DocOCR | 7ec6087323cf2d06906878c55be236fb1950ce57 | [
"Apache-2.0"
] | null | null | null | viet_ocr/apps.py | trangnm58/DocOCR | 7ec6087323cf2d06906878c55be236fb1950ce57 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
| 15 | 33 | 0.755556 | from django.apps import AppConfig
class VietocrConfig(AppConfig):
name = 'viet_ocr'
| 0 | 32 | 23 |
0ef13dc67dc19f36a03236b125584c776361b5e5 | 6,959 | py | Python | conveyoragent/engine/api/contrib/migration.py | Hybrid-Cloud/conveyor-agent | 034f683fc194669301e185260fb4082478bc83a0 | [
"Apache-2.0"
] | null | null | null | conveyoragent/engine/api/contrib/migration.py | Hybrid-Cloud/conveyor-agent | 034f683fc194669301e185260fb4082478bc83a0 | [
"Apache-2.0"
] | null | null | null | conveyoragent/engine/api/contrib/migration.py | Hybrid-Cloud/conveyor-agent | 034f683fc194669301e185260fb4082478bc83a0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Justin Santa Barbara
# 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/l... | 34.795 | 78 | 0.599943 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Justin Santa Barbara
# 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/l... | 4,820 | 697 | 152 |
0a2ef2bff53ca82f1c2d9d380cd0412b82d2d538 | 15,096 | py | Python | earth_enterprise/src/fusion/portableglobe/servers/portable_server.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 2,661 | 2017-03-20T22:12:50.000Z | 2022-03-30T09:43:19.000Z | earth_enterprise/src/fusion/portableglobe/servers/portable_server.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 1,531 | 2017-03-24T17:20:32.000Z | 2022-03-16T18:11:14.000Z | earth_enterprise/src/fusion/portableglobe/servers/portable_server.py | ezeeyahoo/earthenterprise | b6cac9e6228946f2f17d1edb75e118aeb3e8e8c9 | [
"Apache-2.0"
] | 990 | 2017-03-24T11:54:28.000Z | 2022-03-22T11:51:47.000Z | #!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc, 2019 Open GEE Contributors.
#
# 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
#
# Unl... | 34.78341 | 78 | 0.678458 | #!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc, 2019 Open GEE Contributors.
#
# 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
#
# Unl... | 0 | 0 | 0 |
9e3b04c387e2d782f322458fda8ec7701c1d7f0c | 8,405 | py | Python | pysnmp/HH3C-DLDP2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/HH3C-DLDP2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/HH3C-DLDP2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HH3C-DLDP2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-DLDP2-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:13:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 127.348485 | 1,240 | 0.767519 | #
# PySNMP MIB module HH3C-DLDP2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-DLDP2-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:13:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 0 | 0 | 0 |
6fbcb112e3cbf7b7ec5221eb2478ad7087c4499d | 7,248 | py | Python | app/math_functions.py | cchenzi/INE5420 | b14b22b1400e21b4b722d427e1f1375778c5929c | [
"MIT"
] | 2 | 2021-06-24T04:31:37.000Z | 2021-06-24T19:35:15.000Z | app/math_functions.py | cchenzi/INE5420 | b14b22b1400e21b4b722d427e1f1375778c5929c | [
"MIT"
] | null | null | null | app/math_functions.py | cchenzi/INE5420 | b14b22b1400e21b4b722d427e1f1375778c5929c | [
"MIT"
] | 1 | 2021-06-24T21:26:36.000Z | 2021-06-24T21:26:36.000Z | import numpy as np
from functools import reduce
from app.utils import get_reflection_indexes, transformations_codes
from app.config import (
X_MAX_TRANSLATED,
X_MIN_TRANSLATED,
Y_MAX_TRANSLATED,
Y_MIN_TRANSLATED,
MAX_NORMALIZED_VALUE,
MIN_NORMALIZED_VALUE,
)
def build_translation_matrix(Tx, ... | 23.763934 | 87 | 0.55436 | import numpy as np
from functools import reduce
from app.utils import get_reflection_indexes, transformations_codes
from app.config import (
X_MAX_TRANSLATED,
X_MIN_TRANSLATED,
Y_MAX_TRANSLATED,
Y_MIN_TRANSLATED,
MAX_NORMALIZED_VALUE,
MIN_NORMALIZED_VALUE,
)
def x_viewport_transform(
x_win... | 2,883 | 0 | 276 |
0a2958118b8db956dd2ee11d7db9251548a92702 | 1,486 | py | Python | planning_system/db/schema/views/finance/v_calc_staff_period.py | jehboyes/planning_system | a415f1408ef344732498d2ffb111dfd187b9b50f | [
"MIT"
] | null | null | null | planning_system/db/schema/views/finance/v_calc_staff_period.py | jehboyes/planning_system | a415f1408ef344732498d2ffb111dfd187b9b50f | [
"MIT"
] | null | null | null | planning_system/db/schema/views/finance/v_calc_staff_period.py | jehboyes/planning_system | a415f1408ef344732498d2ffb111dfd187b9b50f | [
"MIT"
] | null | null | null | """
Alternative calculation to the v_calc_staff_monthly set of views.
This one differs by having period as a column. There is not a significant
performance difference beteween the two until
it comes to aggregation (which for the other, could require an unpivot).
"""
from planning_system.db.schema.views.finance.v_c... | 38.102564 | 102 | 0.668237 | """
Alternative calculation to the v_calc_staff_monthly set of views.
This one differs by having period as a column. There is not a significant
performance difference beteween the two until
it comes to aggregation (which for the other, could require an unpivot).
"""
from planning_system.db.schema.views.finance.v_c... | 0 | 0 | 0 |
08f523c4abe909ef500adec76786ecc682e7f3ad | 1,051 | py | Python | Two Pointers/019. Remove Nth Node From End of List.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 138 | 2020-02-08T05:25:26.000Z | 2021-11-04T11:59:28.000Z | Two Pointers/019. Remove Nth Node From End of List.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | null | null | null | Two Pointers/019. Remove Nth Node From End of List.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 24 | 2021-01-02T07:18:43.000Z | 2022-03-20T08:17:54.000Z | """
19. Remove Nth Node From End of List
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.
"""
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
... | 25.634146 | 122 | 0.52902 | """
19. Remove Nth Node From End of List
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.
"""
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
... | 0 | 722 | 50 |
025c4d7441b98a62c194d9ead223718491d7e529 | 9,159 | py | Python | convlab2/dst/rule/multiwoz/dst.py | ljw23/ConvLab-2 | 13d48ea0e441701bd66100689b6c25b561f15525 | [
"Apache-2.0"
] | 339 | 2020-03-04T09:43:22.000Z | 2022-03-26T17:27:38.000Z | convlab2/dst/rule/multiwoz/dst.py | ljw23/ConvLab-2 | 13d48ea0e441701bd66100689b6c25b561f15525 | [
"Apache-2.0"
] | 122 | 2020-04-12T04:19:06.000Z | 2022-03-23T14:20:57.000Z | convlab2/dst/rule/multiwoz/dst.py | ljw23/ConvLab-2 | 13d48ea0e441701bd66100689b6c25b561f15525 | [
"Apache-2.0"
] | 138 | 2020-02-18T16:48:04.000Z | 2022-03-26T17:27:43.000Z | import json
import os
from convlab2.util.multiwoz.state import default_state
from convlab2.dst.rule.multiwoz.dst_util import normalize_value
from convlab2.dst.dst import DST
from convlab2.util.multiwoz.multiwoz_slot_trans import REF_SYS_DA
class RuleDST(DST):
"""Rule based DST which trivially updates new values ... | 56.888199 | 291 | 0.398188 | import json
import os
from convlab2.util.multiwoz.state import default_state
from convlab2.dst.rule.multiwoz.dst_util import normalize_value
from convlab2.dst.dst import DST
from convlab2.util.multiwoz.multiwoz_slot_trans import REF_SYS_DA
class RuleDST(DST):
"""Rule based DST which trivially updates new values ... | 316 | 0 | 27 |
158997cdc6825b7103282f3d12014097e98b55e1 | 2,163 | py | Python | toontown/coghq/LawbotOfficeDiamondRoom_Trap00_Cogs.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/coghq/LawbotOfficeDiamondRoom_Trap00_Cogs.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/coghq/LawbotOfficeDiamondRoom_Trap00_Cogs.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from toontown.coghq.SpecImports import *
from toontown.toonbase import ToontownGlobals
CogParent = 100007
CogParent1 = 100009
BattlePlace1 = 100004
BattlePlace2 = 100005
BattleCellId = 0
BattleCellId1 = 1
BattleCells = {BattleCellId: {'parentEntId': BattlePlace1,
'pos': Point3(0, 0, 0)},
BattleCellId1:... | 25.151163 | 58 | 0.630606 | from toontown.coghq.SpecImports import *
from toontown.toonbase import ToontownGlobals
CogParent = 100007
CogParent1 = 100009
BattlePlace1 = 100004
BattlePlace2 = 100005
BattleCellId = 0
BattleCellId1 = 1
BattleCells = {BattleCellId: {'parentEntId': BattlePlace1,
'pos': Point3(0, 0, 0)},
BattleCellId1:... | 0 | 0 | 0 |
bcddf4a6a8323db0aab19a414052aeb51889ba15 | 1,904 | py | Python | alchemy_provider/provider/provider.py | SherkhanSyzdykov/alchemy_provider | d964f8dcfb59f803e9d5f69316eef5199bf71529 | [
"MIT"
] | 1 | 2022-03-30T22:12:50.000Z | 2022-03-30T22:12:50.000Z | alchemy_provider/provider/provider.py | SherkhanSyzdykov/alchemy_provider | d964f8dcfb59f803e9d5f69316eef5199bf71529 | [
"MIT"
] | null | null | null | alchemy_provider/provider/provider.py | SherkhanSyzdykov/alchemy_provider | d964f8dcfb59f803e9d5f69316eef5199bf71529 | [
"MIT"
] | null | null | null | from typing import List, Optional, Sequence
from sqlalchemy.orm import DeclarativeMeta
from ..clause_binder.clause_binder import ClauseBinder
from ..query import CRUDQuery
from .select_provider import SelectProvider
from .insert_provider import InsertProvider
from .update_provider import UpdateProvider
from .delete_pro... | 25.052632 | 54 | 0.609244 | from typing import List, Optional, Sequence
from sqlalchemy.orm import DeclarativeMeta
from ..clause_binder.clause_binder import ClauseBinder
from ..query import CRUDQuery
from .select_provider import SelectProvider
from .insert_provider import InsertProvider
from .update_provider import UpdateProvider
from .delete_pro... | 1,260 | 96 | 157 |
728e2b2cdd3da6ce82622492cfcd44f328297a42 | 968 | py | Python | build/openwisp_websocket/module_settings.py | tkaefer/docker-openwisp | 93e162ccb44382b5b2d0092d10cac236d0069516 | [
"BSD-3-Clause"
] | 127 | 2019-07-12T15:41:20.000Z | 2022-03-29T18:50:37.000Z | build/openwisp_websocket/module_settings.py | tkaefer/docker-openwisp | 93e162ccb44382b5b2d0092d10cac236d0069516 | [
"BSD-3-Clause"
] | 138 | 2019-05-14T19:38:30.000Z | 2022-03-31T20:33:56.000Z | build/openwisp_websocket/module_settings.py | tkaefer/docker-openwisp | 93e162ccb44382b5b2d0092d10cac236d0069516 | [
"BSD-3-Clause"
] | 69 | 2019-05-16T18:56:41.000Z | 2022-03-23T05:41:55.000Z | INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
# all-auth
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
# o... | 22 | 37 | 0.646694 | INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.gis',
# all-auth
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
# o... | 0 | 0 | 0 |
ff84cc53d95a666037cb6e3407c5b81895ed51d7 | 140 | py | Python | src/amuse/support/data/core.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | src/amuse/support/data/core.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | src/amuse/support/data/core.py | rieder/amuse | 3ac3b6b8f922643657279ddee5c8ab3fc0440d5e | [
"Apache-2.0"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z | import warnings
from amuse.datamodel import *
warnings.warn("amuse.support.data.core has moved to amuse.datamodel", DeprecationWarning)
| 17.5 | 89 | 0.8 | import warnings
from amuse.datamodel import *
warnings.warn("amuse.support.data.core has moved to amuse.datamodel", DeprecationWarning)
| 0 | 0 | 0 |
0f366542032fb61dd89f4a087dbe245ab3cc9b19 | 1,220 | py | Python | source/pkgsrc/lang/python37/patches/patch-Lib_ctypes_macholib_dyld.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python37/patches/patch-Lib_ctypes_macholib_dyld.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python37/patches/patch-Lib_ctypes_macholib_dyld.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_ctypes_macholib_dyld.py,v 1.1 2020/11/17 19:33:26 sjmulder Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
--- Lib/ctypes/macholib/dyld.py.orig 2020-08-15 05:20:16.000000000 +0000
+++ Lib/ctypes/macholib/dyld.py
@@ -6,6 +6,11 ... | 33.888889 | 83 | 0.67623 | $NetBSD: patch-Lib_ctypes_macholib_dyld.py,v 1.1 2020/11/17 19:33:26 sjmulder Exp $
Support for macOS 11 and Apple Silicon (ARM). Mostly backported from:
https://github.com/python/cpython/pull/22855
--- Lib/ctypes/macholib/dyld.py.orig 2020-08-15 05:20:16.000000000 +0000
+++ Lib/ctypes/macholib/dyld.py
@@ -6,6 +6,11 ... | 0 | 0 | 0 |
2f7c889d4a0edc68eca134e1931eaaf4bbaef1ce | 161 | py | Python | Practice Round/solver/client.py | sbrodehl/hashcode2022 | 02d1b13e5dc089144bbe05c0e1633156e2f03a2b | [
"Apache-2.0"
] | 1 | 2022-02-25T15:47:34.000Z | 2022-02-25T15:47:34.000Z | Practice Round/solver/client.py | sbrodehl/hashcode2022 | 02d1b13e5dc089144bbe05c0e1633156e2f03a2b | [
"Apache-2.0"
] | null | null | null | Practice Round/solver/client.py | sbrodehl/hashcode2022 | 02d1b13e5dc089144bbe05c0e1633156e2f03a2b | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
@dataclass
class Client:
"""Class representing a pizza with ingredients."""
id: int
likes: set
dislikes: set
| 16.1 | 54 | 0.695652 | from dataclasses import dataclass
@dataclass
class Client:
"""Class representing a pizza with ingredients."""
id: int
likes: set
dislikes: set
| 0 | 0 | 0 |
47d603195b3dd04da5450dec1a13304a09a60378 | 1,958 | py | Python | OrchardVision/orchardMap/views.py | Michalas-Jomi/Orchard-Vision | cc07c4195d527563f232b03831d79a824bb43d05 | [
"MIT"
] | null | null | null | OrchardVision/orchardMap/views.py | Michalas-Jomi/Orchard-Vision | cc07c4195d527563f232b03831d79a824bb43d05 | [
"MIT"
] | null | null | null | OrchardVision/orchardMap/views.py | Michalas-Jomi/Orchard-Vision | cc07c4195d527563f232b03831d79a824bb43d05 | [
"MIT"
] | null | null | null | from django.http import request
from django.views import generic
import OrchardVision.settings as settings
import broker.models as models
from broker.models import Tree
from html import escape
import json | 30.123077 | 80 | 0.644535 | from django.http import request
from django.views import generic
import OrchardVision.settings as settings
import broker.models as models
from broker.models import Tree
from html import escape
import json
class MapView(generic.TemplateView):
template_name = "orchardMap/map.html"
def get_context_data(self, *... | 1,187 | 473 | 92 |
ce6ebe8604df48f97f24099f183578496e15d0fd | 458 | py | Python | main.py | trampfox/nimbus-phantom-rest-client | f0559b48bd47dfe66d39c33c39015468785790fb | [
"Apache-2.0"
] | null | null | null | main.py | trampfox/nimbus-phantom-rest-client | f0559b48bd47dfe66d39c33c39015468785790fb | [
"Apache-2.0"
] | null | null | null | main.py | trampfox/nimbus-phantom-rest-client | f0559b48bd47dfe66d39c33c39015468785790fb | [
"Apache-2.0"
] | null | null | null | __author__ = 'Davide Monfrecola'
from phantomrestclient import auth
from phantomrestclient import launchconfigurations
from phantomrestclient import domains
from phantomrestclient import sites
from phantomrestclient import phantomrequests
# only for testing purpouse
if __name__ == "__main__":
#d = domains.Domains... | 28.625 | 53 | 0.768559 | __author__ = 'Davide Monfrecola'
from phantomrestclient import auth
from phantomrestclient import launchconfigurations
from phantomrestclient import domains
from phantomrestclient import sites
from phantomrestclient import phantomrequests
# only for testing purpouse
if __name__ == "__main__":
#d = domains.Domains... | 0 | 0 | 0 |
fa1d1d19d8f79e38e0ed816bc8d8035e84d8d1cd | 1,455 | py | Python | Python3-GUI/QuickStart-Tkinter/Tkinter_04_grid_Entry.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-GUI/QuickStart-Tkinter/Tkinter_04_grid_Entry.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-GUI/QuickStart-Tkinter/Tkinter_04_grid_Entry.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import tkinter
root = tkinter.Tk()
root.wm_title("Tkinter04 Demo")
label1 = tkinter.Label(root, text=u"账号:").grid(row=0, sticky="w")
label2 = tkinter.Label(root, text=u"密码:").grid(row=1, sticky="w")
label3 = tkinter.Label(root, text=u"")
var = tkinter.Variable()
var.set("tester")
... | 25.982143 | 72 | 0.636426 | # -*- coding: utf-8 -*-
import tkinter
root = tkinter.Tk()
root.wm_title("Tkinter04 Demo")
label1 = tkinter.Label(root, text=u"账号:").grid(row=0, sticky="w")
label2 = tkinter.Label(root, text=u"密码:").grid(row=1, sticky="w")
label3 = tkinter.Label(root, text=u"")
var = tkinter.Variable()
var.set("tester")
... | 301 | 0 | 25 |
4961797e3e55b4d0b3285f57e8cf405242dc635b | 824 | py | Python | tests/test_jhb.py | dapu/femagtools | 95eaf750adc2013232cdf482e523b3900ac6eb08 | [
"BSD-2-Clause"
] | 21 | 2016-09-07T12:17:21.000Z | 2022-01-08T11:43:24.000Z | tests/test_jhb.py | dapu/femagtools | 95eaf750adc2013232cdf482e523b3900ac6eb08 | [
"BSD-2-Clause"
] | 63 | 2016-09-11T12:04:48.000Z | 2022-03-28T13:22:16.000Z | tests/test_jhb.py | dapu/femagtools | 95eaf750adc2013232cdf482e523b3900ac6eb08 | [
"BSD-2-Clause"
] | 8 | 2017-07-12T13:05:57.000Z | 2022-01-08T11:43:26.000Z | #!/usr/bin/env python
#
import os
import femagtools.jhb
| 27.466667 | 69 | 0.595874 | #!/usr/bin/env python
#
import os
import femagtools.jhb
def test_read_jhb():
testPath = os.path.split(__file__)[0]
if not testPath:
testPath = '.'
filename = "data/M270-50A_1000Hz_L.jhb"
jhb = femagtools.jhb.Reader('{0}/{1}'.format(testPath, filename))
assert jhb['name'] == 'M270-50A_1000H... | 719 | 0 | 46 |
da7ce9cd4430416de73af85bbbefe60b25136935 | 2,262 | py | Python | play_sql/providers.py | davidemoro/play_sql | 46ad2f2890574bf457cc799dc983ed0bab17d676 | [
"Apache-2.0"
] | 2 | 2018-04-12T13:26:49.000Z | 2018-04-14T08:07:18.000Z | play_sql/providers.py | davidemoro/play_sql | 46ad2f2890574bf457cc799dc983ed0bab17d676 | [
"Apache-2.0"
] | 2 | 2019-01-10T22:35:32.000Z | 2019-01-25T22:13:12.000Z | play_sql/providers.py | davidemoro/play_sql | 46ad2f2890574bf457cc799dc983ed0bab17d676 | [
"Apache-2.0"
] | null | null | null | import logging
from pytest_play.providers import BaseProvider
from sqlalchemy.pool import NullPool
from sqlalchemy import (
create_engine,
text,
)
class SQLProvider(BaseProvider):
""" SQL provider """
def get_db(self, database_url):
""" Return a cached db engine if available """
if no... | 31.416667 | 61 | 0.535367 | import logging
from pytest_play.providers import BaseProvider
from sqlalchemy.pool import NullPool
from sqlalchemy import (
create_engine,
text,
)
class SQLProvider(BaseProvider):
""" SQL provider """
def __init__(self, engine):
super(SQLProvider, self).__init__(engine)
self.logger = ... | 639 | 0 | 54 |
5cb51cc7cf3c23cb66d568666e6dc636c413aa03 | 2,882 | py | Python | QuantTorch/layers/xnor_layers.py | Enderdead/BinaryConnect_PyTorch | 990e970b1fbd299ff88200db21a9cc3fe44706d3 | [
"MIT"
] | 75 | 2019-03-19T07:36:56.000Z | 2021-12-23T02:34:59.000Z | QuantTorch/layers/xnor_layers.py | Enderdead/BinaryConnect_PyTorch | 990e970b1fbd299ff88200db21a9cc3fe44706d3 | [
"MIT"
] | 10 | 2019-03-19T21:16:56.000Z | 2019-04-16T15:05:37.000Z | QuantTorch/layers/xnor_layers.py | Enderdead/BinaryConnect_PyTorch | 990e970b1fbd299ff88200db21a9cc3fe44706d3 | [
"MIT"
] | 9 | 2019-08-12T10:33:55.000Z | 2021-07-23T02:10:06.000Z | import torch
from .common import QLayer
from ..functions import xnor_connect
import warnings
warnings.simplefilter("always",DeprecationWarning)
warnings.warn("Module not finished due to gradient implementation on conv layer !", ImportWarning)
| 40.027778 | 122 | 0.653019 | import torch
from .common import QLayer
from ..functions import xnor_connect
import warnings
warnings.simplefilter("always",DeprecationWarning)
warnings.warn("Module not finished due to gradient implementation on conv layer !", ImportWarning)
class LinearXNOR(torch.nn.Linear, QLayer):
@staticmethod
def conve... | 2,266 | 323 | 46 |
e6dfa4e39472fd6034ac5499ccd65e3b9f918aa8 | 935 | py | Python | tests/molecular/molecules/molecule/test_dump_molecular_structures.py | stevenkbennett/stk | a8311fa6110adc0ea593a24d9a0c064597b1b174 | [
"MIT"
] | 21 | 2018-04-12T16:25:24.000Z | 2022-02-14T23:05:43.000Z | tests/molecular/molecules/molecule/test_dump_molecular_structures.py | stevenkbennett/stk | a8311fa6110adc0ea593a24d9a0c064597b1b174 | [
"MIT"
] | 8 | 2019-03-19T12:36:36.000Z | 2020-11-11T12:46:00.000Z | tests/molecular/molecules/molecule/test_dump_molecular_structures.py | stevenkbennett/stk | a8311fa6110adc0ea593a24d9a0c064597b1b174 | [
"MIT"
] | 5 | 2018-08-07T13:00:16.000Z | 2021-11-01T00:55:10.000Z | def test_dump_molecular_structures(
request,
tmp_path,
molecule_db,
name_db,
case_data,
):
"""
Dump molecular structures.
This test dumps molecules to files and to a MongoDB database
so that they can be visually inspected.
Parameters
----------
request : :class:`pytest.... | 25.27027 | 70 | 0.668449 | def test_dump_molecular_structures(
request,
tmp_path,
molecule_db,
name_db,
case_data,
):
"""
Dump molecular structures.
This test dumps molecules to files and to a MongoDB database
so that they can be visually inspected.
Parameters
----------
request : :class:`pytest.... | 0 | 0 | 0 |
6e7ef4889ec0856753fdc799a4f1a7beee999fbf | 961 | py | Python | app/conversations/models.py | gurnitha/2022-django4-clone-airbnb | 169060e3da0abf91f4ba25740c7bf6d2bea01750 | [
"Unlicense"
] | null | null | null | app/conversations/models.py | gurnitha/2022-django4-clone-airbnb | 169060e3da0abf91f4ba25740c7bf6d2bea01750 | [
"Unlicense"
] | null | null | null | app/conversations/models.py | gurnitha/2022-django4-clone-airbnb | 169060e3da0abf91f4ba25740c7bf6d2bea01750 | [
"Unlicense"
] | null | null | null | # app/conversations/models.py
# Django modules
from django.db import models
# Locals
from app.users.models import MyCustomUser
# Create your models here.
# NAMA MODEL/TABEL: Conversation
# NAMA MODEL/TABEL: Message
| 22.348837 | 50 | 0.766909 | # app/conversations/models.py
# Django modules
from django.db import models
# Locals
from app.users.models import MyCustomUser
# Create your models here.
# NAMA MODEL/TABEL: Conversation
class Conversation(models.Model):
participans = models.ManyToManyField(
"users.MyCustomUser", blank=True)
created = models.... | 66 | 629 | 44 |
c6eff3acdd18180e3321a2ab28b671a37e341371 | 438 | py | Python | malloc_model.py | Mario-Kart-Felix/log4j | 6118f9ade2d69052b3f45522bb55ac4e93163b6d | [
"Apache-2.0"
] | 1 | 2021-12-26T01:36:54.000Z | 2021-12-26T01:36:54.000Z | malloc_model.py | Mario-Kart-Felix/log4j | 6118f9ade2d69052b3f45522bb55ac4e93163b6d | [
"Apache-2.0"
] | null | null | null | malloc_model.py | Mario-Kart-Felix/log4j | 6118f9ade2d69052b3f45522bb55ac4e93163b6d | [
"Apache-2.0"
] | null | null | null | import angr
| 25.764706 | 62 | 0.652968 | import angr
class malloc_addr_tracker(angr.procedures.libc.malloc.malloc):
IS_FUNCTION = True
def store_addr(self, addr):
if "stored_malloc" not in self.state.globals.keys():
self.state.globals["stored_malloc"] = []
self.state.globals["stored_malloc"].append(addr)
def run(se... | 284 | 118 | 23 |
36e81d1b4580ddbd6392d5017945b89eb11a22e7 | 2,047 | py | Python | evalml/pipelines/pipeline_meta.py | BlockchainClimateInstitute/price_microservice | 11d1cff8965fe1befc997e9da3dc09efceed4579 | [
"BSD-3-Clause"
] | null | null | null | evalml/pipelines/pipeline_meta.py | BlockchainClimateInstitute/price_microservice | 11d1cff8965fe1befc997e9da3dc09efceed4579 | [
"BSD-3-Clause"
] | 13 | 2021-03-04T19:29:09.000Z | 2022-03-07T01:00:43.000Z | evalml/pipelines/pipeline_meta.py | RG4421/evalml | 33c62abe6d107d1da2f54e9e44a90f18aaf916a9 | [
"BSD-3-Clause"
] | null | null | null |
from functools import wraps
from evalml.exceptions import PipelineNotYetFittedError
from evalml.utils.base_meta import BaseMeta
class PipelineBaseMeta(BaseMeta):
"""Metaclass that overrides creating a new pipeline by wrapping methods with validators and setters"""
@classmethod
def check_for_fit(cls, m... | 41.77551 | 138 | 0.645823 |
from functools import wraps
from evalml.exceptions import PipelineNotYetFittedError
from evalml.utils.base_meta import BaseMeta
class PipelineBaseMeta(BaseMeta):
"""Metaclass that overrides creating a new pipeline by wrapping methods with validators and setters"""
@classmethod
def check_for_fit(cls, m... | 928 | 0 | 60 |
b8bf26ec2ce6a033aaa38387d0f109b0f1a76f17 | 918 | py | Python | scrappers/plugins/foxnews/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | 2 | 2016-01-10T08:45:29.000Z | 2019-10-25T06:53:39.000Z | scrappers/plugins/foxnews/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | 3 | 2016-01-07T15:43:40.000Z | 2016-01-09T14:44:08.000Z | scrappers/plugins/foxnews/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | null | null | null | import scrappers
import scrappers.mixins
class FoxNews(scrappers.mixins.RSSScrapper, scrappers.Scrapper):
"""The Fox News RSS feeds scrapper.
"""
| 36.72 | 101 | 0.59695 | import scrappers
import scrappers.mixins
class FoxNews(scrappers.mixins.RSSScrapper, scrappers.Scrapper):
"""The Fox News RSS feeds scrapper.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def should_translate(self):
return False
def encoding(self):
... | 654 | 0 | 108 |
39239c0cbe321e1e0c50301232271a8f5a6b8d08 | 4,467 | py | Python | seashells/__init__.py | anishathalye/conch | 878da872ff010dac44fa933edf565da3f7ed1bee | [
"MIT"
] | 651 | 2017-07-06T09:10:36.000Z | 2022-03-20T04:26:30.000Z | seashells/__init__.py | anishathalye/conch | 878da872ff010dac44fa933edf565da3f7ed1bee | [
"MIT"
] | 20 | 2017-07-11T02:06:13.000Z | 2021-08-22T09:27:07.000Z | seashells/__init__.py | anishathalye/conch | 878da872ff010dac44fa933edf565da3f7ed1bee | [
"MIT"
] | 23 | 2017-07-10T20:01:44.000Z | 2022-01-31T22:22:52.000Z | #!/usr/bin/env python
# Copyright (c) 2018 Anish Athalye (me@anishathalye.com)
#
# 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
... | 33.586466 | 81 | 0.60197 | #!/usr/bin/env python
# Copyright (c) 2018 Anish Athalye (me@anishathalye.com)
#
# 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
... | 2,993 | 0 | 69 |
6460202dd69850f1791d42f5cdbd6f37acc6169a | 2,048 | py | Python | complex_relations.py | SebaLenny/DataGeneration | dbb92ec1cebd661d7e1d8ba06c97dc8900cfecb0 | [
"MIT"
] | null | null | null | complex_relations.py | SebaLenny/DataGeneration | dbb92ec1cebd661d7e1d8ba06c97dc8900cfecb0 | [
"MIT"
] | null | null | null | complex_relations.py | SebaLenny/DataGeneration | dbb92ec1cebd661d7e1d8ba06c97dc8900cfecb0 | [
"MIT"
] | null | null | null | from faker import Faker
from generators.uniform_distribution_gen import UniformDistributionGen
from generators.random_relation_gen import RandomRelationGen
from base.field_base import FieldBase
from generators.normal_distribution_gen import NormalDistributionGen
from generators.first_name_generator import FirstNameGene... | 31.030303 | 78 | 0.689941 | from faker import Faker
from generators.uniform_distribution_gen import UniformDistributionGen
from generators.random_relation_gen import RandomRelationGen
from base.field_base import FieldBase
from generators.normal_distribution_gen import NormalDistributionGen
from generators.first_name_generator import FirstNameGene... | 241 | -39 | 147 |
576b5d0ffd656d923b719f6f39f44366df52d2e7 | 45,723 | py | Python | devtest/devices/android/adb.py | pycopia/devtest | 9ec93045ba4bab5b20ce99dc61cebd5b5a234d01 | [
"Apache-2.0"
] | null | null | null | devtest/devices/android/adb.py | pycopia/devtest | 9ec93045ba4bab5b20ce99dc61cebd5b5a234d01 | [
"Apache-2.0"
] | null | null | null | devtest/devices/android/adb.py | pycopia/devtest | 9ec93045ba4bab5b20ce99dc61cebd5b5a234d01 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | 34.983168 | 97 | 0.58487 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | 15,762 | 11 | 1,841 |
4928be4151cd434441ae17f011c08dddb5da8fa7 | 2,857 | py | Python | build_wmc.py | giulia-berto/app-classifyber | c25543bfae915e3ab732e5e9beb22bc60759b9ec | [
"MIT"
] | 3 | 2019-12-17T09:52:05.000Z | 2021-01-15T00:47:45.000Z | build_wmc.py | giulia-berto/app-classifyber | c25543bfae915e3ab732e5e9beb22bc60759b9ec | [
"MIT"
] | null | null | null | build_wmc.py | giulia-berto/app-classifyber | c25543bfae915e3ab732e5e9beb22bc60759b9ec | [
"MIT"
] | 1 | 2019-12-09T14:50:30.000Z | 2019-12-09T14:50:30.000Z | import os
import sys
import json
import argparse
import numpy as np
import nibabel as nib
import scipy.io as sio
from matplotlib import cm
from json import encoder
from matplotlib import colors as mcolors
encoder.FLOAT_REPR = lambda o: format(o, '.2f')
def build_wmc(tck_file, tractID_list):
"""
Build the wm... | 31.395604 | 94 | 0.645782 | import os
import sys
import json
import argparse
import numpy as np
import nibabel as nib
import scipy.io as sio
from matplotlib import cm
from json import encoder
from matplotlib import colors as mcolors
encoder.FLOAT_REPR = lambda o: format(o, '.2f')
def build_wmc(tck_file, tractID_list):
"""
Build the wm... | 0 | 0 | 0 |
4494ce25eb6a925df570942e279f006207ebd024 | 95 | py | Python | gerapy_auto_extractor/settings.py | zanachka/GerapyAutoExtractor | 152007f31e6cf2a7c08f07be95b24043976b2ce0 | [
"Apache-2.0"
] | 214 | 2020-06-27T23:23:04.000Z | 2022-03-28T04:34:40.000Z | Engine/gerapy_auto_extractor/settings.py | Justin3go/xiu-search | 3f42d946c98e312fa2eb3397824758465b959518 | [
"MulanPSL-1.0"
] | 16 | 2020-07-07T06:47:16.000Z | 2022-01-19T05:27:55.000Z | Engine/gerapy_auto_extractor/settings.py | Justin3go/xiu-search | 3f42d946c98e312fa2eb3397824758465b959518 | [
"MulanPSL-1.0"
] | 60 | 2020-06-29T07:37:55.000Z | 2022-02-25T03:07:16.000Z | import environs
env = environs.Env()
env.read_env()
APP_DEBUG = env.bool('APP_DEBUG', False)
| 13.571429 | 40 | 0.726316 | import environs
env = environs.Env()
env.read_env()
APP_DEBUG = env.bool('APP_DEBUG', False)
| 0 | 0 | 0 |
dee680aa095f3c45ca322d788702ef8a34d37f78 | 714 | py | Python | prog.py | AdarshK1/FDAnalysis | 202514bfd25429d24c311dac65c8f1f467257f7a | [
"Apache-2.0"
] | null | null | null | prog.py | AdarshK1/FDAnalysis | 202514bfd25429d24c311dac65c8f1f467257f7a | [
"Apache-2.0"
] | null | null | null | prog.py | AdarshK1/FDAnalysis | 202514bfd25429d24c311dac65c8f1f467257f7a | [
"Apache-2.0"
] | null | null | null |
#Todo functions
punctuation = ",./?'|}{[]=+-_;:<>!@#$%^&*()`~"
fd = open("FDText.txt")
hf = open("huckfinn.txt")
fdText=fd.read()
hfText=hf.read()
fdArray = fdText.split()
hfArray = hfText.split()
fdArray2 = cleantext(fdArray)
hfArray2 = cleantext(hfArray)
fd.close()
hf.close()
print(hfArray2)
| 17 | 63 | 0.564426 |
#Todo functions
def cleantext(txt): #get rid of html markup and punctuation
arr = []
temp = ""
for word in txt:
for char in word:
if (char not in punctuation):
temp = temp + char
temp = temp.rstrip()
temp = temp.lower()
arr . append (temp)
... | 361 | 0 | 45 |
08b7ffe60631d75ef4f1fe0ebe59526b6a975f53 | 6,566 | py | Python | word_generator.py | jpinsonault/language_generator | 3668fdd68122d3ba646648b1d94684348e2ba942 | [
"MIT"
] | null | null | null | word_generator.py | jpinsonault/language_generator | 3668fdd68122d3ba646648b1d94684348e2ba942 | [
"MIT"
] | null | null | null | word_generator.py | jpinsonault/language_generator | 3668fdd68122d3ba646648b1d94684348e2ba942 | [
"MIT"
] | null | null | null | from random import randint
from random import choice
from random import uniform
from collections import namedtuple
from typing import List, Dict
_Options = namedtuple("Options",
["vowels",
"consonants",
"max_initial_consonants",
"m... | 34.925532 | 114 | 0.68276 | from random import randint
from random import choice
from random import uniform
from collections import namedtuple
from typing import List, Dict
_Options = namedtuple("Options",
["vowels",
"consonants",
"max_initial_consonants",
"m... | 5,251 | -7 | 306 |
85c899b2ecba9e23ee235890cd083f654f65dfb0 | 659 | py | Python | libs/langfromchars/LangFromCharsModel.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | libs/langfromchars/LangFromCharsModel.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | libs/langfromchars/LangFromCharsModel.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.path.dirname(__file__))
from libs.AbstractLanguageDetectionModel import AbstractLanguageDetectionModel
from libs.langfromchars.mobi.LangFromChars import LangFromChars
| 27.458333 | 78 | 0.742033 | import os
import sys
sys.path.append(os.path.dirname(__file__))
from libs.AbstractLanguageDetectionModel import AbstractLanguageDetectionModel
from libs.langfromchars.mobi.LangFromChars import LangFromChars
class LangFromCharsModel(AbstractLanguageDetectionModel):
def __init__(self):
AbstractLanguageDet... | 308 | 36 | 104 |
a10212ebffbaa0eb97667f57ab12bf1e2cf565c0 | 17,202 | py | Python | core/domain/beam_job_services_test.py | WebFlakyTest/oppia | 520e35490eae8171beb035fbafc2948983abec75 | [
"Apache-2.0"
] | 1 | 2021-08-17T20:33:12.000Z | 2021-08-17T20:33:12.000Z | core/domain/beam_job_services_test.py | WebFlakyTest/oppia | 520e35490eae8171beb035fbafc2948983abec75 | [
"Apache-2.0"
] | null | null | null | core/domain/beam_job_services_test.py | WebFlakyTest/oppia | 520e35490eae8171beb035fbafc2948983abec75 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | 45.387863 | 89 | 0.690036 | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | 11,066 | 4,809 | 177 |
84624031aeb2c0a0410ae4a16dc2db8ad6e1f6af | 1,715 | py | Python | motion-record.py | antanasbruzas/motion-record | da62a9f900237751d431210afcb49e8da82617cd | [
"MIT"
] | null | null | null | motion-record.py | antanasbruzas/motion-record | da62a9f900237751d431210afcb49e8da82617cd | [
"MIT"
] | null | null | null | motion-record.py | antanasbruzas/motion-record | da62a9f900237751d431210afcb49e8da82617cd | [
"MIT"
] | null | null | null | import sys
import gpiod
import time
import liblo
with gpiod.Chip('gpiochip0') as chip:
if (len(sys.argv) > 1):
# Use arg specified line
line = chip.get_line(int(sys.argv[1]))
else:
# TXD1 (GPIO14)
line = chip.get_line(14)
line.request(consumer=sys.argv[0], type=gpiod.LINE_RE... | 34.3 | 72 | 0.501458 | import sys
import gpiod
import time
import liblo
with gpiod.Chip('gpiochip0') as chip:
if (len(sys.argv) > 1):
# Use arg specified line
line = chip.get_line(int(sys.argv[1]))
else:
# TXD1 (GPIO14)
line = chip.get_line(14)
line.request(consumer=sys.argv[0], type=gpiod.LINE_RE... | 0 | 0 | 0 |
822c69bf9eab24739af5458d65e525a57048eea2 | 1,933 | py | Python | zmk/nyokaserver/tests.py | frenebo/ZMOD | 58159fcbf61200c1ec2d6b92fca0cd9d4e83a208 | [
"Apache-2.0"
] | 2 | 2021-02-22T18:36:21.000Z | 2021-06-12T20:28:43.000Z | zmk/nyokaserver/tests.py | frenebo/ZMOD | 58159fcbf61200c1ec2d6b92fca0cd9d4e83a208 | [
"Apache-2.0"
] | 12 | 2019-12-09T13:38:30.000Z | 2022-02-10T00:31:27.000Z | zmk/nyokaserver/tests.py | frenebo/ZMOD | 58159fcbf61200c1ec2d6b92fca0cd9d4e83a208 | [
"Apache-2.0"
] | null | null | null | # from django.test import TestCase
import unittest
import requests, os, json, sys, logging
from django.http import JsonResponse
from nyokaserver.nyokaServerClass import NyokaServer
| 33.327586 | 78 | 0.747025 | # from django.test import TestCase
import unittest
import requests, os, json, sys, logging
from django.http import JsonResponse
from nyokaserver.nyokaServerClass import NyokaServer
class TestNyokaServer(unittest.TestCase):
@classmethod
def setUpClass(self):
logging.info("******* Running Test Cases for Nyoka Serve... | 1,533 | 196 | 23 |
21068aa008855ea9e31285aea780e013cff3be02 | 13,830 | py | Python | datalogger/old/DataLoggerWeb.py | gunny26/datalogger | 7bd29ab88f2e2749284d80a6a834c94c0955a7e0 | [
"Apache-2.0"
] | null | null | null | datalogger/old/DataLoggerWeb.py | gunny26/datalogger | 7bd29ab88f2e2749284d80a6a834c94c0955a7e0 | [
"Apache-2.0"
] | null | null | null | datalogger/old/DataLoggerWeb.py | gunny26/datalogger | 7bd29ab88f2e2749284d80a6a834c94c0955a7e0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import urllib
import urllib2
from collections import OrderedDict as OrderedDict
import json
import base64
import logging
import os
# own modules
from datalogger import Timeseries as Timeseries
from datalogger import TimeseriesArray as TimeseriesArray
from datalogger import TimeseriesArrayStats as Tim... | 30.395604 | 108 | 0.584382 | #!/usr/bin/python
import urllib
import urllib2
from collections import OrderedDict as OrderedDict
import json
import base64
import logging
import os
# own modules
from datalogger import Timeseries as Timeseries
from datalogger import TimeseriesArray as TimeseriesArray
from datalogger import TimeseriesArrayStats as Tim... | 0 | 0 | 0 |
f59b0f3a7c8ba393f35d719cd42bf672b3b7575e | 832 | py | Python | Term2/Session 6/16-6-string-methods.py | theseana/apondaone | 7cbf3572a86c73220329804fee1f3d03842ae902 | [
"MIT"
] | null | null | null | Term2/Session 6/16-6-string-methods.py | theseana/apondaone | 7cbf3572a86c73220329804fee1f3d03842ae902 | [
"MIT"
] | null | null | null | Term2/Session 6/16-6-string-methods.py | theseana/apondaone | 7cbf3572a86c73220329804fee1f3d03842ae902 | [
"MIT"
] | null | null | null | # lower, upper, title, capitalize, isupper, islower
# istitle, swapcase
g = "HI"
"HI".lower() # firsth method
g.lower() # second method
print(g.lower())
print(g)
g = g.lower()
print(g)
# ######################################################## #
g = "Python"
print(g.lower()) # "Python" >> "python"
print(g.upper(... | 22.486486 | 72 | 0.538462 | # lower, upper, title, capitalize, isupper, islower
# istitle, swapcase
g = "HI"
"HI".lower() # firsth method
g.lower() # second method
print(g.lower())
print(g)
g = g.lower()
print(g)
# ######################################################## #
g = "Python"
print(g.lower()) # "Python" >> "python"
print(g.upper(... | 0 | 0 | 0 |
ff98e0dda3b302d8e3e572ebdb0b29892b48ab9c | 3,110 | py | Python | dogepartylib/lib/config.py | coinwarp/dogeparty-lib | 1823db21b25de723448fb50957fbfe9ff8d092c9 | [
"MIT"
] | 2 | 2016-01-31T18:13:11.000Z | 2020-05-08T23:54:55.000Z | dogepartylib/lib/config.py | coinwarp/dogeparty-lib | 1823db21b25de723448fb50957fbfe9ff8d092c9 | [
"MIT"
] | 1 | 2015-11-07T10:17:05.000Z | 2015-11-07T10:17:05.000Z | dogepartylib/lib/config.py | coinwarp/dogeparty-lib | 1823db21b25de723448fb50957fbfe9ff8d092c9 | [
"MIT"
] | 2 | 2015-11-03T19:12:02.000Z | 2021-12-18T04:48:52.000Z | """Variables prefixed with `DEFAULT` should be able to be overridden by
configuration file and command-line arguments."""
UNIT = 100000000 # The same across assets.
# Versions
VERSION_MAJOR = 9
VERSION_MINOR = 59
VERSION_REVISION = 4
VERSION_STRING = str(VERSION_MAJOR) + '.' + str(VERSION_MINOR) + '.' + str(V... | 29.903846 | 128 | 0.789389 | """Variables prefixed with `DEFAULT` should be able to be overridden by
configuration file and command-line arguments."""
UNIT = 100000000 # The same across assets.
# Versions
VERSION_MAJOR = 9
VERSION_MINOR = 59
VERSION_REVISION = 4
VERSION_STRING = str(VERSION_MAJOR) + '.' + str(VERSION_MINOR) + '.' + str(V... | 0 | 0 | 0 |
b971fae1abae25e297e5037f285abb33cce7a1e9 | 661 | py | Python | awwardsapp/forms.py | careymwarabu/Awwards | 908be568ac074ea1e28151cebad9c26c169fedca | [
"MIT"
] | null | null | null | awwardsapp/forms.py | careymwarabu/Awwards | 908be568ac074ea1e28151cebad9c26c169fedca | [
"MIT"
] | null | null | null | awwardsapp/forms.py | careymwarabu/Awwards | 908be568ac074ea1e28151cebad9c26c169fedca | [
"MIT"
] | null | null | null | from .models import Profile, Project, Vote
from django.forms import ModelForm, widgets
from django import forms | 28.73913 | 78 | 0.597579 | from .models import Profile, Project, Vote
from django.forms import ModelForm, widgets
from django import forms
class CreateProfileForm(ModelForm):
class Meta:
model = Profile
exclude = ['user',]
widgets = {
'bio': forms.Textarea(attrs={'rows':2, 'cols':10,}),
}
class Ne... | 0 | 481 | 69 |
e5d2f331e1e6589c398bf24a44120178923fb711 | 5,099 | py | Python | examples/combo_box_example.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 5 | 2020-10-16T03:46:47.000Z | 2022-03-21T07:10:37.000Z | examples/combo_box_example.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | null | null | null | examples/combo_box_example.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 1 | 2022-02-16T14:18:43.000Z | 2022-02-16T14:18:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.2
# Email : muyanru345@163.com
###################################################################
import random
from dayu_widgets3.combo_box import MComboBox
from dayu_w... | 37.77037 | 107 | 0.569916 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.2
# Email : muyanru345@163.com
###################################################################
import random
from dayu_widgets3.combo_box import MComboBox
from dayu_w... | 4,378 | 23 | 76 |
e95ddc71807c879afd64601d6b2e52a76de7171b | 14,886 | py | Python | data/utils.py | jefflai108/VGNSL | 0edc3db3691abbad2a505b2165bd99e7a62d784f | [
"MIT"
] | 1 | 2022-03-08T16:09:03.000Z | 2022-03-08T16:09:03.000Z | data/utils.py | jefflai108/VGNSL | 0edc3db3691abbad2a505b2165bd99e7a62d784f | [
"MIT"
] | null | null | null | data/utils.py | jefflai108/VGNSL | 0edc3db3691abbad2a505b2165bd99e7a62d784f | [
"MIT"
] | null | null | null | import librosa
import numpy as np
import scipy.signal
import torch
import textgrid
import pickle
import os
import torch
import torch.nn.functional as F
import s3prl.hub as hub
import w2v2_model_jeff
WINDOWS = {'hamming': scipy.signal.hamming,
'hann': scipy.signal.hann,
'blackman': scipy.signal... | 49.45515 | 471 | 0.6359 | import librosa
import numpy as np
import scipy.signal
import torch
import textgrid
import pickle
import os
import torch
import torch.nn.functional as F
import s3prl.hub as hub
import w2v2_model_jeff
WINDOWS = {'hamming': scipy.signal.hamming,
'hann': scipy.signal.hann,
'blackman': scipy.signal... | 8,516 | 0 | 165 |
43c3a1b901d726272e7852eb495c8f5158f104da | 227 | py | Python | pytl866/pytl866/__init__.py | Kiboneu/open-tl866 | b8cada420dd3822ea6333a675ede38a4d7789185 | [
"BSD-2-Clause"
] | 1 | 2018-08-04T12:29:56.000Z | 2018-08-04T12:29:56.000Z | pytl866/pytl866/__init__.py | Kiboneu/open-tl866 | b8cada420dd3822ea6333a675ede38a4d7789185 | [
"BSD-2-Clause"
] | null | null | null | pytl866/pytl866/__init__.py | Kiboneu/open-tl866 | b8cada420dd3822ea6333a675ede38a4d7789185 | [
"BSD-2-Clause"
] | null | null | null | from pytl866.context import Tl866Context
from pytl866.driver import DriverError, \
VPP_98, VPP_126, VPP_140, VPP_166, VPP_144, VPP_171, VPP_185, VPP_212, \
VDD_30, VDD_35, VDD_46, VDD_51, VDD_43, VDD_48, VDD_60, VDD_65
| 45.4 | 76 | 0.762115 | from pytl866.context import Tl866Context
from pytl866.driver import DriverError, \
VPP_98, VPP_126, VPP_140, VPP_166, VPP_144, VPP_171, VPP_185, VPP_212, \
VDD_30, VDD_35, VDD_46, VDD_51, VDD_43, VDD_48, VDD_60, VDD_65
| 0 | 0 | 0 |
dc3cc4dcd2d3aceb1ae6f5204ddf272b195b8e80 | 9,479 | py | Python | python/akg/ops/array/strided_slice.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | python/akg/ops/array/strided_slice.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | python/akg/ops/array/strided_slice.py | KnowingNothing/akg-test | 114d8626b824b9a31af50a482afc07ab7121862b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 38.848361 | 113 | 0.619791 | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 0 | 0 | 0 |
45a86ad55e9de74d2e64af53b590738fb5b9a3fe | 9,148 | py | Python | gramtools/commands/genotype/seq_region_map.py | bricoletc/gramtools | 1ce06178b7b26f42d72e47d3d7b8a7a606e6f256 | [
"MIT"
] | null | null | null | gramtools/commands/genotype/seq_region_map.py | bricoletc/gramtools | 1ce06178b7b26f42d72e47d3d7b8a7a606e6f256 | [
"MIT"
] | null | null | null | gramtools/commands/genotype/seq_region_map.py | bricoletc/gramtools | 1ce06178b7b26f42d72e47d3d7b8a7a606e6f256 | [
"MIT"
] | null | null | null | from typing import List, Dict, Iterable, Union, Callable
from enum import Enum, auto
import json
from pathlib import Path
from pysam import VariantRecord
VariantRecords = Iterable[VariantRecord]
Chrom = str
ChromSizes = Dict[Chrom, int]
class SeqRegion:
"""Mapping between vcf records in two coordinate spaces
... | 34.916031 | 90 | 0.631504 | from typing import List, Dict, Iterable, Union, Callable
from enum import Enum, auto
import json
from pathlib import Path
from pysam import VariantRecord
VariantRecords = Iterable[VariantRecord]
Chrom = str
ChromSizes = Dict[Chrom, int]
class SeqRegion:
"""Mapping between vcf records in two coordinate spaces
... | 6,745 | 1,690 | 278 |
745786911fb18cea8818bca88a76e9eb06fe4164 | 1,690 | py | Python | setup.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | setup.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | setup.py | vishwesh-vishwesh/HiWi-job | 8953eb744f6e03191b94869e833b44efe74f7bd8 | [
"MIT"
] | null | null | null | import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
__version__ = "unknown"
# "import" __version__
for line in open("sfs/__init__.py"):
if line.startswith("__version__"):
exec(line)
break
# See http://pytest.org/latest/goodpractises.html... | 26.825397 | 78 | 0.645562 | import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
__version__ = "unknown"
# "import" __version__
for line in open("sfs/__init__.py"):
if line.startswith("__version__"):
exec(line)
break
# See http://pytest.org/latest/goodpractises.html... | 342 | 161 | 22 |
1197b0b460bc0ebc958f8300a0f336ec4ff36ff1 | 2,180 | py | Python | PyBank/main.py | mhchopade/python-challenge | 59067e45366bc70e0c7cb583a9714396d7c293a6 | [
"ADSL"
] | null | null | null | PyBank/main.py | mhchopade/python-challenge | 59067e45366bc70e0c7cb583a9714396d7c293a6 | [
"ADSL"
] | null | null | null | PyBank/main.py | mhchopade/python-challenge | 59067e45366bc70e0c7cb583a9714396d7c293a6 | [
"ADSL"
] | null | null | null | import csv
import os
from statistics import mean
csvpath = os.path.join('resources', 'budget_data.csv')
output_file = os.path.join('resources', 'Financial_Analysis.txt')
with open(csvpath, 'r', newline='') as csvfile:
csvreader = csv.reader(csvfile, delimiter=",")
# Defining our dictionaries and lists
da... | 36.333333 | 105 | 0.65 | import csv
import os
from statistics import mean
csvpath = os.path.join('resources', 'budget_data.csv')
output_file = os.path.join('resources', 'Financial_Analysis.txt')
with open(csvpath, 'r', newline='') as csvfile:
csvreader = csv.reader(csvfile, delimiter=",")
# Defining our dictionaries and lists
da... | 0 | 0 | 0 |
93f5e6457524ab4e00a5a10a693541d08ba7cf4b | 749 | py | Python | examples/health_service_examples.py | Sensory-Cloud/python-sdk | 1457987481a7fbddaa6dff6b5b935c1a2c0d7213 | [
"Apache-2.0"
] | 2 | 2022-01-11T21:49:33.000Z | 2022-02-15T23:53:41.000Z | examples/health_service_examples.py | Sensory-Cloud/python-sdk | 1457987481a7fbddaa6dff6b5b935c1a2c0d7213 | [
"Apache-2.0"
] | null | null | null | examples/health_service_examples.py | Sensory-Cloud/python-sdk | 1457987481a7fbddaa6dff6b5b935c1a2c0d7213 | [
"Apache-2.0"
] | null | null | null | import helpers
from sensory_cloud.config import Config
from sensory_cloud.generated.common.common_pb2 import ServerHealthResponse
from sensory_cloud.services.health_service import HealthService
if __name__ == "__main__":
server_health = health_service_example()
| 25.827586 | 74 | 0.76235 | import helpers
from sensory_cloud.config import Config
from sensory_cloud.generated.common.common_pb2 import ServerHealthResponse
from sensory_cloud.services.health_service import HealthService
def health_service_example() -> ServerHealthResponse:
config: Config = Config(
fully_qualified_domain_name=hel... | 456 | 0 | 23 |
575177fc3df4be8720cec71a0b88012981c5e7c4 | 1,772 | py | Python | scripts/workset_validation.py | ssjunnebo/LIMS2DB | 37345ab7a4f6a28bf77c6ece4b69b672b01441e4 | [
"MIT"
] | null | null | null | scripts/workset_validation.py | ssjunnebo/LIMS2DB | 37345ab7a4f6a28bf77c6ece4b69b672b01441e4 | [
"MIT"
] | null | null | null | scripts/workset_validation.py | ssjunnebo/LIMS2DB | 37345ab7a4f6a28bf77c6ece4b69b672b01441e4 | [
"MIT"
] | null | null | null |
from genologics.lims import *
from genologics_sql.utils import *
from genologics.config import BASEURI, USERNAME, PASSWORD
from genologics_sql.tables import Process
from pprint import pprint
import genologics.entities as gent
import LIMS2DB.utils as lutils
import LIMS2DB.classes as lclasses
if __name__ == "__main... | 26.447761 | 111 | 0.572799 |
from genologics.lims import *
from genologics_sql.utils import *
from genologics.config import BASEURI, USERNAME, PASSWORD
from genologics_sql.tables import Process
from pprint import pprint
import genologics.entities as gent
import LIMS2DB.utils as lutils
import LIMS2DB.classes as lclasses
def main(ws_id):
log... | 1,137 | 0 | 46 |
0ffae1173ad09a4c808b81d25ab8e38146700078 | 6,542 | py | Python | api/coverage.py | pic-ed/LibrarySimplifies | 16dd6459b794fb805b7a5e10758b3c151356908a | [
"Apache-2.0"
] | null | null | null | api/coverage.py | pic-ed/LibrarySimplifies | 16dd6459b794fb805b7a5e10758b3c151356908a | [
"Apache-2.0"
] | null | null | null | api/coverage.py | pic-ed/LibrarySimplifies | 16dd6459b794fb805b7a5e10758b3c151356908a | [
"Apache-2.0"
] | null | null | null | """Base classes for CoverageProviders.
The CoverageProviders themselves are in the file corresponding to the
service that needs coverage -- overdrive.py, metadata_wrangler.py, and
so on.
"""
import logging
from lxml import etree
from nose.tools import set_trace
from StringIO import StringIO
from core.coverage import (... | 33.721649 | 83 | 0.682513 | """Base classes for CoverageProviders.
The CoverageProviders themselves are in the file corresponding to the
service that needs coverage -- overdrive.py, metadata_wrangler.py, and
so on.
"""
import logging
from lxml import etree
from nose.tools import set_trace
from StringIO import StringIO
from core.coverage import (... | 637 | 240 | 23 |
92a79538d3b6eeba306f7fd549cc7f4743b22fbc | 10,841 | py | Python | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_5.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | 2 | 2020-08-29T11:37:29.000Z | 2020-09-09T14:46:48.000Z | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_5.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_5.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | 1 | 2020-10-13T00:49:17.000Z | 2020-10-13T00:49:17.000Z | from .__Fundamental_6 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class BeginningCashPositionCashFlowStatement(QuantConnec... | 30.624294 | 171 | 0.731206 | from .__Fundamental_6 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class BeginningCashPositionCashFlowStatement(QuantConnec... | 2,924 | 0 | 1,040 |
8362dfe4ca13727fd2af4c0f69bc5560e5277526 | 231 | py | Python | board/imx6sl/ucube.py | jinlongliu/AliOS-Things | ce051172a775f987183e7aca88bb6f3b809ea7b0 | [
"Apache-2.0"
] | 4 | 2019-03-12T11:04:48.000Z | 2019-10-22T06:06:53.000Z | board/imx6sl/ucube.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 3 | 2018-12-17T13:06:46.000Z | 2018-12-28T01:40:59.000Z | board/imx6sl/ucube.py | IamBaoMouMou/AliOS-Things | 195a9160b871b3d78de6f8cf6c2ab09a71977527 | [
"Apache-2.0"
] | 2 | 2018-01-23T07:54:08.000Z | 2018-01-23T11:38:59.000Z | linux_only_targets="blink bluetooth.ble_bqb netmgrapp bluetooth.blemesh_srv bluetooth.blemesh uDataapp bluetooth.blemesh_cli bluetooth.bleadv wifihalapp hdlcapp.hdlcserver acapp helloworld bluetooth.bleperipheral helloworld_nocli"
| 115.5 | 230 | 0.896104 | linux_only_targets="blink bluetooth.ble_bqb netmgrapp bluetooth.blemesh_srv bluetooth.blemesh uDataapp bluetooth.blemesh_cli bluetooth.bleadv wifihalapp hdlcapp.hdlcserver acapp helloworld bluetooth.bleperipheral helloworld_nocli"
| 0 | 0 | 0 |
76d0908000b90be304a42544e3a9a63bf20f9612 | 6,291 | py | Python | homeassistant/components/zha/entity.py | tubalainen/core | 2ba514253c4981062853f3e1981903d3e4aa803c | [
"Apache-2.0"
] | 4 | 2016-12-23T10:36:36.000Z | 2021-04-22T12:38:16.000Z | homeassistant/components/zha/entity.py | tubalainen/core | 2ba514253c4981062853f3e1981903d3e4aa803c | [
"Apache-2.0"
] | 9 | 2022-01-27T06:32:10.000Z | 2022-03-31T07:07:51.000Z | homeassistant/components/zha/entity.py | tubalainen/core | 2ba514253c4981062853f3e1981903d3e4aa803c | [
"Apache-2.0"
] | 1 | 2020-02-24T16:17:42.000Z | 2020-02-24T16:17:42.000Z | """Entity for Zigbee Home Automation."""
import asyncio
import logging
import time
from homeassistant.core import callback
from homeassistant.helpers import entity
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassista... | 32.595855 | 88 | 0.631855 | """Entity for Zigbee Home Automation."""
import asyncio
import logging
import time
from homeassistant.core import callback
from homeassistant.helpers import entity
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassista... | 0 | 0 | 0 |
0f86fde6926356f76d6719bd63ffbfe6fd5c0107 | 4,597 | py | Python | qiniuyun/qiniustorage.py | chuangkee/mygithub | a3742d45002de55378987eea551776a3168acc17 | [
"MIT"
] | null | null | null | qiniuyun/qiniustorage.py | chuangkee/mygithub | a3742d45002de55378987eea551776a3168acc17 | [
"MIT"
] | null | null | null | qiniuyun/qiniustorage.py | chuangkee/mygithub | a3742d45002de55378987eea551776a3168acc17 | [
"MIT"
] | null | null | null | #coding=utf-8
from __future__ import absolute_import, unicode_literals
# https://github.com/qiniu/python-sdk/blob/master/qiniu/services/storage/uploader.py
# https://developer.qiniu.com/kodo/sdk/python
from qiniu import Auth,put_file,put_data,BucketManager
from .utils import QiniuError, bucket_lister
from os.path impor... | 35.361538 | 104 | 0.501631 | #coding=utf-8
from __future__ import absolute_import, unicode_literals
# https://github.com/qiniu/python-sdk/blob/master/qiniu/services/storage/uploader.py
# https://developer.qiniu.com/kodo/sdk/python
from qiniu import Auth,put_file,put_data,BucketManager
from .utils import QiniuError, bucket_lister
from os.path impor... | 0 | 0 | 0 |
92538b4f3e6f4b70478fde9b50a525f28b979464 | 2,815 | py | Python | qstrader/strategy/intraday_ml_strategy.py | zhengshouzhi/qstrader-master | 5dc888f72a2ddde8497ff7ae44af68524ec8696c | [
"MIT"
] | 1 | 2018-08-27T07:44:39.000Z | 2018-08-27T07:44:39.000Z | qstrader/strategy/intraday_ml_strategy.py | zhengshouzhi/qstrader-master | 5dc888f72a2ddde8497ff7ae44af68524ec8696c | [
"MIT"
] | null | null | null | qstrader/strategy/intraday_ml_strategy.py | zhengshouzhi/qstrader-master | 5dc888f72a2ddde8497ff7ae44af68524ec8696c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.externals import joblib
from qstrader.price_parser import PriceParser
from qstrader.event import (SignalEvent, EventType)
from qstrader.strategy.base import AbstractStrategy
class IntradayMachineLearningPredictionStrategy(AbstractStrategy):
... | 35.1875 | 79 | 0.557726 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.externals import joblib
from qstrader.price_parser import PriceParser
from qstrader.event import (SignalEvent, EventType)
from qstrader.strategy.base import AbstractStrategy
class IntradayMachineLearningPredictionStrategy(AbstractStrategy):
... | 456 | 0 | 27 |
355f0fe9ca296523f85e7b6cb88bd15d74b861dc | 1,795 | py | Python | junit.py | sunilkr/elf-tests | 9401d26aa5ae2778db236297c30e51aeb30c1eec | [
"MIT"
] | null | null | null | junit.py | sunilkr/elf-tests | 9401d26aa5ae2778db236297c30e51aeb30c1eec | [
"MIT"
] | null | null | null | junit.py | sunilkr/elf-tests | 9401d26aa5ae2778db236297c30e51aeb30c1eec | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
from junit_xml import TestSuite, TestCase
if __name__ == "__main__":
ap = argparse.ArgumentParser(add_help=True)
ap.add_argument("-o", "--out", default=None, help="Output file.")
ap.add_argument("input", help="input file")
args = ap.parse_args()
... | 30.948276 | 103 | 0.545404 | #!/usr/bin/env python3
import argparse
import os
from junit_xml import TestSuite, TestCase
def generate_junit_xml(inputfile):
target = None
suite = None
infos = []
errors = []
testcases = []
for line in inputfile:
tag = line[0:3]
props = line[3:].split(':')
if tag == "... | 1,121 | 0 | 23 |
30e022ccf5ae4e7a6809fa4956ae0925247d264e | 2,615 | py | Python | hierarchical-semantic-segmentation/estimator/define_initializers.py | pmeletis/IV2018-hierarchical-semantic-segmentation-for-heterogeneous-datasets | 25a085387181d8f483285d96cf39e5095be63d84 | [
"Apache-2.0"
] | 2 | 2020-08-31T13:50:11.000Z | 2021-08-31T06:00:34.000Z | hierarchical-semantic-segmentation/estimator/define_initializers.py | pmeletis/IV2018-hierarchical-semantic-segmentation-for-heterogeneous-datasets | 25a085387181d8f483285d96cf39e5095be63d84 | [
"Apache-2.0"
] | 3 | 2019-02-20T09:29:48.000Z | 2019-04-14T18:48:00.000Z | hierarchical-semantic-segmentation/estimator/define_initializers.py | pmeletis/IV2018-hierarchical-semantic-segmentation-for-heterogeneous-datasets | 25a085387181d8f483285d96cf39e5095be63d84 | [
"Apache-2.0"
] | 5 | 2018-08-27T03:13:49.000Z | 2019-09-04T03:12:11.000Z | import os
import tensorflow as tf
| 39.029851 | 95 | 0.679924 | import os
import tensorflow as tf
def train_init(config, params, scope='init'):
# different situations for initialization:
# 1) initialize from init_ckpt_path (log_dir has to be empty from checkpoints)
# 2) continue training from log_dir
del config
with tf.name_scope(scope), tf.device('/cpu:0'):
... | 2,556 | 0 | 23 |
1328a1ede1073f87ae628632c526c94e1ddb3ade | 1,992 | py | Python | server_normal_Flask_beautiful/models/comment.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 7 | 2018-02-24T13:41:21.000Z | 2022-02-06T04:59:13.000Z | server_normal_Flask_beautiful/models/comment.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 6 | 2018-02-25T11:50:42.000Z | 2021-12-13T19:55:13.000Z | server_normal_Flask_beautiful/models/comment.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 1 | 2018-03-01T02:43:15.000Z | 2018-03-01T02:43:15.000Z | from models import MonModel, change_time
# from models.user import User
import models.user
# from models.tweet import Tweet # 这样不行
import models.tweet # 为了避免和comment交叉引用
import time
class Comment(MonModel):
"""
__fields__ = [
'_id',
('id', int, -1),
('type', str, ''),
('deleted', bool, False)... | 28.457143 | 80 | 0.565763 | from models import MonModel, change_time
# from models.user import User
import models.user
# from models.tweet import Tweet # 这样不行
import models.tweet # 为了避免和comment交叉引用
import time
class Comment(MonModel):
"""
__fields__ = [
'_id',
('id', int, -1),
('type', str, ''),
('deleted', bool, False)... | 782 | 0 | 134 |
944e9efa841b118b98e620c68fce5f7ed3af6c93 | 4,502 | py | Python | config_srv.py | IcardS-13/PythTTP | 6717a6c2b6593e74d41e1b328a889169a6433fbb | [
"MIT"
] | null | null | null | config_srv.py | IcardS-13/PythTTP | 6717a6c2b6593e74d41e1b328a889169a6433fbb | [
"MIT"
] | null | null | null | config_srv.py | IcardS-13/PythTTP | 6717a6c2b6593e74d41e1b328a889169a6433fbb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 14:04:11 2020
@author: ICARD
"""
#module systeme :
import os.path
import os
import threading
import configparser
Config = configparser.ConfigParser()
verrou = threading.Lock()
def creer_config_defaut():
'''
Ici dans la fonction creer_con... | 35.448819 | 153 | 0.601733 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 14:04:11 2020
@author: ICARD
"""
#module systeme :
import os.path
import os
import threading
import configparser
Config = configparser.ConfigParser()
verrou = threading.Lock()
def creer_config_defaut():
'''
Ici dans la fonction creer_con... | 184 | 0 | 46 |
796fedd9adc4e2939cb94325c4f5c7779990c235 | 488 | py | Python | Chapter_15_Generating_Data/try_15.1/five_cubic.py | charliealpha094/Project_Data_Visualization | ccd55db58927dbbcfd57ab750fe7b21754c2b2dc | [
"MIT"
] | null | null | null | Chapter_15_Generating_Data/try_15.1/five_cubic.py | charliealpha094/Project_Data_Visualization | ccd55db58927dbbcfd57ab750fe7b21754c2b2dc | [
"MIT"
] | null | null | null | Chapter_15_Generating_Data/try_15.1/five_cubic.py | charliealpha094/Project_Data_Visualization | ccd55db58927dbbcfd57ab750fe7b21754c2b2dc | [
"MIT"
] | null | null | null | #Done by Carlos Amaral (19/07/2020)
#Try 15.1- Cubes
import matplotlib.pyplot as plt
x_values = [1, 2, 3, 4, 5]
y_values = [1, 8, 27, 64, 125]
plt.style.use('seaborn')
fig, ax = plt.subplots()
ax.plot(x_values, y_values, linewidth = 3)
#Set chart title and label axes
ax.set_title("Cubic Numbers", fontsize = 24)
... | 21.217391 | 47 | 0.690574 | #Done by Carlos Amaral (19/07/2020)
#Try 15.1- Cubes
import matplotlib.pyplot as plt
x_values = [1, 2, 3, 4, 5]
y_values = [1, 8, 27, 64, 125]
plt.style.use('seaborn')
fig, ax = plt.subplots()
ax.plot(x_values, y_values, linewidth = 3)
#Set chart title and label axes
ax.set_title("Cubic Numbers", fontsize = 24)
... | 0 | 0 | 0 |
6e8980b182687a4077c70c0b48b5464531808ef0 | 681 | py | Python | WoodworkingCalculations/CalcBoardFeet.py | savvysteve/UnitTestingPractice | a0ad1327f13809e61bd1e9434011b843408afe07 | [
"MIT"
] | null | null | null | WoodworkingCalculations/CalcBoardFeet.py | savvysteve/UnitTestingPractice | a0ad1327f13809e61bd1e9434011b843408afe07 | [
"MIT"
] | null | null | null | WoodworkingCalculations/CalcBoardFeet.py | savvysteve/UnitTestingPractice | a0ad1327f13809e61bd1e9434011b843408afe07 | [
"MIT"
] | null | null | null | ## https://github.com/bast/somepackage
## https://github.com/navdeep-G/samplemod
if __name__ == '__main__':
BoardFeet = CalcBoardFeet(8,1,LengthInFeet=8)
print(BoardFeet)
BoardFeet = CalcBoardFeet(7,2,LengthInInches=120)
print(BoardFeet) | 28.375 | 91 | 0.715125 | ## https://github.com/bast/somepackage
## https://github.com/navdeep-G/samplemod
def CalcBoardFeet(WidthInInches, ThicknesInInches, LengthInInches=0, LengthInFeet=0):
if LengthInInches > 0:
BoardFeet = (WidthInInches * LengthInInches * ThicknesInInches) / 144
elif LengthInFeet > 0:
BoardFee... | 399 | 0 | 23 |
3fd0e85217b81464b89832edb31dee814bd076d3 | 65 | py | Python | Chapter 2/printRandom.py | Miillky/automate_the_boring_stuff_with_python | 284b074b0738c66f38b54fe0fc5f69b3446e7e43 | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | Chapter 2/printRandom.py | Miillky/automate_the_boring_stuff_with_python | 284b074b0738c66f38b54fe0fc5f69b3446e7e43 | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | Chapter 2/printRandom.py | Miillky/automate_the_boring_stuff_with_python | 284b074b0738c66f38b54fe0fc5f69b3446e7e43 | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | import random
for i in range(5):
print(random.randint(1, 10)) | 21.666667 | 32 | 0.692308 | import random
for i in range(5):
print(random.randint(1, 10)) | 0 | 0 | 0 |
d11002b3f6a8dde28221e43fb310e01f5fb438b2 | 2,962 | py | Python | lambda/automations/ec2_quarantine_instance.py | hyperglance/aws-rule-automations | b770b2687ffa04a6bad857f3ed6505cf57985022 | [
"MIT"
] | null | null | null | lambda/automations/ec2_quarantine_instance.py | hyperglance/aws-rule-automations | b770b2687ffa04a6bad857f3ed6505cf57985022 | [
"MIT"
] | null | null | null | lambda/automations/ec2_quarantine_instance.py | hyperglance/aws-rule-automations | b770b2687ffa04a6bad857f3ed6505cf57985022 | [
"MIT"
] | 3 | 2021-06-14T04:31:42.000Z | 2021-12-05T23:56:37.000Z | """
This automation Quarantines and EC2 Instance, identified as above or below the configured threshold
by Hyperglance Rule(s)
This automation will operate across accounts, where the appropriate IAM Role exists.
"""
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def hyperglance_automati... | 29.326733 | 128 | 0.593856 | """
This automation Quarantines and EC2 Instance, identified as above or below the configured threshold
by Hyperglance Rule(s)
This automation will operate across accounts, where the appropriate IAM Role exists.
"""
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def hyperglance_automati... | 506 | 0 | 23 |
da8f50a9cc98d97078923fafad6444ed71daca9e | 12,833 | py | Python | Technical_Indicator_Analysis/visualization.py | JingZhang918/master_thesis | f0d3b874a5ac1c55db028f87a7442a18f2d418eb | [
"MIT"
] | null | null | null | Technical_Indicator_Analysis/visualization.py | JingZhang918/master_thesis | f0d3b874a5ac1c55db028f87a7442a18f2d418eb | [
"MIT"
] | null | null | null | Technical_Indicator_Analysis/visualization.py | JingZhang918/master_thesis | f0d3b874a5ac1c55db028f87a7442a18f2d418eb | [
"MIT"
] | null | null | null | from plotly.subplots import make_subplots
import plotly.graph_objs as go
import numpy as np
import pandas as pd
| 30.700957 | 95 | 0.491935 | from plotly.subplots import make_subplots
import plotly.graph_objs as go
import numpy as np
import pandas as pd
def plot_indicator(price_df, save_path, ticker, indicator, signal_df=None, show_signals=False):
# make a 2 x 1 figure
fig = make_subplots(rows=2, cols=1, shared_xaxes=True)
# add candlestick on... | 12,630 | 0 | 92 |
77c50404d43f3b17a5df3d810a1c6b5ec9cfc647 | 1,303 | py | Python | cartridge_tax/tests.py | kenbolton/cartridge-tax | 9bcb4f06991cd839de3695357063baeaec4cdee1 | [
"BSD-2-Clause"
] | 1 | 2015-12-31T17:55:34.000Z | 2015-12-31T17:55:34.000Z | cartridge_tax/tests.py | kenbolton/cartridge-tax | 9bcb4f06991cd839de3695357063baeaec4cdee1 | [
"BSD-2-Clause"
] | null | null | null | cartridge_tax/tests.py | kenbolton/cartridge-tax | 9bcb4f06991cd839de3695357063baeaec4cdee1 | [
"BSD-2-Clause"
] | null | null | null | from decimal import Decimal
from django.test import TestCase
from cartridge.shop.models import Cart
from cartridge.shop.tests import ShopTests
from cartridgetax.handler import default_billship_handler
| 29.613636 | 75 | 0.683039 | from decimal import Decimal
from django.test import TestCase
from cartridge.shop.models import Cart
from cartridge.shop.tests import ShopTests
from cartridgetax.handler import default_billship_handler
class MockRequest(object):
pass
class TaxTests(ShopTests):
#class TaxTests(TestCase):
def setUp(self):
... | 822 | 229 | 46 |
418aa7b0a6b37cdd5ba3a63824e3a19f9c35765b | 8,784 | py | Python | arrview/tools/roi.py | jthacker/arrview | 93d5d0a17a33dbbc7098eb4e5eac92d84d9ba04c | [
"MIT"
] | 1 | 2016-07-25T15:17:17.000Z | 2016-07-25T15:17:17.000Z | arrview/tools/roi.py | jthacker/arrview | 93d5d0a17a33dbbc7098eb4e5eac92d84d9ba04c | [
"MIT"
] | null | null | null | arrview/tools/roi.py | jthacker/arrview | 93d5d0a17a33dbbc7098eb4e5eac92d84d9ba04c | [
"MIT"
] | null | null | null | import logging
import math
import numpy as np
#TODO: Remove this line
from PySide.QtGui import QGraphicsPolygonItem, QImage
from PySide.QtGui import QColor, QGraphicsPixmapItem, QPixmap
from PySide.QtCore import QPoint, QPointF, Qt
from traits.api import Bool, Enum, DelegatesTo, Dict, HasTraits, Instance, Int, List... | 34.719368 | 110 | 0.651867 | import logging
import math
import numpy as np
#TODO: Remove this line
from PySide.QtGui import QGraphicsPolygonItem, QImage
from PySide.QtGui import QColor, QGraphicsPixmapItem, QPixmap
from PySide.QtCore import QPoint, QPointF, Qt
from traits.api import Bool, Enum, DelegatesTo, Dict, HasTraits, Instance, Int, List... | 4,602 | 1,835 | 115 |
e88215e31e852f23bcaa7b1114f919bb9b00d79b | 219 | py | Python | apps/music/apps.py | deniskrumko/dendynotdead | d1fd8b32cf2065413c19799f45487ed317b85eb1 | [
"MIT"
] | null | null | null | apps/music/apps.py | deniskrumko/dendynotdead | d1fd8b32cf2065413c19799f45487ed317b85eb1 | [
"MIT"
] | null | null | null | apps/music/apps.py | deniskrumko/dendynotdead | d1fd8b32cf2065413c19799f45487ed317b85eb1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class MusicConfig(AppConfig):
"""Configuration for ``Music`` app."""
name = 'apps.music'
verbose_name = _('Music')
| 24.333333 | 55 | 0.716895 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class MusicConfig(AppConfig):
"""Configuration for ``Music`` app."""
name = 'apps.music'
verbose_name = _('Music')
| 0 | 0 | 0 |
615829f9a1f47b67e5e70b292d445e4e7ae3d72f | 2,881 | py | Python | Project/script/03_detect_cities_in_2gram.py | mmewen/UTSEUS-DataScience | 179f0f069385cbdd767654df013ca26a59ac3496 | [
"MIT"
] | null | null | null | Project/script/03_detect_cities_in_2gram.py | mmewen/UTSEUS-DataScience | 179f0f069385cbdd767654df013ca26a59ac3496 | [
"MIT"
] | null | null | null | Project/script/03_detect_cities_in_2gram.py | mmewen/UTSEUS-DataScience | 179f0f069385cbdd767654df013ca26a59ac3496 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Use Python 3 !
# Filter 2gram files to keep cities that really exist
# In :
# "../_data/2gram-to/" directory
# "../_out/inverted_cities.json"
# Out :
# "../_out/2gram-to-cities/" directory
# Prerequisite:
# 01, 02
import csv
import json
import time
import os
conj = "t... | 22.507813 | 107 | 0.652204 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Use Python 3 !
# Filter 2gram files to keep cities that really exist
# In :
# "../_data/2gram-to/" directory
# "../_out/inverted_cities.json"
# Out :
# "../_out/2gram-to-cities/" directory
# Prerequisite:
# 01, 02
import csv
import json
import time
import os
conj = "t... | 743 | 0 | 92 |
e25f2f98fd2712bc16a54a98e25db42700fdccbc | 1,409 | py | Python | opticalflow/dataset/flying_things.py | COATZ/PanoFlow | d4ad8efbd9069e469233c206c4d642a2b1a97299 | [
"MIT"
] | 14 | 2022-01-17T10:15:02.000Z | 2022-03-22T12:43:16.000Z | opticalflow/dataset/flying_things.py | MasterHow/PanoFlow | 6c5d4312d0763645c3484cd87a9dc590e1642f00 | [
"MIT"
] | 1 | 2022-03-14T23:11:58.000Z | 2022-03-17T01:04:31.000Z | opticalflow/dataset/flying_things.py | MasterHow/PanoFlow | 6c5d4312d0763645c3484cd87a9dc590e1642f00 | [
"MIT"
] | 1 | 2022-03-17T11:27:18.000Z | 2022-03-17T11:27:18.000Z | import os.path as osp
from glob import glob
from .base_flow import FlowDataset
| 40.257143 | 78 | 0.493967 | import os.path as osp
from glob import glob
from .base_flow import FlowDataset
class FlyingThings3D(FlowDataset):
def __init__(self,
aug_params=None,
root='datasets/FlyingThings3D',
dstype='frames_cleanpass'):
super(FlyingThings3D, self).__init__(aug_pa... | 1,265 | 13 | 50 |
956e8d95c3de4178e6ee40e6880bced7f885c745 | 4,340 | py | Python | pyobs/vfs/gzippipe.py | pyobs/pyobs-core | e3401e63eb31587c2bc535f7346b7e4ef69d64ab | [
"MIT"
] | 4 | 2020-02-14T10:50:03.000Z | 2022-03-25T04:15:06.000Z | pyobs/vfs/gzippipe.py | pyobs/pyobs-core | e3401e63eb31587c2bc535f7346b7e4ef69d64ab | [
"MIT"
] | 60 | 2020-09-14T09:10:20.000Z | 2022-03-25T17:51:42.000Z | pyobs/vfs/gzippipe.py | pyobs/pyobs-core | e3401e63eb31587c2bc535f7346b7e4ef69d64ab | [
"MIT"
] | 2 | 2020-10-14T09:34:57.000Z | 2021-04-27T09:35:57.000Z | import io
import subprocess
import logging
import os
import gzip
from .vfs import VFSFile
log = logging.getLogger(__name__)
class GzipReader(VFSFile, io.RawIOBase):
"""A pipe object that takes a file-like object as input and acts itself like a stream,
decompressing data on the fly."""
__module__ = 'pyo... | 25.833333 | 116 | 0.550461 | import io
import subprocess
import logging
import os
import gzip
from .vfs import VFSFile
log = logging.getLogger(__name__)
class GzipReader(VFSFile, io.RawIOBase):
"""A pipe object that takes a file-like object as input and acts itself like a stream,
decompressing data on the fly."""
__module__ = 'pyo... | 0 | 0 | 0 |
4058daca87082dc47cf7dca366f609a0c88dae32 | 123 | py | Python | models/__init__.py | Ramesh-X/ModelViewer | e1d67d5ca1bc71db6c1c67b5bc6d4ac13be16799 | [
"MIT"
] | 1 | 2019-11-19T22:06:36.000Z | 2019-11-19T22:06:36.000Z | models/__init__.py | Ramesh-X/ModelViewer | e1d67d5ca1bc71db6c1c67b5bc6d4ac13be16799 | [
"MIT"
] | null | null | null | models/__init__.py | Ramesh-X/ModelViewer | e1d67d5ca1bc71db6c1c67b5bc6d4ac13be16799 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .densenet161 import densenet_no_top
from .resnet50_notop import resnet50_notop
| 30.75 | 42 | 0.886179 | from __future__ import absolute_import
from .densenet161 import densenet_no_top
from .resnet50_notop import resnet50_notop
| 0 | 0 | 0 |