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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3310368135e649bf028187ed7a04013100b76b9e | 4,905 | py | Python | python/registration_gui.py | zivy/ISBI2018_TUTORIAL | 4fa3d695982785f858fc35ac3ff02822bf5a1cdd | [
"Apache-2.0"
] | 26 | 2018-03-15T19:46:16.000Z | 2022-01-11T11:26:28.000Z | python/registration_gui.py | zivy/ISBI2018_TUTORIAL | 4fa3d695982785f858fc35ac3ff02822bf5a1cdd | [
"Apache-2.0"
] | 1 | 2018-04-02T15:27:13.000Z | 2018-04-02T16:12:04.000Z | python/registration_gui.py | zivy/ISBI2018_TUTORIAL | 4fa3d695982785f858fc35ac3ff02822bf5a1cdd | [
"Apache-2.0"
] | 16 | 2018-03-16T13:50:03.000Z | 2021-09-11T08:11:46.000Z | import SimpleITK as sitk
import matplotlib.pyplot as plt
import numpy as np
#
# Set of methods used for displaying the registration metric during the optimization.
#
# Callback invoked when the StartEvent happens, sets up our new data.
# Callback invoked when the EndEvent happens, do cleanup of data and figure.
#... | 44.189189 | 116 | 0.66422 | import SimpleITK as sitk
import matplotlib.pyplot as plt
import numpy as np
#
# Set of methods used for displaying the registration metric during the optimization.
#
# Callback invoked when the StartEvent happens, sets up our new data.
def start_plot():
global metric_values, multires_iterations, ax, fig
fig,... | 829 | 0 | 88 |
f4b2b6a614552cb471ee1018cb6473daef2454ed | 4,499 | py | Python | valet/utils/protobuf/communicate_pb2.py | sadmicrowave/valet | 39724c3f2a49b2253e89044af2b103e3e89d4cd8 | [
"MIT"
] | null | null | null | valet/utils/protobuf/communicate_pb2.py | sadmicrowave/valet | 39724c3f2a49b2253e89044af2b103e3e89d4cd8 | [
"MIT"
] | null | null | null | valet/utils/protobuf/communicate_pb2.py | sadmicrowave/valet | 39724c3f2a49b2253e89044af2b103e3e89d4cd8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: communicate.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | 31.243056 | 329 | 0.759724 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: communicate.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.pro... | 0 | 0 | 0 |
00abcc7f4cf9a20a02896d0e5d048eb36a63e80c | 2,801 | py | Python | main.py | TheWithz/discord-selfbot.py | 848fb994a4a8e2a1ccb69a948219b7ce356e8ad3 | [
"MIT"
] | null | null | null | main.py | TheWithz/discord-selfbot.py | 848fb994a4a8e2a1ccb69a948219b7ce356e8ad3 | [
"MIT"
] | null | null | null | main.py | TheWithz/discord-selfbot.py | 848fb994a4a8e2a1ccb69a948219b7ce356e8ad3 | [
"MIT"
] | null | null | null | import asyncio
import json
import os
import aiofiles
import discord
with open('config.json') as f:
config = json.load(f)
if __name__ == '__main__':
main()
| 30.445652 | 82 | 0.482685 | import asyncio
import json
import os
import aiofiles
import discord
with open('config.json') as f:
config = json.load(f)
class Bot(discord.Client):
def __init__(self):
super(Bot, self).__init__()
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print... | 2,454 | 5 | 172 |
46cc55d2fe6b35ca6e90b4d3845fd8292a1109ea | 1,769 | py | Python | pyformlang/pda/utils.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 15 | 2020-06-25T14:38:27.000Z | 2022-03-09T17:55:07.000Z | pyformlang/pda/utils.py | IlyaEp/pyformlang | eef239844beff5e9da3be4a4a240440ece81c10b | [
"MIT"
] | 11 | 2020-09-23T09:48:35.000Z | 2021-08-24T08:37:47.000Z | pyformlang/pda/utils.py | YaccConstructor/pyformlang | df640e13524c5d835ddcdedf25d8246fc73d7b88 | [
"MIT"
] | 5 | 2020-03-08T19:00:17.000Z | 2021-08-15T12:38:05.000Z | """ Useful functions for a PDA """
from .state import State
from .symbol import Symbol
from .stack_symbol import StackSymbol
from .epsilon import Epsilon
class PDAObjectCreator:
"""
A Object in a PDA
"""
def to_state(self, given):
""" Convert to a state """
if isinstance(given, State... | 30.5 | 72 | 0.63143 | """ Useful functions for a PDA """
from .state import State
from .symbol import Symbol
from .stack_symbol import StackSymbol
from .epsilon import Epsilon
class PDAObjectCreator:
"""
A Object in a PDA
"""
def __init__(self):
self._state_creator = dict()
self._symbol_creator = dict()
... | 456 | 0 | 73 |
fed03a781b64a2ca6afd5bacbc8faa8e99b33252 | 1,144 | py | Python | bottrust/solve.py | corbinmcneill/codejam | 5156fec100c73eb95969a91fd20bf411aec4b795 | [
"Apache-2.0"
] | null | null | null | bottrust/solve.py | corbinmcneill/codejam | 5156fec100c73eb95969a91fd20bf411aec4b795 | [
"Apache-2.0"
] | null | null | null | bottrust/solve.py | corbinmcneill/codejam | 5156fec100c73eb95969a91fd20bf411aec4b795 | [
"Apache-2.0"
] | null | null | null |
infile = open("input.txt")
T =int(infile.readline().strip())
for t in range(1, T+1):
solve(t, infile.readline().split(' '))
| 23.833333 | 94 | 0.627622 | def opp(x):
return (x+1)%2
def solve(casenum, inlist):
inlist.pop(0)
pos=[1,1]
time=0
waitingOn = 0
queue = []
while len(inlist) > 0:
queue.append((1 if inlist.pop(0)=='O' else 0, int(inlist.pop(0))))
primary = queue.pop(0)
while len(queue) > 0:
waitingOn = primary[0]
primetime = abs(primary[1] - po... | 970 | 0 | 46 |
4b318a33f234812471367a2b69c153781e83ecf3 | 797 | py | Python | pyisis/tests/check_performance.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | null | null | null | pyisis/tests/check_performance.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | null | null | null | pyisis/tests/check_performance.py | rodsenra/pyisis | f5815fd096a463902893f87f309f8117b5705621 | [
"MIT"
] | 2 | 2019-11-08T20:51:54.000Z | 2021-08-17T23:49:48.000Z | # -*- coding: utf-8 -*-
"""
File to test Isis performance
"""
__created__ = "2007-05-15"
__updated__ = "2008-05-15"
__author__ = "Rodrigo Senra <rsenra@acm.org>"
# Setup test environment
from timeit import Timer
from pyisis.tests.config_tests import test_data, Lyer, initialize
config = initialize()
setup="""
from ... | 20.435897 | 65 | 0.668758 | # -*- coding: utf-8 -*-
"""
File to test Isis performance
"""
__created__ = "2007-05-15"
__updated__ = "2008-05-15"
__author__ = "Rodrigo Senra <rsenra@acm.org>"
# Setup test environment
from timeit import Timer
from pyisis.tests.config_tests import test_data, Lyer, initialize
config = initialize()
setup="""
from ... | 273 | 0 | 23 |
f7e28024155c4f77c948f2b05fb0f54a2779a2c3 | 5,412 | py | Python | unify_eval/model/keras_model.py | goesslfabian/unify-eval | ced486e44ca57ed31b552fd20b53cae61015e486 | [
"Apache-2.0"
] | 3 | 2021-02-18T10:40:29.000Z | 2022-01-28T10:20:54.000Z | unify_eval/model/keras_model.py | goesslfabian/unify-eval | ced486e44ca57ed31b552fd20b53cae61015e486 | [
"Apache-2.0"
] | 8 | 2020-11-13T19:00:13.000Z | 2022-02-10T02:10:28.000Z | unify_eval/model/keras_model.py | goesslfabian/unify-eval | ced486e44ca57ed31b552fd20b53cae61015e486 | [
"Apache-2.0"
] | 1 | 2021-06-23T12:37:12.000Z | 2021-06-23T12:37:12.000Z | from typing import Dict, List
import numpy as np
from keras import utils
from keras.engine import Layer
from keras.layers import Embedding
from keras.models import Sequential
from keras.preprocessing import text, sequence
from unify_eval.model.mixins.classification import DeepModel, Classifier
from unify_eval.model.t... | 35.84106 | 104 | 0.592203 | from typing import Dict, List
import numpy as np
from keras import utils
from keras.engine import Layer
from keras.layers import Embedding
from keras.models import Sequential
from keras.preprocessing import text, sequence
from unify_eval.model.mixins.classification import DeepModel, Classifier
from unify_eval.model.t... | 1,121 | 0 | 188 |
8c2ffadb64c357fa253ed239b739f7970fd7159f | 1,833 | py | Python | learning/base-language/custom-errors/custom-error-2.py | gerryw1389/python | 74fedaf2034769f2865659f14d332026b9aaede3 | [
"MIT"
] | 2 | 2020-12-01T17:29:09.000Z | 2020-12-13T02:54:43.000Z | learning/base-language/custom-errors/custom-error-2.py | gerryw1389/python | 74fedaf2034769f2865659f14d332026b9aaede3 | [
"MIT"
] | 4 | 2020-12-26T15:08:02.000Z | 2021-05-16T13:19:33.000Z | learning/base-language/custom-errors/custom-error-2.py | gerryw1389/python | 74fedaf2034769f2865659f14d332026b9aaede3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
################################################################
# Check for 'myfile.csv' in a certain directory
# Since this has more than two lines, it will output the files contents
# You should also try renaming to 'myfile3.csv' and re-running to ensure it catches it
#######################... | 33.944444 | 104 | 0.624659 | #!/usr/bin/env python3
################################################################
# Check for 'myfile.csv' in a certain directory
# Since this has more than two lines, it will output the files contents
# You should also try renaming to 'myfile3.csv' and re-running to ensure it catches it
#######################... | 0 | 16 | 22 |
e92a4323942d5e185d2ec4d2a8f20702a5940c71 | 3,429 | py | Python | DIKB/DIKB_Utils.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | 3 | 2015-06-08T17:58:54.000Z | 2022-03-10T18:49:44.000Z | DIKB/DIKB_Utils.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | null | null | null | DIKB/DIKB_Utils.py | dbmi-pitt/DIKB-Evidence-analytics | 9ffd629db30c41ced224ff2afdf132ce9276ae3f | [
"MIT"
] | null | null | null | ## The Drug Interaction Knowledge Base (DIKB) is (C) Copyright 2005 by
## Richard Boyce
## Original Authors:
## Richard Boyce
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; eithe... | 45.118421 | 132 | 0.649169 | ## The Drug Interaction Knowledge Base (DIKB) is (C) Copyright 2005 by
## Richard Boyce
## Original Authors:
## Richard Boyce
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; eithe... | 0 | 0 | 0 |
3f33f3dcee520339082c17e485022226b8479d5f | 4,828 | py | Python | tests/functional/test_empty_value.py | mazzi/tartiflette | 54ffdcb97f3ef0ea8b87ea3378790221cdb08e0b | [
"MIT"
] | 530 | 2019-06-04T11:45:36.000Z | 2022-03-31T09:29:56.000Z | tests/functional/test_empty_value.py | mazzi/tartiflette | 54ffdcb97f3ef0ea8b87ea3378790221cdb08e0b | [
"MIT"
] | 242 | 2019-06-04T11:53:08.000Z | 2022-03-28T07:06:27.000Z | tests/functional/test_empty_value.py | mazzi/tartiflette | 54ffdcb97f3ef0ea8b87ea3378790221cdb08e0b | [
"MIT"
] | 36 | 2019-06-21T06:40:27.000Z | 2021-11-04T13:11:16.000Z | import pytest
from tartiflette import Resolver, create_engine
_SDL = """
type bobby {
c: String
}
type boby {
b: bobby!
}
type bob {
a: boby
}
type Query {
string1: String!
stringList: [String]
stringListNonNull: [String]!
nonNullStringList: [String!]
nonNullStringListNonNull: [Str... | 27.276836 | 111 | 0.440969 | import pytest
from tartiflette import Resolver, create_engine
_SDL = """
type bobby {
c: String
}
type boby {
b: bobby!
}
type bob {
a: boby
}
type Query {
string1: String!
stringList: [String]
stringListNonNull: [String]!
nonNullStringList: [String!]
nonNullStringListNonNull: [Str... | 707 | 0 | 110 |
e2257060548bbe94947020be6e7151c54ae4f973 | 673 | py | Python | tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/extmod/uasyncio_fair.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | # Test fairness of scheduler
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
asyncio.run(main())
| 19.228571 | 44 | 0.592868 | # Test fairness of scheduler
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task(id, t):
print("task start", id)
while True:
if t > 0:
print("task work", id)
a... | 414 | 0 | 46 |
8f572daf819a48b89eb252616a9f6be2ccd086e9 | 5,767 | py | Python | assessment/views.py | ma2th/vfat-server | 3ccf98159c0b404e42cd8b2b66593130d8575c00 | [
"Apache-2.0"
] | null | null | null | assessment/views.py | ma2th/vfat-server | 3ccf98159c0b404e42cd8b2b66593130d8575c00 | [
"Apache-2.0"
] | null | null | null | assessment/views.py | ma2th/vfat-server | 3ccf98159c0b404e42cd8b2b66593130d8575c00 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Matthias Ring
# Machine Learning and Data Analytics Lab
# Friedrich-Alexander-University Erlangen-Nuremberg
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 42.718519 | 119 | 0.710075 | # Copyright 2019 Matthias Ring
# Machine Learning and Data Analytics Lab
# Friedrich-Alexander-University Erlangen-Nuremberg
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 4,566 | 0 | 207 |
70b67168ab77c3dc1229b30dab4060805c01673a | 770 | py | Python | python/Orbits/OrbitColor.py | PaulAustin/sb7 | e7e7f9f85387d16f6069ed8e98192bd387d8cf95 | [
"MIT"
] | null | null | null | python/Orbits/OrbitColor.py | PaulAustin/sb7 | e7e7f9f85387d16f6069ed8e98192bd387d8cf95 | [
"MIT"
] | null | null | null | python/Orbits/OrbitColor.py | PaulAustin/sb7 | e7e7f9f85387d16f6069ed8e98192bd387d8cf95 | [
"MIT"
] | null | null | null | # Turtles in space
import turtle
sky = turtle.Screen()
sky.tracer(0)
sky.bgcolor('black')
rocket = turtle.Turtle()
rocket.speed(0)
rocket.color('green')
a = 10.0
b = 28.0
c = 8.0/3.0
x = y = z= 1.0e-1
#x = y = z= 1.0e-200
tic = 0.0
sky.ontimer(tictoc, 5)
| 16.73913 | 31 | 0.509091 | # Turtles in space
import turtle
sky = turtle.Screen()
sky.tracer(0)
sky.bgcolor('black')
rocket = turtle.Turtle()
rocket.speed(0)
rocket.color('green')
a = 10.0
b = 28.0
c = 8.0/3.0
x = y = z= 1.0e-1
#x = y = z= 1.0e-200
def setColor(x, y, z):
r = min(abs(x+0.5), 1.0)
g = min(abs(y+0.5), 1.0)
b = min(ab... | 442 | 0 | 68 |
d1a33930c9561630af9fd3336226f039547dac00 | 27,966 | py | Python | pesummary/gw/conversions/remnant.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 1 | 2021-08-03T05:58:20.000Z | 2021-08-03T05:58:20.000Z | pesummary/gw/conversions/remnant.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 1 | 2020-06-13T13:29:35.000Z | 2020-06-15T12:45:04.000Z | pesummary/gw/conversions/remnant.py | pesummary/pesummary | 99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8 | [
"MIT"
] | 3 | 2021-07-08T08:31:28.000Z | 2022-03-31T14:08:58.000Z | # Licensed under an MIT style license -- see LICENSE.md
import numpy as np
from pesummary.utils.utils import logger, iterator
from pesummary.utils.decorators import array_input
from .spins import chi_p
__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"]
try:
import lalsimulation
from lalsimulation import (
... | 37.997283 | 87 | 0.667525 | # Licensed under an MIT style license -- see LICENSE.md
import numpy as np
from pesummary.utils.utils import logger, iterator
from pesummary.utils.decorators import array_input
from .spins import chi_p
__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"]
try:
import lalsimulation
from lalsimulation import (
... | 419 | 0 | 27 |
76beea20d465eec4a5cee6eba183bfc6d0f150c4 | 9,159 | py | Python | nrc/nrc/spiders/PAPermitScraper.py | SkyTruth/scraper | c1903a74c717a7b36a05f0f466c51544911c4499 | [
"MIT"
] | 2 | 2016-07-01T02:41:17.000Z | 2020-04-04T16:16:55.000Z | nrc/nrc/spiders/PAPermitScraper.py | SkyTruth/scraper | c1903a74c717a7b36a05f0f466c51544911c4499 | [
"MIT"
] | 4 | 2015-01-14T17:00:12.000Z | 2015-06-29T19:36:27.000Z | nrc/nrc/spiders/PAPermitScraper.py | SkyTruth/scraper | c1903a74c717a7b36a05f0f466c51544911c4499 | [
"MIT"
] | null | null | null | # PA Well Permit Scraper
import re
from datetime import datetime, timedelta
import xlrd
#import uuid
from string import Template
from xml.sax.saxutils import escape
from dateutil.parser import parse as parse_date
from scrapy.spider import BaseSpider
from scrapy.contrib.loader import ItemLoader
from scrapy.http import... | 42.402778 | 155 | 0.599301 | # PA Well Permit Scraper
import re
from datetime import datetime, timedelta
import xlrd
#import uuid
from string import Template
from xml.sax.saxutils import escape
from dateutil.parser import parse as parse_date
from scrapy.spider import BaseSpider
from scrapy.contrib.loader import ItemLoader
from scrapy.http import... | 8,115 | 319 | 23 |
ee78a57c8a14d6b4c72780cf061ac7ed488b5e03 | 3,941 | py | Python | cryptobrute.py | mustafasayilan/cryptobrute | 855959ebc04388e12ea786133ab8eb2f464cf637 | [
"MIT"
] | 8 | 2021-06-14T21:02:47.000Z | 2022-03-17T20:57:20.000Z | cryptobrute.py | mustafasayilan/cryptobrute | 855959ebc04388e12ea786133ab8eb2f464cf637 | [
"MIT"
] | 4 | 2021-06-17T17:24:19.000Z | 2022-03-18T16:22:26.000Z | cryptobrute.py | mustafasayilan/cryptobrute | 855959ebc04388e12ea786133ab8eb2f464cf637 | [
"MIT"
] | 2 | 2021-06-25T09:44:14.000Z | 2021-10-08T17:42:06.000Z | from bitcoinaddress import Wallet
import os
from multiprocessing import Process
import argparse
import sys
import signal
# Set the signal handler
signal.signal(signal.SIGINT, handler)
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output", action='store', dest='output', help="Results will wr... | 30.550388 | 134 | 0.544278 | from bitcoinaddress import Wallet
import os
from multiprocessing import Process
import argparse
import sys
import signal
def handler(signum, frame):
print('Exiting')
sys.exit()
# Set the signal handler
signal.signal(signal.SIGINT, handler)
parser = argparse.ArgumentParser()
parser.add_argument("... | 2,338 | 18 | 203 |
5e3dafd6d0e7593121c3eb1051224de153348874 | 1,180 | py | Python | src/tasks.py | artinnok/billing-gateway | fbb0b358066a0038e775e6a9c4d40bcdf8f79e8e | [
"MIT"
] | null | null | null | src/tasks.py | artinnok/billing-gateway | fbb0b358066a0038e775e6a9c4d40bcdf8f79e8e | [
"MIT"
] | 4 | 2021-03-18T23:34:38.000Z | 2021-06-04T22:27:26.000Z | src/tasks.py | artinnok/billing-gateway | fbb0b358066a0038e775e6a9c4d40bcdf8f79e8e | [
"MIT"
] | 1 | 2020-02-11T09:20:30.000Z | 2020-02-11T09:20:30.000Z | import django
from django.conf import settings
from django.db import transaction
from django.contrib.auth import get_user_model
django.setup()
from billing.models import Account, Payment
from billing.utils import complete_payment
USER = get_user_model()
| 25.652174 | 55 | 0.619492 | import django
from django.conf import settings
from django.db import transaction
from django.contrib.auth import get_user_model
django.setup()
from billing.models import Account, Payment
from billing.utils import complete_payment
USER = get_user_model()
def init_account(user_id):
with transaction.atomic():
... | 874 | 0 | 46 |
dd3763f11f7171672cdad6d6acbf95ff8acd06bb | 6,545 | py | Python | cride/circles/views/memberships.py | jecs580/django_second_app | ef04b48342ef560eac8f58540ba684e5eb7d7926 | [
"MIT"
] | null | null | null | cride/circles/views/memberships.py | jecs580/django_second_app | ef04b48342ef560eac8f58540ba684e5eb7d7926 | [
"MIT"
] | 2 | 2019-12-24T00:03:49.000Z | 2019-12-24T00:03:50.000Z | cride/circles/views/memberships.py | jecs580/django_second_app | ef04b48342ef560eac8f58540ba684e5eb7d7926 | [
"MIT"
] | null | null | null | """Vistas de miembros del círculo"""
# Django REST Framework
from rest_framework import mixins, viewsets, status
from rest_framework.generics import get_object_or_404
from rest_framework.decorators import action
from rest_framework.response import Response
# Models
from cride.circles.models import Circle, Membership,... | 45.451389 | 112 | 0.676394 | """Vistas de miembros del círculo"""
# Django REST Framework
from rest_framework import mixins, viewsets, status
from rest_framework.generics import get_object_or_404
from rest_framework.decorators import action
from rest_framework.response import Response
# Models
from cride.circles.models import Circle, Membership,... | 0 | 0 | 0 |
c668b9611e35ba029b366d3fe235af37c06dfa5b | 2,369 | py | Python | mmmeta/backend/base.py | simonwoerpel/mmmeta | 3b130c859f0251f0a90af4423c47c91c0d5b496f | [
"MIT"
] | 4 | 2021-05-31T18:59:01.000Z | 2021-06-27T23:15:26.000Z | mmmeta/backend/base.py | simonwoerpel/mmmeta | 3b130c859f0251f0a90af4423c47c91c0d5b496f | [
"MIT"
] | null | null | null | mmmeta/backend/base.py | simonwoerpel/mmmeta | 3b130c859f0251f0a90af4423c47c91c0d5b496f | [
"MIT"
] | null | null | null | import json
import os
from ..util import cast, datetime_to_json
class Backend:
"""
base class for metadir backends.
currently only local filesystem backend implemented.
"""
def get_base_path(self):
"""return a base path to a local file dir or a cloud bucket"""
raise NotImplemente... | 29.246914 | 83 | 0.629802 | import json
import os
from ..util import cast, datetime_to_json
class Backend:
"""
base class for metadir backends.
currently only local filesystem backend implemented.
"""
def __init__(self, data_root):
self.data_root = data_root
self.base_path = self.get_base_path()
def __... | 334 | 0 | 135 |
5762199f83ef7cf6fdb43234108f9b42447293d5 | 3,947 | py | Python | fencing/diagram/FencingEntity.py | cqtran/Cmput_401_Fence_Friends | 98a25359e3801212e5afaaf71d1191870f73d608 | [
"Apache-2.0"
] | null | null | null | fencing/diagram/FencingEntity.py | cqtran/Cmput_401_Fence_Friends | 98a25359e3801212e5afaaf71d1191870f73d608 | [
"Apache-2.0"
] | null | null | null | fencing/diagram/FencingEntity.py | cqtran/Cmput_401_Fence_Friends | 98a25359e3801212e5afaaf71d1191870f73d608 | [
"Apache-2.0"
] | null | null | null | import math
from decimal import Decimal
# Used for rotations:
# https://stackoverflow.com/questions/34372480/rotate-point-about-another-point-in-degrees-python/34374437#34374437
# Accessed November 17, 2017
class Post:
"""A post"""
def displayString(self):
"""Return this item as it would be displayed to the use... | 22.683908 | 115 | 0.657968 | import math
from decimal import Decimal
# Used for rotations:
# https://stackoverflow.com/questions/34372480/rotate-point-about-another-point-in-degrees-python/34374437#34374437
# Accessed November 17, 2017
class Post:
"""A post"""
def __init__(self, postType, x, y, isRemoval=False):
self.entityType = "post"
s... | 2,016 | 0 | 480 |
349f64833648c7a6bb0330713d700aa416d68e30 | 8,314 | py | Python | source/module/memory_helper_v2.py | siat-nlp/TTOS | 524ac690b01415818dd17b045692795db55f1552 | [
"MIT"
] | 14 | 2020-10-12T11:43:04.000Z | 2022-03-11T07:12:12.000Z | source/module/memory_helper_v2.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | 1 | 2020-11-16T17:07:40.000Z | 2021-04-21T08:42:17.000Z | source/module/memory_helper_v2.py | siat-nlp/MGMA | 71b07cba6c18a916fe491f552402405387400294 | [
"Apache-2.0"
] | 3 | 2020-11-29T13:36:42.000Z | 2021-11-29T10:36:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: source/module/memory_helper.py
"""
import torch
import torch.nn as nn
| 47.238636 | 128 | 0.60332 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: source/module/memory_helper.py
"""
import torch
import torch.nn as nn
class KnowledgeMemoryv2(nn.Module):
def __init__(self,
query_size,
memory_size,
hidden_size,
max_hop=1,
... | 4,047 | 4,105 | 25 |
dd4abb2ea03219fe9b4715144457ad9fc8a13898 | 2,230 | py | Python | config/settings/env.example.py | hbvj99/market-api | 489c9433556002cb391b93cbd6486da739c2418a | [
"MIT"
] | 1 | 2021-08-28T05:30:40.000Z | 2021-08-28T05:30:40.000Z | config/settings/env.example.py | hbvj99/market-api | 489c9433556002cb391b93cbd6486da739c2418a | [
"MIT"
] | 1 | 2022-01-14T08:57:19.000Z | 2022-01-14T08:57:20.000Z | config/settings/env.example.py | hbvj99/market-api | 489c9433556002cb391b93cbd6486da739c2418a | [
"MIT"
] | 1 | 2022-01-11T10:14:27.000Z | 2022-01-11T10:14:27.000Z | from datetime import timedelta
from .base import *
SECRET_KEY = ''
DEBUG = True
ALLOWED_HOSTS = '*'
INSTALLED_APPS += [
'drf_yasg'
]
INTERNAL_IPS = ['127.0.0.1', ] # required for drf_yasg
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.SessionAuthentication'] + \
... | 22.989691 | 110 | 0.676682 | from datetime import timedelta
from .base import *
SECRET_KEY = ''
DEBUG = True
ALLOWED_HOSTS = '*'
INSTALLED_APPS += [
'drf_yasg'
]
INTERNAL_IPS = ['127.0.0.1', ] # required for drf_yasg
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = ['rest_framework.authentication.SessionAuthentication'] + \
... | 0 | 0 | 0 |
7ecf764ca531cde0ebfa413f6cef01952df65a81 | 416 | py | Python | accounts/forms.py | EstherWaweru/Ecommerce-Backend | 2e0c1328d669c51e0786bde31c5feca648897875 | [
"MIT"
] | 5 | 2021-02-24T15:17:36.000Z | 2022-02-26T22:25:06.000Z | accounts/forms.py | EstherWaweru/Ecommerce-Backend | 2e0c1328d669c51e0786bde31c5feca648897875 | [
"MIT"
] | 5 | 2021-02-24T13:52:50.000Z | 2021-04-21T15:37:23.000Z | accounts/forms.py | EstherWaweru/Ecommerce-Backend | 2e0c1328d669c51e0786bde31c5feca648897875 | [
"MIT"
] | 1 | 2021-02-17T14:12:19.000Z | 2021-02-17T14:12:19.000Z | from django.contrib.auth.forms import UserCreationForm
from .models import User
from django import forms
| 32 | 73 | 0.757212 | from django.contrib.auth.forms import UserCreationForm
from .models import User
from django import forms
class SignUpForm(UserCreationForm):
class Meta:
model=User
fields=('email','first_name','last_name','password1','password2')
class LoginForm(forms.Form):
email=forms.CharField()
password=... | 0 | 266 | 44 |
2a466d17f5958a202a4ed6b24cc4a465e028f11d | 2,298 | py | Python | catalogService/handler_apache.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | 3 | 2015-06-10T19:31:17.000Z | 2017-11-29T07:04:12.000Z | catalogService/handler_apache.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | null | null | null | catalogService/handler_apache.py | sassoftware/-catalog-service | 4b68af224842a2e93f7a4bacdac1fc262ae7b917 | [
"Apache-2.0"
] | 2 | 2016-02-04T00:51:15.000Z | 2020-07-24T00:22:44.000Z | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.054054 | 78 | 0.735857 | #!/usr/bin/python
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 452 | 316 | 69 |
ea46f3168358363f5a637b7a03fc6a11c0722d89 | 4,805 | py | Python | udaru_anomaly_detection/cli/insert.py | nearform/udaru-anomaly-detection | ffae43713ef51135f6cf32e9244a5af098f888fe | [
"Apache-2.0"
] | 4 | 2018-06-11T15:35:07.000Z | 2021-03-16T14:19:31.000Z | udaru_anomaly_detection/cli/insert.py | nearform/udaru-anomaly-detection | ffae43713ef51135f6cf32e9244a5af098f888fe | [
"Apache-2.0"
] | null | null | null | udaru_anomaly_detection/cli/insert.py | nearform/udaru-anomaly-detection | ffae43713ef51135f6cf32e9244a5af098f888fe | [
"Apache-2.0"
] | 1 | 2019-04-04T16:36:19.000Z | 2019-04-04T16:36:19.000Z |
import datetime
from udaru_anomaly_detection.trail.insert import trail_insert
from udaru_anomaly_detection.tests.generator import generate_resource
| 30.605096 | 75 | 0.441831 |
import datetime
from udaru_anomaly_detection.trail.insert import trail_insert
from udaru_anomaly_detection.tests.generator import generate_resource
def insert(args):
for resource_i, resource in enumerate(generate_resource(100, 'train')):
print(f'insert [train]: {resource}')
trail_insert(
... | 4,631 | 0 | 23 |
de4cf2d04f8b6b65c62b52449a76f4089e5a7ae5 | 1,536 | py | Python | face_detection_mtcnn.py | zjxgithub/mtcnn-pytorch | b0a76c84fc2794e898aff3465bdeffd013616493 | [
"MIT"
] | null | null | null | face_detection_mtcnn.py | zjxgithub/mtcnn-pytorch | b0a76c84fc2794e898aff3465bdeffd013616493 | [
"MIT"
] | null | null | null | face_detection_mtcnn.py | zjxgithub/mtcnn-pytorch | b0a76c84fc2794e898aff3465bdeffd013616493 | [
"MIT"
] | null | null | null | from src import detect_faces, show_bboxes
from PIL import Image
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
img_path = '/net/deepfake-defense/datasets/CelebA/img/img_celeba/'
pert_path = '/net/deepfake-defense/datasets/CelebA/img/MTCNN_ifgsm/'
result_f = open('/home/zhujunxiao/protect_face_identity/face_image_... | 48 | 146 | 0.692057 | from src import detect_faces, show_bboxes
from PIL import Image
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
img_path = '/net/deepfake-defense/datasets/CelebA/img/img_celeba/'
pert_path = '/net/deepfake-defense/datasets/CelebA/img/MTCNN_ifgsm/'
result_f = open('/home/zhujunxiao/protect_face_identity/face_image_... | 0 | 0 | 0 |
6dafa7f39f8db7ea07fba93e25e731b3e174ed07 | 3,897 | py | Python | magcoords_v0.17.py | gregstarr/cartomap | 46f0917c4315dede1a12a663de80cdde0ae73393 | [
"MIT"
] | 5 | 2019-06-21T01:18:20.000Z | 2021-03-21T22:17:40.000Z | magcoords_v0.17.py | mrinalghosh/cartomap | 741c5916ad180b382dd1e60e5c8bb5168899c878 | [
"MIT"
] | 1 | 2019-06-10T13:05:18.000Z | 2019-06-10T13:05:18.000Z | magcoords_v0.17.py | mrinalghosh/cartomap | 741c5916ad180b382dd1e60e5c8bb5168899c878 | [
"MIT"
] | 4 | 2018-08-29T00:08:39.000Z | 2020-06-02T21:51:19.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 14:08:42 2019
@author: smrak
"""
import numpy as np
from cartomap import geogmap as gm
from datetime import datetime
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import apexpy as ap
latlim = [-0,60]
lonlim= [-140,0]
date = datetim... | 40.175258 | 123 | 0.561714 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 20 14:08:42 2019
@author: smrak
"""
import numpy as np
from cartomap import geogmap as gm
from datetime import datetime
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import apexpy as ap
latlim = [-0,60]
lonlim= [-140,0]
date = datetim... | 0 | 0 | 0 |
90b32c2a68a416c3472e5dabbfb1919af076c658 | 4,194 | py | Python | agent/agents.py | diegcr/2D-Motion-Retargeting | 2b4acedb45a281d2867c812fce6063dc68b8e88b | [
"MIT"
] | 2 | 2019-08-20T18:31:44.000Z | 2019-08-20T18:39:04.000Z | agent/agents.py | diegcr/2D-Motion-Retargeting | 2b4acedb45a281d2867c812fce6063dc68b8e88b | [
"MIT"
] | null | null | null | agent/agents.py | diegcr/2D-Motion-Retargeting | 2b4acedb45a281d2867c812fce6063dc68b8e88b | [
"MIT"
] | null | null | null | from agent.base_agent import BaseAgent
from functional.motion import get_foot_vel
import torch
| 47.123596 | 114 | 0.596328 | from agent.base_agent import BaseAgent
from functional.motion import get_foot_vel
import torch
class Agent2x(BaseAgent):
def __init__(self, config, net):
super(Agent2x, self).__init__(config, net)
self.inputs_name = ['input1', 'input2', 'input12', 'input21']
self.targets_name = ['target1',... | 3,937 | 8 | 152 |
f5e992e91eca6adf82b3dad2c408676155551138 | 1,136 | py | Python | visan/examples/SCI_NL__1P_spectral_readout.py | ercumentaksoy/visan | 57c9257d80622fc0ab03591db48cc2155bd12f1b | [
"MIT",
"BSD-3-Clause"
] | 7 | 2020-04-09T05:21:03.000Z | 2022-01-23T18:39:02.000Z | visan/examples/SCI_NL__1P_spectral_readout.py | ercumentaksoy/visan | 57c9257d80622fc0ab03591db48cc2155bd12f1b | [
"MIT",
"BSD-3-Clause"
] | 7 | 2020-01-05T19:19:20.000Z | 2020-05-27T09:41:49.000Z | visan/examples/SCI_NL__1P_spectral_readout.py | ercumentaksoy/visan | 57c9257d80622fc0ab03591db48cc2155bd12f1b | [
"MIT",
"BSD-3-Clause"
] | 4 | 2020-04-18T14:11:22.000Z | 2021-11-10T02:27:49.000Z | # This is an example VISAN script for the SCI_NL__1P product
# Make sure to set the 'products-file directory' option in the VISAN Preferences panel to
# a directory containing SCI_NL__1P products.
# This example will then take the first product it finds in this directory and
# for that product plot the measured limb ... | 34.424242 | 98 | 0.712148 | # This is an example VISAN script for the SCI_NL__1P product
# Make sure to set the 'products-file directory' option in the VISAN Preferences panel to
# a directory containing SCI_NL__1P products.
# This example will then take the first product it finds in this directory and
# for that product plot the measured limb ... | 748 | 0 | 23 |
aacb1e500ae26ed3efe067878478f2b7a74cc7a0 | 154 | py | Python | wsgi_multi/wsgi.py | ned2/dash-embed-recipes | ff495afd0e1293125957c86cac7b3953521d4895 | [
"MIT"
] | 1 | 2019-01-21T12:38:27.000Z | 2019-01-21T12:38:27.000Z | wsgi_multi/wsgi.py | ned2/dash-embed-recipes | ff495afd0e1293125957c86cac7b3953521d4895 | [
"MIT"
] | null | null | null | wsgi_multi/wsgi.py | ned2/dash-embed-recipes | ff495afd0e1293125957c86cac7b3953521d4895 | [
"MIT"
] | null | null | null | from server import server
from app1 import app as app1
from app2 import app as app2
app1.enable_dev_tools(debug=True)
app2.enable_dev_tools(debug=True)
| 19.25 | 33 | 0.818182 | from server import server
from app1 import app as app1
from app2 import app as app2
app1.enable_dev_tools(debug=True)
app2.enable_dev_tools(debug=True)
| 0 | 0 | 0 |
06d9344638a0e4528c9018bd45590f8835132b7c | 1,688 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/docker/plugins/module_utils/socket_helper.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 7 | 2021-11-16T04:05:42.000Z | 2022-02-19T21:14:29.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/docker/plugins/module_utils/socket_helper.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/docker/plugins/module_utils/socket_helper.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2022-03-01T05:43:07.000Z | 2022-03-01T05:43:07.000Z | # Copyright (c) 2019-2021, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import fcntl
import os
import os.path
import socket as pysocket
from ansibl... | 31.259259 | 108 | 0.677133 | # Copyright (c) 2019-2021, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import fcntl
import os
import os.path
import socket as pysocket
from ansibl... | 1,242 | 0 | 92 |
392aa847b676c6ae4c0ce9254f3f9d819e5bb6ac | 7,438 | py | Python | scripts/match-pr-to-feedstocks.py | ax3l/conda-forge.github.io | 2086f087d3b2875c4493e38c2f71b1ccc5304ffd | [
"BSD-3-Clause"
] | null | null | null | scripts/match-pr-to-feedstocks.py | ax3l/conda-forge.github.io | 2086f087d3b2875c4493e38c2f71b1ccc5304ffd | [
"BSD-3-Clause"
] | null | null | null | scripts/match-pr-to-feedstocks.py | ax3l/conda-forge.github.io | 2086f087d3b2875c4493e38c2f71b1ccc5304ffd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env conda-execute
# conda execute
# env:
# - python
# - click
# - jinja2
# - requests
# - ruamel.yaml
# - conda-smithy
# - pygithub
# - fuzzywuzzy
# channels:
# - conda-forge
# run_with: python
import click
import conda_smithy.feedstocks as feedstocks
import jinja2
import json
import requests
impo... | 36.106796 | 96 | 0.654477 | #!/usr/bin/env conda-execute
# conda execute
# env:
# - python
# - click
# - jinja2
# - requests
# - ruamel.yaml
# - conda-smithy
# - pygithub
# - fuzzywuzzy
# channels:
# - conda-forge
# run_with: python
import click
import conda_smithy.feedstocks as feedstocks
import jinja2
import json
import requests
impo... | 2,394 | 17 | 215 |
e5e0d12a9e36fc5f92b96a631ff6de1286ac2249 | 1,566 | py | Python | application/mod_collage/col_controllers.py | hieusydo/Voyage | 2a98118131fad927326d318ae1766e64bbb5add8 | [
"MIT"
] | 1 | 2018-04-23T05:16:49.000Z | 2018-04-23T05:16:49.000Z | application/mod_collage/col_controllers.py | hieusydo/Voyage | 2a98118131fad927326d318ae1766e64bbb5add8 | [
"MIT"
] | null | null | null | application/mod_collage/col_controllers.py | hieusydo/Voyage | 2a98118131fad927326d318ae1766e64bbb5add8 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, session, redirect, url_for
from flask_wtf import FlaskForm
from wtforms import SelectField
from application.mod_collage.photoManip import generateCollage
from application.mod_auth.models import Landmark
mod_collage = Blueprint('collage', __name__, url_prefix='/collage')
... | 32.625 | 72 | 0.716475 | from flask import Blueprint, render_template, session, redirect, url_for
from flask_wtf import FlaskForm
from wtforms import SelectField
from application.mod_collage.photoManip import generateCollage
from application.mod_auth.models import Landmark
mod_collage = Blueprint('collage', __name__, url_prefix='/collage')
... | 945 | 174 | 44 |
0af5e91130c6574093b9682b307fb1019139a663 | 2,201 | py | Python | siteblog/blog/migrations/0001_initial.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | siteblog/blog/migrations/0001_initial.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | siteblog/blog/migrations/0001_initial.py | vladislavnet/siteblog | f8e0b139c974a78d5de17671768c34d214c025fe | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-05 12:46
from django.db import migrations, models
import django.db.models.deletion
| 39.303571 | 135 | 0.545207 | # Generated by Django 3.1.6 on 2021-02-05 12:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 0 | 2,081 | 23 |
b2b8567fa0354d9e623bba8b14d8a1f37a000693 | 7,750 | py | Python | autoreload/autoreload.py | jarret/plugins | 65304d4baf3d6a0254148be0fd851789c152d8d3 | [
"BSD-3-Clause"
] | null | null | null | autoreload/autoreload.py | jarret/plugins | 65304d4baf3d6a0254148be0fd851789c152d8d3 | [
"BSD-3-Clause"
] | null | null | null | autoreload/autoreload.py | jarret/plugins | 65304d4baf3d6a0254148be0fd851789c152d8d3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from lightning import Plugin
import json
import psutil
import subprocess
import threading
import time
import os
try:
# C-lightning v0.7.2
plugin = Plugin(dynamic=False)
except:
plugin = Plugin()
@plugin.init()
def inject_manifest(plugin, manifest):
"""Once we have the manife... | 31.25 | 117 | 0.572645 | #!/usr/bin/env python3
from lightning import Plugin
import json
import psutil
import subprocess
import threading
import time
import os
try:
# C-lightning v0.7.2
plugin = Plugin(dynamic=False)
except:
plugin = Plugin()
class ChildPlugin(object):
def __init__(self, path, plugin):
self.path = p... | 4,365 | 1,318 | 45 |
15cd974602f7b171557d6e3634177554bb7eed60 | 2,239 | py | Python | hard-gists/1381489/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/1381489/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/1381489/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
try:
dialog.deleteLater()
except:
pass
dialog = show()
| 30.671233 | 111 | 0.652523 | from PyQt4 import QtCore, QtGui
import maya.cmds as cmds
import maya.OpenMayaUI as mui
import sip
class MyDialog(QtGui.QDialog):
def __init__(self, parent, **kwargs):
super(MyDialog, self).__init__(parent, **kwargs)
self.setObjectName("MyWindow")
self.resize(800, 600)
s... | 1,939 | 9 | 100 |
61e3d943b4cd0789dbc0aead054385cc47d08639 | 2,124 | py | Python | fitbert/tests.py | tranvien98/fit_bert | 0857aacaaa5358c3111bb57d675c9edfed8654c8 | [
"Apache-2.0"
] | 67 | 2019-07-15T02:26:14.000Z | 2021-08-29T07:16:12.000Z | fitbert/tests.py | tranvien98/fit_bert | 0857aacaaa5358c3111bb57d675c9edfed8654c8 | [
"Apache-2.0"
] | 12 | 2019-07-12T22:14:25.000Z | 2021-09-06T12:41:13.000Z | fitbert/tests.py | tranvien98/fit_bert | 0857aacaaa5358c3111bb57d675c9edfed8654c8 | [
"Apache-2.0"
] | 14 | 2019-10-04T00:56:38.000Z | 2021-08-11T03:35:56.000Z | import pytest
from fitbert import FitBert
from fitbert.delemmatize import Delemmatizer
dl = Delemmatizer()
"""
def test_masker_works_without_instantiating():
masked_string, masked = FitBert.mask(
"This might be justified to signalling the connection between drunken driving and fatal accidents.",
... | 29.5 | 121 | 0.649718 | import pytest
from fitbert import FitBert
from fitbert.delemmatize import Delemmatizer
dl = Delemmatizer()
def test_delemmatizer_instantiates():
assert Delemmatizer() is not None, "It instantiates"
def test_delemmatizer_callable():
assert callable(dl), "Delemmatizer instance should be callable"
def test_... | 1,488 | 0 | 114 |
a84817ea7d662e7c6e5a6852c3ddb16144d004f0 | 729 | py | Python | src/orders/services/order_is_paid_setter.py | vaibhavantil2/education-backend | ae36f6652d8b120f13d3859874d5051ddbef7092 | [
"MIT"
] | null | null | null | src/orders/services/order_is_paid_setter.py | vaibhavantil2/education-backend | ae36f6652d8b120f13d3859874d5051ddbef7092 | [
"MIT"
] | null | null | null | src/orders/services/order_is_paid_setter.py | vaibhavantil2/education-backend | ae36f6652d8b120f13d3859874d5051ddbef7092 | [
"MIT"
] | 1 | 2021-12-22T06:46:05.000Z | 2021-12-22T06:46:05.000Z | from django.utils import timezone
from orders.models import Order
class OrderIsPaidSetter:
"""Mark order as paid"""
| 28.038462 | 85 | 0.647462 | from django.utils import timezone
from orders.models import Order
class OrderIsPaidSetter:
"""Mark order as paid"""
def __init__(self, order: Order, silent=False):
self.order = order
self.silent = silent
self.is_already_paid = (order.paid is not None)
def __call__(self):
... | 499 | 0 | 107 |
d30bb470de738f9f6f1fb2cbbd6f7dac331f9e25 | 4,783 | py | Python | swift_iam_role/swift_iam_role.py | sijuvj/quickstart-swift-digital-connectivity | 741eb7422987f9cbde28746443d466351906ce1a | [
"Apache-2.0"
] | null | null | null | swift_iam_role/swift_iam_role.py | sijuvj/quickstart-swift-digital-connectivity | 741eb7422987f9cbde28746443d466351906ce1a | [
"Apache-2.0"
] | null | null | null | swift_iam_role/swift_iam_role.py | sijuvj/quickstart-swift-digital-connectivity | 741eb7422987f9cbde28746443d466351906ce1a | [
"Apache-2.0"
] | null | null | null | """Nested Stack for the sample IAM Role creation for Managing SWIFT components"""
from typing import List
from aws_cdk import (
aws_rds as _rds,
aws_iam as _iam
)
from constructs import Construct
from aws_cdk import NestedStack
class SwiftIAMRole(NestedStack):
"""Nested Stack for the sample IAM Role creat... | 45.990385 | 99 | 0.593142 | """Nested Stack for the sample IAM Role creation for Managing SWIFT components"""
from typing import List
from aws_cdk import (
aws_rds as _rds,
aws_iam as _iam
)
from constructs import Construct
from aws_cdk import NestedStack
class SwiftIAMRole(NestedStack):
"""Nested Stack for the sample IAM Role creat... | 416 | 0 | 26 |
2593d84834118e5edba7d5ac56debf357570d58b | 1,192 | py | Python | s3prl/downstream/ctc/corpus/downsample_cv.py | hhhaaahhhaa/s3prl | a469787f05c42196c4d989555082f5fd9dcbe8a6 | [
"Apache-2.0"
] | 1 | 2022-03-15T04:04:23.000Z | 2022-03-15T04:04:23.000Z | s3prl/downstream/ctc/corpus/downsample_cv.py | hhhaaahhhaa/s3prl | a469787f05c42196c4d989555082f5fd9dcbe8a6 | [
"Apache-2.0"
] | 2 | 2021-12-08T14:52:39.000Z | 2021-12-12T09:33:08.000Z | s3prl/downstream/ctc/corpus/downsample_cv.py | hhhaaahhhaa/s3prl | a469787f05c42196c4d989555082f5fd9dcbe8a6 | [
"Apache-2.0"
] | null | null | null | import argparse
import csv
from os.path import join
from pathlib import Path
from tqdm import tqdm
import torch
import torchaudio
import numpy as np
from librosa import resample
if __name__ == "__main__":
main()
| 25.913043 | 78 | 0.621644 | import argparse
import csv
from os.path import join
from pathlib import Path
from tqdm import tqdm
import torch
import torchaudio
import numpy as np
from librosa import resample
def read_processed_tsv(path):
with open(path, "r") as fp:
rows = csv.reader(fp, delimiter="\t")
file_list = []
... | 925 | 0 | 46 |
2e9e400801bf584b334ce06ed106835a338d64f7 | 1,474 | py | Python | Kseg2annANN.py | kejitan/ESVGscale | d4674d7ba3c897e25c010b3e1bceb3ca421adcd3 | [
"CC-BY-4.0"
] | null | null | null | Kseg2annANN.py | kejitan/ESVGscale | d4674d7ba3c897e25c010b3e1bceb3ca421adcd3 | [
"CC-BY-4.0"
] | 7 | 2021-04-21T01:01:12.000Z | 2022-03-12T00:18:22.000Z | Kseg2annANN.py | kejitan/ESVGscale | d4674d7ba3c897e25c010b3e1bceb3ca421adcd3 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python
import os
from PIL import Image
import glob, os
from tqdm import tqdm
import six
#import cv2
import pandas as pd
from keras_segmentation.data_utils.data_loader import get_image_array, get_segmentation_array
import numpy as np
import re
import json
from pandas.io.json import json_normalize
impor... | 22.333333 | 93 | 0.629579 | #!/usr/bin/env python
import os
from PIL import Image
import glob, os
from tqdm import tqdm
import six
#import cv2
import pandas as pd
from keras_segmentation.data_utils.data_loader import get_image_array, get_segmentation_array
import numpy as np
import re
import json
from pandas.io.json import json_normalize
impor... | 1,097 | 0 | 23 |
000d0dce0600f816e990894a0f4ae04b12802ab8 | 771 | py | Python | Part_3_advanced/m03_date_and_time/date_iso_calendar_and_weekday/homework_1_solution/new_movies/cinema_schedule.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m03_date_and_time/date_iso_calendar_and_weekday/homework_1_solution/new_movies/cinema_schedule.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | Part_3_advanced/m03_date_and_time/date_iso_calendar_and_weekday/homework_1_solution/new_movies/cinema_schedule.py | Mikma03/InfoShareacademy_Python_Courses | 3df1008c8c92831bebf1625f960f25b39d6987e6 | [
"MIT"
] | null | null | null | from enum import Enum, auto
from new_movies import movies_directory
weekly_schedule = {
Weekday.MONDAY: movies_directory.available_movies[0:2],
Weekday.TUESDAY: movies_directory.available_movies[2:4],
Weekday.WEDNESDAY: movies_directory.available_movies[4:6],
Weekday.THURSDAY: movies_directory.avail... | 26.586207 | 63 | 0.736706 | from enum import Enum, auto
from new_movies import movies_directory
class Weekday(Enum):
MONDAY = auto()
TUESDAY = auto()
WEDNESDAY = auto()
THURSDAY = auto()
FRIDAY = auto()
SATURDAY = auto()
SUNDAY = auto()
weekly_schedule = {
Weekday.MONDAY: movies_directory.available_movies[0:2]... | 50 | 147 | 46 |
964acf6bcfdb818f7ae341ce8f450e261785e925 | 3,351 | py | Python | sara_flexbe_behaviors/src/sara_flexbe_behaviors/check_reachability_sm.py | WalkingMachine/sara_behaviors | fcb55d274331915cd39d7d444546f17a39f85a44 | [
"BSD-3-Clause"
] | 5 | 2018-05-07T19:58:08.000Z | 2021-04-21T10:49:05.000Z | sara_flexbe_behaviors/src/sara_flexbe_behaviors/check_reachability_sm.py | WalkingMachine/sara_behaviors | fcb55d274331915cd39d7d444546f17a39f85a44 | [
"BSD-3-Clause"
] | 21 | 2017-05-26T01:20:06.000Z | 2021-01-26T23:03:36.000Z | sara_flexbe_behaviors/src/sara_flexbe_behaviors/check_reachability_sm.py | WalkingMachine/sara_behaviors | fcb55d274331915cd39d7d444546f17a39f85a44 | [
"BSD-3-Clause"
] | 2 | 2019-07-22T07:21:20.000Z | 2019-11-11T20:49:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | 32.852941 | 115 | 0.626977 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] ta... | 2,182 | 0 | 48 |
d0d3ee91c9b8767fd459ff0b851864c764d98ba6 | 2,489 | py | Python | uu/formlibrary/upgrades/reindexer.py | mostscript/uu.formlibrary | a7f5819abac7c1ddea69ddee8fce465d45f4d1d5 | [
"BSD-4-Clause-UC"
] | null | null | null | uu/formlibrary/upgrades/reindexer.py | mostscript/uu.formlibrary | a7f5819abac7c1ddea69ddee8fce465d45f4d1d5 | [
"BSD-4-Clause-UC"
] | null | null | null | uu/formlibrary/upgrades/reindexer.py | mostscript/uu.formlibrary | a7f5819abac7c1ddea69ddee8fce465d45f4d1d5 | [
"BSD-4-Clause-UC"
] | null | null | null | import sys
import transaction
from zope.component.hooks import setSite
PKGNAME = 'uu.formlibrary'
PROFILE = 'profile-%s:default' % PKGNAME
_installed = lambda site: site.portal_quickinstaller.isProductInstalled
product_installed = lambda site, name: _installed(site)(name)
if __name__ == '__main__' and 'app' i... | 30.353659 | 78 | 0.634793 | import sys
import transaction
from zope.component.hooks import setSite
PKGNAME = 'uu.formlibrary'
PROFILE = 'profile-%s:default' % PKGNAME
_installed = lambda site: site.portal_quickinstaller.isProductInstalled
product_installed = lambda site, name: _installed(site)(name)
def stale_catalog_entries(site, catalog=N... | 1,878 | 0 | 92 |
e764e1f40a98967bf941bfbb2600858b41fd38ee | 1,364 | py | Python | brain/missing_incorrect_files.py | neuropoly/lesion-mapping | 48365fec608b0a4bce8c613c937b2b7f26317470 | [
"MIT"
] | null | null | null | brain/missing_incorrect_files.py | neuropoly/lesion-mapping | 48365fec608b0a4bce8c613c937b2b7f26317470 | [
"MIT"
] | null | null | null | brain/missing_incorrect_files.py | neuropoly/lesion-mapping | 48365fec608b0a4bce8c613c937b2b7f26317470 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# This script helps at the generation or correction of groundtruths.
#
# Usage: python missing_incorrect_files.py <pickle_filename>
# where <pickle_filename> has been generated by '0_check_data.py'.
# e.g. python missing_incorrect_files.py 201809192209_incorrect_lesion.pkl
#
# Charley Gros 20... | 28.416667 | 111 | 0.703079 | #!/usr/bin/env python
#
# This script helps at the generation or correction of groundtruths.
#
# Usage: python missing_incorrect_files.py <pickle_filename>
# where <pickle_filename> has been generated by '0_check_data.py'.
# e.g. python missing_incorrect_files.py 201809192209_incorrect_lesion.pkl
#
# Charley Gros 20... | 187 | 0 | 23 |
56cb0d99986ba98be7c75318cc32a218466d3d93 | 10,142 | py | Python | scripts/rouge_analysis.py | olizhu10/newsroom | 0a6dccd21da28892cc089e0924c53e0723b42785 | [
"Apache-2.0"
] | null | null | null | scripts/rouge_analysis.py | olizhu10/newsroom | 0a6dccd21da28892cc089e0924c53e0723b42785 | [
"Apache-2.0"
] | null | null | null | scripts/rouge_analysis.py | olizhu10/newsroom | 0a6dccd21da28892cc089e0924c53e0723b42785 | [
"Apache-2.0"
] | 1 | 2019-10-04T03:24:35.000Z | 2019-10-04T03:24:35.000Z | from rouge import Rouge
import csv
"""Creates a csv file with rouge scores between summaries in a cluster"""
CLUSTERS = {
'sandy':[
"After Sandy hit the East Coast Monday night, more than 2 million New Jersey residents were left without power and feeling powerless",
"Superstorm Sandy crashed ashore this week, cuttin... | 60.369048 | 318 | 0.686945 | from rouge import Rouge
import csv
"""Creates a csv file with rouge scores between summaries in a cluster"""
def rouge(cluster):
matrix1 = []
matrix2 = []
matrixl = []
for summary1 in cluster:
scores1 = []
scores2 = []
scoresl = []
for summary2 in cluster:
r... | 4,233 | 0 | 92 |
a392f556d31a226a84e5dcaedacfa7b0401a58a5 | 3,422 | py | Python | dearpygui_ext/simple_table.py | Atlamillias/DearPyGui_Ext | 7f8e500988c697d6e006af625065a2065537f56e | [
"MIT"
] | 27 | 2021-08-19T16:10:23.000Z | 2022-03-25T16:53:11.000Z | dearpygui_ext/simple_table.py | Atlamillias/DearPyGui_Ext | 7f8e500988c697d6e006af625065a2065537f56e | [
"MIT"
] | 4 | 2021-08-23T23:30:14.000Z | 2022-02-21T19:27:44.000Z | dearpygui_ext/simple_table.py | Atlamillias/DearPyGui_Ext | 7f8e500988c697d6e006af625065a2065537f56e | [
"MIT"
] | 4 | 2021-08-19T16:10:39.000Z | 2022-02-12T05:20:28.000Z | import dearpygui._dearpygui as internal_dpg
import dearpygui.dearpygui as dpg
# 0.6 functions
# * add_column
# * delete_column
# * set_table_data
# * get_table_data
# * get_table_item
# * set_table_item
# * get_table_selections
# * set_table_selections
# * insert_column
# * insert_row
# * set_hea... | 34.918367 | 122 | 0.579778 | import dearpygui._dearpygui as internal_dpg
import dearpygui.dearpygui as dpg
# 0.6 functions
# * add_column
# * delete_column
# * set_table_data
# * get_table_data
# * get_table_item
# * set_table_item
# * get_table_selections
# * set_table_selections
# * insert_column
# * insert_row
# * set_hea... | 2,912 | -1 | 185 |
0acac77f99130902d3f1059af0697c6e56b0ebbd | 12,283 | py | Python | article/experiments/exp13.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | 2 | 2018-08-23T06:54:17.000Z | 2021-03-05T14:38:41.000Z | article/experiments/exp13.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | null | null | null | article/experiments/exp13.py | andycasey/mcfa | 8c4135e665e47006e9ca725e8bfc67315508366e | [
"MIT"
] | null | null | null |
"""
Experiment using all GALAH data.
"""
from __future__ import division # Just in case. Use Python 3.
import os
import sys
import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import yaml
from matplotlib.ticker import MaxNLocator
from collections import Counter
from scipy import linalg... | 29.175772 | 183 | 0.642107 |
"""
Experiment using all GALAH data.
"""
from __future__ import division # Just in case. Use Python 3.
import os
import sys
import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import yaml
from matplotlib.ticker import MaxNLocator
from collections import Counter
from scipy import linalg... | 488 | 0 | 46 |
a910f16a21bfa52d0e32dae6f790623e2eaac9f2 | 38 | py | Python | feeds/tests/__init__.py | RamezIssac/djangopackages | 2b54b0ae95ef805c07ca3c0b9c5184466b65c23a | [
"MIT"
] | 383 | 2015-05-06T03:51:51.000Z | 2022-03-26T07:56:44.000Z | feeds/tests/__init__.py | RamezIssac/djangopackages | 2b54b0ae95ef805c07ca3c0b9c5184466b65c23a | [
"MIT"
] | 257 | 2017-04-17T08:31:16.000Z | 2022-03-27T02:30:49.000Z | feeds/tests/__init__.py | RamezIssac/djangopackages | 2b54b0ae95ef805c07ca3c0b9c5184466b65c23a | [
"MIT"
] | 105 | 2017-04-17T06:21:26.000Z | 2022-03-30T05:24:19.000Z | from feeds.tests.test_latest import *
| 19 | 37 | 0.815789 | from feeds.tests.test_latest import *
| 0 | 0 | 0 |
e67ed531cbda0b0c671afd7ecd25b2ee8474f03a | 1,268 | py | Python | SIP/src/peer/server/__init__.py | trishantpahwa/Session-Initiation-Protocol | 5b770dbb9533fbe3a8ff31fc583576cc107e5ba8 | [
"MIT"
] | 3 | 2019-06-18T18:21:05.000Z | 2021-07-15T06:28:25.000Z | SIP/src/peer/server/__init__.py | trishantpahwa/Session-Initiation-Protocol | 5b770dbb9533fbe3a8ff31fc583576cc107e5ba8 | [
"MIT"
] | 4 | 2019-01-30T11:31:13.000Z | 2019-03-06T12:36:54.000Z | SIP/src/peer/server/__init__.py | trishantpahwa/Session-Initiation-Protocol | 5b770dbb9533fbe3a8ff31fc583576cc107e5ba8 | [
"MIT"
] | 1 | 2019-08-12T11:31:23.000Z | 2019-08-12T11:31:23.000Z | # Sample TCP Server
'''from server import server
server_name = 'server'
domain = '192.168.1.218'
protocol = 'TCP'
port = '5060'
server_network_name = 'SERVER'
content_type = 'application'
content_sub_type = 'sdp'
server_ = server(server_name, domain, protocol, port, server_network_name,
content_type... | 24.862745 | 74 | 0.721609 | # Sample TCP Server
'''from server import server
server_name = 'server'
domain = '192.168.1.218'
protocol = 'TCP'
port = '5060'
server_network_name = 'SERVER'
content_type = 'application'
content_sub_type = 'sdp'
server_ = server(server_name, domain, protocol, port, server_network_name,
content_type... | 0 | 0 | 0 |
fb7f5797b0a8a40e01914660c71d0962e8e429dc | 841 | py | Python | Analysis/tests/ParserTests.py | ashishnitinpatil/resanalysersite | 0604d2fed4760be741c4d90b6d230d0f2cd8bf9e | [
"CC-BY-4.0"
] | null | null | null | Analysis/tests/ParserTests.py | ashishnitinpatil/resanalysersite | 0604d2fed4760be741c4d90b6d230d0f2cd8bf9e | [
"CC-BY-4.0"
] | null | null | null | Analysis/tests/ParserTests.py | ashishnitinpatil/resanalysersite | 0604d2fed4760be741c4d90b6d230d0f2cd8bf9e | [
"CC-BY-4.0"
] | null | null | null | import unittest
import random
from Analysis.ResAnalyser import PDF_Parser
# Pro tip - Am a noob at Testing :|
class ParserTests(unittest.TestCase):
"""
All tests for PDFParser class & all it's methods go here
"""
if __name__ == '__main__':
unittest.main()
| 24.028571 | 61 | 0.650416 | import unittest
import random
from Analysis.ResAnalyser import PDF_Parser
# Pro tip - Am a noob at Testing :|
class ParserTests(unittest.TestCase):
"""
All tests for PDFParser class & all it's methods go here
"""
def setUp(self):
self.parser = PDF_Parser(testing=True)
def test_is_credit(s... | 405 | 0 | 161 |
4d21e2bbb3f7199438454942c63073b8ad992302 | 5,027 | py | Python | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_parse.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 11,356 | 2017-12-08T19:42:32.000Z | 2022-03-31T16:55:25.000Z | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_parse.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 2,402 | 2017-12-08T22:31:01.000Z | 2022-03-28T19:25:52.000Z | src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/test/test_parse.py | cookingcodewithme/turicreate | a89e203d60529d2d72547c03ec9753ea979ee342 | [
"BSD-3-Clause"
] | 1,343 | 2017-12-08T19:47:19.000Z | 2022-03-26T11:31:36.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import unittest
import pytest
pytest.importorskip("tensorflow", minversion=... | 39.896825 | 88 | 0.655262 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import unittest
import pytest
pytest.importorskip("tensorflow", minversion=... | 4,153 | 193 | 23 |
3002f2f09fa463bc36f6a4afa3490d0ddcbaccac | 4,581 | py | Python | tsmtool/tarsnap.py | rstms/tsmtool | 97ce28e398185d983a96dc2787274946bfab5553 | [
"MIT"
] | null | null | null | tsmtool/tarsnap.py | rstms/tsmtool | 97ce28e398185d983a96dc2787274946bfab5553 | [
"MIT"
] | 1 | 2022-03-28T11:07:36.000Z | 2022-03-28T11:07:36.000Z | tsmtool/tarsnap.py | rstms/tsmtool | 97ce28e398185d983a96dc2787274946bfab5553 | [
"MIT"
] | null | null | null | # Tarsnap - tarsnap website interface
import datetime
from pathlib import Path
import requests
from bs4 import BeautifulSoup, element
URL = "https://www.tarsnap.com"
| 29.554839 | 79 | 0.505566 | # Tarsnap - tarsnap website interface
import datetime
from pathlib import Path
import requests
from bs4 import BeautifulSoup, element
URL = "https://www.tarsnap.com"
class Tarsnap:
def __init__(self, config_file, account=None, email=None, password=None):
self.url = URL
self.account = account o... | 4,207 | -7 | 211 |
96f267c168e1d5d5937fae5a5b39d3b15c98c832 | 395 | py | Python | simple_fun_#204_smallest_integer.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | simple_fun_#204_smallest_integer.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | simple_fun_#204_smallest_integer.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Simple Fun #204: Smallest Integer
#Problem level: 7 kyu
from itertools import groupby, chain
| 24.6875 | 90 | 0.61519 | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Simple Fun #204: Smallest Integer
#Problem level: 7 kyu
from itertools import groupby, chain
def smallest_integer(matrix):
min = pos = 0
for key,_ in groupby([x for x in sorted(list(chain.from_iterable(matrix))) if x>=0]):
if key==min:
min... | 228 | 0 | 22 |
55df1dbbfc5a5b8a80f1ba121da64e4465ba79b1 | 608 | py | Python | urbanairship/devices/__init__.py | rodsenra/python-library | bd3fb129ee0eb72265f6d0f2f03fd9e8184dcac0 | [
"Apache-2.0"
] | null | null | null | urbanairship/devices/__init__.py | rodsenra/python-library | bd3fb129ee0eb72265f6d0f2f03fd9e8184dcac0 | [
"Apache-2.0"
] | null | null | null | urbanairship/devices/__init__.py | rodsenra/python-library | bd3fb129ee0eb72265f6d0f2f03fd9e8184dcac0 | [
"Apache-2.0"
] | null | null | null | from .devicelist import (
ChannelList,
ChannelInfo,
DeviceTokenList,
APIDList,
DeviceInfo,
)
from .tag import (
ChannelTags,
OpenChannelTags
)
from .segment import (
Segment,
SegmentList
)
from .channel_uninstall import (
ChannelUninstall
)
from .open_channel import (
Ope... | 12.16 | 32 | 0.669408 | from .devicelist import (
ChannelList,
ChannelInfo,
DeviceTokenList,
APIDList,
DeviceInfo,
)
from .tag import (
ChannelTags,
OpenChannelTags
)
from .segment import (
Segment,
SegmentList
)
from .channel_uninstall import (
ChannelUninstall
)
from .open_channel import (
Ope... | 0 | 0 | 0 |
4d0d23e77fd94495bc44c0163012002503b7b6dc | 2,147 | py | Python | siam_tracker/models/necks/adjust.py | microsoft/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 28 | 2020-03-18T04:41:21.000Z | 2022-02-24T16:44:01.000Z | siam_tracker/models/necks/adjust.py | HengFan2010/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 1 | 2020-04-05T15:23:22.000Z | 2020-04-07T16:23:12.000Z | siam_tracker/models/necks/adjust.py | HengFan2010/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 11 | 2020-03-19T00:30:06.000Z | 2021-11-10T08:22:35.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import torch
from torch import nn
from typing import List, Union, Dict
from ..builder import NECKS
from ..utils import build_stack_conv_layers, random_init_weights
@NECKS.register_module
| 38.339286 | 71 | 0.585468 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import torch
from torch import nn
from typing import List, Union, Dict
from ..builder import NECKS
from ..utils import build_stack_conv_layers, random_init_weights
@NECKS.register_module
class Adjust(nn.Module):
def _... | 1,783 | 3 | 76 |
035257ef15ef2d405531293d8c35ccff5962b78c | 557 | py | Python | runserver.py | GFZ-Centre-for-Early-Warning/REM_DEA | 68af70088db58acc916f2223a8e3b715beb3866d | [
"BSD-3-Clause"
] | null | null | null | runserver.py | GFZ-Centre-for-Early-Warning/REM_DEA | 68af70088db58acc916f2223a8e3b715beb3866d | [
"BSD-3-Clause"
] | null | null | null | runserver.py | GFZ-Centre-for-Early-Warning/REM_DEA | 68af70088db58acc916f2223a8e3b715beb3866d | [
"BSD-3-Clause"
] | null | null | null | '''
---------------------------
runserver.py
---------------------------
Created on 24.04.2015
Last modified on 12.01.2016
Author: Marc Wieland
Description: Starts the application using a local flask server (NOT RECOMMENDED: use wsgi implementation instead see README.md)
----
'''
from webapp import app, db, models
... | 26.52381 | 127 | 0.70377 | '''
---------------------------
runserver.py
---------------------------
Created on 24.04.2015
Last modified on 12.01.2016
Author: Marc Wieland
Description: Starts the application using a local flask server (NOT RECOMMENDED: use wsgi implementation instead see README.md)
----
'''
from webapp import app, db, models
... | 0 | 0 | 0 |
7476c102eb8d74542cc6384cbb824d87d94c1c07 | 3,394 | py | Python | setup.py | Bhaskers-Blu-Org2/mu_pip_environment | d62df3b1d86bf375e82a7ca09740fa0aa3504fcc | [
"BSD-2-Clause"
] | 6 | 2019-07-01T05:10:41.000Z | 2021-06-11T08:58:35.000Z | setup.py | Microsoft/mu_pip_environment | d62df3b1d86bf375e82a7ca09740fa0aa3504fcc | [
"BSD-2-Clause"
] | null | null | null | setup.py | Microsoft/mu_pip_environment | d62df3b1d86bf375e82a7ca09740fa0aa3504fcc | [
"BSD-2-Clause"
] | 5 | 2019-07-01T05:10:42.000Z | 2020-08-05T14:52:28.000Z | # @file setup.py
# This contains setup info for mu_environment pip module
#
##
# Copyright (c) 2018, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistribut... | 34.989691 | 120 | 0.68739 | # @file setup.py
# This contains setup info for mu_environment pip module
#
##
# Copyright (c) 2018, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistribut... | 318 | 0 | 81 |
b514131d371af8802111a0dae7ec5445b63bcfcd | 10,929 | py | Python | tensorflow_probability/python/distributions/jax_transformation_test.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 2 | 2020-12-17T20:43:24.000Z | 2021-06-11T22:09:16.000Z | tensorflow_probability/python/distributions/jax_transformation_test.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/jax_transformation_test.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 1 | 2021-01-03T20:23:52.000Z | 2021-01-03T20:23:52.000Z | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.835913 | 87 | 0.708116 | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 5,673 | 1,482 | 115 |
0bee46430076063eb07a695c066b5cd6da03fd47 | 1,257 | py | Python | setup.py | JWKennington/CompPhys | f53ad33609738eeed81aa4b3390599668bf54017 | [
"MIT"
] | null | null | null | setup.py | JWKennington/CompPhys | f53ad33609738eeed81aa4b3390599668bf54017 | [
"MIT"
] | null | null | null | setup.py | JWKennington/CompPhys | f53ad33609738eeed81aa4b3390599668bf54017 | [
"MIT"
] | null | null | null | """Setup file
"""
import setuptools
import compphys
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(name='compphys',
version=compphys.__version__,
description='compphys',
long_description=long_description,
long_... | 32.230769 | 63 | 0.446301 | """Setup file
"""
import setuptools
import compphys
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(name='compphys',
version=compphys.__version__,
description='compphys',
long_description=long_description,
long_... | 0 | 0 | 0 |
4c0c86973bef9febabafdbc0b7755320ac5cdf61 | 166 | py | Python | lazy_record/typecasts.py | ECESeniorDesign/lazy_record | 929d3cc7c2538b0f792365c0d2b0e0d41084c2dd | [
"MIT"
] | 2 | 2017-02-04T03:33:28.000Z | 2021-01-08T05:58:18.000Z | lazy_record/typecasts.py | ECESeniorDesign/lazy_record | 929d3cc7c2538b0f792365c0d2b0e0d41084c2dd | [
"MIT"
] | 17 | 2016-01-05T00:09:30.000Z | 2016-02-15T20:06:45.000Z | lazy_record/typecasts.py | ECESeniorDesign/lazy_record | 929d3cc7c2538b0f792365c0d2b0e0d41084c2dd | [
"MIT"
] | null | null | null | """Functions to convert objects to a type"""
| 20.75 | 44 | 0.716867 | """Functions to convert objects to a type"""
def date(datetime):
# may get more complexity later
return datetime
def datetime(datetime):
return datetime
| 76 | 0 | 45 |
3b034620c9c0ef8e147d7736b8c194653375c054 | 2,070 | py | Python | ingestion/main.py | mharrisb1/blocktrace | 3c54286d4f28c3b0610f577dfdbbf643953475fa | [
"MIT"
] | null | null | null | ingestion/main.py | mharrisb1/blocktrace | 3c54286d4f28c3b0610f577dfdbbf643953475fa | [
"MIT"
] | null | null | null | ingestion/main.py | mharrisb1/blocktrace | 3c54286d4f28c3b0610f577dfdbbf643953475fa | [
"MIT"
] | null | null | null | import os
from typing import List, Optional
import multiprocessing as mp
from fastapi import FastAPI, BackgroundTasks
from Blocktrace.Networks import Wax
from Blocktrace.Streaming import stream_writer, publish_messages
app = FastAPI()
API_KEY = os.getenv("BT__API_KEY") or ""
GCP_PROJECT_ID = os.getenv("BT__GCP_PROJ... | 25.875 | 76 | 0.669565 | import os
from typing import List, Optional
import multiprocessing as mp
from fastapi import FastAPI, BackgroundTasks
from Blocktrace.Networks import Wax
from Blocktrace.Streaming import stream_writer, publish_messages
app = FastAPI()
API_KEY = os.getenv("BT__API_KEY") or ""
GCP_PROJECT_ID = os.getenv("BT__GCP_PROJ... | 1,438 | 0 | 45 |
f245d7340956f5a4519687e8747eb806b6b1f7a9 | 2,544 | py | Python | src/diffsnn/popp/thinning.py | ibm-research-tokyo/diffsnn | 9299fc5e8542c6fde33a287f81e7ae3682b2fd9d | [
"Apache-2.0"
] | 20 | 2021-06-01T02:42:43.000Z | 2022-02-14T07:08:34.000Z | src/diffsnn/popp/thinning.py | ibm-research-tokyo/diffsnn | 9299fc5e8542c6fde33a287f81e7ae3682b2fd9d | [
"Apache-2.0"
] | null | null | null | src/diffsnn/popp/thinning.py | ibm-research-tokyo/diffsnn | 9299fc5e8542c6fde33a287f81e7ae3682b2fd9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Title '''
__author__ = 'Hiroshi Kajino <KAJINO@jp.ibm.com>'
__copyright__ = 'Copyright IBM Corp. 2020, 2021'
import math
import torch
from ..data import (EventSeq,
MultivariateEventSeq,
append_hidden)
from ..utils import complet... | 41.032258 | 82 | 0.608491 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Title '''
__author__ = 'Hiroshi Kajino <KAJINO@jp.ibm.com>'
__copyright__ = 'Copyright IBM Corp. 2020, 2021'
import math
import torch
from ..data import (EventSeq,
MultivariateEventSeq,
append_hidden)
from ..utils import complet... | 0 | 2,077 | 23 |
61b5cf4058bc359d31b1993b7454a6d576f40a1b | 2,320 | py | Python | downloader.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | downloader.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | downloader.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | import argparse
import subprocess
import os
import re
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Specify youtube url to download audio from.")
parser.add_argument("--out", default="out", metavar="<FILENAME>", help="Specify name of output file.")
parse... | 38.666667 | 191 | 0.658621 | import argparse
import subprocess
import os
import re
def cmdcall(command):
process = subprocess.Popen(command)
process.communicate()
def trimUrl(url):
trimmed_url = re.search(r'[^&]+', url).group()
print("[INFO]: Input URL trimmed to: {}".format(trimmed_url))
return trimmed_url
def isValidUrl(ur... | 1,602 | 0 | 92 |
261e351ade7c25413d564adb4e59ef72613cb9f9 | 2,045 | py | Python | tests/unit/tst_26.py | qrefine/qrefine | 016cac07a39e032c07f34384065dbd4756fe85f8 | [
"Apache-2.0"
] | 17 | 2016-01-13T02:22:26.000Z | 2021-04-03T18:58:43.000Z | tests/unit/tst_26.py | rajeevroy09/qrefine | 789cb6266d7a3055aea0ebb5a5f0a253680a97d0 | [
"Apache-2.0"
] | 78 | 2015-12-23T12:03:38.000Z | 2022-01-28T18:13:21.000Z | tests/unit/tst_26.py | rajeevroy09/qrefine | 789cb6266d7a3055aea0ebb5a5f0a253680a97d0 | [
"Apache-2.0"
] | 11 | 2017-04-04T04:10:25.000Z | 2021-04-13T08:54:54.000Z | import os, sys
import run_tests
from libtbx import easy_run
import libtbx.load_env
qrefine_path = libtbx.env.find_in_repositories("qrefine")
pdb_lines = '''
CRYST1 72.470 66.336 68.552 90.00 90.00 90.00 P 1
ATOM 387 N HIS A 30 62.619 25.986 37.359 1.00 66.84 N
ATOM 388 CA HIS A ... | 44.456522 | 78 | 0.549144 | import os, sys
import run_tests
from libtbx import easy_run
import libtbx.load_env
qrefine_path = libtbx.env.find_in_repositories("qrefine")
pdb_lines = '''
CRYST1 72.470 66.336 68.552 90.00 90.00 90.00 P 1
ATOM 387 N HIS A 30 62.619 25.986 37.359 1.00 66.84 N
ATOM 388 CA HIS A ... | 228 | 0 | 23 |
5d973a87f39d560b2655e7710aee9c5c99bf2cd5 | 1,693 | py | Python | DataStructures/Hashing/ChainingHashing.py | Yarintop/Data-Structures-And-Algorithms-In-Python | 55db9e7f39211c42988171d51ef2659041df1aa1 | [
"MIT"
] | null | null | null | DataStructures/Hashing/ChainingHashing.py | Yarintop/Data-Structures-And-Algorithms-In-Python | 55db9e7f39211c42988171d51ef2659041df1aa1 | [
"MIT"
] | null | null | null | DataStructures/Hashing/ChainingHashing.py | Yarintop/Data-Structures-And-Algorithms-In-Python | 55db9e7f39211c42988171d51ef2659041df1aa1 | [
"MIT"
] | null | null | null | from HashFunctions import HashFunctions
# def __getitem__(self, data):
# pos = self.hashFunction(data) % self.maxSize
if __name__ == "__main__":
h = ChainingHashing()
h.insert(1, 'a')
h.insert(2, 'b')
h.insert(3, 'c')
h.insert(3, 'd')
print(h[3])
| 28.694915 | 84 | 0.478441 | from HashFunctions import HashFunctions
class ChainingHashing:
def __init__(self, maxSize = 10000, hashFunction = HashFunctions.djb2a) -> None:
self.maxSize = maxSize
self.hash = [[]] * maxSize
self.hashFunction = hashFunction
def insert(self, key, data):
pos = self.hashFun... | 1,219 | 1 | 158 |
617675dd9196551a79d5a7317754b632108d6ec1 | 7,179 | py | Python | src/showbits.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | src/showbits.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | src/showbits.py | phungj/MSOE_Comp_Prog_Py | 95e7521b28d3dbcb6279e7baf03067ca27acbe37 | [
"MIT"
] | null | null | null | import warnings
import sys
def bits(v, numbits=None):
"""
Display the bits used to store an object
:param v: the value to display the bits of
:param numbits: the number of bits to display. Only used for int objects. bytes objects
always show the exact bits stored, and int objects d... | 33.863208 | 120 | 0.6246 | import warnings
import sys
def bits(v, numbits=None):
"""
Display the bits used to store an object
:param v: the value to display the bits of
:param numbits: the number of bits to display. Only used for int objects. bytes objects
always show the exact bits stored, and int objects d... | 0 | 0 | 0 |
af9bb922f3751e526ef2ef2b4b54d0b758578ed4 | 296 | py | Python | Plots and Graphs/potassium_boxplot.py | archit-47/Predicting-Chronic-Kidney-Diseases | 6f0a1ca68302a8ef2c5ba15ae136a011faf97aab | [
"MIT"
] | null | null | null | Plots and Graphs/potassium_boxplot.py | archit-47/Predicting-Chronic-Kidney-Diseases | 6f0a1ca68302a8ef2c5ba15ae136a011faf97aab | [
"MIT"
] | null | null | null | Plots and Graphs/potassium_boxplot.py | archit-47/Predicting-Chronic-Kidney-Diseases | 6f0a1ca68302a8ef2c5ba15ae136a011faf97aab | [
"MIT"
] | null | null | null | import csv
import matplotlib.pyplot as plt
with open('idsfinal.csv',mode='r') as csv_file:
csv_reader=csv.DictReader(csv_file)
mydata=[]
for row in csv_reader:
mydata.append(float(row["pot"]))
plt.boxplot(mydata)
plt.ylabel("Potassium")
plt.title("Potassium distribution")
plt.show()
| 18.5 | 47 | 0.736486 | import csv
import matplotlib.pyplot as plt
with open('idsfinal.csv',mode='r') as csv_file:
csv_reader=csv.DictReader(csv_file)
mydata=[]
for row in csv_reader:
mydata.append(float(row["pot"]))
plt.boxplot(mydata)
plt.ylabel("Potassium")
plt.title("Potassium distribution")
plt.show()
| 0 | 0 | 0 |
a768a7c7b3a894f4c526eaefb45d9d4f53fb312d | 12,091 | py | Python | classify.py | rothadamg/UPSITE | 80cce9c9dfc097bb5aaecb0a0975e6a49fdf184c | [
"MIT"
] | null | null | null | classify.py | rothadamg/UPSITE | 80cce9c9dfc097bb5aaecb0a0975e6a49fdf184c | [
"MIT"
] | null | null | null | classify.py | rothadamg/UPSITE | 80cce9c9dfc097bb5aaecb0a0975e6a49fdf184c | [
"MIT"
] | 1 | 2018-12-21T04:12:59.000Z | 2018-12-21T04:12:59.000Z | #!/usr/bin/env python
"""
Detect events or relations from text.
"""
from train import workdir, getDetector, getSteps
import sys, os
import tempfile
import codecs
import Utils.Settings as Settings
import Utils.Stream as Stream
import Utils.Download
from Utils.Connection.Connection import getConnection
import Utils.Down... | 51.67094 | 200 | 0.648168 | #!/usr/bin/env python
"""
Detect events or relations from text.
"""
from train import workdir, getDetector, getSteps
import sys, os
import tempfile
import codecs
import Utils.Settings as Settings
import Utils.Stream as Stream
import Utils.Download
from Utils.Connection.Connection import getConnection
import Utils.Down... | 5,343 | 0 | 92 |
cd8f015fd57b190763452236dbe2f747d3309b7f | 837 | py | Python | tests/test_set.py | maxslarsson/tennis-probability | f26021b305e2b8abd87acad846454f7ce02e9199 | [
"MIT"
] | null | null | null | tests/test_set.py | maxslarsson/tennis-probability | f26021b305e2b8abd87acad846454f7ce02e9199 | [
"MIT"
] | null | null | null | tests/test_set.py | maxslarsson/tennis-probability | f26021b305e2b8abd87acad846454f7ce02e9199 | [
"MIT"
] | null | null | null | import pytest
from tennis_probability import set, InvalidInput, InvalidProbability, NegativeNumber
| 27.9 | 84 | 0.628435 | import pytest
from tennis_probability import set, InvalidInput, InvalidProbability, NegativeNumber
def test_set():
assert set(0, 0, 0) == 0
assert set(0, 0, 0.50) == 0.5
assert set(0, 0, 1) == 1
# Test valid inputs
assert set(5, 3, 0.13) == 0.008146509339015371
assert set(2, 2, 0.37) == 0.024... | 714 | 0 | 23 |
a59ded17348263bc8f03888d65350f5f62929739 | 26,195 | py | Python | pe_tree/runtime.py | lybtongji/pe_tree | 2be607fc55702293cd02cbc6cda5283452464aff | [
"Apache-2.0"
] | 1,271 | 2020-07-27T14:46:44.000Z | 2022-03-30T15:58:24.000Z | pe_tree/runtime.py | lybtongji/pe_tree | 2be607fc55702293cd02cbc6cda5283452464aff | [
"Apache-2.0"
] | 9 | 2020-08-04T13:23:38.000Z | 2021-05-18T16:53:49.000Z | pe_tree/runtime.py | lybtongji/pe_tree | 2be607fc55702293cd02cbc6cda5283452464aff | [
"Apache-2.0"
] | 168 | 2020-07-27T13:56:42.000Z | 2022-03-29T12:48:00.000Z | #
# Copyright (c) 2020 BlackBerry Limited. 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 requ... | 31.790049 | 274 | 0.605001 | #
# Copyright (c) 2020 BlackBerry Limited. 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 requ... | 3,305 | 0 | 781 |
41ab13b76744a888101fd6efde15e7403c131fa3 | 11,010 | py | Python | ion/services/sa/observatory/test/test_platform_instrument.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 3 | 2016-09-20T09:50:06.000Z | 2018-08-10T01:41:38.000Z | ion/services/sa/observatory/test/test_platform_instrument.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | null | null | null | ion/services/sa/observatory/test/test_platform_instrument.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 2 | 2016-03-16T22:25:49.000Z | 2016-11-26T14:54:21.000Z | #!/usr/bin/env python
"""
@package ion.services.sa.observatory.test.test_platform_instrument
@file ion/services/sa/observatory/test/test_platform_instrument.py
@author Carlos Rueda, Maurice Manning
@brief Tests involving some more detailed platform-instrument interations
"""
__author__ = 'Carlos Rueda, Maurice ... | 46.455696 | 239 | 0.679473 | #!/usr/bin/env python
"""
@package ion.services.sa.observatory.test.test_platform_instrument
@file ion/services/sa/observatory/test/test_platform_instrument.py
@author Carlos Rueda, Maurice Manning
@brief Tests involving some more detailed platform-instrument interations
"""
__author__ = 'Carlos Rueda, Maurice ... | 8,970 | 329 | 22 |
523193ed8dd76327553e190d697260b45a0f932f | 2,092 | py | Python | desktop/core/src/desktop/lib/test_export_csvxls.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/lib/test_export_csvxls.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | desktop/core/src/desktop/lib/test_export_csvxls.py | erickt/hue | a046f1dd21226689ed447422f3373d96c65b2fd2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 38.740741 | 79 | 0.718451 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 1,109 | 0 | 69 |
99936fb51ccf71b834427377bf4477143dd06b55 | 2,044 | py | Python | modules/process.py | hectorapp/hector-agent | 0d7ac3ab8b585aa2cd4effb7c218bb7830be18b7 | [
"BSD-3-Clause"
] | 1 | 2019-10-28T11:50:37.000Z | 2019-10-28T11:50:37.000Z | modules/process.py | hectorapp/hector-agent | 0d7ac3ab8b585aa2cd4effb7c218bb7830be18b7 | [
"BSD-3-Clause"
] | null | null | null | modules/process.py | hectorapp/hector-agent | 0d7ac3ab8b585aa2cd4effb7c218bb7830be18b7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
'''
* Author : Hutter Valentin
* Date : 13.05.2019
* Description : Hector agent monitoring
* Help :
- https://psutil.readthedocs.io/en/latest/#processes
- https://psutil.readthedocs.io/en/latest/#psutil.process_iter
- https://psutil.readthedocs.io/en/latest/#unic... | 37.851852 | 134 | 0.674658 | #!/usr/bin/env python
# coding: utf-8
'''
* Author : Hutter Valentin
* Date : 13.05.2019
* Description : Hector agent monitoring
* Help :
- https://psutil.readthedocs.io/en/latest/#processes
- https://psutil.readthedocs.io/en/latest/#psutil.process_iter
- https://psutil.readthedocs.io/en/latest/#unic... | 1,531 | 57 | 23 |
0127c03d824add7d490dbb30604454d0eb757174 | 668 | py | Python | support/shared_consts.py | victordalla/regression-diagnosis | d0dd04de0dac801726113a93f2a6c833307333ca | [
"MIT"
] | null | null | null | support/shared_consts.py | victordalla/regression-diagnosis | d0dd04de0dac801726113a93f2a6c833307333ca | [
"MIT"
] | null | null | null | support/shared_consts.py | victordalla/regression-diagnosis | d0dd04de0dac801726113a93f2a6c833307333ca | [
"MIT"
] | null | null | null | """
Constants used across all files
"""
# The constants in this file must be defined and checked by the user of the template
import numpy as np
from typing import Dict, List, Optional
from copy import deepcopy
from datetime import date
seed = 0
true_params = {"b0": 6, "b1": 1.3, "scale": 50}
n = 300
x_min = -5... | 23.034483 | 84 | 0.712575 | """
Constants used across all files
"""
# The constants in this file must be defined and checked by the user of the template
import numpy as np
from typing import Dict, List, Optional
from copy import deepcopy
from datetime import date
def from_dict_to_list(dictionary):
from itertools import chain
retu... | 90 | 0 | 23 |
a8589db975cc723af5c71c12006f483dccac9b7c | 14,387 | py | Python | dictionary/dict_yeelight.py | giuliapuntoit/RL-framework-iot | 1c0961f10f0477415198bbee94b6eb3272973004 | [
"MIT"
] | 5 | 2021-01-23T20:47:18.000Z | 2021-09-13T14:37:01.000Z | dictionary/dict_yeelight.py | SmartData-Polito/RL-IoT | d293c8410d6c2e8fcb56f96c346c519dd3a84a28 | [
"MIT"
] | null | null | null | dictionary/dict_yeelight.py | SmartData-Polito/RL-IoT | d293c8410d6c2e8fcb56f96c346c519dd3a84a28 | [
"MIT"
] | 1 | 2021-02-09T17:34:47.000Z | 2021-02-09T17:34:47.000Z | """
Class containing the dictionary for the Yeelight protocol
"""
# COMMAND message {id_pair, method_pair, params_pair}
# id_pair is "id":<number>
# method_pair is "method":"<method>"
# params_pair is "params":["<param1>","<param2>", <numeric_param3>]
# <param1> is "property":<property_value>
... | 42.190616 | 70 | 0.260443 | """
Class containing the dictionary for the Yeelight protocol
"""
# COMMAND message {id_pair, method_pair, params_pair}
# id_pair is "id":<number>
# method_pair is "method":"<method>"
# params_pair is "params":["<param1>","<param2>", <numeric_param3>]
# <param1> is "property":<property_value>
... | 13,841 | 6 | 77 |
e1350dcd5fec81e1aacfcd1ad5964e08627c60d1 | 2,641 | py | Python | _includes/ropes.py | hectorpefo/prepublication | 084a0b331e331f8a56c413bc63ea73c2744076da | [
"MIT"
] | 4 | 2019-02-17T22:26:28.000Z | 2022-03-03T11:23:37.000Z | _includes/ropes.py | hectorpefo/prepublication | 084a0b331e331f8a56c413bc63ea73c2744076da | [
"MIT"
] | null | null | null | _includes/ropes.py | hectorpefo/prepublication | 084a0b331e331f8a56c413bc63ea73c2744076da | [
"MIT"
] | 5 | 2017-02-27T22:34:54.000Z | 2020-10-26T01:23:06.000Z | # Rope Burning Riddler from fivethirtyeight.com
# Main program
# Numbers of ropes to do
MinRopes = 1
MaxRopes = 6
for N in range(MinRopes,MaxRopes+1):
# ropes is a list of pairs. each pair is: [ends-lit
# (0, 1, or 2), time (has been or will be) extinguished].
# We start with extinction time 0 as a dummy value.
... | 28.095745 | 66 | 0.678531 | # Rope Burning Riddler from fivethirtyeight.com
def explore(situation):
ropes = situation[0]
time = situation[1]
# Find unextinguished ropes and make a list of those
# with at least 1 unlit end.
allextinguished = True
ropestochoose = []
for r in range(N):
if ropes[r][1] == 0 or ropes[r][1] > time:
allex... | 1,824 | 0 | 23 |
d9a2e2115dcdf579f02fc328bcbd1f22a3326b91 | 1,818 | py | Python | src/predict.py | Akashcba/ML | 95ecf3e011dcbd6112a4e58312c1656b94e9414d | [
"MIT"
] | null | null | null | src/predict.py | Akashcba/ML | 95ecf3e011dcbd6112a4e58312c1656b94e9414d | [
"MIT"
] | null | null | null | src/predict.py | Akashcba/ML | 95ecf3e011dcbd6112a4e58312c1656b94e9414d | [
"MIT"
] | null | null | null | import os
import pandas as pd
from sklearn import ensemble
from sklearn import preprocessing
from sklearn import metrics
import joblib
import numpy as np
import time
from . import dispatcher
TEST_DATA = os.environ.get("TEST_DATA")
MODEL = os.environ.get("MODEL")
PATH = os.environ.get("MODEL_PATH")
NUM_FOLDS = int(os... | 31.344828 | 111 | 0.628713 | import os
import pandas as pd
from sklearn import ensemble
from sklearn import preprocessing
from sklearn import metrics
import joblib
import numpy as np
import time
from . import dispatcher
TEST_DATA = os.environ.get("TEST_DATA")
MODEL = os.environ.get("MODEL")
PATH = os.environ.get("MODEL_PATH")
NUM_FOLDS = int(os... | 1,079 | 0 | 27 |
8ad92d5050c75dcd61e8facec28005990ce8c6a4 | 3,369 | py | Python | ackermann_vehicle_gazebo/scripts/commandEncoder.py | testville/ros_gazebo_car | c8e3d149df9f25756e3a002bf080d474e40ad57e | [
"Apache-2.0"
] | 2 | 2020-12-05T11:14:14.000Z | 2022-01-09T20:23:18.000Z | ackermann_vehicle_gazebo/scripts/commandEncoder.py | testville/ros_gazebo_car | c8e3d149df9f25756e3a002bf080d474e40ad57e | [
"Apache-2.0"
] | null | null | null | ackermann_vehicle_gazebo/scripts/commandEncoder.py | testville/ros_gazebo_car | c8e3d149df9f25756e3a002bf080d474e40ad57e | [
"Apache-2.0"
] | 1 | 2022-02-14T23:21:27.000Z | 2022-02-14T23:21:27.000Z | #!/usr/bin/env python
import rospy
import tf
import roslib
import random
import math
import copy as copy_module
from tf.transformations import euler_from_quaternion, quaternion_from_euler
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
from ackermann_msgs.msg i... | 45.527027 | 167 | 0.640843 | #!/usr/bin/env python
import rospy
import tf
import roslib
import random
import math
import copy as copy_module
from tf.transformations import euler_from_quaternion, quaternion_from_euler
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
from ackermann_msgs.msg i... | 2,790 | 0 | 103 |
ab583dfc0f7d74b79f55a79c04417e8e1f16a66f | 4,069 | py | Python | tests/unit/test_triton_inference.py | beingaryan/NVTabular | 126c8e38ffe77ce36a228079776410d97580f992 | [
"Apache-2.0"
] | 1 | 2021-08-31T08:21:09.000Z | 2021-08-31T08:21:09.000Z | tests/unit/test_triton_inference.py | beingaryan/NVTabular | 126c8e38ffe77ce36a228079776410d97580f992 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_triton_inference.py | beingaryan/NVTabular | 126c8e38ffe77ce36a228079776410d97580f992 | [
"Apache-2.0"
] | null | null | null | import contextlib
import os
import signal
import subprocess
import time
from distutils.spawn import find_executable
import cudf
import pytest
from cudf.tests.utils import assert_eq
import nvtabular as nvt
import nvtabular.ops as ops
triton = pytest.importorskip("nvtabular.inference.triton")
grpcclient = pytest.impor... | 34.483051 | 92 | 0.657901 | import contextlib
import os
import signal
import subprocess
import time
from distutils.spawn import find_executable
import cudf
import pytest
from cudf.tests.utils import assert_eq
import nvtabular as nvt
import nvtabular.ops as ops
triton = pytest.importorskip("nvtabular.inference.triton")
grpcclient = pytest.impor... | 3,349 | 0 | 89 |
8610d811befae6e575ff7f591c6961562d7dc4b9 | 69,207 | py | Python | salt/modules/debian_ip.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | 1 | 2021-04-05T19:46:35.000Z | 2021-04-05T19:46:35.000Z | salt/modules/debian_ip.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | salt/modules/debian_ip.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The networking module for Debian based distros
References:
* http://www.debian.org/doc/manuals/debian-reference/ch05.en.html
'''
# Import python libs
from __future__ import absolute_import
import functools
import logging
import os.path
import os
import re
import time
# Import third party... | 32.62942 | 114 | 0.587917 | # -*- coding: utf-8 -*-
'''
The networking module for Debian based distros
References:
* http://www.debian.org/doc/manuals/debian-reference/ch05.en.html
'''
# Import python libs
from __future__ import absolute_import
import functools
import logging
import os.path
import os
import re
import time
# Import third party... | 554 | 0 | 115 |
369a9a39bc0dffc579cc1557c234597a461013c7 | 8,726 | py | Python | openmmmcmc/tests/test_mcmc.py | choderalab/openmm-mcmc | 0b28cb9465699685176bbd8cfa5c83125af8fda9 | [
"MIT"
] | 1 | 2016-01-14T20:10:00.000Z | 2016-01-14T20:10:00.000Z | openmmmcmc/tests/test_mcmc.py | choderalab/openmmmcmc | 0b28cb9465699685176bbd8cfa5c83125af8fda9 | [
"MIT"
] | 9 | 2016-01-14T18:47:21.000Z | 2017-02-02T23:08:54.000Z | openmmmcmc/tests/test_mcmc.py | choderalab/openmmmcmc | 0b28cb9465699685176bbd8cfa5c83125af8fda9 | [
"MIT"
] | 3 | 2016-01-14T20:59:52.000Z | 2021-04-01T00:38:29.000Z | import numpy as np
import simtk.openmm as openmm
import simtk.unit as units
from openmmtools import testsystems
from pymbar import timeseries
from functools import partial
from openmmmcmc.mcmc import HMCMove, GHMCMove, LangevinDynamicsMove, MonteCarloBarostatMove
import logging
# Test various combinations of syste... | 44.748718 | 258 | 0.655168 | import numpy as np
import simtk.openmm as openmm
import simtk.unit as units
from openmmtools import testsystems
from pymbar import timeseries
from functools import partial
from openmmmcmc.mcmc import HMCMove, GHMCMove, LangevinDynamicsMove, MonteCarloBarostatMove
import logging
# Test various combinations of syste... | 7,259 | 0 | 69 |
f519e5a9d3baabea7b9efdf4583778ebf50e0b07 | 163 | py | Python | aula/aula013.py | henriquekirchheck/Curso-em-video-Python | 1a29f68515313af85c8683f626ba35f8fcdd10e7 | [
"MIT"
] | null | null | null | aula/aula013.py | henriquekirchheck/Curso-em-video-Python | 1a29f68515313af85c8683f626ba35f8fcdd10e7 | [
"MIT"
] | null | null | null | aula/aula013.py | henriquekirchheck/Curso-em-video-Python | 1a29f68515313af85c8683f626ba35f8fcdd10e7 | [
"MIT"
] | null | null | null | from time import sleep
#Aula N°13
print("Aula N°13 \n")
sleep(0.2)
s = 0
for c in range(1, 4):
n = int(input('Escolha um numero: '))
s = s + n
print(s) | 12.538462 | 41 | 0.576687 | from time import sleep
#Aula N°13
print("Aula N°13 \n")
sleep(0.2)
s = 0
for c in range(1, 4):
n = int(input('Escolha um numero: '))
s = s + n
print(s) | 0 | 0 | 0 |
033708bec7b12d53ab2579de5592e8c6448a6dee | 1,043 | py | Python | Leetcode/0151-0200/0167-two-sum-ii.py | MiKueen/Data-Structures-and-Algorithms | 8788bde5349f326aac0267531f39ac7a2a708ee6 | [
"MIT"
] | null | null | null | Leetcode/0151-0200/0167-two-sum-ii.py | MiKueen/Data-Structures-and-Algorithms | 8788bde5349f326aac0267531f39ac7a2a708ee6 | [
"MIT"
] | null | null | null | Leetcode/0151-0200/0167-two-sum-ii.py | MiKueen/Data-Structures-and-Algorithms | 8788bde5349f326aac0267531f39ac7a2a708ee6 | [
"MIT"
] | 1 | 2019-10-06T15:46:14.000Z | 2019-10-06T15:46:14.000Z | '''
Author : MiKueen
Level : Easy
Problem Statement : Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ta... | 34.766667 | 137 | 0.628955 | '''
Author : MiKueen
Level : Easy
Problem Statement : Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ta... | 297 | -6 | 49 |
1a3533a122ed8825db4a37879558e890c3636d80 | 22,998 | py | Python | trueskilltest.py | adity5/trueskill | cd616d625973305a40d3259d9371cb430bf31dd4 | [
"BSD-3-Clause"
] | 533 | 2015-01-09T06:23:49.000Z | 2022-03-18T07:01:21.000Z | trueskilltest.py | adity5/trueskill | cd616d625973305a40d3259d9371cb430bf31dd4 | [
"BSD-3-Clause"
] | 40 | 2015-04-26T15:47:54.000Z | 2022-02-02T17:35:30.000Z | trueskilltest.py | adity5/trueskill | cd616d625973305a40d3259d9371cb430bf31dd4 | [
"BSD-3-Clause"
] | 116 | 2015-01-05T03:22:58.000Z | 2022-03-18T07:01:31.000Z | # -*- coding: utf-8 -*-
from __future__ import with_statement
import warnings
from almost import Approximate
from pytest import deprecated_call, raises
from conftest import various_backends
import trueskill as t
from trueskill import (
quality, quality_1vs1, rate, rate_1vs1, Rating, setup, TrueSkill)
warnings.... | 35.71118 | 79 | 0.587573 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import warnings
from almost import Approximate
from pytest import deprecated_call, raises
from conftest import various_backends
import trueskill as t
from trueskill import (
quality, quality_1vs1, rate, rate_1vs1, Rating, setup, TrueSkill)
warnings.... | 16,534 | 76 | 781 |
13add9bde409fbeafca507098bc9056f4d2fe97e | 44,491 | py | Python | main.py | qinyiwei/MuTual | 3bdd13c1388d6136b8944666dfd434870760cc93 | [
"MIT"
] | null | null | null | main.py | qinyiwei/MuTual | 3bdd13c1388d6136b8944666dfd434870760cc93 | [
"MIT"
] | null | null | null | main.py | qinyiwei/MuTual | 3bdd13c1388d6136b8944666dfd434870760cc93 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 41.310121 | 190 | 0.572835 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 29,209 | 2,753 | 445 |
1c82a092d652b6f6dacceb9ea22aa4185bdac0bb | 1,389 | py | Python | netbox/users/migrations/0001_api_tokens_squashed_0002_unicode_literals.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | 6 | 2017-12-01T05:13:39.000Z | 2020-01-23T13:04:43.000Z | netbox/users/migrations/0001_api_tokens_squashed_0002_unicode_literals.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | 8 | 2021-04-16T01:38:00.000Z | 2022-01-04T21:27:27.000Z | netbox/users/migrations/0001_api_tokens_squashed_0002_unicode_literals.py | xcorp/netbox | 48b9c9da932dc736710d9c14793067093f8f1bde | [
"Apache-2.0"
] | 3 | 2017-11-18T01:28:22.000Z | 2018-05-17T14:04:43.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-01 17:43
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
| 40.852941 | 141 | 0.635709 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-01 17:43
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [('users', '0001_api_tokens'), ('users', '0002_unico... | 0 | 1,154 | 23 |
924b4ba3b425982309ec0f08bffb018f6cdf7467 | 497 | py | Python | downscale-lls.py | jni/useful-histories | 0c75003e4fa3a80d4bf7281314cdf6e363d3be56 | [
"BSD-3-Clause"
] | null | null | null | downscale-lls.py | jni/useful-histories | 0c75003e4fa3a80d4bf7281314cdf6e363d3be56 | [
"BSD-3-Clause"
] | null | null | null | downscale-lls.py | jni/useful-histories | 0c75003e4fa3a80d4bf7281314cdf6e363d3be56 | [
"BSD-3-Clause"
] | null | null | null | # IPython log file
from tqdm import tqdm
import dask.array as da
import zarr
import itertools
from skimage.transform import downscale_local_mean
lls = da.from_zarr('data/gokul-lls/aollsm-m4-560nm.zarr')
lls3 = zarr.open('data/gokul-lls/aollsm-m4-560nm-downscale.zarr', dtype=np.float32, shape=(199, 201, 192, 256), chu... | 33.133333 | 138 | 0.730382 | # IPython log file
from tqdm import tqdm
import dask.array as da
import zarr
import itertools
from skimage.transform import downscale_local_mean
lls = da.from_zarr('data/gokul-lls/aollsm-m4-560nm.zarr')
lls3 = zarr.open('data/gokul-lls/aollsm-m4-560nm-downscale.zarr', dtype=np.float32, shape=(199, 201, 192, 256), chu... | 0 | 0 | 0 |
d9f95ccb9bd06253bf86b034d97ce272134d0fd4 | 967 | py | Python | snake.py | kuntaltattu/beginning-python | 59b6e0b179fbf973976f8b12470fab8243aad793 | [
"Apache-2.0"
] | 1 | 2017-06-30T10:43:27.000Z | 2017-06-30T10:43:27.000Z | snake.py | kuntaltattu/beginning-python | 59b6e0b179fbf973976f8b12470fab8243aad793 | [
"Apache-2.0"
] | null | null | null | snake.py | kuntaltattu/beginning-python | 59b6e0b179fbf973976f8b12470fab8243aad793 | [
"Apache-2.0"
] | null | null | null | import pygame,sys
from pygame.locals import *
pygame.init()
FPS = 10
frametime = 1000/FPS
fpsClock = pygame.time.Clock ()
DISPLAYSURF = pygame.display.set_mode((700,500),pygame.DOUBLEBUF, 32)
DISPLAYSURF = pygame.display.set_caption ('Snakes!')
snakeImg = pygame.image.load ('snake.png')
WHITE = (255,255,255)
snakeht... | 21.977273 | 69 | 0.649431 | import pygame,sys
from pygame.locals import *
pygame.init()
FPS = 10
frametime = 1000/FPS
fpsClock = pygame.time.Clock ()
DISPLAYSURF = pygame.display.set_mode((700,500),pygame.DOUBLEBUF, 32)
DISPLAYSURF = pygame.display.set_caption ('Snakes!')
snakeImg = pygame.image.load ('snake.png')
WHITE = (255,255,255)
snakeht... | 0 | 0 | 0 |
4a8c44382a90003bcba3dd0fb83e3532d22fe13e | 201 | py | Python | rts/python/panic.py | Snektron/futhark | ca9a33d511ba30b27409aef46e5df92556ab2e8b | [
"ISC"
] | 2 | 2022-01-02T16:21:11.000Z | 2022-01-09T09:49:43.000Z | rts/python/panic.py | q60/futhark | a9421d922778281ac8a84e66497c340290c1e23b | [
"ISC"
] | null | null | null | rts/python/panic.py | q60/futhark | a9421d922778281ac8a84e66497c340290c1e23b | [
"ISC"
] | null | null | null | # Start of panic.py.
# End of panic.py.
| 20.1 | 42 | 0.61194 | # Start of panic.py.
def panic(exitcode, fmt, *args):
sys.stderr.write('%s: ' % sys.argv[0])
sys.stderr.write(fmt % args)
sys.stderr.write('\n')
sys.exit(exitcode)
# End of panic.py.
| 137 | 0 | 23 |
4248b02199f22375a1b1218c15ae4465fdf441ae | 1,276 | py | Python | codetools/contexts/name_filter_context.py | enthought/codetools | 20d8bb1eba68145750a1b689655b839078121474 | [
"BSD-3-Clause"
] | 29 | 2015-08-10T20:25:00.000Z | 2021-11-30T23:34:24.000Z | codetools/contexts/name_filter_context.py | enthought/codetools | 20d8bb1eba68145750a1b689655b839078121474 | [
"BSD-3-Clause"
] | 40 | 2015-01-05T15:01:37.000Z | 2022-03-11T13:47:06.000Z | codetools/contexts/name_filter_context.py | enthought/codetools | 20d8bb1eba68145750a1b689655b839078121474 | [
"BSD-3-Clause"
] | 4 | 2015-04-14T10:06:26.000Z | 2021-01-19T16:46:48.000Z | #
# (C) Copyright 2013 Enthought, Inc., Austin, TX
# All right reserved.
#
# This file is open source software distributed according to the terms in
# LICENSE.txt
#
from __future__ import absolute_import
# Enthought library imports
from traits.api import Any
# Local imports
from .data_context import DataContext
cla... | 28.355556 | 85 | 0.582288 | #
# (C) Copyright 2013 Enthought, Inc., Austin, TX
# All right reserved.
#
# This file is open source software distributed according to the terms in
# LICENSE.txt
#
from __future__ import absolute_import
# Enthought library imports
from traits.api import Any
# Local imports
from .data_context import DataContext
cla... | 22 | 0 | 27 |
3b89cf23a8f1210a9d5cf7e6030cb9a5160845ec | 591 | py | Python | setup.py | joeyearsley/quiver | 0702720f0d97fdd57e8bbac087c44a7982ff2e0e | [
"MIT"
] | 1,129 | 2016-11-14T06:16:21.000Z | 2022-03-03T02:24:37.000Z | setup.py | ankur248/quiver | cc901e43ab0dbc5544e4196ecaa079dd87f1f6ec | [
"MIT"
] | 43 | 2016-11-14T08:38:32.000Z | 2017-02-03T17:24:11.000Z | setup.py | ankur248/quiver | cc901e43ab0dbc5544e4196ecaa079dd87f1f6ec | [
"MIT"
] | 129 | 2016-11-14T10:51:25.000Z | 2021-11-14T03:06:09.000Z | from setuptools import setup, find_packages
setup(
name='quiver_engine',
version="0.1.4.1.4",
author="Jake Bian",
author_email="jake@keplr.io",
description=("Interactive per-layer visualization for convents in keras"),
license='mit',
packages=find_packages(),
include_package_data=True,
... | 24.625 | 78 | 0.617597 | from setuptools import setup, find_packages
setup(
name='quiver_engine',
version="0.1.4.1.4",
author="Jake Bian",
author_email="jake@keplr.io",
description=("Interactive per-layer visualization for convents in keras"),
license='mit',
packages=find_packages(),
include_package_data=True,
... | 0 | 0 | 0 |
2132da8d7e158e987542f256421399d9c24000d9 | 1,867 | py | Python | test/test_voice_endpoints_api.py | networthdata/generated-swagger-client | 41dd3fb02b322ed1d39cbaef6b4091ae6cab0d0b | [
"MIT"
] | null | null | null | test/test_voice_endpoints_api.py | networthdata/generated-swagger-client | 41dd3fb02b322ed1d39cbaef6b4091ae6cab0d0b | [
"MIT"
] | null | null | null | test/test_voice_endpoints_api.py | networthdata/generated-swagger-client | 41dd3fb02b322ed1d39cbaef6b4091ae6cab0d0b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Speech Services API v2.0
Speech Services API v2.0. # noqa: E501
OpenAPI spec version: v2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.api.voice_endp... | 24.246753 | 98 | 0.668988 | # coding: utf-8
"""
Speech Services API v2.0
Speech Services API v2.0. # noqa: E501
OpenAPI spec version: v2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.api.voice_endp... | 98 | 0 | 54 |
fc7dd1c1e382aa08a027fdd5d8a16f08b7a9fd25 | 192 | py | Python | infoset/utils/__init__.py | clayton-colovore/infoset-ng | b0404fdda9e805effc16cebc9caef5f86b6bfe33 | [
"Apache-2.0"
] | null | null | null | infoset/utils/__init__.py | clayton-colovore/infoset-ng | b0404fdda9e805effc16cebc9caef5f86b6bfe33 | [
"Apache-2.0"
] | null | null | null | infoset/utils/__init__.py | clayton-colovore/infoset-ng | b0404fdda9e805effc16cebc9caef5f86b6bfe33 | [
"Apache-2.0"
] | null | null | null | """Infoset utilities package.
This package's modules which perform important tasks within
the project but are either not specific enough or not large
enough to warrant their own package
"""
| 24 | 59 | 0.796875 | """Infoset utilities package.
This package's modules which perform important tasks within
the project but are either not specific enough or not large
enough to warrant their own package
"""
| 0 | 0 | 0 |
b2011b74dfaf912f01e8af596df8d01c9f15ebc9 | 465 | py | Python | kagi/lower/east/_capital/four.py | jedhsu/kagi | 1301f7fc437bb445118b25ca92324dbd58d6ad2d | [
"MIT"
] | null | null | null | kagi/lower/east/_capital/four.py | jedhsu/kagi | 1301f7fc437bb445118b25ca92324dbd58d6ad2d | [
"MIT"
] | null | null | null | kagi/lower/east/_capital/four.py | jedhsu/kagi | 1301f7fc437bb445118b25ca92324dbd58d6ad2d | [
"MIT"
] | null | null | null | """
*Lower-East Capital 4* ⠨
The lower-east capital four gi.
"""
from dataclasses import dataclass
from ....._gi import Gi
from ....capital import CapitalGi
from ...._gi import StrismicGi
from ....east import EasternGi
from ...._number import FourGi
from ..._gi import LowerGi
__all__ = ["LowerEastCapital4... | 15 | 33 | 0.668817 | """
*Lower-East Capital 4* ⠨
The lower-east capital four gi.
"""
from dataclasses import dataclass
from ....._gi import Gi
from ....capital import CapitalGi
from ...._gi import StrismicGi
from ....east import EasternGi
from ...._number import FourGi
from ..._gi import LowerGi
__all__ = ["LowerEastCapital4... | 0 | 107 | 22 |
9bbeb054aaf802732a08d718ed260eec7f5edfb0 | 2,242 | py | Python | utils.py | resph0ina/mosaic_tools | 43484bec986bf03ff2dd0c5dc4b5520ee0408aed | [
"MIT"
] | null | null | null | utils.py | resph0ina/mosaic_tools | 43484bec986bf03ff2dd0c5dc4b5520ee0408aed | [
"MIT"
] | null | null | null | utils.py | resph0ina/mosaic_tools | 43484bec986bf03ff2dd0c5dc4b5520ee0408aed | [
"MIT"
] | null | null | null | import cv2
import numpy as np | 35.03125 | 82 | 0.541481 | import cv2
import numpy as np
def add_mosaic_rect(image, p1, p2, block_size=10, in_place=True):
if in_place:
img = image
else:
img = np.copy(image)
if p1[0] >= p2[0] or p1[1] >= p2[1]:
return img
for x in xrange(p1[0], p2[0], block_size):
for y in xrange(p1[1], p2[1], bl... | 2,121 | 0 | 92 |
52db126a2ba0c671a7e58d5bac4bbfac41519cd3 | 753 | py | Python | inference-engine/ie_bridges/python/tests/test_utils.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 1 | 2022-01-19T15:36:45.000Z | 2022-01-19T15:36:45.000Z | inference-engine/ie_bridges/python/tests/test_utils.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 22 | 2021-02-03T12:41:51.000Z | 2022-02-21T13:04:48.000Z | inference-engine/ie_bridges/python/tests/test_utils.py | mmakridi/openvino | 769bb7709597c14debdaa356dd60c5a78bdfa97e | [
"Apache-2.0"
] | null | null | null | from openvino.inference_engine import IECore, IENetwork
import ngraph as ng
from ngraph.impl.op import Parameter
from ngraph.impl import Function, Shape, Type
| 27.888889 | 69 | 0.701195 | from openvino.inference_engine import IECore, IENetwork
import ngraph as ng
from ngraph.impl.op import Parameter
from ngraph.impl import Function, Shape, Type
def get_test_cnnnetwork():
element_type = Type.f32
param = Parameter(element_type, Shape([1, 3, 22, 22]))
relu = ng.relu(param)
func = Function... | 546 | 0 | 46 |
53bb5459b58c2bd4de374bf23136490aac39de80 | 3,974 | py | Python | 2 - Conceptual Design/4 - Wing Design/aircraft_plotter.py | JARC99/DISECON_PIA | 8b05b39ffce9dc9cdfdae5b21129857bad6e4d99 | [
"MIT"
] | null | null | null | 2 - Conceptual Design/4 - Wing Design/aircraft_plotter.py | JARC99/DISECON_PIA | 8b05b39ffce9dc9cdfdae5b21129857bad6e4d99 | [
"MIT"
] | null | null | null | 2 - Conceptual Design/4 - Wing Design/aircraft_plotter.py | JARC99/DISECON_PIA | 8b05b39ffce9dc9cdfdae5b21129857bad6e4d99 | [
"MIT"
] | null | null | null | """Provide tools for creating parametirc aircraft geometry."""
import numpy as np
import matplotlib.pyplot as plt
import openvsp as vsp
def naca_4_series(max_camber, max_camber_loc, max_tc, n_points,
plot_switch=False):
"""Plot NACA 4-Series airfoil with the given characteristics."""
airfoi... | 33.116667 | 108 | 0.585053 | """Provide tools for creating parametirc aircraft geometry."""
import numpy as np
import matplotlib.pyplot as plt
import openvsp as vsp
def naca_4_series(max_camber, max_camber_loc, max_tc, n_points,
plot_switch=False):
"""Plot NACA 4-Series airfoil with the given characteristics."""
airfoi... | 874 | 0 | 54 |
ce957869072f6295537bd57aeed256f7e4c2f9c5 | 2,574 | py | Python | app/centroid-to-feet-interpolation/funzioniUtili.py | davave/EdgeRealtimeVideoAnalytics | 8f6abf233b2e1822d4ab0b65c6f5eb7a91df090d | [
"Apache-2.0"
] | null | null | null | app/centroid-to-feet-interpolation/funzioniUtili.py | davave/EdgeRealtimeVideoAnalytics | 8f6abf233b2e1822d4ab0b65c6f5eb7a91df090d | [
"Apache-2.0"
] | null | null | null | app/centroid-to-feet-interpolation/funzioniUtili.py | davave/EdgeRealtimeVideoAnalytics | 8f6abf233b2e1822d4ab0b65c6f5eb7a91df090d | [
"Apache-2.0"
] | null | null | null | import cv2
import yaml
import numpy as np
def centroidFeetFromFile(fileName="/home/davide/Documenti/progetti/playground/centroid-to-feet-interpolation/101_640x480.yaml", normalization=False):
'''
funzione che carica e restituisce le coordinate di centroide e piedi nel formato [[x y]]
'''
with open(file... | 41.516129 | 156 | 0.6554 | import cv2
import yaml
import numpy as np
def pointsMap(imgName='640x480.jpg',windowName='Disposizione punti del centroide'):
img = cv2.imread(imgName)
windowName = windowName
centroidCoordinates, feetCoordinates = centroidFeetFromFile()
#img = cv2.drawMarker(img, (320,240), color=(255,255,0), marker... | 1,424 | 0 | 69 |
0fb04afb3633198dd89331a36a5ad6f08b43e364 | 4,856 | py | Python | tetris/a2c_rewards/play.py | NeuralFlux/rl-analysis | bb45e1f8bb9da4683cce4bd0a5e687770a4005e2 | [
"MIT"
] | 1 | 2020-12-05T13:15:35.000Z | 2020-12-05T13:15:35.000Z | tetris/a2c_rewards/play.py | NeuralFlux/rl-analysis | bb45e1f8bb9da4683cce4bd0a5e687770a4005e2 | [
"MIT"
] | null | null | null | tetris/a2c_rewards/play.py | NeuralFlux/rl-analysis | bb45e1f8bb9da4683cce4bd0a5e687770a4005e2 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Categorical
from Tetris.src.tetris import Tetris
from PIL import Image
from time import sleep
from pathlib import Path
import cv2
# height, w... | 30.161491 | 116 | 0.585255 | import sys
import numpy as np
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Categorical
from Tetris.src.tetris import Tetris
from PIL import Image
from time import sleep
from pathlib import Path
import cv2
# height, w... | 3,655 | 6 | 214 |