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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12b135466c5c850993528becc6050f17c4230012 | 1,906 | py | Python | itests/client_fixtures.py | skivis/BlackSheep | 486f04ba2045f31dd3e188f52c45a275eb150967 | [
"MIT"
] | 1 | 2021-04-28T14:42:26.000Z | 2021-04-28T14:42:26.000Z | itests/client_fixtures.py | skivis/BlackSheep | 486f04ba2045f31dd3e188f52c45a275eb150967 | [
"MIT"
] | null | null | null | itests/client_fixtures.py | skivis/BlackSheep | 486f04ba2045f31dd3e188f52c45a275eb150967 | [
"MIT"
] | null | null | null | from itests.utils import get_sleep_time
from blacksheep.client.pool import ClientConnectionPools
import os
import pathlib
import asyncio
from multiprocessing import Process
from time import sleep
import pytest
from blacksheep.client import ClientSession
from .flask_app import app
@pytest.fixture(scope="session")
... | 24.753247 | 81 | 0.718258 | from itests.utils import get_sleep_time
from blacksheep.client.pool import ClientConnectionPools
import os
import pathlib
import asyncio
from multiprocessing import Process
from time import sleep
import pytest
from blacksheep.client import ClientSession
from .flask_app import app
def get_static_path(file_name):
... | 1,060 | 0 | 156 |
9afbe23daffa1d6b64b319da9bb5fb508db62891 | 673 | py | Python | 2021/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2021/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2021/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null |
print("part1:", iterate(80))
print("part2:", iterate(256))
| 29.26087 | 66 | 0.456166 | def iterate(days):
with open("inputs/day6.txt") as f:
input = [int(x) for x in f.readline().strip().split(",")]
fish = {}
for f in input:
fish[f] = fish.get(f, 0) + 1
for day in range(1, days+1):
new_fish = {}
for x in fish:
if x =... | 591 | 0 | 22 |
cfe8552d61b7b191dc8c08bf956d94364e70490c | 7,322 | py | Python | vivarium/core/repository.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/core/repository.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/core/repository.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | """
==============================================
Repository of Updaters, Dividers, and Derivers
==============================================
You should interpret words and phrases that appear fully capitalized in
this document as described in :rfc:`2119`. Here is a brief summary of
the RFC:
* "MUST" indicates abs... | 29.643725 | 88 | 0.680688 | """
==============================================
Repository of Updaters, Dividers, and Derivers
==============================================
You should interpret words and phrases that appear fully capitalized in
this document as described in :rfc:`2119`. Here is a brief summary of
the RFC:
* "MUST" indicates abs... | 161 | 17 | 174 |
c489189444952f919e3577efb4fb2967757abb02 | 591 | py | Python | utils.py | doiken23/mccformers.pytorch | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | [
"MIT"
] | 1 | 2021-11-26T12:08:41.000Z | 2021-11-26T12:08:41.000Z | utils.py | doiken23/mccformers.pytorch | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | [
"MIT"
] | null | null | null | utils.py | doiken23/mccformers.pytorch | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | [
"MIT"
] | null | null | null | import torch
from torch import Tensor
def compute_accuracy(pred: Tensor, gt: Tensor, ignore: int = 0):
"""
pred (torch.Tensor): predicted words shape of [L, N]
gt (torch.Tensor): GT words shape of [L, N]
ignore (int): ignored label
"""
mask = gt != ignore
tp = torch.logical_and(pred == gt,... | 22.730769 | 64 | 0.563452 | import torch
from torch import Tensor
def compute_accuracy(pred: Tensor, gt: Tensor, ignore: int = 0):
"""
pred (torch.Tensor): predicted words shape of [L, N]
gt (torch.Tensor): GT words shape of [L, N]
ignore (int): ignored label
"""
mask = gt != ignore
tp = torch.logical_and(pred == gt,... | 206 | 0 | 23 |
e1ef75ea90706b3fa5441badf9e317871b169654 | 96 | py | Python | service-cfg-mgnt/ansible_app/apps.py | pfroelke/Confne | bd7771fdd3c6e59ec0f327ba2b9d72d31cb8e582 | [
"MIT"
] | null | null | null | service-cfg-mgnt/ansible_app/apps.py | pfroelke/Confne | bd7771fdd3c6e59ec0f327ba2b9d72d31cb8e582 | [
"MIT"
] | 14 | 2021-03-30T14:26:53.000Z | 2022-03-02T10:40:40.000Z | service-cfg-mgnt/ansible_app/apps.py | pfroelke/Confnetti | bd7771fdd3c6e59ec0f327ba2b9d72d31cb8e582 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 16 | 34 | 0.770833 | from django.apps import AppConfig
class AnsibleAppConfig(AppConfig):
name = "ansible_app"
| 0 | 38 | 23 |
5749762850ea7ecd0b18114c1bb163d34428e1e5 | 6,295 | py | Python | python-ref/python-make/cxx_sources_deps_rules.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | 1 | 2019-10-16T12:15:53.000Z | 2019-10-16T12:15:53.000Z | python-ref/python-make/cxx_sources_deps_rules.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | null | null | null | python-ref/python-make/cxx_sources_deps_rules.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | null | null | null | # this is a make/python hybrid file
# Normal make files are a make/sh hybrid.
# This makefile uses python instead of sh (or bash)
test_cxx_sources ?=
checkcxxsources $(cxxsources):$(out_init)
$(origin)
if (this == "checkcxxsources") and (not os.path.exists(env.cxxsources)):
leave()
caption()
if (this ==... | 34.211957 | 82 | 0.58189 | # this is a make/python hybrid file
# Normal make files are a make/sh hybrid.
# This makefile uses python instead of sh (or bash)
test_cxx_sources ?=
checkcxxsources $(cxxsources):$(out_init)
$(origin)
if (this == "checkcxxsources") and (not os.path.exists(env.cxxsources)):
leave()
caption()
if (this ==... | 609 | 0 | 74 |
6d18fbcf0c4128657606560451cbb6b3b8077b66 | 20,036 | py | Python | binance/delivery/market.py | AlfonsoAgAr/binance-futures-connector-python | f0bd2c7b0576503bf526ce6be329ca2dae90fefe | [
"MIT"
] | 1 | 2022-01-29T14:37:47.000Z | 2022-01-29T14:37:47.000Z | binance/delivery/market.py | sanjeevan121/binance-futures-connector-python | d820b73a15e9f64c80891a13694ca0c5d1693b90 | [
"MIT"
] | null | null | null | binance/delivery/market.py | sanjeevan121/binance-futures-connector-python | d820b73a15e9f64c80891a13694ca0c5d1693b90 | [
"MIT"
] | 1 | 2022-02-25T16:23:41.000Z | 2022-02-25T16:23:41.000Z | from binance.lib.utils import (
check_required_parameter,
)
from binance.lib.utils import check_required_parameters
def ping(self):
"""
|
| **Test Connectivity**
| *Test connectivity to the Rest API.*
:API endpoint: ``GET /dapi/v1/ping``
:API doc: https://binance-docs.github.io/apidocs/de... | 38.679537 | 204 | 0.674636 | from binance.lib.utils import (
check_required_parameter,
)
from binance.lib.utils import check_required_parameters
def ping(self):
"""
|
| **Test Connectivity**
| *Test connectivity to the Rest API.*
:API endpoint: ``GET /dapi/v1/ping``
:API doc: https://binance-docs.github.io/apidocs/de... | 0 | 0 | 0 |
6561f371a02903143318b73cd46ae7e124479c61 | 279 | py | Python | gitkit/commands/what.py | akx/git-kit | 54948b57f201adecc810c4895b6712c1c8265cf3 | [
"MIT"
] | 3 | 2017-02-16T09:04:09.000Z | 2021-05-03T08:25:52.000Z | gitkit/commands/what.py | akx/git-kit | 54948b57f201adecc810c4895b6712c1c8265cf3 | [
"MIT"
] | 2 | 2017-02-16T08:54:15.000Z | 2017-02-16T09:09:41.000Z | gitkit/commands/what.py | akx/git-kit | 54948b57f201adecc810c4895b6712c1c8265cf3 | [
"MIT"
] | 1 | 2022-02-07T09:07:39.000Z | 2022-02-07T09:07:39.000Z | import click
from gitkit.util.shell import get_output
@click.command()
def what():
"""
What _is_ the current revision anyway?
"""
description = get_output("git describe")
revision = get_output("git rev-parse HEAD")
print(f"{description} ({revision})")
| 19.928571 | 47 | 0.670251 | import click
from gitkit.util.shell import get_output
@click.command()
def what():
"""
What _is_ the current revision anyway?
"""
description = get_output("git describe")
revision = get_output("git rev-parse HEAD")
print(f"{description} ({revision})")
| 0 | 0 | 0 |
d7905df33f83738c4064bc686d449bb022aa90b4 | 1,281 | py | Python | census/code.py | Balaji-Pa/greyatom-python-for-data-science | 801905c377cbd0a573a9d5d8cc0b66972bffc4af | [
"MIT"
] | null | null | null | census/code.py | Balaji-Pa/greyatom-python-for-data-science | 801905c377cbd0a573a9d5d8cc0b66972bffc4af | [
"MIT"
] | null | null | null | census/code.py | Balaji-Pa/greyatom-python-for-data-science | 801905c377cbd0a573a9d5d8cc0b66972bffc4af | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
# data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
data = np.genfromtxt(path, delimiter = ",",... | 22.875 | 61 | 0.664325 | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
# data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
data = np.genfromtxt(path, delimiter = ",",... | 0 | 0 | 0 |
4165bf5b7d8a9d455b4c62503f72f9ecebf7e6ba | 509 | py | Python | CHAPTER 06 (stacks_queues_deques)/reverse_file_using_stack.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 06 (stacks_queues_deques)/reverse_file_using_stack.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 06 (stacks_queues_deques)/reverse_file_using_stack.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | from stack_class import *
def reverse_file(path):
"""Overwrite given file using its context line-by-line reversed"""
s=ArrayStack()
with open(path,"r") as original:
for line in original:
s.push(line.rstrip("\n")) # removing newline characters
# overwrite the contents in LIFO order
... | 29.941176 | 70 | 0.642436 | from stack_class import *
def reverse_file(path):
"""Overwrite given file using its context line-by-line reversed"""
s=ArrayStack()
with open(path,"r") as original:
for line in original:
s.push(line.rstrip("\n")) # removing newline characters
# overwrite the contents in LIFO order
... | 0 | 0 | 0 |
6500eec5e3f781f090b684bdb20725e228725ab7 | 816 | py | Python | simulaqron/tests/performance/ring_teleport/configure_ring.py | Doomsk/SimulaQron | 09bd81730e31c7642a0fece8ae7d518820fe57eb | [
"BSD-3-Clause"
] | 69 | 2018-10-14T10:32:34.000Z | 2022-03-08T10:28:15.000Z | simulaqron/tests/performance/ring_teleport/configure_ring.py | Doomsk/SimulaQron | 09bd81730e31c7642a0fece8ae7d518820fe57eb | [
"BSD-3-Clause"
] | 121 | 2018-10-03T13:57:44.000Z | 2021-12-17T17:36:39.000Z | simulaqron/tests/performance/ring_teleport/configure_ring.py | Doomsk/SimulaQron | 09bd81730e31c7642a0fece8ae7d518820fe57eb | [
"BSD-3-Clause"
] | 43 | 2018-10-10T15:53:28.000Z | 2022-03-31T16:52:55.000Z | import sys
import os
from simulaqron.toolbox import get_simulaqron_path
# Get path to SimulaQron folder
simulaqron_path = get_simulaqron_path.main()
tot_nr = int(sys.argv[1])
# configure run files for nodes
with open("run.sh", "w") as f:
f.write("#!/bin/sh\n\n")
for i in range(tot_nr - 1):
f.write(... | 27.2 | 68 | 0.627451 | import sys
import os
from simulaqron.toolbox import get_simulaqron_path
# Get path to SimulaQron folder
simulaqron_path = get_simulaqron_path.main()
tot_nr = int(sys.argv[1])
# configure run files for nodes
with open("run.sh", "w") as f:
f.write("#!/bin/sh\n\n")
for i in range(tot_nr - 1):
f.write(... | 0 | 0 | 0 |
3455b79313232342209d06b8958b01bacb4d6b24 | 181 | py | Python | popupdict/util/__init__.py | hantaotaohan/popup-dict | 9eb05fd9797a14323c9b1166f916778b32e933bc | [
"MIT"
] | 85 | 2018-02-23T07:16:27.000Z | 2022-03-26T19:53:48.000Z | popupdict/util/__init__.py | glMa7/popup-dict | dbf9121aa63d65095bd848a582595e1b03327418 | [
"MIT"
] | 12 | 2018-02-23T07:45:34.000Z | 2020-03-10T03:20:03.000Z | popupdict/util/__init__.py | glMa7/popup-dict | dbf9121aa63d65095bd848a582595e1b03327418 | [
"MIT"
] | 16 | 2018-01-02T02:07:50.000Z | 2021-12-17T08:01:00.000Z | from .selection import Selection
from .logging import logger
from .dir import config_dir, cache_dir
__all__ = [
'Selection',
'logger',
'config_dir',
'cache_dir',
]
| 16.454545 | 38 | 0.685083 | from .selection import Selection
from .logging import logger
from .dir import config_dir, cache_dir
__all__ = [
'Selection',
'logger',
'config_dir',
'cache_dir',
]
| 0 | 0 | 0 |
33fc243f69957eb951b7bee3d0b96740c540016f | 13,978 | py | Python | classification/CIFAR/gram_matrics.py | warner-benjamin/vos | 1f6844caeb2985f875b446f284bcfcfb8f9bba0e | [
"Apache-2.0"
] | 174 | 2022-02-03T04:45:23.000Z | 2022-03-31T06:04:23.000Z | classification/CIFAR/gram_matrics.py | warner-benjamin/vos | 1f6844caeb2985f875b446f284bcfcfb8f9bba0e | [
"Apache-2.0"
] | 19 | 2022-02-08T14:48:43.000Z | 2022-03-31T08:48:05.000Z | classification/CIFAR/gram_matrics.py | warner-benjamin/vos | 1f6844caeb2985f875b446f284bcfcfb8f9bba0e | [
"Apache-2.0"
] | 24 | 2022-02-04T14:16:29.000Z | 2022-03-26T12:13:06.000Z | from __future__ import division,print_function
#matplotlib inline
#load_ext autoreload
#autoreload 2
import sys
from tqdm import tqdm_notebook as tqdm
import random
import matplotlib.pyplot as plt
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim a... | 33.440191 | 136 | 0.609744 | from __future__ import division,print_function
#matplotlib inline
#load_ext autoreload
#autoreload 2
import sys
from tqdm import tqdm_notebook as tqdm
import random
import matplotlib.pyplot as plt
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim a... | 9,549 | 76 | 506 |
668413f0ce3cd197c88e2f927c1dbf7519e7a5cb | 1,597 | py | Python | LinkMeBot/utils.py | mdlss/PlayStoreLinks_Bot | 3c4bec4594c9670c7a3b88848cdc59c988c7f454 | [
"MIT"
] | null | null | null | LinkMeBot/utils.py | mdlss/PlayStoreLinks_Bot | 3c4bec4594c9670c7a3b88848cdc59c988c7f454 | [
"MIT"
] | null | null | null | LinkMeBot/utils.py | mdlss/PlayStoreLinks_Bot | 3c4bec4594c9670c7a3b88848cdc59c988c7f454 | [
"MIT"
] | null | null | null | import logging
import math
from misaka import Markdown, HtmlRenderer
from lxml.html import fromstring
# https://stackoverflow.com/a/3155023
millnames = ['',' thousand',' million',' billion',' trillion'] | 33.270833 | 121 | 0.72511 | import logging
import math
from misaka import Markdown, HtmlRenderer
from lxml.html import fromstring
def make_logger(logger_name, logfile, loggin_level=logging.DEBUG):
logger = logging.getLogger(logger_name)
logger.setLevel(loggin_level)
formatter = logging.Formatter('%(levelname)s - %(name)s - %(asctime)s - %(... | 1,325 | 0 | 68 |
b88fd5088d5c6562e9e754916376f77c12018147 | 3,004 | py | Python | handling.py | alnordst/address-book-api | 4385512ea5d1fdfd153160f2de2e6874890acd70 | [
"Apache-2.0"
] | null | null | null | handling.py | alnordst/address-book-api | 4385512ea5d1fdfd153160f2de2e6874890acd70 | [
"Apache-2.0"
] | null | null | null | handling.py | alnordst/address-book-api | 4385512ea5d1fdfd153160f2de2e6874890acd70 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from elasticsearch import Elasticsearch
from contact import Contact
class Handler(object):
"""
Handles operations on elasticsearch.
"""
def list_contacts(self, arguments):
"""
Returns a list of contacts or False.
"""
try:
self.es.in... | 29.165049 | 79 | 0.515313 | from flask import Flask
from elasticsearch import Elasticsearch
from contact import Contact
class Handler(object):
"""
Handles operations on elasticsearch.
"""
def __init__(self, index_name, port = 9200, wipe_index = False):
self.index_name = index_name
self.es = Elasticsearch(port = ... | 752 | 0 | 54 |
3e1ac6e8a54a6c16c3f79943e80cd2d3572d84bc | 1,671 | py | Python | temp/models.py | oteejay/lms | be351c8ec7aee1f81dede6fcf4292c1ecad31c60 | [
"MIT"
] | null | null | null | temp/models.py | oteejay/lms | be351c8ec7aee1f81dede6fcf4292c1ecad31c60 | [
"MIT"
] | 11 | 2020-06-05T22:33:23.000Z | 2022-03-11T23:56:46.000Z | temp/models.py | oteejay/lms | be351c8ec7aee1f81dede6fcf4292c1ecad31c60 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
| 33.42 | 105 | 0.618791 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
def upload_location(instance, filename):
return "%s/%s/%s" %('jtgreen', 'temp', filename)
class TempUser(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='tempusers')
... | 72 | 1,391 | 92 |
0d89603cb6143b26a131f84180a888c6ee7dfc8b | 279 | py | Python | Early/copyField_offices.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | 1 | 2017-05-24T02:05:20.000Z | 2017-05-24T02:05:20.000Z | historic/copyField_offices.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | historic/copyField_offices.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | import arcpy
source = "C:\\TxDOT\\Shapefiles\\District_Offices.shp"
outputcopy = "T:\\DATAMGT\\MAPPING\\Personal Folders\\Adam\\District_Offices.shp"
copyPhone()
| 34.875 | 81 | 0.752688 | import arcpy
source = "C:\\TxDOT\\Shapefiles\\District_Offices.shp"
outputcopy = "T:\\DATAMGT\\MAPPING\\Personal Folders\\Adam\\District_Offices.shp"
def copyPhone():
arcpy.JoinField_management(outputcopy, "Address", source, "Address", ["Phone"])
return "complete"
copyPhone()
| 95 | 0 | 22 |
0e5c3c46f6c668faf01c3b0e96efc84b5cd1661c | 5,095 | py | Python | novmpy/vm.py | Dy-Baby/NoVmpy | 49b13f5c9e5f4d3d4931e52836ee526996cea557 | [
"BSD-3-Clause"
] | null | null | null | novmpy/vm.py | Dy-Baby/NoVmpy | 49b13f5c9e5f4d3d4931e52836ee526996cea557 | [
"BSD-3-Clause"
] | null | null | null | novmpy/vm.py | Dy-Baby/NoVmpy | 49b13f5c9e5f4d3d4931e52836ee526996cea557 | [
"BSD-3-Clause"
] | null | null | null | from novmpy.bridge import *
from capstone import *
from capstone.x86 import *
from novmpy.x86_deobf import *
from novmpy.match_helper import *
| 44.304348 | 138 | 0.479686 | from novmpy.bridge import *
from capstone import *
from capstone.x86 import *
from novmpy.x86_deobf import *
from novmpy.match_helper import *
class VMConfig:
def __init__(self):
self.reg_key = X86_REG_INVALID
self.reg_ip = X86_REG_INVALID
self.reg_sp = X86_REG_INVALID
self.reg_reg... | 4,757 | -13 | 206 |
2de0437e5ff66c828b518801f8dc21a58fbed809 | 952 | py | Python | src/smach_tutorial/Introspection/Introspection.py | vishnuPra/state_machine_tutorial | e27ee3b91feba8da3389df921f1c4346bf8d4bc2 | [
"Apache-2.0"
] | null | null | null | src/smach_tutorial/Introspection/Introspection.py | vishnuPra/state_machine_tutorial | e27ee3b91feba8da3389df921f1c4346bf8d4bc2 | [
"Apache-2.0"
] | null | null | null | src/smach_tutorial/Introspection/Introspection.py | vishnuPra/state_machine_tutorial | e27ee3b91feba8da3389df921f1c4346bf8d4bc2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
import smach_ros
from smach_tutorial.BasicStateMachine import BasicStateMachine_0,\
BasicStateMachine_1,\
BasicStateMachine_2
##-----------------------------------------------------------------... | 30.709677 | 85 | 0.548319 | #!/usr/bin/env python
import rospy
import smach_ros
from smach_tutorial.BasicStateMachine import BasicStateMachine_0,\
BasicStateMachine_1,\
BasicStateMachine_2
##-----------------------------------------------------------------... | 356 | 0 | 45 |
922e212a09a16f5831aaa45b2164778b91ffe10a | 8,448 | py | Python | vendor/packages/translate-toolkit/translate/convert/test_xliff2po.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | vendor/packages/translate-toolkit/translate/convert/test_xliff2po.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/translate-toolkit/translate/convert/test_xliff2po.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from translate.convert import xliff2po
from translate.misc import wStringIO
from translate.storage.test_base import headerless_len, first_translatable
class TestBasicXLIFF2PO(TestXLIFF2PO):
"""This tests a basic XLIFF file without xmlns attribute"""
xliffskeleton = '''<?xml version="1.... | 38.054054 | 131 | 0.623816 | #!/usr/bin/env python
from translate.convert import xliff2po
from translate.misc import wStringIO
from translate.storage.test_base import headerless_len, first_translatable
class TestXLIFF2PO:
xliffskeleton = '''<?xml version="1.0" ?>
<xliff version="1.1" xmlns="urn:oasis:names:tc:xliff:document:1.1">
<file ori... | 1,513 | 6,438 | 23 |
d8082c1ca4107fc4e8b66d4b8f63834432cb57a8 | 1,419 | py | Python | Python/the_office_outed.py | ielvisd/CodeWar_Katas | 3d95dd72332a81cc2bff1c7fd3b782d1f4658ca8 | [
"MIT"
] | null | null | null | Python/the_office_outed.py | ielvisd/CodeWar_Katas | 3d95dd72332a81cc2bff1c7fd3b782d1f4658ca8 | [
"MIT"
] | null | null | null | Python/the_office_outed.py | ielvisd/CodeWar_Katas | 3d95dd72332a81cc2bff1c7fd3b782d1f4658ca8 | [
"MIT"
] | null | null | null | """ Your colleagues have been looking over you shoulder. When you should have been doing your boring real job, you've been using the work computers to smash in endless hours of codewars.
In a team meeting, a terrible, awful person declares to the group that you aren't working. You're in trouble. You quickly have to ga... | 61.695652 | 237 | 0.680761 | """ Your colleagues have been looking over you shoulder. When you should have been doing your boring real job, you've been using the work computers to smash in endless hours of codewars.
In a team meeting, a terrible, awful person declares to the group that you aren't working. You're in trouble. You quickly have to ga... | 34 | 0 | 23 |
421acd565a0e8398b36565449d99af0489f54b35 | 399 | py | Python | app_orders/serializers.py | la5tway/candy_shop | c3bc5b958afe0c1066de98126b5cf5d96eb06a1b | [
"MIT"
] | null | null | null | app_orders/serializers.py | la5tway/candy_shop | c3bc5b958afe0c1066de98126b5cf5d96eb06a1b | [
"MIT"
] | null | null | null | app_orders/serializers.py | la5tway/candy_shop | c3bc5b958afe0c1066de98126b5cf5d96eb06a1b | [
"MIT"
] | null | null | null | from app_couriers.serializers import CourierSerializer
from .models import Orders
| 22.166667 | 69 | 0.676692 | from app_couriers.serializers import CourierSerializer
from .models import Orders
class OrderSerializer(CourierSerializer):
id_field_name = "order_id"
class Meta:
model = Orders
fields = ('order_id', 'weight', 'region', 'delivery_hours', )
class SingleOrderSerializer(OrderSerializer):
c... | 0 | 270 | 46 |
383a19a0b2431ee34819fe0766e2d6b83c59586f | 4,740 | py | Python | Rake.py | beenotung/Rake_For_Chinese | 07e8e570f7d35ec0b93f18d6a124eeb8529d7780 | [
"MIT"
] | null | null | null | Rake.py | beenotung/Rake_For_Chinese | 07e8e570f7d35ec0b93f18d6a124eeb8529d7780 | [
"MIT"
] | null | null | null | Rake.py | beenotung/Rake_For_Chinese | 07e8e570f7d35ec0b93f18d6a124eeb8529d7780 | [
"MIT"
] | null | null | null | '''
Implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Chinese
Original algorithm described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010).
Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan
(Eds.), Text Mining: Theory and Applications: John Wiley & Sons. ... | 30.779221 | 126 | 0.587553 | '''
Implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Chinese
Original algorithm described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010).
Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan
(Eds.), Text Mining: Theory and Applications: John Wiley & Sons. ... | 3,832 | -8 | 250 |
808fad95e5fb38e2f8830d881ee74dc3281332bf | 249 | py | Python | 20211217_PartialExam/SaveTheWorld/solution.py | augustozanellato/Cybersec2021 | 466fd9db0e7c359a8afd5115eacb3fca2b439c28 | [
"BSD-3-Clause"
] | 15 | 2021-10-01T16:10:48.000Z | 2022-02-19T20:45:35.000Z | 20211217_PartialExam/SaveTheWorld/solution.py | augustozanellato/Cybersec2021 | 466fd9db0e7c359a8afd5115eacb3fca2b439c28 | [
"BSD-3-Clause"
] | null | null | null | 20211217_PartialExam/SaveTheWorld/solution.py | augustozanellato/Cybersec2021 | 466fd9db0e7c359a8afd5115eacb3fca2b439c28 | [
"BSD-3-Clause"
] | 2 | 2021-11-06T08:32:41.000Z | 2021-12-11T16:18:54.000Z | from pwn import * # type: ignore
context.binary = "./SaveTheWorld"
p = process()
p.sendline(b"A" * 72 + b"Jotaro!!" + b"Star Platinum!!!" + b"HORA" + b"9999")
p.recvuntil(b"Congratulation, you won!!!")
os.system("grep .*{.*}.* victory_recap.txt")
| 31.125 | 77 | 0.634538 | from pwn import * # type: ignore
context.binary = "./SaveTheWorld"
p = process()
p.sendline(b"A" * 72 + b"Jotaro!!" + b"Star Platinum!!!" + b"HORA" + b"9999")
p.recvuntil(b"Congratulation, you won!!!")
os.system("grep .*{.*}.* victory_recap.txt")
| 0 | 0 | 0 |
e2a1f52aba416ba05637ca92a6566a1e403ae81d | 654 | py | Python | synlib/descriptions/CMPR32X1.py | vhnatyk/vlsistuff | 0981097bd19a0c482728dcc5048a3615ac9a9a90 | [
"MIT"
] | 26 | 2018-03-17T18:14:22.000Z | 2022-03-14T07:23:13.000Z | synlib/descriptions/CMPR32X1.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 1 | 2019-10-16T10:31:11.000Z | 2019-10-17T04:14:53.000Z | synlib/descriptions/CMPR32X1.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 7 | 2018-07-16T07:51:25.000Z | 2022-02-15T14:22:54.000Z | Desc = cellDescClass("CMPR32X1")
Desc.properties["cell_leakage_power"] = "3632.359140"
Desc.properties["cell_footprint"] = "add32"
Desc.properties["area"] = "69.854400"
Desc.pinOrder = ['A', 'B', 'C', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("C","S","combi")
Desc.add_arc("A","... | 31.142857 | 53 | 0.666667 | Desc = cellDescClass("CMPR32X1")
Desc.properties["cell_leakage_power"] = "3632.359140"
Desc.properties["cell_footprint"] = "add32"
Desc.properties["area"] = "69.854400"
Desc.pinOrder = ['A', 'B', 'C', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("C","S","combi")
Desc.add_arc("A","... | 0 | 0 | 0 |
fb949f558985982b6af7d2af1255dbe8dc314222 | 868 | py | Python | 965.py | OmangRawat/Leetcode | 6fa696367ef9c5e6b08940b11e2202382d1afc07 | [
"MIT"
] | null | null | null | 965.py | OmangRawat/Leetcode | 6fa696367ef9c5e6b08940b11e2202382d1afc07 | [
"MIT"
] | null | null | null | 965.py | OmangRawat/Leetcode | 6fa696367ef9c5e6b08940b11e2202382d1afc07 | [
"MIT"
] | null | null | null | """
---> Univalued Binary Tree
---> Easy
"""
from tree_func import *
in_array = [1, 1, 1, 1, 1, None, 1]
in_root = to_binary_tree(in_array)
pretty_print(in_root)
a = Solution()
print("Answer -", a.isUnivalTree(in_root))
# print("Answer -", a.isUnivalTree(in_root))
"""
Check if node is none or node.value should... | 26.30303 | 133 | 0.673963 | """
---> Univalued Binary Tree
---> Easy
"""
from tree_func import *
class Solution:
def isUnivalTree(self, root) -> bool:
def dfs(node):
# pretty_print(node)
# print(node is None or node.value == root.value and dfs(node.left) and dfs(node.right))
return node is Non... | 297 | -6 | 49 |
13702b905917360de903277c86d31a8e4bc8103e | 947 | py | Python | BPNetWork/NeuralNetwork/mnist_data.py | Keneyr/MachineLearningMethods | 9b15cce18c476f8b827ca5082ff119b6cba41198 | [
"MIT"
] | 1 | 2021-07-02T15:01:30.000Z | 2021-07-02T15:01:30.000Z | BPNetWork/NeuralNetwork/mnist_data.py | Keneyr/MachineLearningMethods | 9b15cce18c476f8b827ca5082ff119b6cba41198 | [
"MIT"
] | null | null | null | BPNetWork/NeuralNetwork/mnist_data.py | Keneyr/MachineLearningMethods | 9b15cce18c476f8b827ca5082ff119b6cba41198 | [
"MIT"
] | 1 | 2021-07-02T15:01:30.000Z | 2021-07-02T15:01:30.000Z | import os
import struct
import numpy as np
def load_mnist(path, kind='train'):
"""Load MNIST data from `path`"""
labels_path = os.path.join(path,
'%s-labels.idx1-ubyte'
% kind)
images_path = os.path.join(path,
'%s-... | 36.423077 | 70 | 0.469905 | import os
import struct
import numpy as np
def load_mnist(path, kind='train'):
"""Load MNIST data from `path`"""
labels_path = os.path.join(path,
'%s-labels.idx1-ubyte'
% kind)
images_path = os.path.join(path,
'%s-... | 0 | 0 | 0 |
ab920960470b013ad4fbe77a3508e1b418275b48 | 295 | py | Python | src/concepts/mode.py | Valeeswaran/tutorials | 71b43cad46f4d7d2d67d3ff4be61bdaaade2a36a | [
"MIT"
] | null | null | null | src/concepts/mode.py | Valeeswaran/tutorials | 71b43cad46f4d7d2d67d3ff4be61bdaaade2a36a | [
"MIT"
] | null | null | null | src/concepts/mode.py | Valeeswaran/tutorials | 71b43cad46f4d7d2d67d3ff4be61bdaaade2a36a | [
"MIT"
] | null | null | null | arr = [1, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 9]
arr.sort()
my_dict = {i:arr.count(i) for i in arr}
# sorting the dictionary based on value
my_dict = {k: v for k, v in sorted(my_dict.items(), key=lambda item: item[1])}
print(len(my_dict))
print(my_dict)
list = list(my_dict.keys())
print(list[-1])
| 22.692308 | 78 | 0.637288 | arr = [1, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 9]
arr.sort()
my_dict = {i:arr.count(i) for i in arr}
# sorting the dictionary based on value
my_dict = {k: v for k, v in sorted(my_dict.items(), key=lambda item: item[1])}
print(len(my_dict))
print(my_dict)
list = list(my_dict.keys())
print(list[-1])
| 0 | 0 | 0 |
635dfca37db44428a5f283624c1effff583c2d39 | 1,125 | py | Python | teamcat_service/doraemon/doraemon/auth_extend/user/templatetags/auth_required.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/doraemon/doraemon/auth_extend/user/templatetags/auth_required.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/doraemon/doraemon/auth_extend/user/templatetags/auth_required.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | #coding=utf-8
'''
Created on 2016-1-18
@author: Devuser
'''
from django import template
from doraemon.auth_extend.user.templatetags.auth_required_node import LogoutRequiredNode,LoginRequiredNode,UserRequiredNode,ManagerRequiredNode,AdminRequiredNode
register = template.Library()
@register.tag()
@register.tag()
... | 26.162791 | 161 | 0.757333 | #coding=utf-8
'''
Created on 2016-1-18
@author: Devuser
'''
from django import template
from doraemon.auth_extend.user.templatetags.auth_required_node import LogoutRequiredNode,LoginRequiredNode,UserRequiredNode,ManagerRequiredNode,AdminRequiredNode
register = template.Library()
@register.tag()
def admin_required... | 646 | 0 | 110 |
526c50830e718621f212e4da83405610854941d1 | 2,326 | py | Python | schoolovy.py | N-l1/schoolovy | 74ea456e04af6029b77cb8310915184a8467849e | [
"MIT"
] | null | null | null | schoolovy.py | N-l1/schoolovy | 74ea456e04af6029b77cb8310915184a8467849e | [
"MIT"
] | null | null | null | schoolovy.py | N-l1/schoolovy | 74ea456e04af6029b77cb8310915184a8467849e | [
"MIT"
] | null | null | null | import yaml
import schoolopy
import sys
def err(msg):
"""
Prints out error message and exits with error.
"""
print(f"Error: {msg}")
exit(1)
def main(limit):
"""
Likes all the posts & comments
in your most recent feed (20 posts).
Args:
limit: How many posts to like.
... | 26.735632 | 74 | 0.552021 | import yaml
import schoolopy
import sys
def err(msg):
"""
Prints out error message and exits with error.
"""
print(f"Error: {msg}")
exit(1)
def main(limit):
"""
Likes all the posts & comments
in your most recent feed (20 posts).
Args:
limit: How many posts to like.
... | 0 | 0 | 0 |
a057e34d83d549a6400f01ec669293543215e6ee | 1,535 | py | Python | examples/session2-fi/loops.py | futurice/PythonInBrowser | 066ab28ffad265efc7968b87f33dab2c68216d9d | [
"MIT"
] | 4 | 2015-12-08T19:34:49.000Z | 2019-09-08T22:11:05.000Z | examples/session2-fi/loops.py | futurice/PythonInBrowser | 066ab28ffad265efc7968b87f33dab2c68216d9d | [
"MIT"
] | 18 | 2016-10-14T13:48:39.000Z | 2019-10-11T12:14:21.000Z | examples/session2-fi/loops.py | futurice/PythonInBrowser | 066ab28ffad265efc7968b87f33dab2c68216d9d | [
"MIT"
] | 4 | 2015-11-18T15:18:43.000Z | 2018-03-02T09:36:23.000Z | # Loopit eli silmukat
##### INFO #####
#
# Joskus monimutkaisen kuvion piirtäminen vaatii samojen
# komentojen toistamista moneen kertaan. Loopilla eli silmukalla
# voit toistaa koodipalikoita eli pätkiä koodia
import turtle
t = turtle.Turtle()
# Seuraava on esimerkki silmukasta.
#
# "for" kertoo tietokoneelle että ... | 29.519231 | 78 | 0.755049 | # Loopit eli silmukat
##### INFO #####
#
# Joskus monimutkaisen kuvion piirtäminen vaatii samojen
# komentojen toistamista moneen kertaan. Loopilla eli silmukalla
# voit toistaa koodipalikoita eli pätkiä koodia
import turtle
t = turtle.Turtle()
# Seuraava on esimerkki silmukasta.
#
# "for" kertoo tietokoneelle että ... | 0 | 0 | 0 |
7fc3e32ddb3a3537ba996d42f205b2e6ae14bd96 | 2,098 | py | Python | bot_commands_test/exception.py | SimoneABNto/My-Code-Py | 47276c1d69a92aa284685c9f148c1bd960147f7f | [
"MIT"
] | null | null | null | bot_commands_test/exception.py | SimoneABNto/My-Code-Py | 47276c1d69a92aa284685c9f148c1bd960147f7f | [
"MIT"
] | null | null | null | bot_commands_test/exception.py | SimoneABNto/My-Code-Py | 47276c1d69a92aa284685c9f148c1bd960147f7f | [
"MIT"
] | null | null | null | from queue import Queue, Empty
from time import sleep
from threading import Timer
if __name__ == '__main__':
main()
| 28.739726 | 85 | 0.560534 | from queue import Queue, Empty
from time import sleep
from threading import Timer
class CommandoLoader(object):
def __init__(self):
self.__bot = None
self.__error_callback_function = None
self.thread = None
self.error_queue_function = None
def start_demon(self, bot... | 1,375 | 540 | 50 |
77c55afce086a01fa8acafddadc82f59d1e34666 | 1,843 | py | Python | core/common.py | MogooStudio/mogoopy | 81d1bfc35fca46dd028f141fb59eb6d87d8396bc | [
"MIT"
] | null | null | null | core/common.py | MogooStudio/mogoopy | 81d1bfc35fca46dd028f141fb59eb6d87d8396bc | [
"MIT"
] | null | null | null | core/common.py | MogooStudio/mogoopy | 81d1bfc35fca46dd028f141fb59eb6d87d8396bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import hashlib
import subprocess
import sys
import os
G_ZIP_SPLIT_LINE = 500
G_ZIP_SPLIT_UNIT = 100
| 23.628205 | 90 | 0.58166 | # -*- coding: utf-8 -*-
import hashlib
import subprocess
import sys
import os
G_ZIP_SPLIT_LINE = 500
G_ZIP_SPLIT_UNIT = 100
def os_system(cmd, use_secure = False):
print("cmd", cmd)
os.system(cmd)
def os_popen(cmd):
print("cmd", cmd)
np = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
... | 1,526 | 0 | 184 |
077095c547b884a222278093dfab78cec8fd69fa | 3,839 | py | Python | sonnet/src/parallel_linear.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 10,287 | 2017-04-07T12:33:37.000Z | 2022-03-30T03:32:16.000Z | sonnet/src/parallel_linear.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 209 | 2017-04-07T15:57:11.000Z | 2022-03-27T10:43:03.000Z | sonnet/src/parallel_linear.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 1,563 | 2017-04-07T13:15:06.000Z | 2022-03-29T15:26:04.000Z | # Copyright 2019 The Sonnet 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 applicable l... | 37.637255 | 80 | 0.68273 | # Copyright 2019 The Sonnet 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 applicable l... | 182 | 0 | 25 |
c4035174e5609822f5176b25618ba665b6bcb7bd | 1,431 | py | Python | tests/spot/futures/test_futures_loan_borrow.py | fossabot/binance-connector-python | bab18df22ba57b407b15dd0a9147cd75e6389b9e | [
"MIT"
] | 1 | 2021-08-05T03:36:24.000Z | 2021-08-05T03:36:24.000Z | tests/spot/futures/test_futures_loan_borrow.py | fossabot/binance-connector-python | bab18df22ba57b407b15dd0a9147cd75e6389b9e | [
"MIT"
] | 2 | 2021-07-12T11:18:55.000Z | 2021-07-12T11:28:19.000Z | tests/spot/futures/test_futures_loan_borrow.py | fossabot/binance-connector-python | bab18df22ba57b407b15dd0a9147cd75e6389b9e | [
"MIT"
] | 1 | 2021-07-10T20:50:04.000Z | 2021-07-10T20:50:04.000Z | import responses
from urllib.parse import urlencode
from tests.util import random_str
from tests.util import mock_http_response
from binance.spot import Spot as Client
from binance.error import ParameterRequiredError, ClientError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
mock_exception = {"code": -1105, "m... | 27.519231 | 77 | 0.712788 | import responses
from urllib.parse import urlencode
from tests.util import random_str
from tests.util import mock_http_response
from binance.spot import Spot as Client
from binance.error import ParameterRequiredError, ClientError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
mock_exception = {"code": -1105, "m... | 0 | 0 | 0 |
e531ec686052a49b40461d2d3da353e84817d346 | 24,729 | py | Python | conary_test/cvctest/buildtest/expansiontest.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 43 | 2015-03-31T01:37:10.000Z | 2021-11-14T16:26:48.000Z | conary_test/cvctest/buildtest/expansiontest.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-06-10T16:39:41.000Z | 2020-01-27T16:35:01.000Z | conary_test/cvctest/buildtest/expansiontest.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-04-07T08:12:37.000Z | 2020-01-26T09:54:18.000Z | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 42.709845 | 89 | 0.597921 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 22,321 | 1,149 | 369 |
be31d4bb7630a7fc2c1993bb09d802aee8af78d3 | 6,647 | py | Python | Project/RE4017_proj1.py | Ciaran-Carroll/college | 46052aa177280f7900e04e0e828247d7097eb07b | [
"MIT"
] | null | null | null | Project/RE4017_proj1.py | Ciaran-Carroll/college | 46052aa177280f7900e04e0e828247d7097eb07b | [
"MIT"
] | null | null | null | Project/RE4017_proj1.py | Ciaran-Carroll/college | 46052aa177280f7900e04e0e828247d7097eb07b | [
"MIT"
] | null | null | null | '''
#Students Name's: Ciaran Carroll
# Student Id Number's: 13113259
#
# Project 1:
# Implement image reconstruction from parallel-projection sinograms using Python.
#
# CAT Scanners (or CT scan) - Computer Axial Tomography
# CT scan: is a special X-ray tests that produce cross-sectional images of the body using X-ra... | 38.871345 | 101 | 0.70844 | '''
#Students Name's: Ciaran Carroll
# Student Id Number's: 13113259
#
# Project 1:
# Implement image reconstruction from parallel-projection sinograms using Python.
#
# CAT Scanners (or CT scan) - Computer Axial Tomography
# CT scan: is a special X-ray tests that produce cross-sectional images of the body using X-ra... | 0 | 0 | 0 |
16ed837df429a96c0cdbd562240040a729a666ee | 7,343 | py | Python | messyger.py | raxod502/messyger | fbfe286d2448bc8ec112e7f3063f71dfe3bf2c27 | [
"MIT"
] | 4 | 2021-12-06T17:06:20.000Z | 2022-02-24T21:10:02.000Z | messyger.py | raxod502/messyger | fbfe286d2448bc8ec112e7f3063f71dfe3bf2c27 | [
"MIT"
] | null | null | null | messyger.py | raxod502/messyger | fbfe286d2448bc8ec112e7f3063f71dfe3bf2c27 | [
"MIT"
] | null | null | null | import argparse
import collections
import datetime
import json
import random
import re
import esprima
import requests
## Get the email and password
parser = argparse.ArgumentParser("messyger")
parser.add_argument("-u", "--email", required=True)
parser.add_argument("-p", "--password", required=True)
parser.add_argume... | 32.635556 | 87 | 0.493395 | import argparse
import collections
import datetime
import json
import random
import re
import esprima
import requests
## Get the email and password
parser = argparse.ArgumentParser("messyger")
parser.add_argument("-u", "--email", required=True)
parser.add_argument("-p", "--password", required=True)
parser.add_argume... | 959 | 0 | 81 |
1711dbc6d5f8418cbf2d6ff20883e3525a9a462a | 1,540 | py | Python | .github/actions/update-version/update-version.py | nihaals/visual-studio-code-insiders-arch | bbd4c26f4766ccab1b9a15608bd84cccaae51341 | [
"MIT"
] | 3 | 2020-09-19T19:26:11.000Z | 2021-08-18T18:30:45.000Z | .github/actions/update-version/update-version.py | nihaals/visual-studio-code-insiders-arch | bbd4c26f4766ccab1b9a15608bd84cccaae51341 | [
"MIT"
] | null | null | null | .github/actions/update-version/update-version.py | nihaals/visual-studio-code-insiders-arch | bbd4c26f4766ccab1b9a15608bd84cccaae51341 | [
"MIT"
] | 2 | 2020-08-17T02:29:14.000Z | 2020-08-18T01:28:49.000Z | import os
import re
with open('PKGBUILD') as fp:
for line in fp.readlines():
line = line.strip()
current_build_number = re.search(r"^_pkgbuildnumber=(.+)$", line)
if current_build_number is None:
continue
current_build_number = current_build_number.group(1)
brea... | 34.222222 | 114 | 0.707143 | import os
import re
with open('PKGBUILD') as fp:
for line in fp.readlines():
line = line.strip()
current_build_number = re.search(r"^_pkgbuildnumber=(.+)$", line)
if current_build_number is None:
continue
current_build_number = current_build_number.group(1)
brea... | 0 | 0 | 0 |
cbd4baa2dbcce74135081efb545a3df0f0b369a9 | 10,085 | py | Python | hottbox/utils/generation/tests/test_basic.py | adamurban98/hottbox | 26580018ec6d38a1b08266c04ce4408c9e276130 | [
"Apache-2.0"
] | 167 | 2018-05-07T10:31:00.000Z | 2022-02-24T19:20:31.000Z | hottbox/utils/generation/tests/test_basic.py | adamurban98/hottbox | 26580018ec6d38a1b08266c04ce4408c9e276130 | [
"Apache-2.0"
] | 19 | 2018-05-10T13:26:39.000Z | 2020-01-31T12:49:27.000Z | hottbox/utils/generation/tests/test_basic.py | adamurban98/hottbox | 26580018ec6d38a1b08266c04ce4408c9e276130 | [
"Apache-2.0"
] | 24 | 2018-04-02T17:16:50.000Z | 2021-12-07T06:21:40.000Z | import pytest
import numpy as np
from functools import reduce
from hottbox.core.structures import Tensor,TensorCPD, TensorTKD, TensorTT
from hottbox.utils.validation.checks import is_super_symmetric
from ..basic import dense_tensor, sparse_tensor, super_diagonal_tensor, \
super_diag_tensor, super_symmetric_tensor, ... | 41.846473 | 110 | 0.578681 | import pytest
import numpy as np
from functools import reduce
from hottbox.core.structures import Tensor,TensorCPD, TensorTKD, TensorTT
from hottbox.utils.validation.checks import is_super_symmetric
from ..basic import dense_tensor, sparse_tensor, super_diagonal_tensor, \
super_diag_tensor, super_symmetric_tensor, ... | 1,236 | 0 | 92 |
3157151c02d05ab116eb33bad54d5906f6b8d1d5 | 2,045 | py | Python | src/appengine/model.py | tomwilkie/awesomation | 708a0ff2ffd431f24ed3f942cafd24882dc89620 | [
"MIT"
] | 28 | 2015-01-12T15:34:37.000Z | 2021-06-17T14:27:49.000Z | src/appengine/model.py | tomwilkie/awesomation | 708a0ff2ffd431f24ed3f942cafd24882dc89620 | [
"MIT"
] | 16 | 2015-01-11T21:46:08.000Z | 2015-02-06T17:01:50.000Z | src/appengine/model.py | tomwilkie/awesomation | 708a0ff2ffd431f24ed3f942cafd24882dc89620 | [
"MIT"
] | 2 | 2015-01-10T17:34:23.000Z | 2015-01-10T18:38:01.000Z | """Base classes for my data model."""
import decimal
from google.appengine.ext import ndb
from google.appengine.ext.ndb import polymodel
from appengine import history, rest, user
# From http://stackoverflow.com/questions/10035133/ndb-decimal-property
class DecimalProperty(ndb.IntegerProperty):
"""Decimal property... | 30.984848 | 76 | 0.672372 | """Base classes for my data model."""
import decimal
from google.appengine.ext import ndb
from google.appengine.ext.ndb import polymodel
from appengine import history, rest, user
# From http://stackoverflow.com/questions/10035133/ndb-decimal-property
class DecimalProperty(ndb.IntegerProperty):
"""Decimal property... | 493 | 0 | 122 |
cedbd4d63dbf752123f11e31471ca8fd234d5f07 | 1,909 | py | Python | Blender 2.91/2.91/scripts/addons/power_sequencer/operators/scene_cycle.py | calculusrobotics/RNNs-for-Bayesian-State-Estimation | 2aacf86d2e447e10c840b4926d4de7bc5e46d9bc | [
"MIT"
] | 1 | 2021-06-30T00:39:40.000Z | 2021-06-30T00:39:40.000Z | release/scripts/addons/power_sequencer/operators/scene_cycle.py | ringsce/Rings3D | 8059d1e2460fc8d6f101eff8e695f68a99f6671d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons/power_sequencer/operators/scene_cycle.py | ringsce/Rings3D | 8059d1e2460fc8d6f101eff8e695f68a99f6671d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | #
# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
#
# This file is part of Power Sequencer.
#
# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either... | 34.709091 | 99 | 0.675746 | #
# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
#
# This file is part of Power Sequencer.
#
# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either... | 432 | 0 | 53 |
df341bd8c114208ae94cc128e9c72342d72f8af5 | 8,094 | py | Python | demo/demo_guess_count_file.py | UChicagoSUPERgroup/analytic-password-cracking | 1c30153e852af36ffdc0566c949f63d9736105f8 | [
"MIT"
] | 22 | 2019-05-20T16:43:16.000Z | 2021-04-23T09:32:11.000Z | demo/demo_guess_count_file.py | UChicagoSUPERgroup/analytic-password-cracking | 1c30153e852af36ffdc0566c949f63d9736105f8 | [
"MIT"
] | null | null | null | demo/demo_guess_count_file.py | UChicagoSUPERgroup/analytic-password-cracking | 1c30153e852af36ffdc0566c949f63d9736105f8 | [
"MIT"
] | 6 | 2019-05-20T18:01:05.000Z | 2020-11-12T07:54:33.000Z | from sys import path as sys_path
from os import path as os_path
from subprocess import Popen, PIPE
import time
import logging
import warnings
import numpy as np
sys_path.append(os_path.abspath('../src'))
from config import RUNTIME_CONFIG
from config import john_nick_names, hc_nick_names
from common import PasswordPol... | 47.611765 | 205 | 0.627255 | from sys import path as sys_path
from os import path as os_path
from subprocess import Popen, PIPE
import time
import logging
import warnings
import numpy as np
sys_path.append(os_path.abspath('../src'))
from config import RUNTIME_CONFIG
from config import john_nick_names, hc_nick_names
from common import PasswordPol... | 220 | 0 | 23 |
333a2f2f140534cc1d6698425fb54de5fcbfec93 | 642 | py | Python | utils/env.py | Omarzintan/bumblebee-ai | 0b8c5cecf032730e23b1b710a88538f5e4ea70c9 | [
"MIT"
] | 3 | 2021-05-06T16:29:26.000Z | 2022-01-09T03:32:40.000Z | utils/env.py | Omarzintan/bumblebee-ai | 0b8c5cecf032730e23b1b710a88538f5e4ea70c9 | [
"MIT"
] | 1 | 2021-05-20T17:59:12.000Z | 2021-05-20T17:59:12.000Z | utils/env.py | Omarzintan/bumblebee-ai | 0b8c5cecf032730e23b1b710a88538f5e4ea70c9 | [
"MIT"
] | null | null | null | '''
This file is for retrieving system environment variables and helper
variables directly derived from them.
In decreasing order of precedence, environment variables can be set by:
1. adding them to .env file at root of this project
2. exporting and then running bumblebee in then same terminal.
E.g. export BUMBLEB... | 33.789474 | 77 | 0.78972 | '''
This file is for retrieving system environment variables and helper
variables directly derived from them.
In decreasing order of precedence, environment variables can be set by:
1. adding them to .env file at root of this project
2. exporting and then running bumblebee in then same terminal.
E.g. export BUMBLEB... | 0 | 0 | 0 |
248e74a35b18bd30f4803c6ed6fcc98efb31c3af | 1,701 | py | Python | pagination.py | billaanil3/Paginization | 4556634517841bc1104fd1a015beda04c16d5322 | [
"MIT"
] | 11 | 2017-11-28T22:26:55.000Z | 2022-03-21T15:42:41.000Z | pagination.py | billaanil3/Paginization | 4556634517841bc1104fd1a015beda04c16d5322 | [
"MIT"
] | 3 | 2017-11-28T21:05:48.000Z | 2019-04-02T22:38:48.000Z | pagination.py | billaanil3/Paginization | 4556634517841bc1104fd1a015beda04c16d5322 | [
"MIT"
] | 8 | 2017-11-28T17:23:39.000Z | 2021-11-19T15:41:18.000Z | """Pagination sample for Microsoft Graph."""
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
# See LICENSE in the project root for license information.
import os
import bottle
import graphrest
import config
MSGRAPH = graphrest.GraphSession(client_id=config.CLIENT_ID,
... | 29.327586 | 81 | 0.681952 | """Pagination sample for Microsoft Graph."""
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
# See LICENSE in the project root for license information.
import os
import bottle
import graphrest
import config
MSGRAPH = graphrest.GraphSession(client_id=config.CLIENT_ID,
... | 0 | 0 | 0 |
d7ba520906466c429eb7e964cc54b23a09f4bd0c | 27,726 | py | Python | numbas_lti/models.py | pbh4/numbas_leicester | bac5c66c0c7809ee9588a69b3bced4244cee08e5 | [
"Apache-2.0"
] | null | null | null | numbas_lti/models.py | pbh4/numbas_leicester | bac5c66c0c7809ee9588a69b3bced4244cee08e5 | [
"Apache-2.0"
] | null | null | null | numbas_lti/models.py | pbh4/numbas_leicester | bac5c66c0c7809ee9588a69b3bced4244cee08e5 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from django.db import models
from django.dispatch import receiver
from django.contrib.auth.models import User
import requests
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _, ugettext
from django.core import validators
from channels import G... | 40.773529 | 197 | 0.68351 | from django.conf import settings
from django.db import models
from django.dispatch import receiver
from django.contrib.auth.models import User
import requests
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _, ugettext
from django.core import validators
from channels import G... | 12,860 | 11,495 | 663 |
c2dec3dcd5aba4c26930d56a78814b05201b9fd5 | 2,763 | py | Python | nb_compress.py | tanakatsu/nb_compress | a1fe923c4b271ce399e1550e51e6bfa354681c06 | [
"MIT"
] | null | null | null | nb_compress.py | tanakatsu/nb_compress | a1fe923c4b271ce399e1550e51e6bfa354681c06 | [
"MIT"
] | null | null | null | nb_compress.py | tanakatsu/nb_compress | a1fe923c4b271ce399e1550e51e6bfa354681c06 | [
"MIT"
] | null | null | null | import json
import re
import argparse
import sys
if __name__ == '__main__':
main()
| 30.7 | 106 | 0.579081 | import json
import re
import argparse
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def compress_output(output, mode):
if "text" in output and mode['first_last_epoch']:
text = output["text"]
mask = False
_text = []
for line in text:
... | 2,603 | 0 | 69 |
d43678988ad4c195277e0b62eb974c64a085ba2d | 827 | py | Python | src/utils/payloadHelper.py | gertschreuder/kinesis-consumer | cfd0dc4fb2ae98f4b54838d390cea0488bbbb975 | [
"MIT"
] | null | null | null | src/utils/payloadHelper.py | gertschreuder/kinesis-consumer | cfd0dc4fb2ae98f4b54838d390cea0488bbbb975 | [
"MIT"
] | 1 | 2021-02-10T11:06:38.000Z | 2021-02-10T11:06:38.000Z | src/utils/payloadHelper.py | gertschreuder/kinesis-consumer | cfd0dc4fb2ae98f4b54838d390cea0488bbbb975 | [
"MIT"
] | null | null | null | import json
from src.mappers.heartbeatMapper import Heartbeat
| 24.323529 | 59 | 0.61185 | import json
from src.mappers.heartbeatMapper import Heartbeat
class PayloadHelper(object):
def __init__(self):
self.heartbeat = None
self.messageTimeStamp = None
def map(self, data):
self.meta(data)
self.resolveStatus(data)
return self
def meta(self, data):
... | 572 | 7 | 184 |
70deaa73a8457f76f76ea1cbe027b3e157405f0d | 4,002 | py | Python | python/h5/_h5py_desc.py | phdum/h5 | d5f1b02354fd93da55cd09dc6a83218d98adab76 | [
"Apache-2.0"
] | null | null | null | python/h5/_h5py_desc.py | phdum/h5 | d5f1b02354fd93da55cd09dc6a83218d98adab76 | [
"Apache-2.0"
] | null | null | null | python/h5/_h5py_desc.py | phdum/h5 | d5f1b02354fd93da55cd09dc6a83218d98adab76 | [
"Apache-2.0"
] | null | null | null | # Generated automatically using the command :
# c++2py h5py_io.hpp --members_read_only -N h5 -a _h5py -m _h5py -o _h5py --moduledoc="A lightweight hdf5 python interface" --cxxflags="-std=c++20" --includes=./../../c++ --only="object file group h5_read_bare h5_write_bare"
from cpp2py.wrap_generator import *
# The module... | 33.915254 | 224 | 0.643428 | # Generated automatically using the command :
# c++2py h5py_io.hpp --members_read_only -N h5 -a _h5py -m _h5py -o _h5py --moduledoc="A lightweight hdf5 python interface" --cxxflags="-std=c++20" --includes=./../../c++ --only="object file group h5_read_bare h5_write_bare"
from cpp2py.wrap_generator import *
# The module... | 0 | 0 | 0 |
467ad5dbc7ae14468d001e76f9f66437da261324 | 13,803 | py | Python | internals/detect_intent_test.py | www-business-com/chromium-dashboard | f7b9c5136f4cfee4adbfca872335eb9c455b071b | [
"Apache-2.0"
] | 1 | 2022-03-25T14:40:37.000Z | 2022-03-25T14:40:37.000Z | internals/detect_intent_test.py | BossNetworking/chromium-dashboard | 9f0d76e70ef5e6169552407e728b3d3205517da8 | [
"Apache-2.0"
] | null | null | null | internals/detect_intent_test.py | BossNetworking/chromium-dashboard | 9f0d76e70ef5e6169552407e728b3d3205517da8 | [
"Apache-2.0"
] | 1 | 2021-11-15T06:49:12.000Z | 2021-11-15T06:49:12.000Z | # Copyright 2021 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 applicable law or agreed to in writing, s... | 40.716814 | 80 | 0.701152 | # Copyright 2021 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 applicable law or agreed to in writing, s... | 1,575 | 11,365 | 46 |
1c741e6bc69fc8671df5a15c26f40ce7a3bf09f3 | 2,839 | py | Python | paranuara/citizens/models/citizens.py | SPLAYER-HD/Paranuara | 5a42f23d761e16e3b486ba04d9185551614f06a5 | [
"MIT"
] | null | null | null | paranuara/citizens/models/citizens.py | SPLAYER-HD/Paranuara | 5a42f23d761e16e3b486ba04d9185551614f06a5 | [
"MIT"
] | 4 | 2021-06-08T20:53:43.000Z | 2022-03-12T00:13:51.000Z | paranuara/citizens/models/citizens.py | SPLAYER-HD/RestServiceDjango | 5a42f23d761e16e3b486ba04d9185551614f06a5 | [
"MIT"
] | null | null | null | """Citizens model."""
# Django
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.validators import RegexValidator
# models
from paranuara.companies.models import Company
# PostgreSQL fields
from django.contrib.postgres.fields import JSONField
# Utilities
from paranuar... | 22.007752 | 98 | 0.62205 | """Citizens model."""
# Django
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.validators import RegexValidator
# models
from paranuara.companies.models import Company
# PostgreSQL fields
from django.contrib.postgres.fields import JSONField
# Utilities
from paranuar... | 68 | 0 | 27 |
e340c1025aff6d53bab2a99990b56f88b3b6f369 | 1,001 | py | Python | aocpo_backend/aocpo_api/urls.py | CoderChen01/aocpo | 279bfae910a30be762e1954df1a53a6217a6e300 | [
"Apache-2.0"
] | 7 | 2020-02-17T12:20:26.000Z | 2021-03-15T01:02:34.000Z | aocpo_backend/aocpo_api/urls.py | CoderChen01/aocpo | 279bfae910a30be762e1954df1a53a6217a6e300 | [
"Apache-2.0"
] | 3 | 2020-04-19T03:01:41.000Z | 2020-04-19T03:02:09.000Z | aocpo_backend/aocpo_api/urls.py | CoderChen01/aocpo | 279bfae910a30be762e1954df1a53a6217a6e300 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.urls import path
from .views import login_register, task_manage, analysis_page
urlpatterns = [
path('login/', login_register.Login.as_view()),
path('register/', login_register.SignIn.as_view()),
path('register/check_username', login_register.SignIn.a... | 52.684211 | 91 | 0.751249 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.urls import path
from .views import login_register, task_manage, analysis_page
urlpatterns = [
path('login/', login_register.Login.as_view()),
path('register/', login_register.SignIn.as_view()),
path('register/check_username', login_register.SignIn.a... | 0 | 0 | 0 |
45719d34a81e10187b4b4005d07f676e2396fd1d | 905 | py | Python | example_project/urls.py | amarandon/django-audiotracks | e2480ebe555b07cc3c3c60b075a7caed462ed96d | [
"MIT"
] | 30 | 2015-04-16T04:56:30.000Z | 2021-02-26T05:28:54.000Z | example_project/urls.py | amarandon/django-audiotracks | e2480ebe555b07cc3c3c60b075a7caed462ed96d | [
"MIT"
] | 2 | 2016-05-29T09:41:40.000Z | 2016-07-12T17:47:06.000Z | example_project/urls.py | amarandon/django-audiotracks | e2480ebe555b07cc3c3c60b075a7caed462ed96d | [
"MIT"
] | 10 | 2015-07-16T12:57:41.000Z | 2021-12-05T22:06:22.000Z | from django.conf import settings
from django.conf.urls import url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from main import views
from django.contrib.auth import views as auth_views
from django.views.static import serve
# Uncomment the next two lines to enable the admin:
from django... | 32.321429 | 72 | 0.685083 | from django.conf import settings
from django.conf.urls import url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from main import views
from django.contrib.auth import views as auth_views
from django.views.static import serve
# Uncomment the next two lines to enable the admin:
from django... | 0 | 0 | 0 |
85ec8b6d8d12f7b35f2c1f28a6864da735f40a62 | 864 | py | Python | mathbox/app/signal/outlier.py | freedeaths/mathbox-py | e294dc1b916bb634807378883b1ba941a924bec5 | [
"MIT"
] | 7 | 2021-12-23T07:03:12.000Z | 2021-12-31T06:35:34.000Z | mathbox/app/signal/outlier.py | freedeaths/mathbox-py | e294dc1b916bb634807378883b1ba941a924bec5 | [
"MIT"
] | 8 | 2021-12-23T06:12:19.000Z | 2022-01-07T15:01:47.000Z | mathbox/app/signal/outlier.py | freedeaths/mathbox-py | e294dc1b916bb634807378883b1ba941a924bec5 | [
"MIT"
] | null | null | null | from mathbox.statistics.estimator import mean, std
# Generalized ESD Test for Outliers
# https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h3.htm | 39.272727 | 89 | 0.675926 | from mathbox.statistics.estimator import mean, std
def noise_outlier(noise, bias=3):
noise_mean = mean(noise)
noise_std = std(noise)
outlier_lo = [(i,x) for i,x in enumerate(noise) if x < noise_mean - bias * noise_std]
outlier_hi = [(i,x) for i,x in enumerate(noise) if x > noise_mean + bias * noise_std... | 641 | 0 | 68 |
9070ee332d8938903159cc96d4620a2bd3b5401c | 397 | py | Python | OS/Syncronization/main.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | OS/Syncronization/main.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | OS/Syncronization/main.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from requirement import *
from producer import producer
from scheduler import fcfs
from teller import teller
txt = open('result/processes','w')
txt.write('Processes\n\n')
#Thread(target = producer).start()
producer()
for process in processes:
txt.write(str(process)+'\n')
for i in range(teller_c... | 16.541667 | 34 | 0.730479 | #!/usr/bin/python
from requirement import *
from producer import producer
from scheduler import fcfs
from teller import teller
txt = open('result/processes','w')
txt.write('Processes\n\n')
#Thread(target = producer).start()
producer()
for process in processes:
txt.write(str(process)+'\n')
for i in range(teller_c... | 0 | 0 | 0 |
33ee54f7c6793f6de7032a70a6e0460c0d4a6957 | 1,674 | py | Python | floem/programs/queue_custom.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | 21 | 2018-10-10T18:52:32.000Z | 2022-02-16T12:23:51.000Z | floem/programs/queue_custom.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | null | null | null | floem/programs/queue_custom.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | 3 | 2020-04-22T23:09:26.000Z | 2021-09-30T01:35:34.000Z | from floem import *
n_cores = 2
Enq, Deq, Release = queue.queue_custom('queue', Tuple, 4, n_cores, Tuple.task, enq_output=True)
RxWrite('mysend')
RxPrint('process')
c = Compiler()
c.testing = r'''
Tuple tuples[5];
for(int i=0; i<5;i++) {
tuples[i].task = 10;
tuples[i].val = i;
}
for(int i=0; i<5;i++) {
... | 20.666667 | 95 | 0.549582 | from floem import *
n_cores = 2
class Tuple(State):
val = Field(Int)
task = Field(Uint(8))
layout = [val, task]
class Display(Element):
def configure(self):
self.inp = Input(queue.q_buffer)
self.out = Output(queue.q_buffer)
def impl(self):
self.run_c(r'''
q_buffe... | 641 | 97 | 327 |
539ef8f7d8675478ff779ecc18fb39f706cede98 | 14,871 | py | Python | electrum/auxpow.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 4 | 2020-06-27T22:43:34.000Z | 2021-04-12T02:29:30.000Z | electrum/auxpow.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 21 | 2020-06-20T15:02:50.000Z | 2021-04-07T10:14:59.000Z | electrum/auxpow.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 13 | 2020-06-28T08:13:28.000Z | 2021-12-28T00:11:56.000Z | # -*- coding: utf-8 -*-
#
# Electrum-NMC - lightweight Namecoin client
# Copyright (C) 2018 The Namecoin developers
#
# License for all components not part of Electrum-DOGE:
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Sof... | 39.134211 | 161 | 0.721404 | # -*- coding: utf-8 -*-
#
# Electrum-NMC - lightweight Namecoin client
# Copyright (C) 2018 The Namecoin developers
#
# License for all components not part of Electrum-DOGE:
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Sof... | 8,649 | 399 | 430 |
2d8bed25eba5b2d701f79d132f9bbf690b6b08da | 545 | py | Python | src/readset.py | Neko250/readset | 22edf00320244be77455e3937e01dd405e478dea | [
"MIT"
] | null | null | null | src/readset.py | Neko250/readset | 22edf00320244be77455e3937e01dd405e478dea | [
"MIT"
] | null | null | null | src/readset.py | Neko250/readset | 22edf00320244be77455e3937e01dd405e478dea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
def extract(file=None, path=None):
"""
Extract all of the YouTube links within a Headset user-made list.
:param file: headset json export file path
:param path: json path to extract, you can use [JSON Columns](http://json-columns.com) to get it
:re... | 21.8 | 98 | 0.67156 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
def extract(file=None, path=None):
"""
Extract all of the YouTube links within a Headset user-made list.
:param file: headset json export file path
:param path: json path to extract, you can use [JSON Columns](http://json-columns.com) to get it
:re... | 0 | 0 | 0 |
f8ed8a42efb7fd5e2ac5ef6c2ba9004eee3a0b6f | 6,180 | py | Python | svision/viewer/views.py | artkulak/ads-eye-tracking | 693a87600362417361dc2725c3577dcbebf3925e | [
"Unlicense"
] | null | null | null | svision/viewer/views.py | artkulak/ads-eye-tracking | 693a87600362417361dc2725c3577dcbebf3925e | [
"Unlicense"
] | null | null | null | svision/viewer/views.py | artkulak/ads-eye-tracking | 693a87600362417361dc2725c3577dcbebf3925e | [
"Unlicense"
] | 1 | 2022-02-10T11:19:04.000Z | 2022-02-10T11:19:04.000Z | from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login, authenticate
from django.contrib.auth.models import User
from django.http import JsonResponse
####################
# IMPORT OTHER LIBS
################... | 27.713004 | 184 | 0.625405 | from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login, authenticate
from django.contrib.auth.models import User
from django.http import JsonResponse
####################
# IMPORT OTHER LIBS
################... | 49 | 0 | 23 |
4c2dfc45b6d9a010d7e553bb3578d11ead92b7c0 | 3,079 | py | Python | py_module_complete.py | Saevon/sublime_pymodule_complete | 92d32dbe341c8278a5665bfa6311d3d4439b8537 | [
"MIT"
] | null | null | null | py_module_complete.py | Saevon/sublime_pymodule_complete | 92d32dbe341c8278a5665bfa6311d3d4439b8537 | [
"MIT"
] | null | null | null | py_module_complete.py | Saevon/sublime_pymodule_complete | 92d32dbe341c8278a5665bfa6311d3d4439b8537 | [
"MIT"
] | null | null | null | import re
from importlib import import_module
import inspect
import sublime_plugin
import sublime
SCOPE_RE = re.compile(r'\bsource\.python\b')
LIB_MODULE_RE = re.compile(r'\bsupport\.module\.python\b')
def grab_module(view, cursor):
''' Grabs the entire module path under the cursor '''
word_sel = view.wor... | 24.830645 | 93 | 0.602793 | import re
from importlib import import_module
import inspect
import sublime_plugin
import sublime
SCOPE_RE = re.compile(r'\bsource\.python\b')
LIB_MODULE_RE = re.compile(r'\bsupport\.module\.python\b')
def format_attr(attr, module):
module_name = module.__name__
pretty_attr = attr
snippet_attr = attr
... | 1,755 | 332 | 46 |
e586b33c1f0991a69d385f1562e8356586b2257e | 13,430 | py | Python | layeredGraphLayouter/crossing/abstractBarycenterPortDistributor.py | Nic30/layeredGraphLayouter | fa792fa8f4b3a781adfbd7756015fbf4b067315b | [
"MIT"
] | 1 | 2020-02-07T15:07:15.000Z | 2020-02-07T15:07:15.000Z | layeredGraphLayouter/crossing/abstractBarycenterPortDistributor.py | Nic30/layeredGraphLayouter | fa792fa8f4b3a781adfbd7756015fbf4b067315b | [
"MIT"
] | null | null | null | layeredGraphLayouter/crossing/abstractBarycenterPortDistributor.py | Nic30/layeredGraphLayouter | fa792fa8f4b3a781adfbd7756015fbf4b067315b | [
"MIT"
] | null | null | null |
"""
Calculates port ranks and distributes ports.
The rank of a port is a floating point number that represents its position
inside the containing layer. This depends on the node order of that layer and on the
port constraints of the nodes. Port ranks are used by {@link ICrossingMinimizationHeuristics
for calculating b... | 42.365931 | 108 | 0.606925 |
"""
Calculates port ranks and distributes ports.
The rank of a port is a floating point number that represents its position
inside the containing layer. This depends on the node order of that layer and on the
port constraints of the nodes. Port ranks are used by {@link ICrossingMinimizationHeuristics
for calculating b... | 9,466 | 0 | 258 |
b9bd1928a2c1d5f03cdbd0cf4d58af342f9134b6 | 592 | py | Python | setup.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | setup.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | setup.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
PACKAGENAME = "deltasigma"
VERSION = "0.0.dev"
setup(
name=PACKAGENAME,
version=VERSION,
author="Antonio Villarreal",
author_email="avillarreal@anl.gov",
description="Source code for chopper / halotools implementation to calculate delta sigma.",
lo... | 31.157895 | 100 | 0.724662 | from setuptools import setup, find_packages
PACKAGENAME = "deltasigma"
VERSION = "0.0.dev"
setup(
name=PACKAGENAME,
version=VERSION,
author="Antonio Villarreal",
author_email="avillarreal@anl.gov",
description="Source code for chopper / halotools implementation to calculate delta sigma.",
lo... | 0 | 0 | 0 |
9df0a549c8d74fd28425f7e25b04aa46f91804bb | 3,055 | py | Python | Python/utils/persistence.py | RemkoPr/smart_textile_public | ffb53b2f5d039f0ca0d84770f2775688f237da1a | [
"Apache-2.0",
"MIT"
] | null | null | null | Python/utils/persistence.py | RemkoPr/smart_textile_public | ffb53b2f5d039f0ca0d84770f2775688f237da1a | [
"Apache-2.0",
"MIT"
] | 1 | 2021-12-21T22:15:04.000Z | 2021-12-21T22:15:04.000Z | Python/utils/persistence.py | RemkoPr/smart_textile_public | ffb53b2f5d039f0ca0d84770f2775688f237da1a | [
"Apache-2.0",
"MIT"
] | null | null | null | import itertools
import os
import csv
from loguru import logger
from datetime import *
class SensorPersistence(Persistence):
"""
Writes sensor data to a buffer and periodically flushes to file system.
"""
| 37.716049 | 115 | 0.594763 | import itertools
import os
import csv
from loguru import logger
from datetime import *
class Persistence:
def __init__(self, directory):
self.directory = directory
self.init_directory(self.directory)
self.file_name = self.create_unique_file_name(directory)
def init_dire... | 2,020 | 657 | 140 |
83ed5ef1449300aba87baa249f1d49549d0f1227 | 318 | py | Python | Python/CopyPasta/animation.py | escharf72/Engineering_4_Notebook | bcfd7edf74791cedc2519be66ac79246670116f3 | [
"BSD-Source-Code"
] | 1 | 2020-11-04T15:27:34.000Z | 2020-11-04T15:27:34.000Z | Python/CopyPasta/animation.py | escharf72/Engineering_4_Notebook | bcfd7edf74791cedc2519be66ac79246670116f3 | [
"BSD-Source-Code"
] | null | null | null | Python/CopyPasta/animation.py | escharf72/Engineering_4_Notebook | bcfd7edf74791cedc2519be66ac79246670116f3 | [
"BSD-Source-Code"
] | null | null | null | from picamera import PiCamera
from time import sleep
from gpiozero import Button
import keyboard
button = keyboard.is_pressed('h')
camera = PiCamera()
while True:
camera.start_preview()
button.wait_for_press()
print("Button has been pressed!")
sleep(3)
camera.capture('animateImage.jpg')
camera.stop_preview()
| 19.875 | 35 | 0.77673 | from picamera import PiCamera
from time import sleep
from gpiozero import Button
import keyboard
button = keyboard.is_pressed('h')
camera = PiCamera()
while True:
camera.start_preview()
button.wait_for_press()
print("Button has been pressed!")
sleep(3)
camera.capture('animateImage.jpg')
camera.stop_preview()
| 0 | 0 | 0 |
bcead883cb43a65442ccf599bda0b4064946fb5a | 4,716 | py | Python | bin/train-model.py | giuscri/thesis | d7aa0a8476f53ad304495b437841af1a8d6c87d4 | [
"MIT"
] | null | null | null | bin/train-model.py | giuscri/thesis | d7aa0a8476f53ad304495b437841af1a8d6c87d4 | [
"MIT"
] | 10 | 2018-05-11T08:40:48.000Z | 2018-06-29T16:14:27.000Z | bin/train-model.py | giuscri/thesis | d7aa0a8476f53ad304495b437841af1a8d6c87d4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os, sys, pickle
import keras.backend as K
import tensorflow as tf
import numpy as np
from argparse import ArgumentParser
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from datasets import mnist
from models import (train, accuracy, save_to_file, fc_100_... | 41.734513 | 85 | 0.632103 | #!/usr/bin/env python
import os, sys, pickle
import keras.backend as K
import tensorflow as tf
import numpy as np
from argparse import ArgumentParser
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from datasets import mnist
from models import (train, accuracy, save_to_file, fc_100_... | 155 | 0 | 23 |
7ae50bdf807009d9b67b7cff99403c699f653f93 | 3,048 | py | Python | plugin/vimtern.py | shivaghose/vimtern | 2f74ee41cd34106d14362d373ef279501f9b1b5b | [
"MIT"
] | null | null | null | plugin/vimtern.py | shivaghose/vimtern | 2f74ee41cd34106d14362d373ef279501f9b1b5b | [
"MIT"
] | null | null | null | plugin/vimtern.py | shivaghose/vimtern | 2f74ee41cd34106d14362d373ef279501f9b1b5b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
VIMTern.py dispatch work to your intern via Slack from the command line.
'''
from random import randint
from sys import exit, argv
import argparse
import json
import yaml # To load the intrn file
VERBOSE = False
try:
import requests
except ImportError:
print "Unable to import reques... | 27.963303 | 72 | 0.562992 | #!/usr/bin/env python
'''
VIMTern.py dispatch work to your intern via Slack from the command line.
'''
from random import randint
from sys import exit, argv
import argparse
import json
import yaml # To load the intrn file
VERBOSE = False
try:
import requests
except ImportError:
print "Unable to import reques... | 0 | 0 | 0 |
643c6bc30b01b37a7a4941a389cd64e1f9090dc2 | 398,739 | py | Python | Data/scigrid-de/pypower/scigrid_2011_01_08_01.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | Data/scigrid-de/pypower/scigrid_2011_01_08_01.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | Data/scigrid-de/pypower/scigrid_2011_01_08_01.py | thanever/SOC | 9f30d1a9c7610a68de9c178a1170bdf1c8ca11d4 | [
"MIT"
] | null | null | null | from numpy import array | 70.962627 | 137 | 0.463647 | from numpy import array
def scigrid_2011_01_08_01():
ppc = {"version": '2'}
ppc["baseMVA"] = 100.0
ppc["bus"] = array([
[586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ],
[589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ],
[590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,... | 398,694 | 0 | 22 |
5fce4f32c59cbf2710e6f68e6f01a2641933d1a1 | 564 | py | Python | env/lib/python2.7/site-packages/stripe/test/resources/test_payouts.py | imran1234567/plutus | c964f18beb139de2645e052eb4c75a6bc0677029 | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/stripe/test/resources/test_payouts.py | imran1234567/plutus | c964f18beb139de2645e052eb4c75a6bc0677029 | [
"MIT"
] | 8 | 2019-06-10T19:43:54.000Z | 2021-11-15T17:48:16.000Z | Lib/site-packages/stripe/test/resources/test_payouts.py | JulioCantu/IndiStore | 723c4ced800d43ffbfd34dc0ff7649b628008416 | [
"bzip2-1.0.6"
] | null | null | null | import stripe
from stripe.test.helper import StripeResourceTest
| 22.56 | 55 | 0.576241 | import stripe
from stripe.test.helper import StripeResourceTest
class PayoutTest(StripeResourceTest):
def test_list_payouts(self):
stripe.Payout.list()
self.requestor_mock.request.assert_called_with(
'get',
'/v1/payouts',
{}
)
def test_cancel_payou... | 406 | 16 | 77 |
9470da2d0635021627dca44b44a547d259bd8a63 | 1,783 | py | Python | src/scs_dfe/display/led_state.py | open-seneca/alphasense_aq_sensor | 12f37f19b4e2fe6f159b127261130d8d3bc48196 | [
"MIT"
] | 1 | 2021-05-10T09:12:13.000Z | 2021-05-10T09:12:13.000Z | src/scs_dfe/display/led_state.py | open-seneca/alphasense_aq_sensor | 12f37f19b4e2fe6f159b127261130d8d3bc48196 | [
"MIT"
] | null | null | null | src/scs_dfe/display/led_state.py | open-seneca/alphasense_aq_sensor | 12f37f19b4e2fe6f159b127261130d8d3bc48196 | [
"MIT"
] | 2 | 2019-03-07T00:25:11.000Z | 2020-02-28T13:45:55.000Z | """
Created on 10 Nov 2018
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
a dummy LED state, to maintain compatibility with the DFE Eng package
"""
from collections import OrderedDict
from scs_core.data.json import JSONable
# ----------------------------------------------------------------------------... | 24.763889 | 118 | 0.325294 | """
Created on 10 Nov 2018
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
a dummy LED state, to maintain compatibility with the DFE Eng package
"""
from collections import OrderedDict
from scs_core.data.json import JSONable
# ----------------------------------------------------------------------------... | 282 | 0 | 158 |
90fdb9009ee72b8b1db38f9c34195a42d71de57f | 2,344 | py | Python | Scripts/001_le_tutoriel_python/s004_les_instructions_de_controle.py | OrangePeelFX/Python-Tutorial | 0d47f194553666304765f5bbc928374b7aec8a48 | [
"MIT"
] | null | null | null | Scripts/001_le_tutoriel_python/s004_les_instructions_de_controle.py | OrangePeelFX/Python-Tutorial | 0d47f194553666304765f5bbc928374b7aec8a48 | [
"MIT"
] | 1 | 2021-06-02T00:28:17.000Z | 2021-06-02T00:28:17.000Z | Scripts/001_le_tutoriel_python/s004_les_instructions_de_controle.py | florianwns/python-scripts | 0d47f194553666304765f5bbc928374b7aec8a48 | [
"MIT"
] | 1 | 2020-01-13T11:08:18.000Z | 2020-01-13T11:08:18.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Les boucles et les instruction de contrôle
Quelques exemples de manipulations des boucles et des instructions
"""
# la suite de fibonnaci
a, b = 0, 1
while a < 20:
print(a, end=",") # on idente de 4 espace l'instruction suivante
a, b = b, a+b
print()
i... | 30.051282 | 88 | 0.433447 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Les boucles et les instruction de contrôle
Quelques exemples de manipulations des boucles et des instructions
"""
# la suite de fibonnaci
a, b = 0, 1
while a < 20:
print(a, end=",") # on idente de 4 espace l'instruction suivante
a, b = b, a+b
print()
i... | 0 | 0 | 0 |
3ceaf757a4a9ba8ec3f0e7a41102e00bf16e21bf | 228 | py | Python | optimal-road-trip/runtime_timer.py | YoungMaker/Machine-Learning-Analysis-With-CUDA | f67cdce6d47a341bab55c20057bb939929c98dc3 | [
"Unlicense",
"CC-BY-4.0",
"MIT"
] | null | null | null | optimal-road-trip/runtime_timer.py | YoungMaker/Machine-Learning-Analysis-With-CUDA | f67cdce6d47a341bab55c20057bb939929c98dc3 | [
"Unlicense",
"CC-BY-4.0",
"MIT"
] | null | null | null | optimal-road-trip/runtime_timer.py | YoungMaker/Machine-Learning-Analysis-With-CUDA | f67cdce6d47a341bab55c20057bb939929c98dc3 | [
"Unlicense",
"CC-BY-4.0",
"MIT"
] | null | null | null | import time
| 16.285714 | 43 | 0.614035 | import time
class runtimeTimer(object):
def __init__(self):
self.starttime = time.time()
def start(self):
self.starttime = time.time()
def stop(self):
return time.time() - self.starttime | 105 | 6 | 104 |
e1e1c9c9b3b1d2f9ea5e172e14b36b3bf582c0be | 652 | py | Python | lambda/setup.py | ingalls/ml-enabler | efda973cb3fa9954cbe24cd0963a7b8f5be5ad6f | [
"BSD-2-Clause"
] | null | null | null | lambda/setup.py | ingalls/ml-enabler | efda973cb3fa9954cbe24cd0963a7b8f5be5ad6f | [
"BSD-2-Clause"
] | 6 | 2021-06-08T22:14:52.000Z | 2022-03-12T00:45:58.000Z | lambda/setup.py | ingalls/ml-enabler | efda973cb3fa9954cbe24cd0963a7b8f5be5ad6f | [
"BSD-2-Clause"
] | null | null | null | """Setup."""
from setuptools import setup, find_packages
inst_reqs = [
"mercantile == 1.1.5",
"requests",
"geojson",
"pillow",
"gdal == 2.4.2",
"shapely == 1.6.4",
"affine == 2.3.0",
"numpy == 1.19.0",
"rasterio == 1.1.5"
]
extra_reqs = {"test": ["pytest", "pytest-cov"]}
setup(
... | 21.733333 | 70 | 0.602761 | """Setup."""
from setuptools import setup, find_packages
inst_reqs = [
"mercantile == 1.1.5",
"requests",
"geojson",
"pillow",
"gdal == 2.4.2",
"shapely == 1.6.4",
"affine == 2.3.0",
"numpy == 1.19.0",
"rasterio == 1.1.5"
]
extra_reqs = {"test": ["pytest", "pytest-cov"]}
setup(
... | 0 | 0 | 0 |
a51f153c8663eebe0dd7b69da625b02703f7e870 | 950 | py | Python | cumm/tensorview/gemm.py | FindDefinition/cumm | 3d58e85b660afa05c20514afe65b8aa3a4995953 | [
"Apache-2.0"
] | 20 | 2021-10-13T03:41:59.000Z | 2022-03-31T07:23:14.000Z | cumm/tensorview/gemm.py | FindDefinition/cumm | 3d58e85b660afa05c20514afe65b8aa3a4995953 | [
"Apache-2.0"
] | 3 | 2021-11-21T11:25:55.000Z | 2022-03-08T06:12:35.000Z | cumm/tensorview/gemm.py | FindDefinition/cumm | 3d58e85b660afa05c20514afe65b8aa3a4995953 | [
"Apache-2.0"
] | 4 | 2021-10-13T03:42:01.000Z | 2022-03-21T13:07:56.000Z | # Copyright 2022 Yan Yan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 47.5 | 79 | 0.649474 | # Copyright 2022 Yan Yan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 0 | 0 | 0 |
0a6eebd1d93127e3126b0ebdfd4693d4c9e4d3a9 | 2,036 | py | Python | src/cihpc/www/rest/__init__.py | janhybs/ci-hpi | 293740c7af62ecada5744ff663266de2e3d37445 | [
"MIT"
] | 1 | 2020-01-09T13:00:18.000Z | 2020-01-09T13:00:18.000Z | src/cihpc/www/rest/__init__.py | janhybs/ci-hpi | 293740c7af62ecada5744ff663266de2e3d37445 | [
"MIT"
] | null | null | null | src/cihpc/www/rest/__init__.py | janhybs/ci-hpi | 293740c7af62ecada5744ff663266de2e3d37445 | [
"MIT"
] | 2 | 2018-08-12T01:13:28.000Z | 2018-08-13T14:37:28.000Z | #!/bin/python3
# author: Jan Hybs
from loguru import logger
from flask_restful import Resource
from cihpc.common.utils import strings
from cihpc.common.utils import datautils as du
| 29.507246 | 118 | 0.543222 | #!/bin/python3
# author: Jan Hybs
from loguru import logger
from flask_restful import Resource
from cihpc.common.utils import strings
from cihpc.common.utils import datautils as du
class ConfigurableView(Resource):
def __init__(self):
super(ConfigurableView, self).__init__()
@classmethod
def _... | 1,107 | 721 | 23 |
28bc94dd5ea00429c9ff3030fa52184e52e1be49 | 3,624 | py | Python | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_partitionable_graph_data_specification_writer.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | 2 | 2020-11-01T13:22:11.000Z | 2020-11-01T13:22:20.000Z | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_partitionable_graph_data_specification_writer.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_partitionable_graph_data_specification_writer.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | from spinn_machine.utilities.progress_bar import ProgressBar
from spinn_front_end_common.abstract_models.\
abstract_data_specable_vertex import AbstractDataSpecableVertex
from spinn_front_end_common.utilities.utility_objs.executable_targets import \
ExecutableTargets
from spinn_front_end_common.utilities impor... | 41.655172 | 78 | 0.678532 | from spinn_machine.utilities.progress_bar import ProgressBar
from spinn_front_end_common.abstract_models.\
abstract_data_specable_vertex import AbstractDataSpecableVertex
from spinn_front_end_common.utilities.utility_objs.executable_targets import \
ExecutableTargets
from spinn_front_end_common.utilities impor... | 1,697 | 0 | 27 |
9d9964d264e68dcb80b3c95e97441214bc9d5263 | 1,719 | py | Python | sveetoy_cli/colors/registry.py | sveetch/sveetoy-cli | b73159e657b9d23e2cffc70869b82c2024439ae1 | [
"MIT"
] | null | null | null | sveetoy_cli/colors/registry.py | sveetch/sveetoy-cli | b73159e657b9d23e2cffc70869b82c2024439ae1 | [
"MIT"
] | 3 | 2017-11-16T00:35:13.000Z | 2017-11-24T23:59:29.000Z | sveetoy_cli/colors/registry.py | sveetch/sveetoy-cli | b73159e657b9d23e2cffc70869b82c2024439ae1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import io, json
from pathlib import Path
class ColorRegistry:
"""
Open, read and store color names maps
Default shipped color registry is used on loading if no specific path is
given to ``load`` method.
"""
def load(self, path=None):
"""
Load registry... | 26.446154 | 78 | 0.585224 | # -*- coding: utf-8 -*-
import io, json
from pathlib import Path
class ColorRegistry:
"""
Open, read and store color names maps
Default shipped color registry is used on loading if no specific path is
given to ``load`` method.
"""
def __init__(self):
datas_dirpath = Path(__file__).pa... | 155 | 0 | 26 |
19ec1ada2edcd3626071d17e705fddd15c6842f3 | 705 | py | Python | futuquant/testcase/person/eva/quote/test_get_multiple_history_kline.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | futuquant/testcase/person/eva/quote/test_get_multiple_history_kline.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | futuquant/testcase/person/eva/quote/test_get_multiple_history_kline.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | #-*-coding:utf-8-*-
from futuquant import *
import pandas
if __name__ == '__main__':
GetMulHtryKl().test1() | 27.115385 | 140 | 0.62695 | #-*-coding:utf-8-*-
from futuquant import *
import pandas
class GetMulHtryKl(object):
def test1(self):
pandas.set_option('display.width',1000)
pandas.set_option('max_columns',1000)
quote_ctx = OpenQuoteContext(host='127.0.0.1',port=11111)
codelist = ['HK.999011']
start = ... | 534 | 6 | 50 |
9473573f60bf4ff2c4fdba5a8b551bc8fd0d7cd6 | 308 | py | Python | _archive/ren2tan/ren2tan.py | oatsu-gh/utau-plugins | c742ed09f6dae3b52d2d1679890194add56f0fd9 | [
"Beerware"
] | 1 | 2021-08-31T00:51:48.000Z | 2021-08-31T00:51:48.000Z | _archive/ren2tan/ren2tan.py | oatsu-gh/utau_plugins | 82f2145fc044a6028f7f7a88a74689797a4b83df | [
"Beerware"
] | null | null | null | _archive/ren2tan/ren2tan.py | oatsu-gh/utau_plugins | 82f2145fc044a6028f7f7a88a74689797a4b83df | [
"Beerware"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2021 oatsu
"""
連続音歌詞を空白で区切って単独音にするUTAUプラグイン
"""
import utaupy
def ren2tan(plugin):
"""
歌詞を空白で区切って、空白より後ろ側だけ残す。
"""
for note in plugin.notes:
note.lyric = note.lyric.split()[-1]
if __name__ == '__main__':
utaupy.utauplugin.run(ren2tan)
| 14.666667 | 43 | 0.649351 | #!/usr/bin/env python3
# Copyright (c) 2021 oatsu
"""
連続音歌詞を空白で区切って単独音にするUTAUプラグイン
"""
import utaupy
def ren2tan(plugin):
"""
歌詞を空白で区切って、空白より後ろ側だけ残す。
"""
for note in plugin.notes:
note.lyric = note.lyric.split()[-1]
if __name__ == '__main__':
utaupy.utauplugin.run(ren2tan)
| 0 | 0 | 0 |
8a58b436d68c59696458a2751cff5fe08edd9a40 | 5,422 | py | Python | cupy/creation/basic.py | fukuta0614/Chainer | 337fe78e1c27924c1195b8b677a9b2cd3ea68828 | [
"MIT"
] | null | null | null | cupy/creation/basic.py | fukuta0614/Chainer | 337fe78e1c27924c1195b8b677a9b2cd3ea68828 | [
"MIT"
] | 1 | 2016-11-09T06:32:32.000Z | 2016-11-09T10:20:04.000Z | cupy/creation/basic.py | fukuta0614/Chainer | 337fe78e1c27924c1195b8b677a9b2cd3ea68828 | [
"MIT"
] | 1 | 2021-05-27T16:52:11.000Z | 2021-05-27T16:52:11.000Z | import cupy
def empty(shape, dtype=float):
"""Returns an array without initializing the elements.
This function currently does not support ``order`` option.
Args:
shape (tuple of ints): Dimensionalities of the array.
dtype: Data type specifier.
Returns:
cupy.ndarray: A new a... | 25.575472 | 79 | 0.629288 | import cupy
def empty(shape, dtype=float):
"""Returns an array without initializing the elements.
This function currently does not support ``order`` option.
Args:
shape (tuple of ints): Dimensionalities of the array.
dtype: Data type specifier.
Returns:
cupy.ndarray: A new a... | 0 | 0 | 0 |
606ef29647dfca7025dc7a7bcba6b2c14ce348cc | 24,399 | py | Python | sciencebeam_gym/trainer/models/pix2pix/pix2pix_model.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 25 | 2017-07-25T12:44:55.000Z | 2020-09-30T22:16:50.000Z | sciencebeam_gym/trainer/models/pix2pix/pix2pix_model.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 192 | 2017-11-29T08:57:03.000Z | 2022-03-29T18:44:41.000Z | sciencebeam_gym/trainer/models/pix2pix/pix2pix_model.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 6 | 2019-02-01T18:49:33.000Z | 2020-07-26T08:18:46.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import argparse
import json
from functools import reduce
import tensorflow as tf
from tensorflow.python.lib.io.file_io import FileIO # pylint: disable=E0611
from sciencebeam_gym.trainer.data... | 33.653793 | 100 | 0.612115 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import argparse
import json
from functools import reduce
import tensorflow as tf
from tensorflow.python.lib.io.file_io import FileIO # pylint: disable=E0611
from sciencebeam_gym.trainer.data... | 21,544 | 697 | 556 |
a59878ebd625530edf2818a79e847570d7a43bc3 | 3,985 | py | Python | dashboard/modules/job/job_head.py | sungho-joo/ray | 7a18d90a2527ba603f3e0444346389c3136bf50e | [
"Apache-2.0"
] | null | null | null | dashboard/modules/job/job_head.py | sungho-joo/ray | 7a18d90a2527ba603f3e0444346389c3136bf50e | [
"Apache-2.0"
] | 30 | 2021-11-05T06:54:54.000Z | 2022-03-19T07:10:33.000Z | dashboard/modules/job/job_head.py | RuofanKong/ray | 60e9737679d93e7e8902dcea0720addb506ddf0a | [
"Apache-2.0"
] | null | null | null | import aiohttp.web
from functools import wraps
import logging
from typing import Callable
import json
import dataclasses
import ray
import ray.dashboard.utils as dashboard_utils
from ray._private.job_manager import JobManager
from ray._private.runtime_env.packaging import (package_exists,
... | 36.898148 | 77 | 0.697867 | import aiohttp.web
from functools import wraps
import logging
from typing import Callable
import json
import dataclasses
import ray
import ray.dashboard.utils as dashboard_utils
from ray._private.job_manager import JobManager
from ray._private.runtime_env.packaging import (package_exists,
... | 2,481 | 559 | 46 |
c24074ac9a3cdf8728bde947483d6f521b704136 | 7,589 | py | Python | minispider/__main__.py | leepxrk/scrapy_learn | 7c0aea1c1e312aa16d11926f2421ed00aa92d97f | [
"MIT"
] | null | null | null | minispider/__main__.py | leepxrk/scrapy_learn | 7c0aea1c1e312aa16d11926f2421ed00aa92d97f | [
"MIT"
] | null | null | null | minispider/__main__.py | leepxrk/scrapy_learn | 7c0aea1c1e312aa16d11926f2421ed00aa92d97f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
from .sql import MiniSpiderSQL
from .scheduler import MiniSpider
from .extractor import Extractor
from .downloader import MiniSpiderDownloader
__version__ = '0.0.3'
if __name__ == '__main__':
main()
| 35.966825 | 112 | 0.58598 | #!/usr/bin/env python
import argparse
from .sql import MiniSpiderSQL
from .scheduler import MiniSpider
from .extractor import Extractor
from .downloader import MiniSpiderDownloader
__version__ = '0.0.3'
def main():
# Make parser for terminal.
description = 'MiniSpider makes it easy to create user-friendly s... | 7,324 | 0 | 23 |
cecda11e8240a03768dc24d5ae13e7860657aad1 | 1,345 | py | Python | invenio_app_ils/ill/mail/tasks.py | masonproffitt/invenio-app-ils | 81dd12aa774d7d70096de77cc526d9b4ca614437 | [
"MIT"
] | null | null | null | invenio_app_ils/ill/mail/tasks.py | masonproffitt/invenio-app-ils | 81dd12aa774d7d70096de77cc526d9b4ca614437 | [
"MIT"
] | null | null | null | invenio_app_ils/ill/mail/tasks.py | masonproffitt/invenio-app-ils | 81dd12aa774d7d70096de77cc526d9b4ca614437 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""ILL mail tasks."""
from invenio_app_ils.ill.errors import ILLError
from invenio_app_ils.ill.mail.factory impor... | 30.568182 | 77 | 0.700372 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""ILL mail tasks."""
from invenio_app_ils.ill.errors import ILLError
from invenio_app_ils.ill.mail.factory impor... | 0 | 0 | 0 |
e490594eb909224b9de0516fb7d5021a6e745b8b | 980 | py | Python | csp/propagators/propagator.py | abeccaro/csp-solver | a761dee02a4dd12162eb55ef34cc0989c79567cc | [
"MIT"
] | null | null | null | csp/propagators/propagator.py | abeccaro/csp-solver | a761dee02a4dd12162eb55ef34cc0989c79567cc | [
"MIT"
] | null | null | null | csp/propagators/propagator.py | abeccaro/csp-solver | a761dee02a4dd12162eb55ef34cc0989c79567cc | [
"MIT"
] | null | null | null | from abc import abstractmethod
from csp.observer import Observer
class Propagator(Observer):
"""Abstract class for a constraint propagator."""
@abstractmethod
def on_domain_change(self, var):
"""Called when a variable domain has changed.
:param var: The var... | 24.5 | 66 | 0.544898 | from abc import abstractmethod
from csp.observer import Observer
class Propagator(Observer):
"""Abstract class for a constraint propagator."""
def __init__(self):
super().__init__()
self.enabled = True
self.map = {}
def on_event(self, var):
se... | 117 | 0 | 66 |
6fec7946842257e2587af351dffd6c086fd072c2 | 413 | py | Python | publications/migrations/0025_publication_is_from_systematic_search.py | gormshackelford/metadataset | ab8a1c0c70a508da37b3a64906ba85c69dd74b6b | [
"MIT"
] | 2 | 2019-12-18T12:00:02.000Z | 2020-03-11T01:15:45.000Z | publications/migrations/0025_publication_is_from_systematic_search.py | gormshackelford/metadataset | ab8a1c0c70a508da37b3a64906ba85c69dd74b6b | [
"MIT"
] | 2 | 2020-06-06T00:01:13.000Z | 2021-06-10T22:09:30.000Z | publications/migrations/0025_publication_is_from_systematic_search.py | gormshackelford/metadataset | ab8a1c0c70a508da37b3a64906ba85c69dd74b6b | [
"MIT"
] | 1 | 2020-01-07T12:28:43.000Z | 2020-01-07T12:28:43.000Z | # Generated by Django 2.0 on 2019-04-02 09:57
from django.db import migrations, models
| 21.736842 | 52 | 0.627119 | # Generated by Django 2.0 on 2019-04-02 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publications', '0024_auto_20190401_1522'),
]
operations = [
migrations.AddField(
model_name='publication',
name='is_fr... | 0 | 301 | 23 |
8c62f4298524bab607b4dbc094a650eb75802544 | 2,046 | py | Python | spider_package/config.py | hjjia/spider | ae52414b608487523e235d69b6404d9d0c06a931 | [
"MIT"
] | null | null | null | spider_package/config.py | hjjia/spider | ae52414b608487523e235d69b6404d9d0c06a931 | [
"MIT"
] | null | null | null | spider_package/config.py | hjjia/spider | ae52414b608487523e235d69b6404d9d0c06a931 | [
"MIT"
] | null | null | null | # coding:utf8
import re
options = {
'root_url': 'http://www.juooo.com',
'max_count': 1000,
'urlReg': {
'urlRegType': 1,
'urlFull': '',
'urlStr': 'http://(\w+).juooo.com/\w+'
},
'urlData': []
}
| 26.230769 | 75 | 0.529326 | # coding:utf8
import re
options = {
'root_url': 'http://www.juooo.com',
'max_count': 1000,
'urlReg': {
'urlRegType': 1,
'urlFull': '',
'urlStr': 'http://(\w+).juooo.com/\w+'
},
'urlData': []
}
def initOptions():
print '请输入入口url:'
root_url = raw_input('入口url:')
i... | 2,055 | 0 | 23 |
033ec08de916e40e952cee70655dddeca4bcde74 | 31,594 | py | Python | code/src/features.py | bsm8734/BC_stage2_Tabular_data_Classification | e421360f3f6f9016c58bfff2dd20485206e4a365 | [
"MIT"
] | null | null | null | code/src/features.py | bsm8734/BC_stage2_Tabular_data_Classification | e421360f3f6f9016c58bfff2dd20485206e4a365 | [
"MIT"
] | null | null | null | code/src/features.py | bsm8734/BC_stage2_Tabular_data_Classification | e421360f3f6f9016c58bfff2dd20485206e4a365 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import os, sys, gc, random
import datetime
import dateutil.relativedelta
# Machine learning
from sklearn.preprocessing import LabelEncoder
from sklearn.impute import SimpleImputer
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import roc_auc_score
# Cus... | 40.298469 | 161 | 0.620877 | import pandas as pd
import numpy as np
import os, sys, gc, random
import datetime
import dateutil.relativedelta
# Machine learning
from sklearn.preprocessing import LabelEncoder
from sklearn.impute import SimpleImputer
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import roc_auc_score
# Cus... | 31,616 | 0 | 206 |
6987eae1d20eb0280e52f15424abd63287a36aae | 1,576 | py | Python | nlp.py | ktrnka/helpers | b52102d81007301ed576c908c8f9fa5df386abbb | [
"MIT"
] | null | null | null | nlp.py | ktrnka/helpers | b52102d81007301ed576c908c8f9fa5df386abbb | [
"MIT"
] | null | null | null | nlp.py | ktrnka/helpers | b52102d81007301ed576c908c8f9fa5df386abbb | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from __future__ import print_function
import unicodedata
import unittest
"""
Very simple assorted helpers for natural language processing that I've used a few times.
"""
_CHAR_TRANSLATIONS = {
# chars to remove
"\u00ae": None,
"\u2122": None,
# chars to normal... | 25.419355 | 117 | 0.616117 | from __future__ import unicode_literals
from __future__ import print_function
import unicodedata
import unittest
"""
Very simple assorted helpers for natural language processing that I've used a few times.
"""
_CHAR_TRANSLATIONS = {
# chars to remove
"\u00ae": None,
"\u2122": None,
# chars to normal... | 571 | 13 | 95 |
8c1a3c2529398f838d4805204cccfb8bf42655bf | 2,471 | py | Python | animations/measure_scene.py | 61smiling/algorithm-stone | 625bcef514a82ad93871987e81c6ec18b34f27cb | [
"MIT"
] | 693 | 2021-02-22T03:52:10.000Z | 2022-03-31T15:54:46.000Z | animations/measure_scene.py | Karen4tree/algorithm-stone | 12e46463bb57929dfb4ab142f5cf0e8e69d460a8 | [
"MIT"
] | 5 | 2021-09-14T07:06:20.000Z | 2022-01-04T02:49:11.000Z | animations/measure_scene.py | Karen4tree/algorithm-stone | 12e46463bb57929dfb4ab142f5cf0e8e69d460a8 | [
"MIT"
] | 265 | 2021-02-28T02:35:44.000Z | 2022-03-31T13:21:31.000Z | from manim_imports_ext import *
| 35.3 | 124 | 0.566977 | from manim_imports_ext import *
class MeasureScene(AlgoScene):
def construct(self):
shape = self.camera.frame.get_shape()
font_size = 30
t = Text("1 width %.2f height %.2f delta 0.00"%(shape[0], shape[1]), color=GREEN, font_size=font_size).shift(LEFT*3)
self.add(t)
hw = s... | 2,322 | 19 | 98 |
f730ed7aa9f9349f15c6cbfc5165fbc8a60781f3 | 1,755 | py | Python | MGSIM/Commands/Genome_download.py | nick-youngblut/MGSIM | 9edae3c170cf5100b3408a853a87e1205e70dd1b | [
"MIT"
] | 3 | 2019-09-02T11:03:40.000Z | 2021-12-13T15:59:06.000Z | MGSIM/Commands/Genome_download.py | nick-youngblut/MGSIM | 9edae3c170cf5100b3408a853a87e1205e70dd1b | [
"MIT"
] | 2 | 2020-11-13T13:04:47.000Z | 2022-02-03T14:58:13.000Z | MGSIM/Commands/Genome_download.py | nick-youngblut/MGSIM | 9edae3c170cf5100b3408a853a87e1205e70dd1b | [
"MIT"
] | 1 | 2020-08-13T12:40:39.000Z | 2020-08-13T12:40:39.000Z | #!/usr/bin/env python
"""
genome_download: downloading genomes
Usage:
genome_download [options] <accession_table>
genome_download -h | --help
genome_download --version
Options:
<accessin_table> Taxon-accession table (see Description).
Use '-' if from STDIN.
-d=<d> Output dir... | 28.770492 | 85 | 0.631339 | #!/usr/bin/env python
"""
genome_download: downloading genomes
Usage:
genome_download [options] <accession_table>
genome_download -h | --help
genome_download --version
Options:
<accessin_table> Taxon-accession table (see Description).
Use '-' if from STDIN.
-d=<d> Output dir... | 177 | 0 | 22 |
6c2d37e74fbca6fb979828a56b8838b574e1ca73 | 6,460 | py | Python | Interface/app.py | BrandonLawler/Office-365-Connector | 2421c560cfbc517a1074c7fdbda916c842e2995d | [
"MIT"
] | null | null | null | Interface/app.py | BrandonLawler/Office-365-Connector | 2421c560cfbc517a1074c7fdbda916c842e2995d | [
"MIT"
] | null | null | null | Interface/app.py | BrandonLawler/Office-365-Connector | 2421c560cfbc517a1074c7fdbda916c842e2995d | [
"MIT"
] | null | null | null | import logging
import multiprocessing
from typing import MutableMapping
from PyQt6.QtCore import *
from PyQt6.QtWidgets import *
from Core.messages import Courier, Message
from .widgets import *
import os, sys
| 35.108696 | 140 | 0.636223 | import logging
import multiprocessing
from typing import MutableMapping
from PyQt6.QtCore import *
from PyQt6.QtWidgets import *
from Core.messages import Courier, Message
from .widgets import *
import os, sys
class App:
_TITLE = 'Office 365 Connector'
_MEDIA_PATH = f"{os.getcwd()}\\Interface\\media"
_WI... | 5,460 | 766 | 23 |
69cc9a1f6a639563622f0c9fe9107b2a2258bf9f | 6,079 | py | Python | img4.py | clayfreeman/img4 | e2d8f05ca5ba4c9d445dff5f8a6b3b4cf48d3bf2 | [
"MIT"
] | null | null | null | img4.py | clayfreeman/img4 | e2d8f05ca5ba4c9d445dff5f8a6b3b4cf48d3bf2 | [
"MIT"
] | null | null | null | img4.py | clayfreeman/img4 | e2d8f05ca5ba4c9d445dff5f8a6b3b4cf48d3bf2 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
# Greetings to:
# - https://www.theiphonewiki.com/wiki/IMG4_File_Format
# - https://github.com/tihmstar/img4tool/
# - https://lapo.it/asn1js/
# - hexdump tool of choice
import functools
from asn1crypto.core import (
Enumerated, Choice, Sequence, SequenceOf, SetOf,
Integer, IA5Str... | 29.225962 | 132 | 0.550584 | # SPDX-License-Identifier: MIT
# Greetings to:
# - https://www.theiphonewiki.com/wiki/IMG4_File_Format
# - https://github.com/tihmstar/img4tool/
# - https://lapo.it/asn1js/
# - hexdump tool of choice
import functools
from asn1crypto.core import (
Enumerated, Choice, Sequence, SequenceOf, SetOf,
Integer, IA5Str... | 83 | 1,958 | 440 |
608146772a2f2ce45897b6339cbe785cf26ad687 | 2,548 | py | Python | test/programytest/storage/stores/nosql/mongo/dao/test_rdf.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/storage/stores/nosql/mongo/dao/test_rdf.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/storage/stores/nosql/mongo/dao/test_rdf.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import unittest
from programy.storage.stores.nosql.mongo.dao.rdf import RDF
| 43.931034 | 132 | 0.619702 | import unittest
from programy.storage.stores.nosql.mongo.dao.rdf import RDF
class RDFTests(unittest.TestCase):
def test_init_no_id(self):
rdf = RDF(name="TEST", subject="subj", predicate="pred", obj="obj")
self.assertIsNotNone(rdf)
self.assertIsNone(rdf.id)
self.assertEqual("TES... | 2,272 | 13 | 185 |
9f9edf6016950ee307ec6bab15c4f6306ef09f36 | 2,328 | py | Python | scripts/pughpore/plot_diff_ahem.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | null | null | null | scripts/pughpore/plot_diff_ahem.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | null | null | null | scripts/pughpore/plot_diff_ahem.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | null | null | null | # (c) 2017 Gregor Mitscha-Baude
from matplotlib import pyplot as plt
import numpy as np
import dolfin
from nanopores.tools import fields
fields.set_dir_dropbox()
from nanopores.models.nanopore import Setup
from nanopores.geometries.alphahempoly import poly
from nanopores.geometries.alphahem import default
from nanopore... | 27.388235 | 85 | 0.693299 | # (c) 2017 Gregor Mitscha-Baude
from matplotlib import pyplot as plt
import numpy as np
import dolfin
from nanopores.tools import fields
fields.set_dir_dropbox()
from nanopores.models.nanopore import Setup
from nanopores.geometries.alphahempoly import poly
from nanopores.geometries.alphahem import default
from nanopore... | 193 | 0 | 46 |
a417f4cdb25dac12c25d28f2f1b5f38a475ca13e | 320 | py | Python | codewars/src/multiples_digits_sum.py | wenima/math-series | 60aa0b0c845bd859a1bf936c7e200f60ecfce026 | [
"MIT"
] | null | null | null | codewars/src/multiples_digits_sum.py | wenima/math-series | 60aa0b0c845bd859a1bf936c7e200f60ecfce026 | [
"MIT"
] | null | null | null | codewars/src/multiples_digits_sum.py | wenima/math-series | 60aa0b0c845bd859a1bf936c7e200f60ecfce026 | [
"MIT"
] | 1 | 2019-10-03T07:38:06.000Z | 2019-10-03T07:38:06.000Z | """This module solves kata https://www.codewars.com/kata/multiples-and-digit-sums/train/python."""
def procedure(i):
"""Return an integer derived by first finding all multiples of i up to 100,
then summing all up digit sums of all multiples."""
return sum(int(d) for i in range(n, 101, n) for d in str(i))
| 40 | 98 | 0.7 | """This module solves kata https://www.codewars.com/kata/multiples-and-digit-sums/train/python."""
def procedure(i):
"""Return an integer derived by first finding all multiples of i up to 100,
then summing all up digit sums of all multiples."""
return sum(int(d) for i in range(n, 101, n) for d in str(i))
| 0 | 0 | 0 |
36e541780526915a358b17b1f29530895478a06a | 1,869 | py | Python | tests/show_drive.py | jmscslgroup/privpurge | f21fa1e05c5e15ea9ed3b3f720aabb151afcc51e | [
"BSD-2-Clause"
] | null | null | null | tests/show_drive.py | jmscslgroup/privpurge | f21fa1e05c5e15ea9ed3b3f720aabb151afcc51e | [
"BSD-2-Clause"
] | 4 | 2021-04-12T17:58:41.000Z | 2021-08-01T12:35:57.000Z | tests/show_drive.py | jmscslgroup/privpurge | f21fa1e05c5e15ea9ed3b3f720aabb151afcc51e | [
"BSD-2-Clause"
] | null | null | null | import json
import folium
import folium.plugins
import tempfile
import os
import re
import argparse
if __name__ == "__main__":
cwd = os.getcwd()
args = get_args()
plot_privpurge(
os.path.join(cwd, args.zonefile),
os.path.join(cwd, args.directory),
filename=args.output,
)
| 26.7 | 86 | 0.579989 | import json
import folium
import folium.plugins
import tempfile
import os
import re
def plot_privpurge(message, outdir, filename=None):
if filename is None:
filename = "~map_" + next(tempfile._get_candidate_names()) + ".html"
my_map = folium.Map()
for fl in [
f for f in os.listdir(outdi... | 1,503 | 0 | 46 |
b5646fff9a5543547a5f966f926aa2fd063a36b3 | 8,249 | py | Python | autopycoin/utils/data_utils_test.py | AutocoinLab/autopycoin | d091292517c3429d5cc2dfeb513c644b506af9cf | [
"Apache-2.0"
] | 3 | 2021-09-26T14:04:25.000Z | 2022-02-10T09:52:00.000Z | autopycoin/utils/data_utils_test.py | AutocoinLab/autopycoin | d091292517c3429d5cc2dfeb513c644b506af9cf | [
"Apache-2.0"
] | 24 | 2021-09-26T14:04:27.000Z | 2022-02-11T13:32:06.000Z | autopycoin/utils/data_utils_test.py | AutocoinLab/autopycoin | d091292517c3429d5cc2dfeb513c644b506af9cf | [
"Apache-2.0"
] | null | null | null | # pylint: skip-file
"""
Unit test for data utils functions.
"""
import numpy as np
import pandas as pd
import pytest
import tensorflow as tf
from tensorflow import test
from .data_utils import quantiles_handler, example_handler, fill_none
from ..data import random_ts
from ..dataset import WindowGenerator
@pytest... | 30.439114 | 88 | 0.534731 | # pylint: skip-file
"""
Unit test for data utils functions.
"""
import numpy as np
import pandas as pd
import pytest
import tensorflow as tf
from tensorflow import test
from .data_utils import quantiles_handler, example_handler, fill_none
from ..data import random_ts
from ..dataset import WindowGenerator
class Ch... | 2,109 | 5,488 | 222 |
462a6cefdccfc40c9c840424ec8ddc04070744bd | 12,923 | py | Python | packages/adminrouter/extra/src/test-harness/modules/mocker/endpoints/generic.py | makkes/dcos | a6df70f3f58ead134c8c49af8fa1387b4f81c19c | [
"Apache-2.0"
] | 1 | 2019-04-26T17:46:37.000Z | 2019-04-26T17:46:37.000Z | packages/adminrouter/extra/src/test-harness/modules/mocker/endpoints/generic.py | makkes/dcos | a6df70f3f58ead134c8c49af8fa1387b4f81c19c | [
"Apache-2.0"
] | 720 | 2017-02-08T04:04:19.000Z | 2021-09-14T14:04:56.000Z | packages/adminrouter/extra/src/test-harness/modules/mocker/endpoints/generic.py | makkes/dcos | a6df70f3f58ead134c8c49af8fa1387b4f81c19c | [
"Apache-2.0"
] | 14 | 2017-02-08T03:57:24.000Z | 2019-10-28T12:14:49.000Z | # Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""
Shared code for DC/OS endpoints mocks used by AR instances, both EE and Open.
"""
import abc
import http.server
import logging
import os
import socket
import socketserver
import ssl
import threading
# pylint: disable=C0103
log = logging.getLogger(__n... | 36.922857 | 108 | 0.630349 | # Copyright (C) Mesosphere, Inc. See LICENSE file for details.
"""
Shared code for DC/OS endpoints mocks used by AR instances, both EE and Open.
"""
import abc
import http.server
import logging
import os
import socket
import socketserver
import ssl
import threading
# pylint: disable=C0103
log = logging.getLogger(__n... | 710 | 0 | 79 |
9ec35e51357b9666792505fb9f52a9e1ad10e223 | 24,247 | py | Python | dspn/train.py | FlorianSchroevers/dspn | 8bd2fe9b336099da8c18c9ce716c00e7cf1ca0b6 | [
"MIT"
] | null | null | null | dspn/train.py | FlorianSchroevers/dspn | 8bd2fe9b336099da8c18c9ce716c00e7cf1ca0b6 | [
"MIT"
] | null | null | null | dspn/train.py | FlorianSchroevers/dspn | 8bd2fe9b336099da8c18c9ce716c00e7cf1ca0b6 | [
"MIT"
] | null | null | null | import os
import argparse
from datetime import datetime
import time
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
import numpy as np
import pandas as pd
from tqdm import tqdm
import matplotlib
import matplotlib.pyplot as plt
from tensorboardX import SummaryWriter
import data
import... | 33.352132 | 79 | 0.479894 | import os
import argparse
from datetime import datetime
import time
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
import numpy as np
import pandas as pd
from tqdm import tqdm
import matplotlib
import matplotlib.pyplot as plt
from tensorboardX import SummaryWriter
import data
import... | 23,664 | 0 | 23 |
8dce960a7b6703eb2654296841d98428d993d7fa | 6,284 | py | Python | classes/Math.py | lekevin42/discord_music_single | fcf30cf33f8bd5b8f2a16dba7f32600024700213 | [
"MIT"
] | null | null | null | classes/Math.py | lekevin42/discord_music_single | fcf30cf33f8bd5b8f2a16dba7f32600024700213 | [
"MIT"
] | 1 | 2017-07-28T14:51:13.000Z | 2017-07-28T20:27:46.000Z | classes/Math.py | lekevin42/discord_music_single | fcf30cf33f8bd5b8f2a16dba7f32600024700213 | [
"MIT"
] | null | null | null | import math
#def find_par(self):
if __name__ == "__main__":
main()
| 20.739274 | 106 | 0.60837 | import math
class Math:
def __init__(self, eq):
self.equation = eq
self.equation_list = None
def print_equation(self):
print(self.equation)
def remove_spaces(self):
self.equation = self.equation.replace(" ", "")
def split_equation(self):
self.equation_list = self.equation.split(" ")
def is_ope... | 5,852 | -10 | 352 |