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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
889ac7ffd9a005060bb43a97aad62ce181ad364f | 1,608 | py | Python | lang/python/bottle/todo/todoone.py | liuyang1/test | a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417 | [
"MIT"
] | 8 | 2015-06-07T13:25:48.000Z | 2022-03-22T23:14:50.000Z | lang/python/bottle/todo/todoone.py | liuyang1/test | a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417 | [
"MIT"
] | 30 | 2016-01-29T01:36:41.000Z | 2018-09-19T07:01:22.000Z | lang/python/bottle/todo/todoone.py | liuyang1/test | a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417 | [
"MIT"
] | null | null | null | from bottle import route, run, debug, template, request
import sqlite3
def pretty_print_POST(req):
"""
At this point it is completely built and ready
to be fired; it is "prepared".
However pay attention at the formatting used in
this function because it is programmed to be pretty
printed an... | 27.724138 | 74 | 0.574627 | from bottle import route, run, debug, template, request
import sqlite3
def pretty_print_POST(req):
"""
At this point it is completely built and ready
to be fired; it is "prepared".
However pay attention at the formatting used in
this function because it is programmed to be pretty
printed an... | 711 | 0 | 44 |
919d3ccaca0399f9adb321600f7cfa64da99a4b2 | 6,262 | py | Python | python/deal_10_fq_list.py | FireflyTang/WoQu | 9f1763b1971e8fce99d123584e803fac36821756 | [
"MIT"
] | null | null | null | python/deal_10_fq_list.py | FireflyTang/WoQu | 9f1763b1971e8fce99d123584e803fac36821756 | [
"MIT"
] | null | null | null | python/deal_10_fq_list.py | FireflyTang/WoQu | 9f1763b1971e8fce99d123584e803fac36821756 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
#!/usr/bin/python
from dealctrl import *
| 33.666667 | 97 | 0.454168 | # -*- coding: utf-8 -*
#!/usr/bin/python
from dealctrl import *
class deal_10_pb_list(dealctrl):
def __init__(self,con):
dealctrl.__init__(self,con)
def run(self):
userid=int(self.recvdic['userid'])
time=int(self.recvdic['time'])
timelimit=''
if(time):
timel... | 6,111 | 11 | 75 |
63cb909a668dcccf26c627d74673ec61d29d34cb | 714 | py | Python | bot.py | Snowcola/simbot | 9d7b04bb46a85d5ffdb57a1c725ca0def92442e8 | [
"MIT"
] | null | null | null | bot.py | Snowcola/simbot | 9d7b04bb46a85d5ffdb57a1c725ca0def92442e8 | [
"MIT"
] | null | null | null | bot.py | Snowcola/simbot | 9d7b04bb46a85d5ffdb57a1c725ca0def92442e8 | [
"MIT"
] | null | null | null | import os
import discord
import asyncio
import logging
from discord.ext import commands
from simc import SimC
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(
filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(
logging.Formatter('%(ascti... | 22.3125 | 73 | 0.726891 | import os
import discord
import asyncio
import logging
from discord.ext import commands
from simc import SimC
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(
filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(
logging.Formatter('%(ascti... | 60 | 0 | 22 |
ad60524a29920db31667f14d371b0c8aa8f3674f | 756 | py | Python | polytester/parsers/protractor.py | skoczen/polytester | c32c99aa61eb4dcfd2b3f6860b5d9d342a7ecfa8 | [
"MIT"
] | 115 | 2015-01-23T13:37:37.000Z | 2020-11-16T09:40:53.000Z | polytester/parsers/protractor.py | skoczen/polytester | c32c99aa61eb4dcfd2b3f6860b5d9d342a7ecfa8 | [
"MIT"
] | 18 | 2015-01-21T14:13:14.000Z | 2021-03-25T21:38:07.000Z | polytester/parsers/protractor.py | skoczen/polytester | c32c99aa61eb4dcfd2b3f6860b5d9d342a7ecfa8 | [
"MIT"
] | 11 | 2015-01-28T19:43:37.000Z | 2017-06-30T13:20:24.000Z | import re
from .default import DefaultParser
| 27 | 97 | 0.599206 | import re
from .default import DefaultParser
class ProtractorParser(DefaultParser):
name = "protractor"
def command_matches(self, command):
return "protractor" in command
def num_passed(self, result):
return self.num_total(result) - self.num_failed(result)
def num_total(self, resul... | 537 | 149 | 23 |
5eff4f616e1bf74af785abd760f50d2a582846ad | 829 | py | Python | mark_blocks.py | m0t/ida-scripts | 17124a4dfc869064a2b44ba89047d03ab4157230 | [
"MIT"
] | 5 | 2015-03-21T05:48:22.000Z | 2016-12-04T13:35:48.000Z | mark_blocks.py | m0t/ida-scripts | 17124a4dfc869064a2b44ba89047d03ab4157230 | [
"MIT"
] | null | null | null | mark_blocks.py | m0t/ida-scripts | 17124a4dfc869064a2b44ba89047d03ab4157230 | [
"MIT"
] | null | null | null | '''
@author: m0t
'''
#search for blocks colored purple(0x9933cc) and creates a disabled breakpoint at the start of each.
#To be used with process stalker to immediately see "interesting" blocks
from idc import *
from idautils import *
purple = 0x9933cc #our definition of purple...
#get start address of each funct... | 23.027778 | 99 | 0.714113 | '''
@author: m0t
'''
#search for blocks colored purple(0x9933cc) and creates a disabled breakpoint at the start of each.
#To be used with process stalker to immediately see "interesting" blocks
from idc import *
from idautils import *
purple = 0x9933cc #our definition of purple...
#get start address of each funct... | 0 | 0 | 0 |
0c4e4f3219b1763eefe5c44b1aa31a75eea348c6 | 2,971 | py | Python | sliding_window/lesson_4.py | Adorism/grok-practice | 62576ef8cce1f9e4289366d9f733618f50c9b648 | [
"MIT"
] | null | null | null | sliding_window/lesson_4.py | Adorism/grok-practice | 62576ef8cce1f9e4289366d9f733618f50c9b648 | [
"MIT"
] | null | null | null | sliding_window/lesson_4.py | Adorism/grok-practice | 62576ef8cce1f9e4289366d9f733618f50c9b648 | [
"MIT"
] | null | null | null | '''
Problem Statement
Given a string with lowercase letters only, if you are allowed to replace no more than ‘k’ letters with any letter, find the length of the longest substring having the same letters after replacement.
Example 1:
Input: String="aabccbb", k=2
Output: 5
Explanation: Replace the two 'c' with 'b' to hav... | 34.952941 | 213 | 0.684618 | '''
Problem Statement
Given a string with lowercase letters only, if you are allowed to replace no more than ‘k’ letters with any letter, find the length of the longest substring having the same letters after replacement.
Example 1:
Input: String="aabccbb", k=2
Output: 5
Explanation: Replace the two 'c' with 'b' to hav... | 1,864 | 0 | 68 |
1452ea9c83f0c6e864e6bb0c90c52cc4eb4cfc1e | 3,292 | py | Python | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/ce_20000819.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/ce_20000819.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/ce_20000819.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z |
'''Contributed by Carey Evans'''
import sys
from Ft.Xml.Xslt import Processor
"""outenc.py
Test whether 4DOM and 4XSLT produce correct output given different
input strings, using different output encodings. The general testing
procedure goes:
Read document into DOM from string <A>.
Extract text into Uni... | 25.92126 | 93 | 0.655832 |
'''Contributed by Carey Evans'''
import sys
from Ft.Xml.Xslt import Processor
"""outenc.py
Test whether 4DOM and 4XSLT produce correct output given different
input strings, using different output encodings. The general testing
procedure goes:
Read document into DOM from string <A>.
Extract text into Uni... | 1,477 | 0 | 115 |
758d57783fdc7bdff4fbe8436f421b519abc52a6 | 2,584 | py | Python | h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_5008_5386_glm_ordinal_large.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 1 | 2022-03-15T06:08:14.000Z | 2022-03-15T06:08:14.000Z | h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_5008_5386_glm_ordinal_large.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | 58 | 2021-10-01T12:43:37.000Z | 2021-12-08T22:58:43.000Z | h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_5008_5386_glm_ordinal_large.py | vishalbelsare/h2o-3 | 9322fb0f4c0e2358449e339a434f607d524c69fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
if __name__ == "__main__":
pyunit_utils.standalone_test(testOrdinalLogit)
else:
testOrdinalLogit()
| 45.333333 | 141 | 0.629644 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
def testOrdinalLogit():
Dtrain = h2o.import_file(pyunit_utils.locate("bigdata/laptop/glm_ordinal_logit/ordinal_ordinal_20_tra... | 2,240 | 0 | 46 |
d90ef5da98b8340392ecfb3fada8d9714ad70733 | 537 | py | Python | urlabridge/app/models.py | kaitlinlogie/url-abridge | dc50f1862de3303edeb4e90d3b75f336e808117b | [
"MIT"
] | null | null | null | urlabridge/app/models.py | kaitlinlogie/url-abridge | dc50f1862de3303edeb4e90d3b75f336e808117b | [
"MIT"
] | null | null | null | urlabridge/app/models.py | kaitlinlogie/url-abridge | dc50f1862de3303edeb4e90d3b75f336e808117b | [
"MIT"
] | null | null | null | from django.db import models
| 25.571429 | 86 | 0.6946 | from django.db import models
class Domain(models.Model):
domain = models.CharField(max_length=200)
def __str__(self):
return self.domain
class Path(models.Model):
domain = models.ForeignKey(Domain, on_delete=models.CASCADE)
redirect_from = models.CharField(max_length=5000)
redirect_to =... | 108 | 352 | 46 |
a23bb494afe62c84ae4f93b0840f0a82740884cd | 421 | py | Python | ectf'14/exploit/250/exploit.py | anarcheuz/CTF | beaccbfe036d90c7d7018978bad288c831d3f8f5 | [
"MIT"
] | 2 | 2015-03-24T22:20:08.000Z | 2018-05-12T16:41:13.000Z | ectf'14/exploit/250/exploit.py | anarcheuz/CTF | beaccbfe036d90c7d7018978bad288c831d3f8f5 | [
"MIT"
] | null | null | null | ectf'14/exploit/250/exploit.py | anarcheuz/CTF | beaccbfe036d90c7d7018978bad288c831d3f8f5 | [
"MIT"
] | null | null | null | import socket
import struct
from binascii import hexlify
system_plt = 0x080483a0
sh = 0x80485c0 # /bin/bash -c 'cat flag.txt'
payload = "A"*140
payload += struct.pack("<I", system_plt)
payload += "AAAA"
payload += struct.pack("<I", sh)
#open('payload', 'w').write(payload)
s=socket.create_connection(('212.71.235.214... | 18.304348 | 52 | 0.700713 | import socket
import struct
from binascii import hexlify
system_plt = 0x080483a0
sh = 0x80485c0 # /bin/bash -c 'cat flag.txt'
payload = "A"*140
payload += struct.pack("<I", system_plt)
payload += "AAAA"
payload += struct.pack("<I", sh)
#open('payload', 'w').write(payload)
s=socket.create_connection(('212.71.235.214... | 0 | 0 | 0 |
1bb4c5f165814f6f8bae4f8a473bb65e176ed0bb | 1,428 | py | Python | flydata.py | KitesForFuture/visualizer | 2ed1e7741f0998cba7a782f936822b1d5b539d47 | [
"MIT"
] | null | null | null | flydata.py | KitesForFuture/visualizer | 2ed1e7741f0998cba7a782f936822b1d5b539d47 | [
"MIT"
] | null | null | null | flydata.py | KitesForFuture/visualizer | 2ed1e7741f0998cba7a782f936822b1d5b539d47 | [
"MIT"
] | null | null | null | import struct
| 25.5 | 160 | 0.607143 | import struct
class Flydata():
def __init__(self, bytes):
# Cycle-Time (1), Height (1), Gyro-Vector (3), Accel-Vector (3), Rotation-Matrix (9), G-Correction-Axis (3), G-Correction-Angle (1), Position-Matrix (9)
data = struct.unpack('fffffffffffffffffffffffffffffff', bytes)
self.cycle_secon... | 915 | 476 | 23 |
9883d0fce6658908ad9144bec50e2e9e4127d938 | 727 | py | Python | kaijigame.py | theortsac/kaiji-e-card | 3eca9df6ff6cb1890619f7b5593090aa531a7718 | [
"MIT"
] | null | null | null | kaijigame.py | theortsac/kaiji-e-card | 3eca9df6ff6cb1890619f7b5593090aa531a7718 | [
"MIT"
] | null | null | null | kaijigame.py | theortsac/kaiji-e-card | 3eca9df6ff6cb1890619f7b5593090aa531a7718 | [
"MIT"
] | null | null | null | from random import randrange
kingCards = ['C', 'C', 'C', 'C', 'K']
slaveCards = ['C', 'C', 'C', 'C', 'S']
print("""- C = Citizen
- S = Slave
- K = King""")
for i in range(5):
print('Your cards:', slaveCards)
cardIPlay = input('Which card will you play? ')
slaveCards.remove(cardIPlay)
cardKPlay = kingCa... | 27.961538 | 52 | 0.562586 | from random import randrange
kingCards = ['C', 'C', 'C', 'C', 'K']
slaveCards = ['C', 'C', 'C', 'C', 'S']
print("""- C = Citizen
- S = Slave
- K = King""")
for i in range(5):
print('Your cards:', slaveCards)
cardIPlay = input('Which card will you play? ')
slaveCards.remove(cardIPlay)
cardKPlay = kingCa... | 0 | 0 | 0 |
558c916ef8163e6662f8789905d357318c3bed90 | 361 | py | Python | tests/base_testcase.py | projectshift/shift-user | ccab014378d60cd372419bcbf63ae6b4b3559d18 | [
"MIT"
] | null | null | null | tests/base_testcase.py | projectshift/shift-user | ccab014378d60cd372419bcbf63ae6b4b3559d18 | [
"MIT"
] | 16 | 2020-05-05T10:17:40.000Z | 2021-06-06T09:01:23.000Z | tests/base_testcase.py | projectshift/shift-user | ccab014378d60cd372419bcbf63ae6b4b3559d18 | [
"MIT"
] | null | null | null | from boiler.testing.testcase import ViewTestCase
from tests.test_app.app import app as test_app
class BaseTestCase(ViewTestCase):
"""
Base test case
Uses test case from shiftboiler to provide flask-integrated testing
facilities.
"""
| 22.5625 | 71 | 0.67036 | from boiler.testing.testcase import ViewTestCase
from tests.test_app.app import app as test_app
class BaseTestCase(ViewTestCase):
"""
Base test case
Uses test case from shiftboiler to provide flask-integrated testing
facilities.
"""
def setUp(self, app=None):
if not app:
ap... | 79 | 0 | 26 |
0bafb6537a70fec8df830c76f640e26f36eafc3c | 162 | py | Python | random/main.py | alexander-schilling/fintual_test | 3a8a3cd17dea4a7a1203eb1cd58a2af411700207 | [
"MIT"
] | null | null | null | random/main.py | alexander-schilling/fintual_test | 3a8a3cd17dea4a7a1203eb1cd58a2af411700207 | [
"MIT"
] | null | null | null | random/main.py | alexander-schilling/fintual_test | 3a8a3cd17dea4a7a1203eb1cd58a2af411700207 | [
"MIT"
] | null | null | null | from classes.portfolio import Portfolio
from classes.menu import Menu
main()
| 14.727273 | 39 | 0.697531 | from classes.portfolio import Portfolio
from classes.menu import Menu
def main():
portfolio = Portfolio()
menu = Menu(portfolio)
menu.run()
main()
| 61 | 0 | 23 |
e73dabd3fa271e007962498bfd2e13f26651cc6f | 1,184 | py | Python | scripts/dblp/wordcases.py | sandeepsoni/semantic-progressiveness | 824079b388d0eebc92b2197805b27ed320353f8f | [
"MIT"
] | 2 | 2021-04-11T16:28:44.000Z | 2021-07-31T03:22:07.000Z | scripts/dblp/wordcases.py | sandeepsoni/semantic-progressiveness | 824079b388d0eebc92b2197805b27ed320353f8f | [
"MIT"
] | null | null | null | scripts/dblp/wordcases.py | sandeepsoni/semantic-progressiveness | 824079b388d0eebc92b2197805b27ed320353f8f | [
"MIT"
] | 1 | 2021-09-01T22:45:25.000Z | 2021-09-01T22:45:25.000Z | import plac
import os
from collections import defaultdict
import logging
logging.basicConfig (format="%(asctime)s : %(levelname)s : %(message)s", level=logging.INFO)
@plac.annotations(
dirname = ("path of the directory", "positional"),
srcfile = ("source filename", "positional"),
tgtfile = ("target filename", "pos... | 30.358974 | 104 | 0.654561 | import plac
import os
from collections import defaultdict
import logging
logging.basicConfig (format="%(asctime)s : %(levelname)s : %(message)s", level=logging.INFO)
@plac.annotations(
dirname = ("path of the directory", "positional"),
srcfile = ("source filename", "positional"),
tgtfile = ("target filename", "pos... | 784 | 0 | 22 |
9984656faf22657ca1d0eb854e78379b3f16d39e | 514 | py | Python | example80.py | augustone/100examples | 94b593b5690a7403e1bf7424047f9a67822d2fd7 | [
"Unlicense"
] | 21 | 2017-05-01T10:23:42.000Z | 2021-09-27T17:11:43.000Z | example80.py | augustone/100examples | 94b593b5690a7403e1bf7424047f9a67822d2fd7 | [
"Unlicense"
] | null | null | null | example80.py | augustone/100examples | 94b593b5690a7403e1bf7424047f9a67822d2fd7 | [
"Unlicense"
] | 6 | 2017-05-26T12:23:26.000Z | 2020-06-30T01:57:36.000Z | #!/usr/bin/python3
__author__ = "yang.dd"
"""
example 080
"""
if __name__ == '__main__':
'''
从第五只猴子拿1个的桃子开始算
如果有一只不满足条件,则从头开始计算,直到满足
'''
monkey = 5
peach5th = 1
peach = 1
while monkey > 1:
total = peach * 5 + 1
if total % 4 == 0:
monkey -= 1
... | 17.133333 | 49 | 0.451362 | #!/usr/bin/python3
__author__ = "yang.dd"
"""
example 080
"""
if __name__ == '__main__':
'''
从第五只猴子拿1个的桃子开始算
如果有一只不满足条件,则从头开始计算,直到满足
'''
monkey = 5
peach5th = 1
peach = 1
while monkey > 1:
total = peach * 5 + 1
if total % 4 == 0:
monkey -= 1
... | 0 | 0 | 0 |
d3cf679068c141105ec4bb19427693ae79759075 | 3,129 | py | Python | s0ngbrew/codec.py | RhythmLunatic/s0ngbrew | a23c96971a1a447bf90f15851e35d1a1ed54b7fb | [
"0BSD"
] | 1 | 2021-04-09T23:43:08.000Z | 2021-04-09T23:43:08.000Z | s0ngbrew/codec.py | RhythmLunatic/s0ngbrew | a23c96971a1a447bf90f15851e35d1a1ed54b7fb | [
"0BSD"
] | null | null | null | s0ngbrew/codec.py | RhythmLunatic/s0ngbrew | a23c96971a1a447bf90f15851e35d1a1ed54b7fb | [
"0BSD"
] | 1 | 2019-12-15T15:18:05.000Z | 2019-12-15T15:18:05.000Z | #!/usr/bin/env python3
import os
import zlib
from struct import pack, unpack
class Codec(object):
"""\
Main codec for DRP.
"""
def run(self):
"""\
Run the codec and write the output file.
"""
with open(self.ifname, 'rb') as f:
self.iofunc(f)
def encode(self, f):
"""\
Encode DRP: Boilderplate ... | 27.447368 | 126 | 0.652605 | #!/usr/bin/env python3
import os
import zlib
from struct import pack, unpack
class FileCountError(Exception):
pass
class ChecksumError(Exception):
pass
class Codec(object):
"""\
Main codec for DRP.
"""
def __init__(self, ifname='', ofname='', is_bin=True):
self.ifname = ifname
#Currently automatic ofna... | 296 | 33 | 69 |
e5bb9891de1f56d0ec84f6d31b0fb41b00aa32ff | 142 | py | Python | 03 - Strings/Capitalize!.py | LynX-gh/HackerRank-python | 52705f423dd564463c67de1b8a2ded49bbef565e | [
"MIT"
] | null | null | null | 03 - Strings/Capitalize!.py | LynX-gh/HackerRank-python | 52705f423dd564463c67de1b8a2ded49bbef565e | [
"MIT"
] | null | null | null | 03 - Strings/Capitalize!.py | LynX-gh/HackerRank-python | 52705f423dd564463c67de1b8a2ded49bbef565e | [
"MIT"
] | null | null | null | # Complete the solve function below. | 28.4 | 50 | 0.626761 | # Complete the solve function below.
def solve(s):
names = s.split(' ')
name = ' '.join(t.capitalize() for t in names)
return name | 84 | 0 | 22 |
8dbb343f5b36e77896d6fa0de9e2829800a05cda | 3,216 | py | Python | src/osmo/make_tx.py | johnny-wang/staketaxcsv | 5e6ce5f17db780737192947008efb3d2f03b769e | [
"MIT"
] | null | null | null | src/osmo/make_tx.py | johnny-wang/staketaxcsv | 5e6ce5f17db780737192947008efb3d2f03b769e | [
"MIT"
] | null | null | null | src/osmo/make_tx.py | johnny-wang/staketaxcsv | 5e6ce5f17db780737192947008efb3d2f03b769e | [
"MIT"
] | null | null | null |
from common.make_tx import (
make_swap_tx, make_reward_tx, make_transfer_in_tx, make_transfer_out_tx,
make_unknown_tx, make_unknown_tx_with_transfer, _make_tx_exchange
)
from osmo import util_osmo
| 35.733333 | 114 | 0.731965 |
from common.make_tx import (
make_swap_tx, make_reward_tx, make_transfer_in_tx, make_transfer_out_tx,
make_unknown_tx, make_unknown_tx_with_transfer, _make_tx_exchange
)
from osmo import util_osmo
def _edit_row(row, txinfo, msginfo):
row.txid = txinfo.txid + "-" + str(msginfo.msg_index)
if msginfo.ms... | 2,698 | 0 | 299 |
13245723e2dda68ad0f4118a95b1a23aac9dde6a | 25,424 | py | Python | tests/tools/cpp/find_warnings.py | susundberg/arduino-aquarium-feeder | 3f243b35e8e27eb4fb551d19fae0b45175a4e23c | [
"MIT"
] | 2 | 2017-11-04T00:09:39.000Z | 2020-04-12T08:28:25.000Z | tests/tools/cpp/find_warnings.py | susundberg/esp8266-waterpump | f78a364c4dfec4ebd8fd2a744a190b5e57941479 | [
"MIT"
] | 1 | 2020-05-27T10:26:57.000Z | 2020-05-27T10:26:57.000Z | tests/tools/cpp/find_warnings.py | susundberg/esp8266-waterpump | f78a364c4dfec4ebd8fd2a744a190b5e57941479 | [
"MIT"
] | null | null | null | # Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google 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 ... | 42.373333 | 79 | 0.55542 | # Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google 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 ... | 16,951 | 6,493 | 192 |
2266f8b954a983ed3c58cd87ec4a30bca2c1d340 | 1,750 | py | Python | sims/s296/mkreconflux.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 1 | 2019-12-19T16:21:13.000Z | 2019-12-19T16:21:13.000Z | sims/s296/mkreconflux.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | null | null | null | sims/s296/mkreconflux.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 2 | 2020-01-08T06:23:33.000Z | 2020-01-08T07:06:50.000Z | import numpy
from pylab import *
import tables
rc('text', usetex=True)
Lx = 100.0
Ly = 50.0
B0 = 1/15.0
n0 = 1.0
mu0 = 1.0
elcCharge = -1.0
ionCharge = 1.0
ionMass = 1.0
elcMass = ionMass/25
elcMass = ionMass/25
ionCycl = ionCharge*B0/ionMass
start = 0
end = 100
nFrame = end-start+1
tm = zeros((nFrame,), float)
flx... | 20.348837 | 58 | 0.562857 | import numpy
from pylab import *
import tables
rc('text', usetex=True)
Lx = 100.0
Ly = 50.0
B0 = 1/15.0
n0 = 1.0
mu0 = 1.0
elcCharge = -1.0
ionCharge = 1.0
ionMass = 1.0
elcMass = ionMass/25
elcMass = ionMass/25
ionCycl = ionCharge*B0/ionMass
start = 0
end = 100
nFrame = end-start+1
tm = zeros((nFrame,), float)
flx... | 482 | 0 | 46 |
e8d016a809ef62359bb058fb37178516edf1ec1c | 4,798 | py | Python | main.py | NairVish/rat-gene-annotation | e9b9f0668b38730cb47c302a30d257f3854e7f6a | [
"MIT"
] | null | null | null | main.py | NairVish/rat-gene-annotation | e9b9f0668b38730cb47c302a30d257f3854e7f6a | [
"MIT"
] | null | null | null | main.py | NairVish/rat-gene-annotation | e9b9f0668b38730cb47c302a30d257f3854e7f6a | [
"MIT"
] | null | null | null | import csv
import time
import requests
import argparse
from sys import exit
from typing import List, Optional, Tuple, Any
from bs4 import BeautifulSoup
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', action='store', type=str, required=True)
parser.add_... | 35.540741 | 160 | 0.647561 | import csv
import time
import requests
import argparse
from sys import exit
from typing import List, Optional, Tuple, Any
from bs4 import BeautifulSoup
def get_ensembl_data(transcript_id: str) -> Tuple[Optional[str], Optional[str], Optional[str], Optional[str]]:
gene_name, gene_desc, gene_type, strand = None, Non... | 2,709 | 0 | 69 |
a053594c48b4b655f20976e125386814a1da178f | 1,944 | py | Python | tests/test_cell.py | billwright/GridPuzzles | 9660880748c656d1a9ac6205eff8cfd22555e069 | [
"MIT"
] | 1 | 2021-01-14T00:29:52.000Z | 2021-01-14T00:29:52.000Z | tests/test_cell.py | billwright/GridPuzzles | 9660880748c656d1a9ac6205eff8cfd22555e069 | [
"MIT"
] | null | null | null | tests/test_cell.py | billwright/GridPuzzles | 9660880748c656d1a9ac6205eff8cfd22555e069 | [
"MIT"
] | null | null | null | import unittest
from Cell import Cell
from Blanking_Cell_Exception import Blanking_Cell_Exception
if __name__ == '__main__':
unittest.main()
| 32.4 | 82 | 0.633745 | import unittest
from Cell import Cell
from Blanking_Cell_Exception import Blanking_Cell_Exception
class TestCell(unittest.TestCase):
def test_cell_creation(self):
cell = Cell('A1', '1234')
self.assertIsNotNone(cell)
self.assertEqual('A1', cell.address)
self.assertEqual('1234', ce... | 1,616 | 13 | 166 |
c11f5d238f7a33c8a3ecbcbde814b2502bb65588 | 3,790 | py | Python | tearing/graph_modules.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | tearing/graph_modules.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | tearing/graph_modules.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
| 36.095238 | 88 | 0.473879 | import torch
from torch import nn
class GraphFilter(nn.Module):
def __init__(self, grid_dims, graph_r, graph_eps, graph_lam):
super(GraphFilter, self).__init__()
self.grid_dims = grid_dims
self.graph_r = graph_r
self.graph_eps_sqr = graph_eps * graph_eps
self.graph_lam = gr... | 3,671 | 8 | 76 |
ebaf6c62d58d48f5c9b9b30a6c3488240ae105a8 | 7,090 | py | Python | machine_learning/ml_ch4.py | ivanlevsky/cowabunga-potato | ab317582b7b8f99d7be3ea4f5edbe9829fc398fb | [
"MIT"
] | null | null | null | machine_learning/ml_ch4.py | ivanlevsky/cowabunga-potato | ab317582b7b8f99d7be3ea4f5edbe9829fc398fb | [
"MIT"
] | null | null | null | machine_learning/ml_ch4.py | ivanlevsky/cowabunga-potato | ab317582b7b8f99d7be3ea4f5edbe9829fc398fb | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures, StandardScaler
# --... | 37.315789 | 95 | 0.591255 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures, StandardScaler
# --... | 776 | 0 | 23 |
922c6d09b01b7f8d5feb3572846faf5f1552685f | 577 | py | Python | vendor/haproxy-1.9.1/tests/test-sockpair.py | junsulee/c-goof | 240c979dd014ed3bb9c8dddf5d0e66afb6a8c2f2 | [
"Apache-2.0"
] | 2 | 2021-11-25T13:42:35.000Z | 2022-02-05T07:58:14.000Z | vendor/haproxy-1.9.1/tests/test-sockpair.py | junsulee/c-goof | 240c979dd014ed3bb9c8dddf5d0e66afb6a8c2f2 | [
"Apache-2.0"
] | null | null | null | vendor/haproxy-1.9.1/tests/test-sockpair.py | junsulee/c-goof | 240c979dd014ed3bb9c8dddf5d0e66afb6a8c2f2 | [
"Apache-2.0"
] | 15 | 2021-11-24T15:40:54.000Z | 2022-03-02T09:17:03.000Z | #!/usr/bin/python
"""
Python wrapper example to test socketpair protocol
./test-socketpair.py test.cfg
use sockpair@${FD1} and sockpair@${FD2} in your configuration file
"""
import socket, os, sys
s = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
os.set_inheritable(s[0].fileno(), 1)
os.set_inheritable(s[1].... | 19.896552 | 66 | 0.651646 | #!/usr/bin/python
"""
Python wrapper example to test socketpair protocol
./test-socketpair.py test.cfg
use sockpair@${FD1} and sockpair@${FD2} in your configuration file
"""
import socket, os, sys
s = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
os.set_inheritable(s[0].fileno(), 1)
os.set_inheritable(s[1].... | 0 | 0 | 0 |
24f33a3e9b503bf6b6318334720a5eb6ff38c001 | 224 | py | Python | output/models/sun_data/elem_decl/abstract/abstract00101m/abstract00101m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/sun_data/elem_decl/abstract/abstract00101m/abstract00101m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/sun_data/elem_decl/abstract/abstract00101m/abstract00101m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.sun_data.elem_decl.abstract.abstract00101m.abstract00101m_xsd.abstract00101m import (
Head,
HeadType,
Member1,
Root,
)
__all__ = [
"Head",
"HeadType",
"Member1",
"Root",
]
| 16 | 104 | 0.651786 | from output.models.sun_data.elem_decl.abstract.abstract00101m.abstract00101m_xsd.abstract00101m import (
Head,
HeadType,
Member1,
Root,
)
__all__ = [
"Head",
"HeadType",
"Member1",
"Root",
]
| 0 | 0 | 0 |
55bc93f1f28a4d3cfdbf2ceae0689c9e65f3b7d4 | 10,760 | py | Python | cmdb/models.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | 3 | 2015-11-05T07:29:00.000Z | 2021-06-17T23:44:17.000Z | cmdb/models.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | 1 | 2016-05-04T10:54:48.000Z | 2016-05-04T10:54:56.000Z | cmdb/models.py | proffalken/edison | 5bfa941f8876cb8698cd8009c4514bc03d24c109 | [
"BSD-3-Clause"
] | null | null | null | # This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
from django.db import models
from django.contrib.auth.models import User
# These are the models required for the basic CMDB
# First, Define our list of countrie... | 34.15873 | 205 | 0.683922 | # This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
from django.db import models
from django.contrib.auth.models import User
# These are the models required for the basic CMDB
# First, Define our list of countrie... | 1,077 | 8,174 | 469 |
2f2714142396728fd927af9cf97aff6dece18541 | 1,318 | py | Python | brightermonday.py | Simonwafula/Kenyan-Jobsites-Scraper | 05589adc2a2253e4bd61de2338ce7c3061afd697 | [
"Apache-2.0"
] | null | null | null | brightermonday.py | Simonwafula/Kenyan-Jobsites-Scraper | 05589adc2a2253e4bd61de2338ce7c3061afd697 | [
"Apache-2.0"
] | null | null | null | brightermonday.py | Simonwafula/Kenyan-Jobsites-Scraper | 05589adc2a2253e4bd61de2338ce7c3061afd697 | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import sqlite3
conn = sqlite3.connect("output.db")
cur = conn.cursor()
headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Max-Age': '3600',
'User-Agent'... | 32.146341 | 96 | 0.657056 | from bs4 import BeautifulSoup
import requests
import sqlite3
conn = sqlite3.connect("output.db")
cur = conn.cursor()
headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Max-Age': '3600',
'User-Agent'... | 0 | 0 | 0 |
70cfb9a2c6a526447cb9611d46444aadca43a0be | 1,791 | py | Python | MyWord2Vec.py | hakimkt/SAIVS | c310bd7c9426f0d21efeea8866cf6b881b7e8530 | [
"Apache-2.0"
] | 40 | 2018-10-29T02:29:13.000Z | 2021-11-23T13:14:50.000Z | MyWord2Vec.py | 5l1v3r1/SAIVS | aa62451665b6398ba329d68592bf4313be60a886 | [
"Apache-2.0"
] | 1 | 2021-02-23T12:27:28.000Z | 2021-02-23T12:27:28.000Z | MyWord2Vec.py | 5l1v3r1/SAIVS | aa62451665b6398ba329d68592bf4313be60a886 | [
"Apache-2.0"
] | 29 | 2018-10-29T02:29:17.000Z | 2022-03-17T06:31:35.000Z | # -*- coding: utf-8 -*-
from gensim.models import word2vec
import os
import logging
MODEL_NAME = 'text8'
DATA_PATH = 'data\\text8'
| 37.3125 | 114 | 0.537688 | # -*- coding: utf-8 -*-
from gensim.models import word2vec
import os
import logging
MODEL_NAME = 'text8'
DATA_PATH = 'data\\text8'
class Word2Vec:
def __init__(self, int_count=10):
self.int_word_count = int_count
def learn_sentense(self):
if os.path.exists(MODEL_NAME):
... | 1,527 | -6 | 138 |
131c6ed9e704d68d36f814ce2b61e216c5b751dd | 4,159 | py | Python | siftOnePixel.py | hakimhassani97/SIFT | b105a0eeb04f7dacd97e96a493bb01e859937098 | [
"MIT"
] | 1 | 2021-05-06T15:33:11.000Z | 2021-05-06T15:33:11.000Z | siftOnePixel.py | hakimhassani97/SIFT | b105a0eeb04f7dacd97e96a493bb01e859937098 | [
"MIT"
] | null | null | null | siftOnePixel.py | hakimhassani97/SIFT | b105a0eeb04f7dacd97e96a493bb01e859937098 | [
"MIT"
] | null | null | null | import cv2 as cv2
import numpy as np
from collections import Counter
import math
import matplotlib.pyplot as plt
#test images
# s='add.png'
s='lenna.jpg'
s='ttt.jpg'
#pixel used for SIFT
pixelX=200
pixelY=200
#functions
#main
img=cv2.imread(s)
h,w,d = np.shape(img)
#convolution matrix
c=1
... | 28.486301 | 104 | 0.576821 | import cv2 as cv2
import numpy as np
from collections import Counter
import math
import matplotlib.pyplot as plt
#test images
# s='add.png'
s='lenna.jpg'
s='ttt.jpg'
#pixel used for SIFT
pixelX=200
pixelY=200
#functions
def drawContours(img,contours,color):
contours=np.array(contours)
for i... | 2,811 | 0 | 248 |
d9a445fd552ca2fc90e819d34d3f6859d94151a1 | 895 | py | Python | carbon/setup.py | katzj/graphite | e33bf5e035360880c4172a3c2ecb355485d7b172 | [
"Apache-2.0"
] | 1 | 2016-07-25T09:45:31.000Z | 2016-07-25T09:45:31.000Z | carbon/setup.py | katzj/graphite | e33bf5e035360880c4172a3c2ecb355485d7b172 | [
"Apache-2.0"
] | null | null | null | carbon/setup.py | katzj/graphite | e33bf5e035360880c4172a3c2ecb355485d7b172 | [
"Apache-2.0"
] | 2 | 2018-03-19T17:49:03.000Z | 2018-12-04T02:14:09.000Z | #!/usr/bin/env python
import os
from glob import glob
if os.environ.get('USE_SETUPTOOLS'):
from setuptools import setup
setup_kwargs = dict(zip_safe=0)
else:
from distutils.core import setup
setup_kwargs = dict()
storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]),
('storage/log'... | 25.571429 | 73 | 0.661453 | #!/usr/bin/env python
import os
from glob import glob
if os.environ.get('USE_SETUPTOOLS'):
from setuptools import setup
setup_kwargs = dict(zip_safe=0)
else:
from distutils.core import setup
setup_kwargs = dict()
storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]),
('storage/log'... | 0 | 0 | 0 |
faf10b239be49828238fcb5f71856d89bfc15fda | 3,376 | py | Python | Scripts/netCDF_splitter2var_2D.py | wolfiex/AC_tools | de5b156ddcc01437bf80b4785d6a327b35d67cc6 | [
"Unlicense"
] | 7 | 2016-10-20T14:55:07.000Z | 2022-03-28T15:35:52.000Z | Scripts/netCDF_splitter2var_2D.py | wolfiex/AC_tools | de5b156ddcc01437bf80b4785d6a327b35d67cc6 | [
"Unlicense"
] | 44 | 2016-09-23T14:02:51.000Z | 2022-03-24T09:53:50.000Z | Scripts/netCDF_splitter2var_2D.py | wolfiex/AC_tools | de5b156ddcc01437bf80b4785d6a327b35d67cc6 | [
"Unlicense"
] | 9 | 2016-10-24T15:33:51.000Z | 2021-08-06T17:52:49.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Split off 2D variable from file with other variables
Notes
----
- based on software carpentary example.
http://damienirving.github.io/capstone-oceanography/03-data-provenance.html
"""
# Modules to import
from netCDF4 import Dataset
import numpy as np
import pylab as pl
... | 25.19403 | 75 | 0.635367 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Split off 2D variable from file with other variables
Notes
----
- based on software carpentary example.
http://damienirving.github.io/capstone-oceanography/03-data-provenance.html
"""
# Modules to import
from netCDF4 import Dataset
import numpy as np
import pylab as pl
... | 0 | 0 | 0 |
b66307882f2392b2f67c3b822cca4c439efe95c5 | 30,127 | py | Python | Ball Handle/base.py | maxbot5/Ball-Handle-Software | fe1b04c3f252a9e6848c2e79601f5633473abb28 | [
"MIT"
] | null | null | null | Ball Handle/base.py | maxbot5/Ball-Handle-Software | fe1b04c3f252a9e6848c2e79601f5633473abb28 | [
"MIT"
] | null | null | null | Ball Handle/base.py | maxbot5/Ball-Handle-Software | fe1b04c3f252a9e6848c2e79601f5633473abb28 | [
"MIT"
] | null | null | null | <<<<<<< HEAD
import time
import numpy as np
import Adafruit_BBIO.PWM as PWM
from PixyCam import PixyCam
from imu import Imu
from servo import Servo
from wheel import Wheel
from classes import State
import constants as cons
import threading
#import logging
import sys
from queue import LifoQueue
count =0
ball_status_new... | 44.898659 | 184 | 0.61181 | <<<<<<< HEAD
import time
import numpy as np
import Adafruit_BBIO.PWM as PWM
from PixyCam import PixyCam
from imu import Imu
from servo import Servo
from wheel import Wheel
from classes import State
import constants as cons
import threading
#import logging
import sys
from queue import LifoQueue
count =0
ball_status_new... | 26,163 | 86 | 766 |
060da80f798be7d2874ba9bc7f1c914bddfe0970 | 17,566 | py | Python | nailgun/nailgun/network/neutron.py | dnikishov/fuel-web | 152c2072cf585fc61d7e157ccf9a7ea1d0377daa | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/network/neutron.py | dnikishov/fuel-web | 152c2072cf585fc61d7e157ccf9a7ea1d0377daa | [
"Apache-2.0"
] | null | null | null | nailgun/nailgun/network/neutron.py | dnikishov/fuel-web | 152c2072cf585fc61d7e157ccf9a7ea1d0377daa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | 37.137421 | 79 | 0.5986 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | 1,642 | 14,546 | 115 |
f1eeece7c0f18999599212275f25573bdf1f2fc4 | 9,267 | py | Python | phns/graph.py | DeepLenin/phns | 80fb48d032cd159782a5d96724e91540a55271ef | [
"MIT"
] | 5 | 2020-04-03T20:59:46.000Z | 2020-07-08T17:40:40.000Z | phns/graph.py | DeepLenin/phns | 80fb48d032cd159782a5d96724e91540a55271ef | [
"MIT"
] | null | null | null | phns/graph.py | DeepLenin/phns | 80fb48d032cd159782a5d96724e91540a55271ef | [
"MIT"
] | null | null | null | import itertools
import numpy as np
from scipy.sparse.csgraph import shortest_path
| 33.334532 | 87 | 0.573109 | import itertools
import numpy as np
from scipy.sparse.csgraph import shortest_path
class Node:
def __init__(self, value, index, meta={}):
self.in_edges = []
self.out_edges = []
self.value = value
self.index = index
self.meta = meta
def __repr__(self):
return f... | 8,705 | 607 | 145 |
a96304dec6862bdf083752a9af5442f5bd3ef565 | 1,957 | py | Python | tests/encryption_test.py | faradaywallet/faradayapp | db9392aea48946979b974d64db3e856b43bc287f | [
"MIT"
] | null | null | null | tests/encryption_test.py | faradaywallet/faradayapp | db9392aea48946979b974d64db3e856b43bc287f | [
"MIT"
] | null | null | null | tests/encryption_test.py | faradaywallet/faradayapp | db9392aea48946979b974d64db3e856b43bc287f | [
"MIT"
] | null | null | null | from encrypt import Encrypt
import json
Encrypt = Encrypt()
if __name__ == '__main__':
payload_encryption_test()
| 32.616667 | 112 | 0.722024 | from encrypt import Encrypt
import json
Encrypt = Encrypt()
def payload_encryption_test():
password = b'testpwd'
payload = {'ccnum': '1111222233334444', 'expdate': '09/13/2018', 'cvc': '123', 'notes': 'adding user notes'}
salt = Encrypt.generate_salt()
print('ENCRYPT\TEST: salt: ', salt)
sym_key... | 1,791 | 0 | 46 |
1a0af461995c8249b4ab9f68a503e712e5f4c6f2 | 1,598 | py | Python | SpiralSpline/SpiralSpline.py | sterlingcrispin/Fusion360API | 5ef8d2ac9fce5476f8c7501aa213c16f54fd481a | [
"Unlicense"
] | 12 | 2017-08-29T12:41:08.000Z | 2022-03-18T13:19:59.000Z | SpiralSpline/SpiralSpline.py | sterlingcrispin/Fusion360API | 5ef8d2ac9fce5476f8c7501aa213c16f54fd481a | [
"Unlicense"
] | null | null | null | SpiralSpline/SpiralSpline.py | sterlingcrispin/Fusion360API | 5ef8d2ac9fce5476f8c7501aa213c16f54fd481a | [
"Unlicense"
] | 5 | 2019-04-10T09:22:28.000Z | 2022-02-15T12:54:39.000Z | #Author-Sterling Crispin
#Description-directly adapted from http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c3d4a306-fade-11e4-8e56-3417ebd3d5be
import adsk.core, adsk.fusion, traceback
import math | 35.511111 | 126 | 0.59637 | #Author-Sterling Crispin
#Description-directly adapted from http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c3d4a306-fade-11e4-8e56-3417ebd3d5be
import adsk.core, adsk.fusion, traceback
import math
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterfa... | 1,369 | 0 | 23 |
8b7d537952b1acd31cd5604bc842bcbe32faaea9 | 1,240 | py | Python | Misc_TestCode/problem_set_1-3.py | osamadel/Python | 6c7e26a96d4b8f875755de98f16eba89e81d94d2 | [
"MIT"
] | null | null | null | Misc_TestCode/problem_set_1-3.py | osamadel/Python | 6c7e26a96d4b8f875755de98f16eba89e81d94d2 | [
"MIT"
] | null | null | null | Misc_TestCode/problem_set_1-3.py | osamadel/Python | 6c7e26a96d4b8f875755de98f16eba89e81d94d2 | [
"MIT"
] | null | null | null | """
Description :
A program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
required by the credit card company each month.
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
monthlyPaymentRate - minimum mont... | 32.631579 | 111 | 0.756452 | """
Description :
A program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
required by the credit card company each month.
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
monthlyPaymentRate - minimum mont... | 0 | 0 | 0 |
6579848b1593a2da0e2c319da40528c3a7235254 | 2,720 | py | Python | backend/wod_board/tests/crud/test_movement.py | GuillaumeOj/P13-WOD-Board | 36df7979e63c354507edb56eabdfc548b1964d08 | [
"MIT"
] | null | null | null | backend/wod_board/tests/crud/test_movement.py | GuillaumeOj/P13-WOD-Board | 36df7979e63c354507edb56eabdfc548b1964d08 | [
"MIT"
] | 82 | 2021-01-17T18:12:23.000Z | 2021-06-12T21:46:49.000Z | backend/wod_board/tests/crud/test_movement.py | GuillaumeOj/WodBoard | 1ac12404f6094909c9bf116bcaf6ccd60e85bc00 | [
"MIT"
] | null | null | null | import pytest
from wod_board import exceptions
from wod_board.crud import movement_crud
from wod_board.models import movement
from wod_board.models import unit
from wod_board.schemas import movement_schemas
| 33.170732 | 75 | 0.745221 | import pytest
from wod_board import exceptions
from wod_board.crud import movement_crud
from wod_board.models import movement
from wod_board.models import unit
from wod_board.schemas import movement_schemas
def test_create_movement(db, db_unit):
assert db.query(movement.Movement).count() == 0
devil_press = ... | 2,392 | 0 | 115 |
0b23c79247e242a9c10909666bbd15979acc980b | 7,058 | py | Python | indicators.py | fwd1990man/PHPCodeScanner | d3601820da465513944ff20650558b862f9ccde1 | [
"MIT"
] | 2 | 2021-05-19T00:09:22.000Z | 2021-05-19T00:09:24.000Z | indicators.py | fwd1990man/PHPCodeScanner | d3601820da465513944ff20650558b862f9ccde1 | [
"MIT"
] | null | null | null | indicators.py | fwd1990man/PHPCodeScanner | d3601820da465513944ff20650558b862f9ccde1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# /!\ Detection Format (.*)function($vuln)(.*) matched by payload[0]+regex_indicators
regex_indicators = '\\((.*?)(\\$_GET\\[.*?\\]|\\$_FILES\\[.*?\\]|\\$_POST\\[.*?\\]|\\$_REQUEST\\[.*?\\]|\\$_COOKIES\\[.*?\\]|\\$_SESSION\\[.*?\\]|\\$(?!this|e-)[a-zA-Z0-9_,]*)(.*?)\\)'
# Fun... | 48.342466 | 184 | 0.638424 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# /!\ Detection Format (.*)function($vuln)(.*) matched by payload[0]+regex_indicators
regex_indicators = '\\((.*?)(\\$_GET\\[.*?\\]|\\$_FILES\\[.*?\\]|\\$_POST\\[.*?\\]|\\$_REQUEST\\[.*?\\]|\\$_COOKIES\\[.*?\\]|\\$_SESSION\\[.*?\\]|\\$(?!this|e-)[a-zA-Z0-9_,]*)(.*?)\\)'
# Fun... | 0 | 0 | 0 |
76131c72b8636284a0712af7817874865d24b1ea | 3,734 | py | Python | src/polyswarm/client/engine.py | polyswarm/polyswarm-cli | f783b77180a7436bc993171b46691a223f175260 | [
"MIT"
] | 2 | 2021-04-14T01:42:48.000Z | 2022-03-12T16:20:23.000Z | src/polyswarm/client/engine.py | polyswarm/polyswarm-cli | f783b77180a7436bc993171b46691a223f175260 | [
"MIT"
] | 11 | 2019-10-22T23:23:27.000Z | 2021-06-07T21:40:10.000Z | src/polyswarm/client/engine.py | polyswarm/polyswarm-cli | f783b77180a7436bc993171b46691a223f175260 | [
"MIT"
] | 1 | 2021-04-26T10:58:01.000Z | 2021-04-26T10:58:01.000Z | from __future__ import absolute_import
import logging
import click
logger = logging.getLogger(__name__)
@click.group(short_help="Interact with engines.")
@engine.group(short_help="Interact with engine's votes.")
@engine.group(short_help="Interact with engine's assertions.")
@assertions.command('create', short... | 29.171875 | 102 | 0.71023 | from __future__ import absolute_import
import logging
import click
logger = logging.getLogger(__name__)
@click.group(short_help="Interact with engines.")
def engine():
pass
@engine.group(short_help="Interact with engine's votes.")
def votes():
pass
@engine.group(short_help="Interact with engine's assert... | 345 | 0 | 110 |
540ebc7352e4bff5af37415803694be42d874d61 | 8,339 | py | Python | rapp_testing_tools/src/rapp_testing_tools/rapp_testing_core.py | DEVX1/NAOrapp-Pythonlib | d07d7fe304556cad24e7e138df4e41376eacb6a7 | [
"Apache-2.0"
] | null | null | null | rapp_testing_tools/src/rapp_testing_tools/rapp_testing_core.py | DEVX1/NAOrapp-Pythonlib | d07d7fe304556cad24e7e138df4e41376eacb6a7 | [
"Apache-2.0"
] | null | null | null | rapp_testing_tools/src/rapp_testing_tools/rapp_testing_core.py | DEVX1/NAOrapp-Pythonlib | d07d7fe304556cad24e7e138df4e41376eacb6a7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright 2015 RAPP
#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 applicabl... | 29.996403 | 82 | 0.58832 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright 2015 RAPP
#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 applicabl... | 5,487 | 205 | 154 |
fd1c96698e6f7c7562f10de30edc13bc0b766cbf | 15,403 | py | Python | pymontecarlo_gui/options/beam/base.py | pymontecarlo/pymontecarlo-gui | 1b3c37d4b634a85c63f23d27ea8bd79bf5a43a2f | [
"Apache-2.0"
] | null | null | null | pymontecarlo_gui/options/beam/base.py | pymontecarlo/pymontecarlo-gui | 1b3c37d4b634a85c63f23d27ea8bd79bf5a43a2f | [
"Apache-2.0"
] | 2 | 2016-05-16T10:19:56.000Z | 2021-12-29T15:16:20.000Z | pymontecarlo_gui/options/beam/base.py | pymontecarlo/pymontecarlo-gui | 1b3c37d4b634a85c63f23d27ea8bd79bf5a43a2f | [
"Apache-2.0"
] | null | null | null | """"""
# Standard library modules.
import abc
from collections import namedtuple
import itertools
# Third party modules.
from qtpy import QtCore, QtGui, QtWidgets
import numpy as np
# Local modules.
from pymontecarlo.options.beam.base import BeamBase
from pymontecarlo.options.particle import Particle
from pymonteca... | 28.898687 | 82 | 0.652925 | """"""
# Standard library modules.
import abc
from collections import namedtuple
import itertools
# Third party modules.
from qtpy import QtCore, QtGui, QtWidgets
import numpy as np
# Local modules.
from pymontecarlo.options.beam.base import BeamBase
from pymontecarlo.options.particle import Particle
from pymonteca... | 11,979 | 894 | 1,769 |
46bea9e2fbb3568b36cb4f14630ab5d9663be4d5 | 826 | py | Python | pyrads/Absorption_Crosssections_UV.py | ddbkoll/PyRADS-shortwave | 9d86f7dc07bef37f832949a584f0abe2fd3b72c4 | [
"MIT"
] | 3 | 2020-12-22T17:39:12.000Z | 2021-02-10T12:31:52.000Z | pyrads/Absorption_Crosssections_UV.py | ddbkoll/PyRADS-shortwave | 9d86f7dc07bef37f832949a584f0abe2fd3b72c4 | [
"MIT"
] | 1 | 2019-11-26T22:53:52.000Z | 2021-02-18T13:35:50.000Z | pyrads/Absorption_Crosssections_UV.py | ddbkoll/PyRADS-shortwave | 9d86f7dc07bef37f832949a584f0abe2fd3b72c4 | [
"MIT"
] | 1 | 2021-05-21T17:55:36.000Z | 2021-05-21T17:55:36.000Z | from __future__ import division, print_function, absolute_import
import numpy as np
from . import phys
import os
'''
Implement UV scattering cross-sections.
Either data or fits.
'''
### -----------------------------------
### Global definitions here
### -----------------------------------
### Absorption crosssectio... | 27.533333 | 122 | 0.561743 | from __future__ import division, print_function, absolute_import
import numpy as np
from . import phys
import os
'''
Implement UV scattering cross-sections.
Either data or fits.
'''
### -----------------------------------
### Global definitions here
### -----------------------------------
### Absorption crosssectio... | 436 | 0 | 23 |
1685731263b74c59bfdef531e9fab0f3fc9420f5 | 200 | py | Python | scripts/item/consume_2434574.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/item/consume_2434574.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/item/consume_2434574.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Full Moon Damage Skin
success = sm.addDamageSkin(2434574)
if success:
sm.chat("The Full Moon Damage Skin has been added to your account's damage skin collection.")
# sm.consumeItem(2434574)
| 33.333333 | 97 | 0.745 | # Full Moon Damage Skin
success = sm.addDamageSkin(2434574)
if success:
sm.chat("The Full Moon Damage Skin has been added to your account's damage skin collection.")
# sm.consumeItem(2434574)
| 0 | 0 | 0 |
212466f096bb63bb64ea1c7aed334c836bb300b4 | 4,215 | py | Python | engineering/dataset/crawl_codes/cjscrape.py | ningfeiwang/Code_De-anonymization | 7c144be4f84eab8d6373ab7608280d80128435d5 | [
"MIT"
] | 3 | 2019-09-26T18:52:33.000Z | 2020-06-13T10:17:22.000Z | engineering/dataset/crawl_codes/cjscrape.py | ningfeiwang/Code_De-anonymization | 7c144be4f84eab8d6373ab7608280d80128435d5 | [
"MIT"
] | null | null | null | engineering/dataset/crawl_codes/cjscrape.py | ningfeiwang/Code_De-anonymization | 7c144be4f84eab8d6373ab7608280d80128435d5 | [
"MIT"
] | 1 | 2021-08-09T09:21:18.000Z | 2021-08-09T09:21:18.000Z | #!/usr/local/bin/python
# coding:utf-8
from urllib import urlopen
from urllib import urlretrieve
import json
import sys
import os
import zipfile
import shutil
import multiprocessing
# returns the URL to download the user submission
# scrapes the C/C++/Python files of the given round
# main section of script
if __na... | 37.972973 | 106 | 0.541637 | #!/usr/local/bin/python
# coding:utf-8
from urllib import urlopen
from urllib import urlretrieve
import json
import sys
import os
import zipfile
import shutil
import multiprocessing
# returns the URL to download the user submission
def get_download_url(round_id, problem_id, username):
return "http://code.google.c... | 3,212 | 0 | 44 |
2282f6e87cb3130b7496b5870fd8c7852d9ed08b | 1,972 | py | Python | tests/test_il_medicaid.py | kiwisquash/city-scrapers | 38ca372467856853b36ec180c440eef0a0c6ce5b | [
"MIT"
] | 1 | 2019-03-18T03:12:25.000Z | 2019-03-18T03:12:25.000Z | tests/test_il_medicaid.py | kiwisquash/city-scrapers | 38ca372467856853b36ec180c440eef0a0c6ce5b | [
"MIT"
] | null | null | null | tests/test_il_medicaid.py | kiwisquash/city-scrapers | 38ca372467856853b36ec180c440eef0a0c6ce5b | [
"MIT"
] | null | null | null | from datetime import datetime
from os.path import dirname, join
import re
import pytest
from freezegun import freeze_time
from city_scrapers_core.constants import NOT_CLASSIFIED
from city_scrapers_core.utils import file_response
from city_scrapers.spiders.il_medicaid import IlMedicaidSpider
test_response = file_resp... | 22.409091 | 88 | 0.678499 | from datetime import datetime
from os.path import dirname, join
import re
import pytest
from freezegun import freeze_time
from city_scrapers_core.constants import NOT_CLASSIFIED
from city_scrapers_core.utils import file_response
from city_scrapers.spiders.il_medicaid import IlMedicaidSpider
test_response = file_resp... | 52 | 0 | 23 |
79b80d0c3b746a092c83a791ebac8e67d24c451d | 16,170 | py | Python | v0/aia_eis_v0/circuits/vogit_1.py | DreamBoatOve/aia_eis | 458b4d29846669b10db4da1b3e86c0b394614ceb | [
"MIT"
] | 1 | 2022-03-02T12:57:19.000Z | 2022-03-02T12:57:19.000Z | v0/aia_eis_v0/circuits/vogit_1.py | DreamBoatOve/aia_eis | 458b4d29846669b10db4da1b3e86c0b394614ceb | [
"MIT"
] | null | null | null | v0/aia_eis_v0/circuits/vogit_1.py | DreamBoatOve/aia_eis | 458b4d29846669b10db4da1b3e86c0b394614ceb | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
import numpy as np
import math
import copy
import os
from circuits.elements import ele_C, ele_L
from IS.IS import IS_0
from IS.IS_criteria import cal_ChiSquare_0
from utils.file_utils.pickle_utils import pickle_file
from utils.visualize_utils.IS_plots.ny import nyquist_multiPlots_1, n... | 38.317536 | 147 | 0.532158 | import sys
sys.path.append('../')
import numpy as np
import math
import copy
import os
from circuits.elements import ele_C, ele_L
from IS.IS import IS_0
from IS.IS_criteria import cal_ChiSquare_0
from utils.file_utils.pickle_utils import pickle_file
from utils.visualize_utils.IS_plots.ny import nyquist_multiPlots_1, n... | 1,881 | 0 | 112 |
8ce4728ba2ad7bcb6e60aff77117e3d48d808d4a | 406 | py | Python | Python3/FileIO/write.py | norbertosanchezdichi/TIL | 2e9719ddd288022f53b094a42679e849bdbcc625 | [
"MIT"
] | null | null | null | Python3/FileIO/write.py | norbertosanchezdichi/TIL | 2e9719ddd288022f53b094a42679e849bdbcc625 | [
"MIT"
] | null | null | null | Python3/FileIO/write.py | norbertosanchezdichi/TIL | 2e9719ddd288022f53b094a42679e849bdbcc625 | [
"MIT"
] | null | null | null | with open("haiku.txt", "w") as file:
file.write("Writing files is great\n")
file.write("Here's another line of text\n")
file.write("Closing now, goodbye!")
with open("haiku.txt", "w") as file:
file.write("Here's one more haiku\n")
file.write("What about the older one?\n")
file.write("Let's ... | 33.833333 | 47 | 0.62069 | with open("haiku.txt", "w") as file:
file.write("Writing files is great\n")
file.write("Here's another line of text\n")
file.write("Closing now, goodbye!")
with open("haiku.txt", "w") as file:
file.write("Here's one more haiku\n")
file.write("What about the older one?\n")
file.write("Let's ... | 0 | 0 | 0 |
4a3e2b0ffbf9e7280df0c8a13b538c297ebb0165 | 7,562 | py | Python | packnet_sfm/utils/image.py | bingai/packnet-sfm-nrs | 2e9fb8850b4e1ae2227e30bff580997fb5377802 | [
"MIT"
] | null | null | null | packnet_sfm/utils/image.py | bingai/packnet-sfm-nrs | 2e9fb8850b4e1ae2227e30bff580997fb5377802 | [
"MIT"
] | null | null | null | packnet_sfm/utils/image.py | bingai/packnet-sfm-nrs | 2e9fb8850b4e1ae2227e30bff580997fb5377802 | [
"MIT"
] | null | null | null | # Copyright 2020 Toyota Research Institute. All rights reserved.
import cv2
import torch
import torch.nn.functional as funct
from functools import lru_cache
from PIL import Image
from packnet_sfm.utils.misc import same_shape
def load_image(path):
"""
Read an image using PIL
Parameters
----------
... | 26.440559 | 120 | 0.549855 | # Copyright 2020 Toyota Research Institute. All rights reserved.
import cv2
import torch
import torch.nn.functional as funct
from functools import lru_cache
from PIL import Image
from packnet_sfm.utils.misc import same_shape
def load_image(path):
"""
Read an image using PIL
Parameters
----------
... | 0 | 0 | 0 |
54cd5059fa45484cd8e7fbee1025e19845882aa9 | 901 | py | Python | pokemongo_bot/tree_config_builder.py | Jasperrr91/pokemongo | 67b64870939a9f19e88321dbe2b0ff6174e7397b | [
"MIT"
] | null | null | null | pokemongo_bot/tree_config_builder.py | Jasperrr91/pokemongo | 67b64870939a9f19e88321dbe2b0ff6174e7397b | [
"MIT"
] | null | null | null | pokemongo_bot/tree_config_builder.py | Jasperrr91/pokemongo | 67b64870939a9f19e88321dbe2b0ff6174e7397b | [
"MIT"
] | null | null | null | import cell_workers
| 25.742857 | 85 | 0.604883 | import cell_workers
class ConfigException(Exception):
pass
class TreeConfigBuilder(object):
def __init__(self, bot, tasks_raw):
self.bot = bot
self.tasks_raw = tasks_raw
def _get_worker_by_name(self, name):
try:
worker = getattr(cell_workers, name)
except Attri... | 722 | 32 | 126 |
d31474846e26a56b1a8fe87101c4edc3c8f19c43 | 4,475 | py | Python | aki.py | wolfniey/school-diary-telegram-bot | 7a50a4649c2cd9f8052f47dbf9ef697bcfa151bd | [
"MIT"
] | 2 | 2020-04-27T10:45:31.000Z | 2020-07-28T08:55:55.000Z | aki.py | wolfniey/school-diary-telegram-bot | 7a50a4649c2cd9f8052f47dbf9ef697bcfa151bd | [
"MIT"
] | null | null | null | aki.py | wolfniey/school-diary-telegram-bot | 7a50a4649c2cd9f8052f47dbf9ef697bcfa151bd | [
"MIT"
] | null | null | null | import logging
import accounts
import diary
from datetime import datetime, timedelta
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove)
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters,
ConversationHandler)
logging.basicConfig(format='%(asctime)s - %(n... | 29.833333 | 144 | 0.693631 | import logging
import accounts
import diary
from datetime import datetime, timedelta
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove)
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters,
ConversationHandler)
logging.basicConfig(format='%(asctime)s - %(n... | 3,661 | 0 | 253 |
c01b111751bee63eeaa564788b3609ddc25c43bc | 819 | py | Python | 1_small-problems/1.1_the fibonacci sequence/fib4.py | bimri/Classic-Computer-Science-Problems-in-Python | d91a1120ef93a5f1b213fcbb7f8e1669c298a826 | [
"MIT"
] | null | null | null | 1_small-problems/1.1_the fibonacci sequence/fib4.py | bimri/Classic-Computer-Science-Problems-in-Python | d91a1120ef93a5f1b213fcbb7f8e1669c298a826 | [
"MIT"
] | null | null | null | 1_small-problems/1.1_the fibonacci sequence/fib4.py | bimri/Classic-Computer-Science-Problems-in-Python | d91a1120ef93a5f1b213fcbb7f8e1669c298a826 | [
"MIT"
] | null | null | null | "Automatic memoization"
'''
fib3() can be further simplified. Python has a built-in decorator for memoizing any
function automagically. In fib4(), the decorator @functools.lru_cache() is used
with the same exact code as we used in fib2(). Each time fib4() is executed with a
novel argument, the decorator causes the ret... | 32.76 | 87 | 0.672772 | "Automatic memoization"
'''
fib3() can be further simplified. Python has a built-in decorator for memoizing any
function automagically. In fib4(), the decorator @functools.lru_cache() is used
with the same exact code as we used in fib2(). Each time fib4() is executed with a
novel argument, the decorator causes the ret... | 172 | 0 | 22 |
869e1a8a1acc2e79662297051e47a12a2bfb89e6 | 1,133 | py | Python | patients/urls.py | Curewell-Homeo-Clinic/admin-system | c8ce56a2bdbccfe1e6bec09068932f1943498b9f | [
"MIT"
] | 1 | 2021-11-29T15:24:41.000Z | 2021-11-29T15:24:41.000Z | patients/urls.py | Curewell-Homeo-Clinic/admin-system | c8ce56a2bdbccfe1e6bec09068932f1943498b9f | [
"MIT"
] | 46 | 2021-11-29T16:05:55.000Z | 2022-03-01T13:04:45.000Z | patients/urls.py | Curewell-Homeo-Clinic/admin-system | c8ce56a2bdbccfe1e6bec09068932f1943498b9f | [
"MIT"
] | null | null | null | from django.urls import path, include
from patients.views.dashboard import dashboard
from patients.views.patient import patient_detail, patient_list
from patients.views.doctor import doctor_detail, doctor_list
from patients.views.appointment import appointment_detail, appointment_list
from patients.views.invoice import... | 45.32 | 78 | 0.729038 | from django.urls import path, include
from patients.views.dashboard import dashboard
from patients.views.patient import patient_detail, patient_list
from patients.views.doctor import doctor_detail, doctor_list
from patients.views.appointment import appointment_detail, appointment_list
from patients.views.invoice import... | 0 | 0 | 0 |
fef9c9b2ba53d6862218a750158a4731be0bac4e | 9,763 | py | Python | main.py | arame/SLAM | 7841dce5e6da641e676a1e4f0f2667300e2f8a15 | [
"OML"
] | null | null | null | main.py | arame/SLAM | 7841dce5e6da641e676a1e4f0f2667300e2f8a15 | [
"OML"
] | null | null | null | main.py | arame/SLAM | 7841dce5e6da641e676a1e4f0f2667300e2f8a15 | [
"OML"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from numpy.linalg import inv
from pandas import DataFrame
import seaborn as sns
from robot_class import Robot
from helpers import display_world, make_data
## slam takes in 6 arguments and returns mu,
## mu is the entire path traversed by a robot (all x,y poses) *and*... | 37.263359 | 121 | 0.626754 | import numpy as np
import matplotlib.pyplot as plt
from numpy.linalg import inv
from pandas import DataFrame
import seaborn as sns
from robot_class import Robot
from helpers import display_world, make_data
def main():
# world parameters
num_landmarks = 5 # number of landmarks
N ... | 8,461 | 0 | 183 |
eebde987156255ed4144196616f7930d77d68959 | 2,264 | py | Python | src/models/basic_linear_model.py | futu-munich-racing/neural-network-trainer | 9ab73a691fe09e853955abf72a6b7559e2711a10 | [
"MIT"
] | null | null | null | src/models/basic_linear_model.py | futu-munich-racing/neural-network-trainer | 9ab73a691fe09e853955abf72a6b7559e2711a10 | [
"MIT"
] | 4 | 2020-11-13T18:37:11.000Z | 2022-02-10T01:24:26.000Z | src/models/basic_linear_model.py | futu-munich-racing/neural-network-trainer | 9ab73a691fe09e853955abf72a6b7559e2711a10 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.python.keras.layers import Input
from tensorflow.python.keras.models import Model, load_model
from tensorflow.python.keras.layers import Convolution2D, Convolution3D
from tensorflow.python.keras.layers import MaxPooling2D, MaxPooling3D
from tensorflow.python.keras.activations im... | 36.516129 | 91 | 0.693905 | import tensorflow as tf
from tensorflow.python.keras.layers import Input
from tensorflow.python.keras.models import Model, load_model
from tensorflow.python.keras.layers import Convolution2D, Convolution3D
from tensorflow.python.keras.layers import MaxPooling2D, MaxPooling3D
from tensorflow.python.keras.activations im... | 1,777 | 0 | 23 |
bb0297f41becea0709adc150426ee1cd3b03c974 | 858 | py | Python | projects/vault-of-scripts/YT-Playlist-Downloader/ytpldl.py | anouaraissani/H4ckT0b3rF3st-2k20 | 1f77652add0effdc7462c829dfb88d5f6818d07e | [
"MIT"
] | 1 | 2020-10-12T16:23:55.000Z | 2020-10-12T16:23:55.000Z | projects/vault-of-scripts/YT-Playlist-Downloader/ytpldl.py | anouaraissani/H4ckT0b3rF3st-2k20 | 1f77652add0effdc7462c829dfb88d5f6818d07e | [
"MIT"
] | 1 | 2020-10-11T17:06:48.000Z | 2020-10-11T17:06:48.000Z | projects/vault-of-scripts/YT-Playlist-Downloader/ytpldl.py | anouaraissani/H4ckT0b3rF3st-2k20 | 1f77652add0effdc7462c829dfb88d5f6818d07e | [
"MIT"
] | null | null | null | from pytube import YouTube # pip install pytube or pytube3
from pytube import Playlist
import os, re
if __name__ == '__main__':
playlist = Playlist("https://www.youtube.com/playlist?list=PL8A83A276F0D85E70")
main(1, playlist)
| 27.677419 | 83 | 0.622378 | from pytube import YouTube # pip install pytube or pytube3
from pytube import Playlist
import os, re
def Download(yt):
print("Downloading....")
# Filter Streams (Optional)
vids = yt.streams.filter()
# Get only .mp4 format
vids[0].download(r"Tracks/")
def main(c, playlist):
# Filter Playlist Ur... | 577 | 0 | 46 |
43a7e7000b9dabe6e0dbe1d58235a074bdf1c40f | 5,593 | py | Python | pybgp/test/test_pathattr.py | toddjcrane/pybgp | 5fa7699675c120b98c5b6fc637bfc29ba5a665f4 | [
"MIT"
] | 5 | 2015-06-14T02:51:23.000Z | 2019-01-05T15:54:22.000Z | pybgp/test/test_pathattr.py | toddjcrane/pybgp | 5fa7699675c120b98c5b6fc637bfc29ba5a665f4 | [
"MIT"
] | null | null | null | pybgp/test/test_pathattr.py | toddjcrane/pybgp | 5fa7699675c120b98c5b6fc637bfc29ba5a665f4 | [
"MIT"
] | 4 | 2016-11-26T01:43:10.000Z | 2021-08-13T16:08:27.000Z | #!/usr/bin/python
import socket
import unittest
from pybgp import pathattr, nlri
| 27.551724 | 190 | 0.550331 | #!/usr/bin/python
import socket
import unittest
from pybgp import pathattr, nlri
class TestOrigin(unittest.TestCase):
def test_encode(self):
orig = pathattr.Origin('igp')
b = orig.encode()
self.assertEqual(b, '\x40\x01\x01\x00')
def test_decode(self):
b = '\x40\x01\x01\x02'... | 4,921 | 105 | 483 |
1edaa9931abb7a139a3d7450677da8402ba4adb9 | 141 | py | Python | lightnlp/utils/data_utils/__init__.py | SHolic/LightNLP | babb4d650b1d120c10130286d472048d542b068c | [
"MIT"
] | 1 | 2020-11-03T08:21:59.000Z | 2020-11-03T08:21:59.000Z | lightnlp/utils/data_utils/__init__.py | SHolic/LightNLP | babb4d650b1d120c10130286d472048d542b068c | [
"MIT"
] | null | null | null | lightnlp/utils/data_utils/__init__.py | SHolic/LightNLP | babb4d650b1d120c10130286d472048d542b068c | [
"MIT"
] | null | null | null | from ._data_loader import RawDataLoader, EmbeddingLoader, NERDataLoader, ATCDataLoader, \
AlbertBaseATCDataLoader, BertBaseATCDataLoader
| 47 | 89 | 0.851064 | from ._data_loader import RawDataLoader, EmbeddingLoader, NERDataLoader, ATCDataLoader, \
AlbertBaseATCDataLoader, BertBaseATCDataLoader
| 0 | 0 | 0 |
5bbc80849986a5e15c02563156c13327c939f1e4 | 19,357 | py | Python | models/cdae.py | chenrz925/DiamondNet | d195dbd5fc6c8ffcf7485a5180f790532f068db9 | [
"Apache-2.0"
] | null | null | null | models/cdae.py | chenrz925/DiamondNet | d195dbd5fc6c8ffcf7485a5180f790532f068db9 | [
"Apache-2.0"
] | null | null | null | models/cdae.py | chenrz925/DiamondNet | d195dbd5fc6c8ffcf7485a5180f790532f068db9 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Text, Any, Tuple, Union
import torch
from torch import nn
| 58.129129 | 118 | 0.573384 | from typing import Dict, Text, Any, Tuple, Union
import torch
from torch import nn
class DenoiseL(nn.Module):
def __init__(self, in_features: int, ratio: float):
super(DenoiseL, self).__init__()
assert in_features > 0
assert 0.0 <= ratio < 1.0
self.permutation = nn.Parameter(torch... | 18,720 | 141 | 407 |
3a6ac3e083b43f0be52796162d41f654222059ea | 2,487 | py | Python | checkmate/management/commands/init.py | marcinguy/checkmate-ce | fc33c7c27bc640ab4db5dbda274a0edd3b3db218 | [
"MIT"
] | 80 | 2015-01-06T17:42:39.000Z | 2022-02-08T19:08:21.000Z | checkmate/management/commands/init.py | ravikumarpurbey/checkmate | 1a4d010c8ef25c678d8d14dc8e37a9bed1883ca2 | [
"MIT"
] | 6 | 2015-08-04T12:16:48.000Z | 2021-02-27T12:09:16.000Z | checkmate/management/commands/init.py | ravikumarpurbey/checkmate | 1a4d010c8ef25c678d8d14dc8e37a9bed1883ca2 | [
"MIT"
] | 33 | 2015-01-02T14:18:11.000Z | 2021-03-18T05:06:54.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .base import BaseCommand
from checkmate.management.helpers import save_project_config
import sys
import os
import os.path
import json
import time
import uuid
import logging
logger = logging.getLogger(__name__)
"""
Creates a new project. The comman... | 27.633333 | 101 | 0.519099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .base import BaseCommand
from checkmate.management.helpers import save_project_config
import sys
import os
import os.path
import json
import time
import uuid
import logging
logger = logging.getLogger(__name__)
"""
Creates a new project. The comman... | 794 | 1,195 | 23 |
f77ef19bc22d083ea7feed89b8aa51d4550f8eda | 4,646 | py | Python | models/model_unet.py | iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer | 57904544c6d6b43dcd5937afeb474c0a47456d98 | [
"MIT"
] | null | null | null | models/model_unet.py | iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer | 57904544c6d6b43dcd5937afeb474c0a47456d98 | [
"MIT"
] | null | null | null | models/model_unet.py | iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer | 57904544c6d6b43dcd5937afeb474c0a47456d98 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from six.moves import cPickle
import unet
import simplified_unet
arg_scope = tf.contrib.framework.arg_scope
| 41.482143 | 137 | 0.655833 | import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from six.moves import cPickle
import unet
import simplified_unet
arg_scope = tf.contrib.framework.arg_scope
class UnetModel(object):
def __init__(self, number_class=3, is_training=True, is_simplified = False, dropout = True):
""... | 0 | 4,439 | 23 |
8bb61dd567b5ca0da6e74a0f8a595d90330016ec | 3,981 | py | Python | pysnmp-with-texts/GNOME-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/GNOME-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/GNOME-SMI.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module GNOME-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GNOME-SMI
# Produced by pysmi-0.3.4 at Wed May 1 13:19:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23... | 102.076923 | 505 | 0.786486 | #
# PySNMP MIB module GNOME-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GNOME-SMI
# Produced by pysmi-0.3.4 at Wed May 1 13:19:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23... | 0 | 0 | 0 |
eb7fcc229e2738f4ef94d625899ae037199f88ae | 375 | py | Python | ftp.py | ZDYC/hacker | 3dd9556bda629a1f2b96905ed3e62ed3f02ae3f6 | [
"Apache-2.0"
] | null | null | null | ftp.py | ZDYC/hacker | 3dd9556bda629a1f2b96905ed3e62ed3f02ae3f6 | [
"Apache-2.0"
] | null | null | null | ftp.py | ZDYC/hacker | 3dd9556bda629a1f2b96905ed3e62ed3f02ae3f6 | [
"Apache-2.0"
] | null | null | null | import ftplib
if __name__ == '__main__':
anonlogin('154.221.18.35') | 22.058824 | 57 | 0.573333 | import ftplib
def anonlogin(hostname):
try:
ftp = ftplib.FTP(hostname)
ftp.login('root', 'hx1NM396')
print('\n[*]' + str(hostname) + 'ftp successed!')
ftp.quit()
return True
except Exception as e:
print('failded to ftp' + str(hostname))
return False
if... | 278 | 0 | 23 |
458bb15a61c36499cdc3ad3c42cfe8316646e17b | 2,497 | py | Python | scripts/pcap2csv.py | rqtx/Nymphenburg | 08ed27b25b336d6201afaa27698ac405a53e537c | [
"MIT"
] | null | null | null | scripts/pcap2csv.py | rqtx/Nymphenburg | 08ed27b25b336d6201afaa27698ac405a53e537c | [
"MIT"
] | null | null | null | scripts/pcap2csv.py | rqtx/Nymphenburg | 08ed27b25b336d6201afaa27698ac405a53e537c | [
"MIT"
] | null | null | null | #!/bin/python
import getopt
import sys
convert('amplifier')
convert('attacker')
convert('victim')
convert('amplifier_input')
convert('amplifier_output')
| 28.375 | 123 | 0.470164 | #!/bin/python
import getopt
import sys
class Pcap2Csv():
__SHORTARGS = 'p:ho:t:'
__LONGARGS = ['pcap=', 'help', 'output=', 'time=']
__USAGE = ['Pcap file', 'Help', 'Output file', 'Start attack time']
start_time = 0
end_time = 0
def __init__(self):
self.__cliParser()
self.__c... | 2,025 | 270 | 46 |
c8a775210c813d4a841be4a5bc26ac6f6f6141bb | 6,013 | py | Python | src/relstorage/adapters/postgresql/connmanager.py | enfold/relstorage | 9fcd526b537cb6537cc2ae33154b63096550f210 | [
"ZPL-2.1"
] | 40 | 2015-10-08T05:35:13.000Z | 2022-03-28T23:50:06.000Z | src/relstorage/adapters/postgresql/connmanager.py | enfold/relstorage | 9fcd526b537cb6537cc2ae33154b63096550f210 | [
"ZPL-2.1"
] | 364 | 2015-03-23T15:25:42.000Z | 2022-03-17T08:41:34.000Z | src/relstorage/adapters/postgresql/connmanager.py | enfold/relstorage | 9fcd526b537cb6537cc2ae33154b63096550f210 | [
"ZPL-2.1"
] | 33 | 2015-06-08T23:03:22.000Z | 2022-03-21T08:25:53.000Z | ##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 42.64539 | 84 | 0.622984 | ##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 2,673 | 2,376 | 23 |
f17815b66a9d51bc88fc2a99940804bbcb0693ef | 1,727 | py | Python | app/api/deals.py | dev-johnlopez/assignably-old | 99f550e3e970a979234a724097ed8c940f1562c1 | [
"MIT"
] | null | null | null | app/api/deals.py | dev-johnlopez/assignably-old | 99f550e3e970a979234a724097ed8c940f1562c1 | [
"MIT"
] | null | null | null | app/api/deals.py | dev-johnlopez/assignably-old | 99f550e3e970a979234a724097ed8c940f1562c1 | [
"MIT"
] | null | null | null | from flask import jsonify, request, url_for, g, current_app, render_template
from app import db
from app.deals.models import Deal
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.email import send_email
@bp.route('/deals/<int:id>', methods=['GET'])
@token_auth.... | 33.862745 | 98 | 0.673422 | from flask import jsonify, request, url_for, g, current_app, render_template
from app import db
from app.deals.models import Deal
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.email import send_email
@bp.route('/deals/<int:id>', methods=['GET'])
@token_auth.... | 1,099 | 0 | 88 |
442d3a64baf645e86d88223fdea6691517abbbdd | 706 | py | Python | python/03_tipos_de_dados/tipos.py | ac-gomes/python-iniciante | 002fc91facb5d89c23540d8b05073e8a3c8a4c59 | [
"MIT"
] | null | null | null | python/03_tipos_de_dados/tipos.py | ac-gomes/python-iniciante | 002fc91facb5d89c23540d8b05073e8a3c8a4c59 | [
"MIT"
] | null | null | null | python/03_tipos_de_dados/tipos.py | ac-gomes/python-iniciante | 002fc91facb5d89c23540d8b05073e8a3c8a4c59 | [
"MIT"
] | null | null | null | # função usada abaixo 'print()' é usada para exibir ou imprimir mensagens no console.
# Iteiros | Int
print(10)
# Será exibido no console o numero 10
# Ponto Flutuante | Float
print(9.5)
# Cadeia de caracteres | Strings
cadeia_de_caracter = "Olá Mundo!"
print(cadeia_de_caracter)
# Boleano | Boolean
valor_verdadeiro... | 23.533333 | 85 | 0.763456 | # função usada abaixo 'print()' é usada para exibir ou imprimir mensagens no console.
# Iteiros | Int
print(10)
# Será exibido no console o numero 10
# Ponto Flutuante | Float
print(9.5)
# Cadeia de caracteres | Strings
cadeia_de_caracter = "Olá Mundo!"
print(cadeia_de_caracter)
# Boleano | Boolean
valor_verdadeiro... | 0 | 0 | 0 |
c98c3446c8a67fb418f6a8db9d31a0315ee0fc3c | 6,470 | py | Python | tuprolog/jvmutils.py | DavideEva/2ppy | 55609415102f8116165a42c8e33e029c4906e160 | [
"Apache-2.0"
] | 1 | 2021-08-07T06:29:28.000Z | 2021-08-07T06:29:28.000Z | tuprolog/jvmutils.py | DavideEva/2ppy | 55609415102f8116165a42c8e33e029c4906e160 | [
"Apache-2.0"
] | 14 | 2021-09-16T13:25:12.000Z | 2022-01-03T10:12:22.000Z | tuprolog/jvmutils.py | DavideEva/2ppy | 55609415102f8116165a42c8e33e029c4906e160 | [
"Apache-2.0"
] | 1 | 2021-12-22T00:25:32.000Z | 2021-12-22T00:25:32.000Z | from tuprolog import logger
# noinspection PyUnresolvedReferences
import jpype
# noinspection PyUnresolvedReferences
import jpype.imports
# noinspection PyProtectedMember
from _jpype import _JObject as JObjectClass
# noinspection PyUnresolvedReferences
import java.util as _jutils
# noinspection PyUnresolvedReferences
i... | 24.323308 | 95 | 0.696909 | from tuprolog import logger
# noinspection PyUnresolvedReferences
import jpype
# noinspection PyUnresolvedReferences
import jpype.imports
# noinspection PyProtectedMember
from _jpype import _JObject as JObjectClass
# noinspection PyUnresolvedReferences
import java.util as _jutils
# noinspection PyUnresolvedReferences
i... | 3,246 | 364 | 816 |
b093d851bb61a63849ee99c0bd9b7eb617be0eb7 | 111 | py | Python | investpy/resources/__init__.py | mdarblade/investpy | 7ace4ac7693f505c199074de3333f56e6b89cfef | [
"MIT"
] | null | null | null | investpy/resources/__init__.py | mdarblade/investpy | 7ace4ac7693f505c199074de3333f56e6b89cfef | [
"MIT"
] | null | null | null | investpy/resources/__init__.py | mdarblade/investpy | 7ace4ac7693f505c199074de3333f56e6b89cfef | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018-2019 Alvaro Bartolome @ alvarob96 in GitHub
# See LICENSE for details.
| 22.2 | 60 | 0.756757 | #!/usr/bin/env python
# Copyright 2018-2019 Alvaro Bartolome @ alvarob96 in GitHub
# See LICENSE for details.
| 0 | 0 | 0 |
9cea7631436a08def5fea287f8493cd8f8305f3c | 1,817 | py | Python | spotdl/types/saved.py | TLINDEN/spotdl-v4 | 30112816ff49e19f76fa54299ff2e94d2d2e65cd | [
"MIT"
] | 3 | 2021-11-24T17:11:16.000Z | 2021-12-19T05:49:38.000Z | spotdl/types/saved.py | TLINDEN/spotdl-v4 | 30112816ff49e19f76fa54299ff2e94d2d2e65cd | [
"MIT"
] | 2 | 2021-11-19T20:49:17.000Z | 2021-11-19T20:49:26.000Z | spotdl/types/saved.py | TLINDEN/spotdl-v4 | 30112816ff49e19f76fa54299ff2e94d2d2e65cd | [
"MIT"
] | 1 | 2021-12-21T01:35:29.000Z | 2021-12-21T01:35:29.000Z | from dataclasses import dataclass
from typing import List
from spotdl.types.song import Song
from spotdl.utils.spotify import SpotifyClient
class SavedError(Exception):
"""
Base class for all exceptions related to saved tracks.
"""
@dataclass(frozen=True)
| 27.953846 | 75 | 0.619703 | from dataclasses import dataclass
from typing import List
from spotdl.types.song import Song
from spotdl.utils.spotify import SpotifyClient
class SavedError(Exception):
"""
Base class for all exceptions related to saved tracks.
"""
@dataclass(frozen=True)
class Saved:
tracks: List[Song]
@classm... | 0 | 1,523 | 22 |
b832291fdac4819b20b9c725cc9297678bc16751 | 725 | py | Python | scripts/countries.py | rizel/timewarrior-southamerica-holidays | ba412e96b6ab72efef51bf786148476a31003e8c | [
"MIT"
] | null | null | null | scripts/countries.py | rizel/timewarrior-southamerica-holidays | ba412e96b6ab72efef51bf786148476a31003e8c | [
"MIT"
] | 1 | 2021-02-28T19:30:44.000Z | 2021-03-09T04:09:54.000Z | scripts/countries.py | rizel/timewarrior-southamerica-holidays | ba412e96b6ab72efef51bf786148476a31003e8c | [
"MIT"
] | null | null | null | #!/usr/bin/python3.6.0
# -*- coding: utf-8 -*-
COUNTRIES = {
"argentina" : ".com.ar",
"bolivia" : ".com.bo",
"brasil" : "http://www.public-holidays.us/BR_ES_{0}_Feriados%20nacionais",
"chile" : ".cl",
"colombia" : ".co",
"ecuador" : ".la/ecu... | 34.52381 | 88 | 0.475862 | #!/usr/bin/python3.6.0
# -*- coding: utf-8 -*-
COUNTRIES = {
"argentina" : ".com.ar",
"bolivia" : ".com.bo",
"brasil" : "http://www.public-holidays.us/BR_ES_{0}_Feriados%20nacionais",
"chile" : ".cl",
"colombia" : ".co",
"ecuador" : ".la/ecu... | 0 | 0 | 0 |
a5ed3b336bf9f20cb77799f38ee5d60cd1216026 | 7,239 | py | Python | src/config/cmssh_extension.py | dmwm/cmssh | 0cd6e104185938d21b10b053479e890c9f4f3b57 | [
"Apache-2.0"
] | 2 | 2016-07-26T18:36:03.000Z | 2017-05-09T08:34:41.000Z | src/config/cmssh_extension.py | dmwm/cmssh | 0cd6e104185938d21b10b053479e890c9f4f3b57 | [
"Apache-2.0"
] | 1 | 2015-01-30T16:00:13.000Z | 2015-01-31T21:59:29.000Z | src/config/cmssh_extension.py | dmwm/cmssh | 0cd6e104185938d21b10b053479e890c9f4f3b57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding: ISO-8859-1 -*-
#pylint: disable-msg=E1101,C0103,R0902
# system modules
import os
import sys
import stat
import time
import thread
import traceback
from types import GeneratorType
# ipython modules
import IPython
from IPython import release
# cmssh modules
import cmssh
from cm... | 31.473913 | 86 | 0.6226 | #!/usr/bin/env python
#-*- coding: ISO-8859-1 -*-
#pylint: disable-msg=E1101,C0103,R0902
# system modules
import os
import sys
import stat
import time
import thread
import traceback
from types import GeneratorType
# ipython modules
import IPython
from IPython import release
# cmssh modules
import cmssh
from cm... | 0 | 195 | 23 |
ed259b12f038032d8c8c3e7e6c607d1791e80efe | 8,191 | py | Python | python/paddle/fluid/tests/unittests/test_program_prune_backward.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | 3 | 2019-07-17T09:30:31.000Z | 2021-12-27T03:16:55.000Z | python/paddle/fluid/tests/unittests/test_program_prune_backward.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_program_prune_backward.py | frankwhzhang/Paddle | 131b1dc3240e53ea295cc49323bb2a7e7dcc717f | [
"Apache-2.0"
] | 4 | 2019-09-30T02:15:34.000Z | 2019-09-30T02:41:30.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 38.455399 | 85 | 0.626297 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 6,789 | 302 | 69 |
3fd42fb31955c495edab37fede8ea45acb1c582c | 910 | py | Python | docs/conf.py | comforx/spray | b880f41e6afeb69f9ad3b2257965f39411a53f03 | [
"Apache-2.0"
] | 1 | 2019-01-19T15:53:06.000Z | 2019-01-19T15:53:06.000Z | docs/conf.py | comforx/spray | b880f41e6afeb69f9ad3b2257965f39411a53f03 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | comforx/spray | b880f41e6afeb69f9ad3b2257965f39411a53f03 | [
"Apache-2.0"
] | null | null | null | import sys, os
# -- General configuration -----------------------------------------------------
extensions = ['sphinx.ext.todo']
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'spray'
copyright = u'2011-2012 spray.cc.'
version = '$VERSION$'
release = '$VERSION$'
exclude_patterns = []... | 26 | 80 | 0.586813 | import sys, os
# -- General configuration -----------------------------------------------------
extensions = ['sphinx.ext.todo']
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'spray'
copyright = u'2011-2012 spray.cc.'
version = '$VERSION$'
release = '$VERSION$'
exclude_patterns = []... | 0 | 0 | 0 |
f08fff9e914531c2eaf0d3773e4791d72fb39839 | 913 | py | Python | primes.py | amacuga/pands-problem-set | ac7461f17f7e5e5d5b6e43db675d9c16a2808d3e | [
"Apache-2.0"
] | null | null | null | primes.py | amacuga/pands-problem-set | ac7461f17f7e5e5d5b6e43db675d9c16a2808d3e | [
"Apache-2.0"
] | null | null | null | primes.py | amacuga/pands-problem-set | ac7461f17f7e5e5d5b6e43db675d9c16a2808d3e | [
"Apache-2.0"
] | null | null | null | # Alexandra Macuga, 2019-03-26
# Write a program that asks the user to input a positive integer and tells the user whether or not the number is a prime.
# Adapted from: https://web.microsoftstream.com/video/3ef695e3-9155-4487-b48e-0867834c76ad
# Ask the user for a value of i (positive integer)
i = int(input('Please en... | 48.052632 | 121 | 0.732749 | # Alexandra Macuga, 2019-03-26
# Write a program that asks the user to input a positive integer and tells the user whether or not the number is a prime.
# Adapted from: https://web.microsoftstream.com/video/3ef695e3-9155-4487-b48e-0867834c76ad
# Ask the user for a value of i (positive integer)
i = int(input('Please en... | 0 | 0 | 0 |
f69b0bb6253043a918c780725e986c1292cd16ae | 1,446 | py | Python | model/utils/similarity_scorer.py | KasparPeterson/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling | 86a9cebe4f24d2397d81c4c263d57d48d17ea76d | [
"MIT"
] | null | null | null | model/utils/similarity_scorer.py | KasparPeterson/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling | 86a9cebe4f24d2397d81c4c263d57d48d17ea76d | [
"MIT"
] | null | null | null | model/utils/similarity_scorer.py | KasparPeterson/A-Hierarchical-Latent-Structure-for-Variational-Conversation-Modeling | 86a9cebe4f24d2397d81c4c263d57d48d17ea76d | [
"MIT"
] | 1 | 2018-07-03T07:47:46.000Z | 2018-07-03T07:47:46.000Z | import nltk
import difflib
from nltk.translate.bleu_score import SmoothingFunction
smoothie = SmoothingFunction().method4
# The higher the better
if __name__ == '__main__':
hypothesis = 'It is a cat at the room'
reference = 'It is a cat inside the room'
print("Bleu:", get_bleu_score(hypothesis, refe... | 30.765957 | 74 | 0.623098 | import nltk
import difflib
from nltk.translate.bleu_score import SmoothingFunction
smoothie = SmoothingFunction().method4
# The higher the better
def get_bleu_score(hypothesis, reference):
try:
return nltk.translate.bleu_score.sentence_bleu(
[reference.split()],
hypothesis.split()... | 903 | 0 | 68 |
93e2d415765ad9ccffdebc7e31e8dc3e85bd50ab | 2,052 | py | Python | test/test_page.py | aspose-diagram-cloud/aspose-diagram-cloud-python | 58254fccb833fb7e3a0453407e21b55edb96b81c | [
"MIT"
] | 3 | 2019-12-10T08:42:21.000Z | 2022-02-04T19:14:02.000Z | test/test_page.py | aspose-diagram-cloud/aspose-diagram-cloud-python | 58254fccb833fb7e3a0453407e21b55edb96b81c | [
"MIT"
] | null | null | null | test/test_page.py | aspose-diagram-cloud/aspose-diagram-cloud-python | 58254fccb833fb7e3a0453407e21b55edb96b81c | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Aspose.Diagram Cloud API Reference
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
#f... | 26.307692 | 105 | 0.698343 | # coding: utf-8
"""
Aspose.Diagram Cloud API Reference
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
#f... | 632 | 0 | 135 |
db0f1d7eb5314ad8755c331f7baacae6965c2ce5 | 775 | py | Python | basics/word_vector_data_frame.py | eshanMewantha/natural-language-processing | 0071d96106d43e2c263d179cc78ba82e3450fda4 | [
"MIT"
] | 1 | 2019-07-06T05:17:08.000Z | 2019-07-06T05:17:08.000Z | basics/word_vector_data_frame.py | eshanMewantha/natural-language-processing | 0071d96106d43e2c263d179cc78ba82e3450fda4 | [
"MIT"
] | null | null | null | basics/word_vector_data_frame.py | eshanMewantha/natural-language-processing | 0071d96106d43e2c263d179cc78ba82e3450fda4 | [
"MIT"
] | null | null | null | # Simple python implementation of creating a pandas data frame with word vectors
import pandas as pd
from collections import Counter
sayings = [
"Rose is a rose is a rose is a rose.",
"We are going to need a bigger boat.",
"Huston, we have a problem"
]
unique_words = set()
for saying in sayings:
uniq... | 25 | 80 | 0.676129 | # Simple python implementation of creating a pandas data frame with word vectors
import pandas as pd
from collections import Counter
sayings = [
"Rose is a rose is a rose is a rose.",
"We are going to need a bigger boat.",
"Huston, we have a problem"
]
unique_words = set()
for saying in sayings:
uniq... | 0 | 0 | 0 |
a27b43c5afda4a8f00affd838fa4143b5b41b88e | 328 | py | Python | mozillians/announcements/templatetags/helpers.py | divyamoncy/mozillians | d53d1d05d1f05b74f8533541e37083dcb89b29a8 | [
"BSD-3-Clause"
] | 202 | 2015-01-14T10:19:55.000Z | 2021-12-11T06:04:16.000Z | mozillians/announcements/templatetags/helpers.py | divyamoncy/mozillians | d53d1d05d1f05b74f8533541e37083dcb89b29a8 | [
"BSD-3-Clause"
] | 2,924 | 2015-01-07T11:27:32.000Z | 2021-01-19T14:05:17.000Z | mozillians/announcements/templatetags/helpers.py | divyamoncy/mozillians | d53d1d05d1f05b74f8533541e37083dcb89b29a8 | [
"BSD-3-Clause"
] | 270 | 2015-01-02T18:31:01.000Z | 2021-02-17T20:57:44.000Z | from django_jinja import library
from mozillians.announcements.models import Announcement
@library.global_function
def latest_announcement():
"""Return the latest published announcement or None."""
if Announcement.objects.published().count():
return Announcement.objects.published().latest()
retu... | 25.230769 | 59 | 0.765244 | from django_jinja import library
from mozillians.announcements.models import Announcement
@library.global_function
def latest_announcement():
"""Return the latest published announcement or None."""
if Announcement.objects.published().count():
return Announcement.objects.published().latest()
retu... | 0 | 0 | 0 |
4afd7e95b95b47b26f79e2fae7cc7645e5b5784f | 1,099 | py | Python | test/unit/optimizer/test_timer.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 358 | 2020-06-11T09:34:53.000Z | 2022-03-31T12:56:22.000Z | test/unit/optimizer/test_timer.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 467 | 2020-06-11T13:49:45.000Z | 2022-03-31T14:19:48.000Z | test/unit/optimizer/test_timer.py | rozlana-g/FEDOT | a909d6c0ef481cc1cf7a5f10f7b1292d8d2def5c | [
"BSD-3-Clause"
] | 48 | 2020-07-13T14:50:45.000Z | 2022-03-26T09:37:13.000Z | import datetime
import time
from fedot.core.optimisers.timer import OptimisationTimer
from fedot.core.pipelines.tuning.timer import TunerTimer
| 29.702703 | 78 | 0.66606 | import datetime
import time
from fedot.core.optimisers.timer import OptimisationTimer
from fedot.core.pipelines.tuning.timer import TunerTimer
def test_composition_timer():
generation_num = 100
reached = False
start = datetime.datetime.now()
with OptimisationTimer(timeout=datetime.timedelta(minutes=0... | 907 | 0 | 46 |
6e82d4864563c11b0cd7a5dd970294a242f9c8ab | 2,635 | py | Python | smok/extras/event_database/base.py | smok-serwis/smok-client | a97b3dac454569f55a8a28a1cac44ae04e3e9cde | [
"MIT"
] | null | null | null | smok/extras/event_database/base.py | smok-serwis/smok-client | a97b3dac454569f55a8a28a1cac44ae04e3e9cde | [
"MIT"
] | 1 | 2021-02-03T14:58:35.000Z | 2021-02-13T17:25:30.000Z | smok/extras/event_database/base.py | smok-serwis/smok-client | a97b3dac454569f55a8a28a1cac44ae04e3e9cde | [
"MIT"
] | null | null | null | import typing as tp
from abc import ABCMeta, abstractmethod
from smok.predicate.event import Event
| 25.833333 | 86 | 0.618216 | import typing as tp
from abc import ABCMeta, abstractmethod
from smok.predicate.event import Event
class BaseEventSynchronization(metaclass=ABCMeta):
__slots__ = ()
@abstractmethod
def get_events(self) -> tp.List[Event]:
"""
:return: a list of events to synchronize
"""
@abst... | 0 | 2,487 | 46 |
e834ca743ecf2afb241c4a48ffc0d0700d49053c | 811 | py | Python | script/CompanyX-Problem.py | Ingenjoy/Linear-Programming-With-Python | 320a8956baa369dd83f5963230aafadcddded3b4 | [
"MIT"
] | 1 | 2022-03-19T16:19:53.000Z | 2022-03-19T16:19:53.000Z | script/CompanyX-Problem.py | Ingenjoy/Linear-Programming-With-Python | 320a8956baa369dd83f5963230aafadcddded3b4 | [
"MIT"
] | null | null | null | script/CompanyX-Problem.py | Ingenjoy/Linear-Programming-With-Python | 320a8956baa369dd83f5963230aafadcddded3b4 | [
"MIT"
] | null | null | null | from scipy.optimize import linprog
import numpy as np
# Objective function
z = np.array([300,500,200])
expense = 75000
# Constraints
C = np.array([
[ 10, 7.5, 4], #C1
[ 0, 10, 0], #C2
[0.5, 0.4, 0.5], #C3
[ 0, 0.4, 0], #C4
[0.5, 0.1, 0.5], #C5
[0.4, ... | 23.171429 | 78 | 0.448829 | from scipy.optimize import linprog
import numpy as np
# Objective function
z = np.array([300,500,200])
expense = 75000
# Constraints
C = np.array([
[ 10, 7.5, 4], #C1
[ 0, 10, 0], #C2
[0.5, 0.4, 0.5], #C3
[ 0, 0.4, 0], #C4
[0.5, 0.1, 0.5], #C5
[0.4, ... | 0 | 0 | 0 |
4326f7a82279646c6831b022a3b6cce31baade64 | 4,638 | py | Python | src/real_estate_scrapers/concrete_items/__init__.py | tuw-eeg/real-estate-scrapers | d86e304119f7abc5a9702044fcc08a2387c7e5ac | [
"MIT"
] | null | null | null | src/real_estate_scrapers/concrete_items/__init__.py | tuw-eeg/real-estate-scrapers | d86e304119f7abc5a9702044fcc08a2387c7e5ac | [
"MIT"
] | null | null | null | src/real_estate_scrapers/concrete_items/__init__.py | tuw-eeg/real-estate-scrapers | d86e304119f7abc5a9702044fcc08a2387c7e5ac | [
"MIT"
] | null | null | null | """
Exposing concrete items dynamically.
Makes it possible to add support for a new website just by
creating a new Python module under this package, and declaring
a concrete implementation for ``RealEstateHomePage``, ``RealEstateListPage`` and ``RealEstatePage``.
"""
import importlib.util
import inspect
import pkgutil
... | 42.163636 | 119 | 0.744071 | """
Exposing concrete items dynamically.
Makes it possible to add support for a new website just by
creating a new Python module under this package, and declaring
a concrete implementation for ``RealEstateHomePage``, ``RealEstateListPage`` and ``RealEstatePage``.
"""
import importlib.util
import inspect
import pkgutil
... | 0 | 0 | 0 |
1fb6382f646275852ac011441c74f5fb2ad358f9 | 643 | py | Python | alembic/versions/11b80498abeb_add_foreign_key.py | JuanDM93/fcc-fastapi-demo | 7d20f91fa96989d22426632c1ab2550f62898789 | [
"MIT"
] | null | null | null | alembic/versions/11b80498abeb_add_foreign_key.py | JuanDM93/fcc-fastapi-demo | 7d20f91fa96989d22426632c1ab2550f62898789 | [
"MIT"
] | null | null | null | alembic/versions/11b80498abeb_add_foreign_key.py | JuanDM93/fcc-fastapi-demo | 7d20f91fa96989d22426632c1ab2550f62898789 | [
"MIT"
] | null | null | null | """add foreign key
Revision ID: 11b80498abeb
Revises: bce514e0541f
Create Date: 2021-11-08 18:26:51.860396
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '11b80498abeb'
down_revision = 'bce514e0541f'
branch_labels = None
depends_on = None
| 20.09375 | 77 | 0.679627 | """add foreign key
Revision ID: 11b80498abeb
Revises: bce514e0541f
Create Date: 2021-11-08 18:26:51.860396
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '11b80498abeb'
down_revision = 'bce514e0541f'
branch_labels = None
depends_on = None
def upgrade():
... | 296 | 0 | 46 |
6be9c0d4bcb7421cc79e552d36238a9c6a75fcb0 | 13,128 | py | Python | bak_to_fossil_3.py | wmelvin/bak-to-git | 1ebea7d4b3c14cabc5981dc8d87fe920f30e0b56 | [
"MIT"
] | null | null | null | bak_to_fossil_3.py | wmelvin/bak-to-git | 1ebea7d4b3c14cabc5981dc8d87fe920f30e0b56 | [
"MIT"
] | null | null | null | bak_to_fossil_3.py | wmelvin/bak-to-git | 1ebea7d4b3c14cabc5981dc8d87fe920f30e0b56 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# ---------------------------------------------------------------------
# bak_to_fossil_3.py
#
# Step 3 (alternate): Read data from a CSV file that was edited in
# step 2, where commit messages were added and files to be skipped
# were flagged. Run fossil (instead of git) to commit each cha... | 29.108647 | 79 | 0.555683 | #!/usr/bin/env python3
# ---------------------------------------------------------------------
# bak_to_fossil_3.py
#
# Step 3 (alternate): Read data from a CSV file that was edited in
# step 2, where commit messages were added and files to be skipped
# were flagged. Run fossil (instead of git) to commit each cha... | 11,336 | 0 | 230 |
8812f60cfa1d071ac53c689d76eee185cf18bbbd | 8,319 | py | Python | opexebo/analysis/population_vector_correlation.py | simon-ball/opexebo | 8e44a4890efa60a6ed8c2e9e0df7cc9ab2d80d31 | [
"MIT"
] | 4 | 2019-06-12T07:50:42.000Z | 2021-11-19T12:55:47.000Z | opexebo/analysis/population_vector_correlation.py | simon-ball/opexebo | 8e44a4890efa60a6ed8c2e9e0df7cc9ab2d80d31 | [
"MIT"
] | 12 | 2019-06-12T07:26:40.000Z | 2021-08-11T15:10:47.000Z | opexebo/analysis/population_vector_correlation.py | simon-ball/opexebo | 8e44a4890efa60a6ed8c2e9e0df7cc9ab2d80d31 | [
"MIT"
] | 4 | 2019-11-21T10:44:37.000Z | 2022-01-07T14:21:07.000Z | """
Provide function for population vector correlation calculation
"""
import numpy as np
from .. import errors as err
def population_vector_correlation(stack_0, stack_1, **kwargs):
"""Calculates the bin-wise correlation between two stacks of rate maps
Each stack corresponds to a separate Task, or trial... | 38.513889 | 97 | 0.617502 | """
Provide function for population vector correlation calculation
"""
import numpy as np
from .. import errors as err
def population_vector_correlation(stack_0, stack_1, **kwargs):
"""Calculates the bin-wise correlation between two stacks of rate maps
Each stack corresponds to a separate Task, or trial... | 0 | 0 | 0 |
43dfff0b11f9abecb2f386dab390d2464fef68ca | 4,700 | py | Python | openslides_backend/http/application.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | 5 | 2020-01-20T13:57:15.000Z | 2021-03-27T14:14:44.000Z | openslides_backend/http/application.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | 859 | 2020-01-11T22:58:37.000Z | 2022-03-30T14:54:06.000Z | openslides_backend/http/application.py | FinnStutzenstein/openslides-backend | fffc152f79d3446591e07a6913d9fdf30b46f577 | [
"MIT"
] | 16 | 2020-01-04T20:28:57.000Z | 2022-02-10T12:06:54.000Z | import os
import re
from typing import Any, Iterable, Union
import simplejson as json
from werkzeug.exceptions import BadRequest as WerkzeugBadRequest
from werkzeug.wrappers import Response
from ..services.auth.adapter import HEADER_NAME
from ..shared.env import is_truthy
from ..shared.exceptions import ViewException... | 38.52459 | 87 | 0.649149 | import os
import re
from typing import Any, Iterable, Union
import simplejson as json
from werkzeug.exceptions import BadRequest as WerkzeugBadRequest
from werkzeug.wrappers import Response
from ..services.auth.adapter import HEADER_NAME
from ..shared.env import is_truthy
from ..shared.exceptions import ViewException... | 262 | 0 | 27 |
78ed8ee145761eaf3c9f43648f0b8fc8e9567525 | 7,899 | py | Python | deep_qa-master/deep_qa/models/sentence_selection/siamese_sentence_selector.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | 1 | 2017-04-11T13:03:55.000Z | 2017-04-11T13:03:55.000Z | deep_qa-master/deep_qa/models/sentence_selection/siamese_sentence_selector.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | null | null | null | deep_qa-master/deep_qa/models/sentence_selection/siamese_sentence_selector.py | RTHMaK/RPGOne | 3f3ada7db1762781668bfb2377154fdc00e17212 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict
from overrides import overrides
from keras.layers import Input
from keras.layers.wrappers import TimeDistributed
from ...data.instances.sentence_selection_instance import SentenceSelectionInstance
from ...layers.attention.attention import Attention
from ...layers.wrappers.encoder_wrapper i... | 48.759259 | 102 | 0.669072 | from typing import Any, Dict
from overrides import overrides
from keras.layers import Input
from keras.layers.wrappers import TimeDistributed
from ...data.instances.sentence_selection_instance import SentenceSelectionInstance
from ...layers.attention.attention import Attention
from ...layers.wrappers.encoder_wrapper i... | 869 | 0 | 78 |
a8867f5403bb99f5bcbae491f8268e1b65d87f58 | 1,572 | py | Python | aulaspythonintermediario/aula08/aula08.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | 1 | 2021-09-04T14:34:34.000Z | 2021-09-04T14:34:34.000Z | aulaspythonintermediario/aula08/aula08.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | null | null | null | aulaspythonintermediario/aula08/aula08.py | lel352/Curso-Python | d65484c807db52d57042eee20ccbd3131825fa98 | [
"MIT"
] | null | null | null | perguntas = {
'Pergunta 1': {
'pergunta': 'Quanto é 2+2?',
'respostas': {
'a': '1',
'b': '4',
'c': '8'
},
'resposta_certa': 'b',
},
'Pergunta 2': {
'pergunta': 'Quanto é 3*2?',
'respostas': {
'a': '4',
... | 22.782609 | 60 | 0.41285 | perguntas = {
'Pergunta 1': {
'pergunta': 'Quanto é 2+2?',
'respostas': {
'a': '1',
'b': '4',
'c': '8'
},
'resposta_certa': 'b',
},
'Pergunta 2': {
'pergunta': 'Quanto é 3*2?',
'respostas': {
'a': '4',
... | 0 | 0 | 0 |
3d0e051a57e016d558884a4d3a81a6b8c4bc541a | 2,521 | py | Python | api.py | dwyer/kvstore | d28e5d30e87663fc659dabd1186f65f7bcc72e7a | [
"BSD-2-Clause"
] | null | null | null | api.py | dwyer/kvstore | d28e5d30e87663fc659dabd1186f65f7bcc72e7a | [
"BSD-2-Clause"
] | null | null | null | api.py | dwyer/kvstore | d28e5d30e87663fc659dabd1186f65f7bcc72e7a | [
"BSD-2-Clause"
] | null | null | null | # -*-coding:utf-8-*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
import json
import urllib
import urllib2
| 29.313953 | 74 | 0.571599 | # -*-coding:utf-8-*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
import json
import urllib
import urllib2
class NotAuthorized(Exception):
pass
class NotFound(Exception):
pass
class A... | 1,815 | 404 | 69 |
3630eaadfd408312b2a07a52e5f3950986ace3b4 | 9,328 | py | Python | appyter/ext/urllib.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | null | null | null | appyter/ext/urllib.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | 24 | 2020-04-07T17:04:47.000Z | 2020-05-27T00:51:25.000Z | appyter/ext/urllib.py | MaayanLab/jupyter-template | dd05bfcb95c9eafb1a9df845b5d8fecae1d6b9d5 | [
"Apache-2.0"
] | null | null | null | import re
import itertools
import dataclasses
import typing as t
import urllib.parse
from appyter.ext.pathlib.chroot import ChrootPurePosixPath
from appyter.ext.dict import dict_merge, expand_dotmap
url_expr = re.compile(
r'^((?P<scheme>.+?)://(?P<authority>((?P<username>[^/:@\?#]+?)(:(?P<password>[^/@\?#]+?))?@)?(?... | 31.836177 | 213 | 0.690502 | import re
import itertools
import dataclasses
import typing as t
import urllib.parse
from appyter.ext.pathlib.chroot import ChrootPurePosixPath
from appyter.ext.dict import dict_merge, expand_dotmap
def parent_url(url):
parent, *filename = url.rsplit('/', maxsplit=1)
return parent if filename else ''
def url_file... | 7,210 | 0 | 950 |
6aa46ba15af9c90cd4de963e915ab8711d8d1291 | 4,891 | py | Python | tensorflow_federated/python/research/optimization/stackoverflow_lr/run_federated.py | matech96/federated | b30a26d66162bd02a89a12f119e17925d161a26b | [
"Apache-2.0"
] | 1 | 2020-05-02T05:08:14.000Z | 2020-05-02T05:08:14.000Z | tensorflow_federated/python/research/optimization/stackoverflow_lr/run_federated.py | RITESG/STATIC | cfe9d3e35ba033b1c4e47d347427a83f682f41de | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/research/optimization/stackoverflow_lr/run_federated.py | RITESG/STATIC | cfe9d3e35ba033b1c4e47d347427a83f682f41de | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, The TensorFlow Federated 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... | 38.511811 | 105 | 0.771212 | # Copyright 2019, The TensorFlow Federated 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... | 2,275 | 0 | 23 |
02df5335e8a3f3d4d358a0212ca07a5e325681d9 | 3,839 | py | Python | rlo/src/rlo/plot_empirical_predicted_values.py | tomjaguarpaw/knossos-ksc | 8fa75e67c0db8f632b135379740051cd10ff31f2 | [
"MIT"
] | 31 | 2021-09-09T16:09:55.000Z | 2022-02-20T02:15:19.000Z | rlo/src/rlo/plot_empirical_predicted_values.py | tomjaguarpaw/knossos-ksc | 8fa75e67c0db8f632b135379740051cd10ff31f2 | [
"MIT"
] | 40 | 2021-08-06T14:30:08.000Z | 2022-01-19T08:49:52.000Z | rlo/src/rlo/plot_empirical_predicted_values.py | tomjaguarpaw/knossos-ksc | 8fa75e67c0db8f632b135379740051cd10ff31f2 | [
"MIT"
] | 5 | 2021-08-06T11:20:31.000Z | 2022-01-07T19:39:40.000Z | import argparse
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
from rlo import experiment_result
from rlo import plotting
from rlo import utils
if __name__ == "__main__":
main()
| 34.585586 | 96 | 0.616567 | import argparse
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
from rlo import experiment_result
from rlo import plotting
from rlo import utils
def plot_empirical_predicted_values(
outfile, title_suffix, events, probabilities=[10, 50, 90]
):
# import json # deter... | 3,537 | 0 | 69 |
66a4b82e23fde1980e30c512048651186c71ab88 | 2,298 | py | Python | recipes/protobuf/all/test_package/conanfile.py | hoxnox/conan-center-index | 5ecea3b63ebfe08dc672c5cbbb5a277d5e47f0f9 | [
"MIT"
] | 1 | 2020-10-23T13:14:41.000Z | 2020-10-23T13:14:41.000Z | recipes/protobuf/all/test_package/conanfile.py | hoxnox/conan-center-index | 5ecea3b63ebfe08dc672c5cbbb5a277d5e47f0f9 | [
"MIT"
] | 4 | 2019-12-12T14:54:30.000Z | 2020-02-12T19:55:02.000Z | recipes/protobuf/all/test_package/conanfile.py | hoxnox/conan-center-index | 5ecea3b63ebfe08dc672c5cbbb5a277d5e47f0f9 | [
"MIT"
] | 3 | 2019-10-01T21:18:08.000Z | 2021-08-04T12:36:22.000Z | import os
from conans import ConanFile, CMake, RunEnvironment, tools
import shutil
| 44.192308 | 124 | 0.632289 | import os
from conans import ConanFile, CMake, RunEnvironment, tools
import shutil
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package"
@property
def _protoc_available(self):
return not self.options["protobuf"].lite an... | 1,982 | 209 | 23 |
439e5ce03fdeb7ff15b9bc418b9bb213e3b0abfd | 1,348 | py | Python | interviewee/05_leetcode/arr_intersection_of_arrays.py | Anshul-GH/interview_prep | 0a30e980e910afbae4ad086dc7ff3b339eba4ec0 | [
"MIT"
] | 1 | 2020-10-10T10:14:27.000Z | 2020-10-10T10:14:27.000Z | interviewee/05_leetcode/arr_intersection_of_arrays.py | Anshul-GH/interview_prep | 0a30e980e910afbae4ad086dc7ff3b339eba4ec0 | [
"MIT"
] | null | null | null | interviewee/05_leetcode/arr_intersection_of_arrays.py | Anshul-GH/interview_prep | 0a30e980e910afbae4ad086dc7ff3b339eba4ec0 | [
"MIT"
] | null | null | null | '''
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Example 2:
Input: nums1 = [4,9,5],... | 29.955556 | 205 | 0.594214 | '''
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Example 2:
Input: nums1 = [4,9,5],... | 486 | -6 | 50 |
f4cb10f0f56ff24847349376a900ee090e9a7376 | 403 | py | Python | pysbd/lang/english.py | nipunsadvilkar/pysbd | 5905f13be4fc95f407b98392e0ec303617a33d86 | [
"MIT"
] | 429 | 2019-03-27T14:42:33.000Z | 2022-03-30T15:52:33.000Z | pysbd/lang/english.py | nipunsadvilkar/pysbd | 5905f13be4fc95f407b98392e0ec303617a33d86 | [
"MIT"
] | 86 | 2017-06-14T17:47:00.000Z | 2022-02-25T07:44:42.000Z | pysbd/lang/english.py | nipunsadvilkar/pysbd | 5905f13be4fc95f407b98392e0ec303617a33d86 | [
"MIT"
] | 55 | 2019-04-16T17:17:39.000Z | 2022-03-09T20:12:48.000Z | # -*- coding: utf-8 -*-
from pysbd.abbreviation_replacer import AbbreviationReplacer
from pysbd.lang.common import Common, Standard
| 33.583333 | 80 | 0.717122 | # -*- coding: utf-8 -*-
from pysbd.abbreviation_replacer import AbbreviationReplacer
from pysbd.lang.common import Common, Standard
class English(Common, Standard):
iso_code = 'en'
class AbbreviationReplacer(AbbreviationReplacer):
SENTENCE_STARTERS = "A Being Did For He How However I In It Millions "... | 0 | 248 | 23 |
f207a86266fcce606728900c23230def441f9355 | 3,578 | py | Python | scarlett_os/utility/file.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 5 | 2016-11-08T21:01:00.000Z | 2018-05-07T11:02:43.000Z | scarlett_os/utility/file.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 854 | 2016-09-21T13:06:32.000Z | 2022-02-10T13:21:47.000Z | scarlett_os/utility/file.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 2 | 2016-12-02T15:12:41.000Z | 2017-02-25T08:21:56.000Z | # -*- coding: utf-8 -*-
from __future__ import with_statement, division
from scarlett_os.compat import os
from scarlett_os.compat import errno
from scarlett_os.compat import environ
from scarlett_os.compat import text_type
from scarlett_os.compat import _FSCODING
def format_size(size):
"""Turn an integer size v... | 27.523077 | 76 | 0.605087 | # -*- coding: utf-8 -*-
from __future__ import with_statement, division
from scarlett_os.compat import os
from scarlett_os.compat import errno
from scarlett_os.compat import environ
from scarlett_os.compat import text_type
from scarlett_os.compat import _FSCODING
def format_size(size):
"""Turn an integer size v... | 0 | 0 | 0 |
61981eb93391ba5fface0de71de724470844469f | 4,159 | py | Python | Raycast.py | Dylooz/raycasting | f0983ecc569f67cbd4dfeed8b28c0c1568db059f | [
"MIT"
] | null | null | null | Raycast.py | Dylooz/raycasting | f0983ecc569f67cbd4dfeed8b28c0c1568db059f | [
"MIT"
] | null | null | null | Raycast.py | Dylooz/raycasting | f0983ecc569f67cbd4dfeed8b28c0c1568db059f | [
"MIT"
] | null | null | null | import math
import numpy
import pygame
CONFIG = {
"START_POS": (400, 400),
"PLAYER_COLOUR": (0, 0, 255),
"PLAYER_RADIUS": 10,
"FOV": (math.pi / 2),
"RESOLUTION": 0.25,
"ROTATE_SPEED": (math.pi / 360),
"MOVE_SPEED": 0.5,
"VIEW_DIST": 300
}
WIDTH = 800
KEYS = {
107... | 28.101351 | 132 | 0.534744 | import math
import numpy
import pygame
CONFIG = {
"START_POS": (400, 400),
"PLAYER_COLOUR": (0, 0, 255),
"PLAYER_RADIUS": 10,
"FOV": (math.pi / 2),
"RESOLUTION": 0.25,
"ROTATE_SPEED": (math.pi / 360),
"MOVE_SPEED": 0.5,
"VIEW_DIST": 300
}
WIDTH = 800
KEYS = {
107... | 2,989 | -6 | 463 |