hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3639f5c290fdd4c9a3c05e0911e6fcda999acef | 2,921 | py | Python | DatasetIndexing/infoExtraction.py | eth-library-lab/inDexDa | 55421454dd3c2ff7e39ee78d0d891ffdcaaa6791 | [
"MIT"
] | 7 | 2020-01-27T12:54:20.000Z | 2021-06-28T10:44:28.000Z | DatasetIndexing/infoExtraction.py | eth-library-lab/inDexDa | 55421454dd3c2ff7e39ee78d0d891ffdcaaa6791 | [
"MIT"
] | 2 | 2020-02-21T08:29:23.000Z | 2020-12-01T16:30:20.000Z | DatasetIndexing/infoExtraction.py | eth-library-lab/inDexDa | 55421454dd3c2ff7e39ee78d0d891ffdcaaa6791 | [
"MIT"
] | 2 | 2020-02-17T09:29:35.000Z | 2020-02-17T13:05:42.000Z |
if __name__ == '__main__':
paper = {
"Title": "BomJi at SemEval-2018 Task 10: Combining Vector-, Pattern- and Graph-based Information to Identify Discriminative Attributes",
"Abstract": "This paper describes BomJi, a supervised system for capturing discriminative attributes in word pairs (e.g. ... | 37.448718 | 469 | 0.647039 | import os
import json
from termcolor import colored
from utils import getInfoAboutArchivesToScrape
from PaperScraper.utils.command_line import printProgressBar
from DatasetIndexing.lib.arxiv_scraper import ArXivScraper
from DatasetIndexing.lib.sciencedirect_scraper import ScienceDirectScraper
def datasetIndexing():
... | 0 | 0 | 0 | 637 | 0 | 862 | 0 | 140 | 201 |
968628b5ca31b300f93f301c0f25da5720d9f276 | 3,697 | py | Python | feeds/torrentpier.py | int3l/xbtit_tools | cca487c9bef60067f9ed76338e7191d75b417713 | [
"MIT"
] | null | null | null | feeds/torrentpier.py | int3l/xbtit_tools | cca487c9bef60067f9ed76338e7191d75b417713 | [
"MIT"
] | null | null | null | feeds/torrentpier.py | int3l/xbtit_tools | cca487c9bef60067f9ed76338e7191d75b417713 | [
"MIT"
] | null | null | null | from asyncio import TimeoutError
from aiohttp import ClientOSError
from aiohttp import ClientPayloadError
from aiohttp import InvalidURL
from utils.config import timeout_interval
CONTENT_PATH = "descendant-or-self::tr[contains(@class, 'hl-tr')]"
NAME_PATH = "string(descendant::td[contains(@class, 'tLeft')]/"\
"d... | 25.673611 | 78 | 0.661888 | import argparse
from asyncio import get_event_loop
from asyncio import sleep as asleep
from asyncio import TimeoutError
from errno import ECONNRESET
from functools import lru_cache
from functools import partial
from urllib.parse import urljoin
from aioconsole.stream import aprint
from aiohttp import ClientOSError
from... | 0 | 55 | 2,054 | 0 | 0 | 128 | 0 | 210 | 558 |
a5fdb7090d10057f9c017c39bf82dc472d82d846 | 390 | py | Python | related_fields_patch.py | nuwainfo/treeio | f57bf9114d9774c11468a1b0e44614b04631beb1 | [
"MIT"
] | null | null | null | related_fields_patch.py | nuwainfo/treeio | f57bf9114d9774c11468a1b0e44614b04631beb1 | [
"MIT"
] | null | null | null | related_fields_patch.py | nuwainfo/treeio | f57bf9114d9774c11468a1b0e44614b04631beb1 | [
"MIT"
] | null | null | null | # Django command helper to apply django related fields patch programattically
# Will cd into 1st argument and run patch
import os
import sys
from subprocess import Popen, PIPE
patch_file = os.path.join(
os.path.abspath('.'), 'bin', 'django-related-fields.patch')
process = Popen(['patch', '-p1'], stdin=PIPE, shell... | 32.5 | 77 | 0.741026 | # Django command helper to apply django related fields patch programattically
# Will cd into 1st argument and run patch
import os
import sys
from subprocess import Popen, PIPE
patch_file = os.path.join(
os.path.abspath('.'), 'bin', 'django-related-fields.patch')
process = Popen(['patch', '-p1'], stdin=PIPE, shell... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
31561705b2a4367ab02712310d58975520781c14 | 324 | py | Python | FastSimulation/Tracking/python/electronCkfTrackCandidates_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | FastSimulation/Tracking/python/electronCkfTrackCandidates_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | FastSimulation/Tracking/python/electronCkfTrackCandidates_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import FastSimulation.Tracking.TrackCandidateProducer_cfi
electronCkfTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
src = cms.InputTag("electronMergedSeeds"),
MinNumberOfCrossedLayers = 5,
OverlapCleaning = True
... | 36 | 109 | 0.824074 | import FWCore.ParameterSet.Config as cms
import FastSimulation.Tracking.TrackCandidateProducer_cfi
electronCkfTrackCandidates = FastSimulation.Tracking.TrackCandidateProducer_cfi.trackCandidateProducer.clone(
src = cms.InputTag("electronMergedSeeds"),
MinNumberOfCrossedLayers = 5,
OverlapCleaning = True
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c22b61a2564fc489f610fbe8efb961e6f3c533c2 | 1,873 | py | Python | resources/libExamples/terminateConn.py | andy897221/Proof-of-Play-Flow-Demo | 018ec382801f1363711b7680e728535a2ac94d26 | [
"MIT"
] | null | null | null | resources/libExamples/terminateConn.py | andy897221/Proof-of-Play-Flow-Demo | 018ec382801f1363711b7680e728535a2ac94d26 | [
"MIT"
] | null | null | null | resources/libExamples/terminateConn.py | andy897221/Proof-of-Play-Flow-Demo | 018ec382801f1363711b7680e728535a2ac94d26 | [
"MIT"
] | null | null | null | from py2p import mesh
import asyncio, argparse, time
loop = asyncio.get_event_loop()
parser = argparse.ArgumentParser()
parser.add_argument("-b", "--bootstrap", type=int, help="whether this node in boostrap node")
parser.add_argument("-p", "--myPort", type=int, help="my port")
args = parser.parse_args()
myPort = arg... | 29.265625 | 93 | 0.595836 | from py2p import mesh
import asyncio, argparse, time, sys
loop = asyncio.get_event_loop()
parser = argparse.ArgumentParser()
parser.add_argument("-b", "--bootstrap", type=int, help="whether this node in boostrap node")
parser.add_argument("-p", "--myPort", type=int, help="my port")
args = parser.parse_args()
myPort ... | 0 | 0 | 1,081 | 0 | 0 | 0 | 0 | 5 | 44 |
e577ffe126638f39e3ba59c1931a422671ebe463 | 3,077 | py | Python | metrics.py | alexjercan/asr-toolkit | 5c423fe49556cd96c888988a80c65e9c7a60556c | [
"MIT"
] | null | null | null | metrics.py | alexjercan/asr-toolkit | 5c423fe49556cd96c888988a80c65e9c7a60556c | [
"MIT"
] | null | null | null | metrics.py | alexjercan/asr-toolkit | 5c423fe49556cd96c888988a80c65e9c7a60556c | [
"MIT"
] | null | null | null | import torch.nn as nn
# Reference: https://github.com/imalic3/python-word-error-rate
| 29.586538 | 86 | 0.546961 | import numpy as np
import torch.nn as nn
class CTCLossFunction(nn.Module):
def __init__(self, blank=0):
super().__init__()
self.blank = blank
self.ctc_loss = nn.CTCLoss(blank)
self.total_size = 0
self.loss_sum = {}
self.loss_avg = {}
def forwar... | 0 | 0 | 0 | 1,473 | 0 | 1,335 | 0 | -3 | 171 |
34c6ce2dced856ed0688e706e9238d8ad4991a44 | 1,946 | py | Python | deeprank/learn/model2d.py | DeepRank/DeepRank_VariantPred | 42cd85c7a521463ab2b644ef8da87c107a2b5bce | [
"Apache-2.0"
] | 84 | 2018-01-18T02:49:10.000Z | 2022-03-05T00:47:49.000Z | deeprank/learn/model2d.py | DeepRank/DeepRank_VariantPred | 42cd85c7a521463ab2b644ef8da87c107a2b5bce | [
"Apache-2.0"
] | 228 | 2018-03-01T15:05:17.000Z | 2022-03-25T13:00:36.000Z | deeprank/learn/model2d.py | DeepRank/DeepRank_VariantPred | 42cd85c7a521463ab2b644ef8da87c107a2b5bce | [
"Apache-2.0"
] | 25 | 2018-03-01T14:56:28.000Z | 2022-01-20T07:32:35.000Z | import torch.nn as nn
######################################################################
#
# Model automatically generated by modelGenerator
#
######################################################################
# ----------------------------------------------------------------------
# Network Structure
# -----... | 33.551724 | 74 | 0.511305 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
######################################################################
#
# Model automatically generated by modelGenerator
#
######################################################################
# ----------------... | 0 | 0 | 0 | 1,041 | 0 | 0 | 0 | 15 | 90 |
364360e1a05160e25452fe4c0df46a41eace3d91 | 637 | py | Python | sfaira/__init__.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | sfaira/__init__.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | sfaira/__init__.py | johnmous/sfaira | c50240a74530e614ab7681bf9c63b04cb815b361 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""A Data and Model Zoo for Single-Cell Genomics."""
import sfaira.consts
import sfaira.data
import sfaira.models
import sfaira.train
import sfaira.ui
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__maintainer__ = ', '.join([
"Leander Dony",
... | 21.965517 | 52 | 0.692308 | # -*- coding: utf-8 -*-
"""A Data and Model Zoo for Single-Cell Genomics."""
from ._settings import settings
import sfaira.consts
import sfaira.data
import sfaira.models
import sfaira.train
import sfaira.ui
import sfaira.versions
from ._version import get_versions
__version__ = get_versions()['version']
del get_versi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 45 |
ebdf8d367c089ce810c252c23af0714e9737c64a | 500 | py | Python | server/apps/movie/serializers.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/movie/serializers.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/movie/serializers.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-19 21:49
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : serializers.py
# @Software: PyCharm
| 21.73913 | 51 | 0.66 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019-04-19 21:49
# @Author : Mayandev
# @Site : https://github.com/Mayandev/
# @File : serializers.py
# @Software: PyCharm
from rest_framework import serializers
from .models import Movie, Genre
class MovieSerializer(serializers.ModelSerializer):
... | 0 | 0 | 0 | 190 | 0 | 0 | 0 | 28 | 91 |
03f7a273070a77b4d974179aeb78183c7456a00d | 336 | py | Python | tests/accounts/test_github_account.py | zvtvz/play-github | 30ad38ca88c1a57b2cec48b19ca31ffa28fa0154 | [
"MIT"
] | 2 | 2019-09-21T04:31:01.000Z | 2020-01-21T03:45:51.000Z | tests/accounts/test_github_account.py | zvtvz/play-github | 30ad38ca88c1a57b2cec48b19ca31ffa28fa0154 | [
"MIT"
] | null | null | null | tests/accounts/test_github_account.py | zvtvz/play-github | 30ad38ca88c1a57b2cec48b19ca31ffa28fa0154 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 28 | 56 | 0.684524 | # -*- coding: utf-8 -*-
from github.accounts.github_account import GithubAccount
def test_get_token():
current_token = GithubAccount.get_token(0)
for i in range(1, 100):
new_token = GithubAccount.get_token(i)
assert new_token != None
assert new_token != current_token
current_to... | 0 | 0 | 0 | 0 | 0 | 231 | 0 | 35 | 45 |
4f5acb019d28b5b4400ff2869aea7212d53840ee | 2,572 | py | Python | aiida_fleur/tests/old_todo/util/btest_extract_corelevels.py | anoopkcn/aiida-fleur | 5d4cc2092b7c3ce5402f1d4b89787eae53b2e60f | [
"MIT"
] | null | null | null | aiida_fleur/tests/old_todo/util/btest_extract_corelevels.py | anoopkcn/aiida-fleur | 5d4cc2092b7c3ce5402f1d4b89787eae53b2e60f | [
"MIT"
] | null | null | null | aiida_fleur/tests/old_todo/util/btest_extract_corelevels.py | anoopkcn/aiida-fleur | 5d4cc2092b7c3ce5402f1d4b89787eae53b2e60f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import time
from aiida_fleur.calculation.fleur import FleurCalculation as FleurCalc
from aiida_fleur_ad.util.extract_corelevels import extract_corelevels
from aiida.orm import load_node
from aiida.plugins import DataFacto... | 31.753086 | 101 | 0.71112 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import time
from aiida_fleur.calculation.fleur import FleurCalculation as FleurCalc
from aiida_fleur_ad.util.extract_corelevels import extract_corelevels
from aiida.orm import load_node
from aiida.orm... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 110 |
1862f570098bf9777d078a89b69ddd8cec2d7b28 | 866 | py | Python | vulture-whitelist.py | lschmelzeisen/wallcrop | e6ab84154d2135f27609f9d29cec67c265b2744a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vulture-whitelist.py | lschmelzeisen/wallcrop | e6ab84154d2135f27609f9d29cec67c265b2744a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vulture-whitelist.py | lschmelzeisen/wallcrop | e6ab84154d2135f27609f9d29cec67c265b2744a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | _.error_on_external_run # unused attribute (/home/lschmelzeisen/Repositories/wallcrop/noxfile.py:20)
_.reuse_existing_virtualenvs # unused attribute (/home/lschmelzeisen/Repositories/wallcrop/noxfile.py:21)
_.stop_on_first_error # unused attribute (/home/lschmelzeisen/Repositories/wallcrop/noxfile.py:22)
test # unu... | 86.6 | 106 | 0.818707 | _.error_on_external_run # unused attribute (/home/lschmelzeisen/Repositories/wallcrop/noxfile.py:20)
_.reuse_existing_virtualenvs # unused attribute (/home/lschmelzeisen/Repositories/wallcrop/noxfile.py:21)
_.stop_on_first_error # unused attribute (/home/lschmelzeisen/Repositories/wallcrop/noxfile.py:22)
test # unu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
275b5ff1364981691bfaac1373fc1cb3eabb0e29 | 1,911 | py | Python | src/rdiff_trimmer/rdiff_api.py | Bystroushaak/rsync_trimmer | 76c7712c2a17f65b9ea78cedceb23dd7b813cac9 | [
"MIT"
] | null | null | null | src/rdiff_trimmer/rdiff_api.py | Bystroushaak/rsync_trimmer | 76c7712c2a17f65b9ea78cedceb23dd7b813cac9 | [
"MIT"
] | 3 | 2018-05-13T10:07:46.000Z | 2020-09-26T08:02:53.000Z | src/rdiff_trimmer/rdiff_api.py | Bystroushaak/rsync_trimmer | 76c7712c2a17f65b9ea78cedceb23dd7b813cac9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 28.522388 | 79 | 0.651491 | # -*- coding: utf-8 -*-
import os
from shutil import rmtree
from tempfile import mkdtemp
import sh
class Increment(object):
def __init__(self, timestamp):
self.timestamp = timestamp
@staticmethod
def from_string(line):
timestamp = int(line.strip().split()[0])
return Increment(tim... | 0 | 104 | 0 | 1,659 | 0 | 0 | 0 | -13 | 135 |
f873716be2968a4a6ca7a9432ece2b12fa23016c | 50 | py | Python | tfsnippet/__init__.py | TsingHuasuya/tfsnippet | 3f51f704e09c654eaf39e231948efed2868669fd | [
"MIT"
] | null | null | null | tfsnippet/__init__.py | TsingHuasuya/tfsnippet | 3f51f704e09c654eaf39e231948efed2868669fd | [
"MIT"
] | null | null | null | tfsnippet/__init__.py | TsingHuasuya/tfsnippet | 3f51f704e09c654eaf39e231948efed2868669fd | [
"MIT"
] | 1 | 2020-02-08T15:33:41.000Z | 2020-02-08T15:33:41.000Z | __version__ = '0.1.1'
| 12.5 | 26 | 0.72 | __version__ = '0.1.1'
from .config import config
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
b248ce9c77029f8aa85d3fe83fbadb996063da4b | 19,117 | py | Python | vamb/encode.py | AndreLamurias/vamb | de5fe2c4c244ba5d6bc3fc44d3cf8ddb8afd9bbb | [
"MIT"
] | 111 | 2019-06-22T15:10:06.000Z | 2022-03-29T06:08:27.000Z | vamb/encode.py | AndreLamurias/vamb | de5fe2c4c244ba5d6bc3fc44d3cf8ddb8afd9bbb | [
"MIT"
] | 86 | 2019-06-22T02:29:30.000Z | 2022-03-31T06:56:18.000Z | vamb/encode.py | AndreLamurias/vamb | de5fe2c4c244ba5d6bc3fc44d3cf8ddb8afd9bbb | [
"MIT"
] | 32 | 2019-08-28T09:53:18.000Z | 2022-03-26T03:30:52.000Z | __doc__ = """Encode a depths matrix and a tnf matrix to latent representation.
Creates a variational autoencoder in PyTorch and tries to represent the depths
and tnf in the latent space under gaussian noise.
Usage:
>>> vae = VAE(nsamples=6)
>>> dataloader, mask = make_dataloader(depths, tnf)
>>> vae.trainmodel(datalo... | 38.005964 | 106 | 0.60883 | __doc__ = """Encode a depths matrix and a tnf matrix to latent representation.
Creates a variational autoencoder in PyTorch and tries to represent the depths
and tnf in the latent space under gaussian noise.
Usage:
>>> vae = VAE(nsamples=6)
>>> dataloader, mask = make_dataloader(depths, tnf)
>>> vae.trainmodel(datalo... | 0 | 1,063 | 0 | 14,167 | 0 | 0 | 0 | 59 | 113 |
1c9f8d1747cae17c8c78cecbf90c7edeb9dac8dc | 494 | py | Python | ports/devel/py-evdev/dragonfly/patch-evdev_genecodes.py | liweitianux/DeltaPorts | b907de0ceb9c0e46ae8961896e97b361aa7c62c0 | [
"BSD-2-Clause-FreeBSD"
] | 31 | 2015-02-06T17:06:37.000Z | 2022-03-08T19:53:28.000Z | ports/devel/py-evdev/dragonfly/patch-evdev_genecodes.py | liweitianux/DeltaPorts | b907de0ceb9c0e46ae8961896e97b361aa7c62c0 | [
"BSD-2-Clause-FreeBSD"
] | 236 | 2015-06-29T19:51:17.000Z | 2021-12-16T22:46:38.000Z | ports/devel/py-evdev/dragonfly/patch-evdev_genecodes.py | liweitianux/DeltaPorts | b907de0ceb9c0e46ae8961896e97b361aa7c62c0 | [
"BSD-2-Clause-FreeBSD"
] | 52 | 2015-02-06T17:05:36.000Z | 2021-10-21T12:13:06.000Z | --- evdev/genecodes.py.orig 2020-11-02 00:44:50 UTC
+++ evdev/genecodes.py
@@ -20,7 +20,7 @@ if sys.argv[1:]:
#-----------------------------------------------------------------------------
-macro_regex = r'#define +((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)'
+macro_regex = r'#de... | 41.166667 | 112 | 0.550607 | --- evdev/genecodes.py.orig 2020-11-02 00:44:50 UTC
+++ evdev/genecodes.py
@@ -20,7 +20,7 @@ if sys.argv[1:]:
#-----------------------------------------------------------------------------
-macro_regex = r'#define +((?:KEY|ABS|REL|SW|MSC|LED|BTN|REP|SND|ID|EV|BUS|SYN|FF|UI_FF|INPUT_PROP)_\w+)'
+macro_regex = r'#de... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07912828a9b33e98f4d3e85614bbb7ab0d4d3836 | 5,591 | py | Python | real_time_dtln_audio.py | SaneBow/DTLN | e99eab9a9df73a755bbe42ea88684e74e9846d98 | [
"MIT"
] | null | null | null | real_time_dtln_audio.py | SaneBow/DTLN | e99eab9a9df73a755bbe42ea88684e74e9846d98 | [
"MIT"
] | null | null | null | real_time_dtln_audio.py | SaneBow/DTLN | e99eab9a9df73a755bbe42ea88684e74e9846d98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is a real time example how to implement DTLN tf light model with
sounddevice. The script is based on the "wire.py" example of the sounddevice
toolbox. If the command line shows "input underflow", restart the script.
If there are still a lot of dropouts, increase... | 35.386076 | 114 | 0.712753 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is a real time example how to implement DTLN tf light model with
sounddevice. The script is based on the "wire.py" example of the sounddevice
toolbox. If the command line shows "input underflow", restart the script.
If there are still a lot of dropouts, increase... | 0 | 0 | 0 | 0 | 0 | 1,962 | 0 | 0 | 23 |
ba0a18c2d98cb16e290ceb4abec1776ac765d3c7 | 1,198 | py | Python | ExPropostos2.py | DaviRestani/C111 | 9d2f550727cd66ecdc4b4834f56f3d3f6836af97 | [
"MIT"
] | null | null | null | ExPropostos2.py | DaviRestani/C111 | 9d2f550727cd66ecdc4b4834f56f3d3f6836af97 | [
"MIT"
] | null | null | null | ExPropostos2.py | DaviRestani/C111 | 9d2f550727cd66ecdc4b4834f56f3d3f6836af97 | [
"MIT"
] | null | null | null | import numpy as np
print("---------Exercicios propostos 2---------")
#Definindo a seed
#np.random.seed(5)
#Exercicio 1
print("------------------------Exercicio 1------------------------")
arr1 = np.random.randn(10)
print("Array 1:",arr1)
arr2 = arr1 * 100
print("Array 2:",arr2)
arr3 = arr2.astype(int)
print("Array 3... | 26.043478 | 83 | 0.575125 | import numpy as np
print("---------Exercicios propostos 2---------")
#Definindo a seed
#np.random.seed(5)
#Exercicio 1
print("------------------------Exercicio 1------------------------")
arr1 = np.random.randn(10)
print("Array 1:",arr1)
arr2 = arr1 * 100
print("Array 2:",arr2)
arr3 = arr2.astype(int)
print("Array 3... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fc0af3ff0a0a99f4bf925fd1de2e01aabbf8da8b | 848 | py | Python | tests/regression.py | bigdata-memory/sgx-ra-tls | fb1c5658b5681a764071810e392073e0cd2a94ee | [
"Apache-2.0"
] | 97 | 2018-01-08T23:54:36.000Z | 2022-02-17T06:03:54.000Z | tests/regression.py | bigdata-memory/sgx-ra-tls | fb1c5658b5681a764071810e392073e0cd2a94ee | [
"Apache-2.0"
] | 25 | 2018-08-06T23:45:08.000Z | 2021-10-12T16:54:43.000Z | tests/regression.py | bigdata-memory/sgx-ra-tls | fb1c5658b5681a764071810e392073e0cd2a94ee | [
"Apache-2.0"
] | 31 | 2018-01-10T07:45:08.000Z | 2022-01-25T05:57:52.000Z | #!/usr/bin/env python3
if __name__ == '__main__':
main()
| 21.2 | 56 | 0.537736 | #!/usr/bin/env python3
import glob
import imp
import os
import sys
def determine_testcases():
tcs = []
py_files = []
if len(sys.argv) > 1:
py_files = sys.argv[1:]
else:
py_files = glob.glob('tests/[0-9]*.py')
print(py_files)
for f in py_files:
modname = os... | 0 | 0 | 0 | 0 | 0 | 695 | 0 | -44 | 135 |
e2bc99d999bd505438da73e937491585ec2258f4 | 18,858 | py | Python | prep_scripts/prep_tcga_clinical.py | dfci/hotspot_logreg | fbd5585e69b39c54637ac240d23f974c5ae6e996 | [
"MIT"
] | null | null | null | prep_scripts/prep_tcga_clinical.py | dfci/hotspot_logreg | fbd5585e69b39c54637ac240d23f974c5ae6e996 | [
"MIT"
] | null | null | null | prep_scripts/prep_tcga_clinical.py | dfci/hotspot_logreg | fbd5585e69b39c54637ac240d23f974c5ae6e996 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
"""
SYNOPSIS
Prepare the TCGA BRCA Clinical data into a format that is suitable for input
into the Hotspots 'Mutation_Counts' pipeline.
NOTES
(1) Data source:
- Supplementary Table 1 of the Cell 2015 Paper:
http://www.nature.com/nature/journal/v490/n7418/ful... | 42.09375 | 134 | 0.653834 | #!/usr/bin/env python2
"""
SYNOPSIS
Prepare the TCGA BRCA Clinical data into a format that is suitable for input
into the Hotspots 'Mutation_Counts' pipeline.
NOTES
(1) Data source:
- Supplementary Table 1 of the Cell 2015 Paper:
http://www.nature.com/nature/journal/v490/n7418/ful... | 0 | 0 | 0 | 0 | 0 | 1,014 | 0 | 0 | 23 |
a4cf4bd029d322e4c371f6b10506c55279d40509 | 6,099 | py | Python | UkDatabaseCrawler/UkDatabase/spiders/uk_database_posts.py | kplachkov/UkDatabase | 51db3183a86d3b07e0f97cc685f6f47ad4a8fc2e | [
"Apache-2.0"
] | null | null | null | UkDatabaseCrawler/UkDatabase/spiders/uk_database_posts.py | kplachkov/UkDatabase | 51db3183a86d3b07e0f97cc685f6f47ad4a8fc2e | [
"Apache-2.0"
] | 3 | 2018-04-02T20:32:51.000Z | 2019-02-09T16:19:39.000Z | UkDatabaseCrawler/UkDatabase/spiders/uk_database_posts.py | kplachkov/UkDatabase | 51db3183a86d3b07e0f97cc685f6f47ad4a8fc2e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 37.648148 | 110 | 0.546155 | # -*- coding: utf-8 -*-
from datetime import datetime
import scrapy
from bs4 import BeautifulSoup
class UkDatabaseSpider(scrapy.Spider):
"""Collect information about people."""
name = "uk_database_posts"
"""str: The name of the spider."""
allowed_domains = ["theukdatabase.com"]
"""list: Allowed ... | 0 | 4,344 | 0 | 1,632 | 0 | 0 | 0 | 8 | 90 |
0eb218bad047b1ca68c4782bdd031e0b545913ff | 1,593 | py | Python | tests/query_test/test_local_fs.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 1,523 | 2015-01-01T03:42:24.000Z | 2022-02-06T22:24:04.000Z | tests/query_test/test_local_fs.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 10 | 2015-01-09T06:46:05.000Z | 2022-03-29T21:57:57.000Z | tests/query_test/test_local_fs.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | 647 | 2015-01-02T04:01:40.000Z | 2022-03-30T15:57:35.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.846154 | 77 | 0.780917 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 387 | 0 | 210 | 0 | 0 | 0 | 92 | 67 |
8a2a864a8c1d9319292f8845f8b5444c17a7e11f | 457 | py | Python | Core Concepts/Deep Learning/1_forward_progation.py | WyckliffeAluga/data-chronicles | 5219fe9cdbafb9fd7be88727483952c4c13f2790 | [
"MIT"
] | null | null | null | Core Concepts/Deep Learning/1_forward_progation.py | WyckliffeAluga/data-chronicles | 5219fe9cdbafb9fd7be88727483952c4c13f2790 | [
"MIT"
] | null | null | null | Core Concepts/Deep Learning/1_forward_progation.py | WyckliffeAluga/data-chronicles | 5219fe9cdbafb9fd7be88727483952c4c13f2790 | [
"MIT"
] | 1 | 2021-02-09T12:22:55.000Z | 2021-02-09T12:22:55.000Z | import numpy as np
input_data = np.array([2,3])
weights = {
'node_0':np.array([1,1]),
'node_1':np.array([-1,1]),
'output':np.array([2,-1])
}
node_0_value = (input_data * weights['node_0']).sum()
node_1_value = (input_data * weights['node_1']).sum()
hidden_layer_values = np.a... | 22.85 | 61 | 0.630197 | import numpy as np
input_data = np.array([2,3])
weights = {
'node_0':np.array([1,1]),
'node_1':np.array([-1,1]),
'output':np.array([2,-1])
}
node_0_value = (input_data * weights['node_0']).sum()
node_1_value = (input_data * weights['node_1']).sum()
hidden_layer_values = np.a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bd2a8be5f2509570872af94eb6112b69ff165a64 | 85 | py | Python | Course 202009/Python/Scrapy/xuetang/begin.py | Seizzzz/DailyCodes | 9a617fb64ee27b9f254be161850e9c9a61747cb1 | [
"MIT"
] | null | null | null | Course 202009/Python/Scrapy/xuetang/begin.py | Seizzzz/DailyCodes | 9a617fb64ee27b9f254be161850e9c9a61747cb1 | [
"MIT"
] | null | null | null | Course 202009/Python/Scrapy/xuetang/begin.py | Seizzzz/DailyCodes | 9a617fb64ee27b9f254be161850e9c9a61747cb1 | [
"MIT"
] | null | null | null | from scrapy import cmdline
cmdline.execute("scrapy crawl xtzx -o result.csv".split()) | 42.5 | 58 | 0.788235 | from scrapy import cmdline
cmdline.execute("scrapy crawl xtzx -o result.csv".split()) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
afd0753e8e33558fd2cb0adbe79b2cab71d1426c | 562 | py | Python | setup.py | tsupei/treeviz | 47c2d840982d95a80381f2114313bd32f231ab88 | [
"MIT"
] | 6 | 2019-11-02T09:26:41.000Z | 2021-03-13T15:26:49.000Z | setup.py | tsupei/treeviz | 47c2d840982d95a80381f2114313bd32f231ab88 | [
"MIT"
] | null | null | null | setup.py | tsupei/treeviz | 47c2d840982d95a80381f2114313bd32f231ab88 | [
"MIT"
] | null | null | null | from distutils.core import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name = 'treeviz',
packages = ['treeviz'],
version = '1.1',
license='MIT',
description = 'Print tree in bash manner',
author = 'Chen Tsu Pei',
author_email = 'a5560648@gmail.com',
url = 'https://... | 26.761905 | 71 | 0.683274 | from distutils.core import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name = 'treeviz',
packages = ['treeviz'],
version = '1.1',
license='MIT',
description = 'Print tree in bash manner',
author = 'Chen Tsu Pei',
author_email = 'a5560648@gmail.com',
url = 'https://... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5adcecdec80e992e865b9182c527169e9d40330 | 2,874 | py | Python | jasonParser.py | ibrahimsh/final-project-software-programming | 13defea94b98b8772d8301bff32ad2136e6261f5 | [
"Apache-2.0"
] | null | null | null | jasonParser.py | ibrahimsh/final-project-software-programming | 13defea94b98b8772d8301bff32ad2136e6261f5 | [
"Apache-2.0"
] | 5 | 2015-04-30T12:46:05.000Z | 2015-04-30T13:34:00.000Z | jasonParser.py | ibrahimsh/final-project-software-programming | 13defea94b98b8772d8301bff32ad2136e6261f5 | [
"Apache-2.0"
] | null | null | null | __author__ = 'MatrixRev'
import json
import codecs
import os
#path = u"C://Users//MatrixRev//Desktop//library_5//"
path="C://Users//MatrixRev//Desktop//mainLib//" # input file
outFile='C:/Users/MatrixRev/Desktop/books/output/mainsubjects.txt' #output file
pathNew = u"C://Users//MatrixRev//Desktop//newOut"
counter=0
... | 40.478873 | 126 | 0.479471 | __author__ = 'MatrixRev'
import json
import codecs
import glob
import os
import sys
#path = u"C://Users//MatrixRev//Desktop//library_5//"
path="C://Users//MatrixRev//Desktop//mainLib//" # input file
outFile='C:/Users/MatrixRev/Desktop/books/output/mainsubjects.txt' #output file
pathNew = u"C://Users//MatrixRev//Deskt... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -21 | 44 |
e84df9dae610f2465c8309e92c32430fc6ed2e22 | 1,955 | py | Python | data/compress.py | Catosine/GDAS | da047fe30b5aeeb1121861458ad61fd7c171874e | [
"MIT"
] | 20 | 2019-10-10T07:13:27.000Z | 2022-03-25T11:33:16.000Z | data/compress.py | BaiYuYuan/GDAS | 5eed8101a78d223a20a43494176051298b24ac3a | [
"MIT"
] | null | null | null | data/compress.py | BaiYuYuan/GDAS | 5eed8101a78d223a20a43494176051298b24ac3a | [
"MIT"
] | 6 | 2020-04-21T14:52:02.000Z | 2021-08-05T15:00:22.000Z | # python ./data/compress.py $TORCH_HOME/ILSVRC2012/ $TORCH_HOME/ILSVRC2012-TAR tar
# python ./data/compress.py $TORCH_HOME/ILSVRC2012/ $TORCH_HOME/ILSVRC2012-ZIP zip
import sys
from pathlib import Path
if __name__ == '__main__':
assert len(sys.argv) == 4, 'invalid argv : {:}'.format(sys.argv)
source, destinatio... | 50.128205 | 183 | 0.652174 | # python ./data/compress.py $TORCH_HOME/ILSVRC2012/ $TORCH_HOME/ILSVRC2012-TAR tar
# python ./data/compress.py $TORCH_HOME/ILSVRC2012/ $TORCH_HOME/ILSVRC2012-ZIP zip
import os, sys
from pathlib import Path
def command(prefix, cmd):
print ('{:}{:}'.format(prefix, cmd))
os.system(cmd)
def main(source, destination... | 0 | 0 | 0 | 0 | 0 | 1,503 | 0 | 4 | 46 |
18c4f10879cd2e41a1c2e314d35e296837a1a82d | 2,934 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/ansible/utils/plugins/test/ipv6_ipv4_mapped.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/ansible/utils/plugins/test/ipv6_ipv4_mapped.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/ansible/utils/plugins/test/ipv6_ipv4_mapped.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
Test plugin file for netaddr tests: ipv6_ipv4_mapped
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
n... | 26.432432 | 96 | 0.621336 | # -*- coding: utf-8 -*-
# Copyright 2021 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
Test plugin file for netaddr tests: ipv6_ipv4_mapped
"""
from __future__ import absolute_import, division, print_function
from ansible_collections.ansible.utils.plugins.p... | 0 | 335 | 0 | 141 | 0 | 0 | 0 | 127 | 68 |
786fe6aeaee7a9de033be18da427dde43002880f | 1,844 | py | Python | tests/unit/test_auth_merge.py | neuro-inc/neuro-extras | cc42fdeff3b993b099850769b3f65a59c29815e7 | [
"Apache-2.0"
] | 2 | 2020-11-02T21:41:15.000Z | 2020-11-03T01:51:31.000Z | tests/unit/test_auth_merge.py | neuro-inc/neuro-extras | cc42fdeff3b993b099850769b3f65a59c29815e7 | [
"Apache-2.0"
] | 137 | 2020-09-29T12:03:45.000Z | 2022-03-31T03:11:35.000Z | tests/unit/test_auth_merge.py | neuro-inc/neuro-extras | cc42fdeff3b993b099850769b3f65a59c29815e7 | [
"Apache-2.0"
] | null | null | null | import logging
from pathlib import Path
TEST_ASSETS_ROOT = (Path(__file__).parent.parent / "assets").resolve()
NEURO_EXTRAS_ROOT = Path(__file__).parent.parent.parent / "neuro_extras"
LOGGER = logging.getLogger(__name__)
| 35.461538 | 82 | 0.706616 | import json
import logging
import os
import subprocess
import sys
from pathlib import Path
import pytest
from deepdiff import DeepDiff
TEST_ASSETS_ROOT = (Path(__file__).parent.parent / "assets").resolve()
NEURO_EXTRAS_ROOT = Path(__file__).parent.parent.parent / "neuro_extras"
LOGGER = logging.getLogger(__name__)
... | 0 | 1,501 | 0 | 0 | 0 | 0 | 0 | -37 | 156 |
51c067b62e55ecdf06e45c874e8c006c2a122ab2 | 1,285 | py | Python | setup.py | easybe/kTorrent | 432b3e1c29c407fc15393409f28a4bb8c95dc236 | [
"MIT"
] | 7 | 2015-11-14T20:28:32.000Z | 2016-10-22T01:04:00.000Z | setup.py | easybe/kTorrent | 432b3e1c29c407fc15393409f28a4bb8c95dc236 | [
"MIT"
] | 1 | 2015-11-14T20:30:05.000Z | 2015-11-16T13:50:29.000Z | setup.py | easybe/kTorrent | 432b3e1c29c407fc15393409f28a4bb8c95dc236 | [
"MIT"
] | 7 | 2015-12-06T13:10:05.000Z | 2021-03-16T10:14:55.000Z | from setuptools import setup
setup(
name='ktorrent',
version='0.4.7',
description='Fetches and parses data from Kickass Torrents.',
long_description=open('README.rst').read(),
license='MIT',
author='Udit Vasu',
author_email='admin@codenirvana.in',
url='https://github.com/codenirvana/kTo... | 33.815789 | 71 | 0.595331 | from setuptools import setup
setup(
name='ktorrent',
version='0.4.7',
description='Fetches and parses data from Kickass Torrents.',
long_description=open('README.rst').read(),
license='MIT',
author='Udit Vasu',
author_email='admin@codenirvana.in',
url='https://github.com/codenirvana/kTo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10f2e068e2a87600e7b9e2637711d264a1a1c769 | 1,548 | py | Python | ocr/utils/dataset.py | anhlt/ocr | df516c51bdf1e62785d4e5c879315413258738af | [
"MIT"
] | null | null | null | ocr/utils/dataset.py | anhlt/ocr | df516c51bdf1e62785d4e5c879315413258738af | [
"MIT"
] | null | null | null | ocr/utils/dataset.py | anhlt/ocr | df516c51bdf1e62785d4e5c879315413258738af | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
SOS_token = 0
EOS_token = 1
| 27.157895 | 80 | 0.665375 | from torch.utils.data.dataset import Dataset
import os
import json
from PIL import Image
from torchvision import transforms
import logging
import numpy as np
import torch
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
SOS_token = 0
EOS_token = 1
class OCRDataset(Dataset):
def __init__(self,... | 0 | 0 | 0 | 962 | 0 | 246 | 0 | 2 | 223 |
d5c447b90d53d395016801b58991e1d0e1d50b4b | 11,936 | py | Python | cinder/tests/unit/volume/flows/test_create_volume_flow.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/flows/test_create_volume_flow.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/flows/test_create_volume_flow.py | potsmaster/cinder | 275c2acdfb4282b0ec0314c9875b759958c093f8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Canonical Ltd.
# 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 b... | 42.176678 | 79 | 0.603552 | # Copyright 2013 Canonical Ltd.
# 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 b... | 0 | 9,365 | 0 | 1,304 | 0 | 0 | 0 | 259 | 335 |
fbf6d66cae31bca840f6d736dcc20928c941375a | 2,863 | py | Python | create_balanced_classes.py | hoytak/diabetic-retinopathy-code-private | fc17020fc33ea05f3add8340d8f64e0a25cd7787 | [
"MIT"
] | 103 | 2015-03-16T20:50:28.000Z | 2022-01-23T02:14:37.000Z | create_balanced_classes.py | hoytak/diabetic-retinopathy-code-private | fc17020fc33ea05f3add8340d8f64e0a25cd7787 | [
"MIT"
] | null | null | null | create_balanced_classes.py | hoytak/diabetic-retinopathy-code-private | fc17020fc33ea05f3add8340d8f64e0a25cd7787 | [
"MIT"
] | 79 | 2015-03-17T09:25:15.000Z | 2021-05-20T22:57:03.000Z | import graphlab as gl
import re
import random
from copy import copy
import os
import graphlab.aggregate as agg
import array
import numpy as np
import sys
# Run this script in the same directory as the
train_path = "image-sframes/train-%d/"
valid_path = "image-sframes/validation-%d/"
X_data = gl.SFrame("image-sframe... | 28.919192 | 105 | 0.654558 | import graphlab as gl
import re
import random
from copy import copy
import os
import graphlab.aggregate as agg
import array
import numpy as np
import sys
# Run this script in the same directory as the
train_path = "image-sframes/train-%d/"
valid_path = "image-sframes/validation-%d/"
X_data = gl.SFrame("image-sframe... | 0 | 0 | 0 | 0 | 0 | 440 | 0 | 0 | 23 |
29943cd62bab8fad145cb0653ab7587ac74c4c24 | 1,258 | py | Python | main.py | xopherw/MarketWatch-API | 4d36da8340014ed4db9da20500c8698bdde236fd | [
"MIT"
] | null | null | null | main.py | xopherw/MarketWatch-API | 4d36da8340014ed4db9da20500c8698bdde236fd | [
"MIT"
] | null | null | null | main.py | xopherw/MarketWatch-API | 4d36da8340014ed4db9da20500c8698bdde236fd | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
app.config['JSON_SORT_KEYS'] = False
if(__name__ == "__main__"):
app.run(debug=True) | 29.255814 | 64 | 0.604928 | from flask import Flask, request, abort, jsonify, Response, json
from marketwatch import marketwatch as MW
from error import Error
app = Flask(__name__)
app.config['JSON_SORT_KEYS'] = False
@app.route('/stock')
def ticker():
ticker = request.args.get('ticker', default='')
data = MW(ticker).data()
json_dat... | 0 | 969 | 0 | 0 | 0 | 0 | 0 | 63 | 90 |
b9f9d8237c315cbefc02573ccdec0ebade8aa1e8 | 609 | py | Python | setup.py | muma7490/PyDIAMONDS-Background | 769a8ad57003a7d342d5e21c0f6fa74fb74821c1 | [
"MIT"
] | null | null | null | setup.py | muma7490/PyDIAMONDS-Background | 769a8ad57003a7d342d5e21c0f6fa74fb74821c1 | [
"MIT"
] | 10 | 2017-09-28T13:45:11.000Z | 2017-10-11T12:32:58.000Z | setup.py | muma7490/PyDIAMONDS-Background | 769a8ad57003a7d342d5e21c0f6fa74fb74821c1 | [
"MIT"
] | null | null | null | from setuptools import setup
name = 'pyDiamondsBackground'
version = '1.1'
release = '1.1.0'
setup(
name=name,
author='Marco Muellner',
author_email='muellnermarco@gmail.com',
version='1.1.2',
packages=['pyDiamondsBackground','pyDiamondsBackground/models'],
licencse = 'MIT',
description='... | 26.478261 | 110 | 0.678161 | from setuptools import setup
name = 'pyDiamondsBackground'
version = '1.1'
release = '1.1.0'
setup(
name=name,
author='Marco Muellner',
author_email='muellnermarco@gmail.com',
version='1.1.2',
packages=['pyDiamondsBackground','pyDiamondsBackground/models'],
licencse = 'MIT',
description='... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0485649b132d40045e1554f5311ae8d3d48fdcfd | 608 | py | Python | samples/log_reg.py | ml-uem/data-sci-lab | ddc1d2aed28538a7fbf53ff1d26356fd8b8f0a9e | [
"MIT"
] | 2 | 2020-01-12T23:24:53.000Z | 2020-01-17T18:15:22.000Z | samples/log_reg.py | ml-uem/data-sci-lab | ddc1d2aed28538a7fbf53ff1d26356fd8b8f0a9e | [
"MIT"
] | 28 | 2020-01-11T10:54:39.000Z | 2020-02-28T18:00:58.000Z | samples/log_reg.py | ml-uem/data-sci-lab | ddc1d2aed28538a7fbf53ff1d26356fd8b8f0a9e | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
X, y = load_data()
main(X, y)
| 19 | 63 | 0.592105 | import numpy as np
import pandas as pd
from mluem import LogisticRegression as LogReg
def main(X, y):
model = LogReg(1, 10, 2)
model.fit(X, y.T)
prediction = model.predict(X)
score = model.score(X, y.T)
print('prediction =>', prediction)
print('score =>', score)
def load_data():
filep... | 0 | 0 | 0 | 0 | 0 | 399 | 0 | 20 | 112 |
a04d8fc2d4997aee687d2050d55e49f8d4373062 | 2,185 | py | Python | cloud/tune_hparams.py | aleksandrinvictor/drivendata-cloud | f85ac074cd9ace60aa4087d27fa281a931597e55 | [
"MIT"
] | null | null | null | cloud/tune_hparams.py | aleksandrinvictor/drivendata-cloud | f85ac074cd9ace60aa4087d27fa281a931597e55 | [
"MIT"
] | null | null | null | cloud/tune_hparams.py | aleksandrinvictor/drivendata-cloud | f85ac074cd9ace60aa4087d27fa281a931597e55 | [
"MIT"
] | null | null | null |
import optuna
import yaml
if __name__ == "__main__":
with open("config.yml", "r") as f:
cfg = yaml.safe_load(f)
pruner: optuna.pruners.BasePruner = optuna.pruners.MedianPruner()
study = optuna.create_study(direction="maximize", pruner=pruner)
study.optimize(lambda x: objective(x, cfg), n_t... | 33.106061 | 80 | 0.675973 | from copy import deepcopy
from typing import Any, Dict
import optuna
import yaml
from optuna.integration import PyTorchLightningPruningCallback
from pytorch_lightning import Trainer, seed_everything
from cloud.dataset import CloudDataModule
from cloud.model import Cloud
def objective(trial: optuna.trial.Trial, cfg:... | 0 | 0 | 0 | 0 | 0 | 1,298 | 0 | 113 | 156 |
e8dc80c1d3c7281f032270c4ab7f6bca23582ec8 | 2,739 | py | Python | src/server/board_assets.py | vertumno/vocal | 168f3578d93de9d6e2cbb91f2db959de962ce37b | [
"MIT"
] | null | null | null | src/server/board_assets.py | vertumno/vocal | 168f3578d93de9d6e2cbb91f2db959de962ce37b | [
"MIT"
] | null | null | null | src/server/board_assets.py | vertumno/vocal | 168f3578d93de9d6e2cbb91f2db959de962ce37b | [
"MIT"
] | null | null | null | import Adafruit_BBIO.GPIO as GPIO
# Dictionary with the PIN number associated to each room
house = {
"KITCHEN": "P9_12",
"BATHROOM": "P9_15",
"LIVINGROOM": "P9_42"
}
def get_status(pin_number):
"""Verify the status of the GPIO pin with number equal to `pin_number`.
Parameters
----------
pin_number : str
Th... | 20.440299 | 90 | 0.678715 | import Adafruit_BBIO.GPIO as GPIO
# Dictionary with the PIN number associated to each room
house = {
"KITCHEN": "P9_12",
"BATHROOM": "P9_15",
"LIVINGROOM": "P9_42"
}
def get_status(pin_number):
"""Verify the status of the GPIO pin with number equal to `pin_number`.
Parameters
----------
pin_number : str
Th... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bf18e85742c06399d60d9b38f228cd40841c9690 | 12,685 | py | Python | cape_responder/responder_core.py | edwardmjackson/cape-responder | 60e0b2fee2507034aae80691a89b07c8d39fa432 | [
"Apache-2.0"
] | null | null | null | cape_responder/responder_core.py | edwardmjackson/cape-responder | 60e0b2fee2507034aae80691a89b07c8d39fa432 | [
"Apache-2.0"
] | null | null | null | cape_responder/responder_core.py | edwardmjackson/cape-responder | 60e0b2fee2507034aae80691a89b07c8d39fa432 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 BLEMUNDSBURY AI LIMITED
#
# 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 ... | 47.33209 | 121 | 0.630587 | # Copyright 2018 BLEMUNDSBURY AI LIMITED
#
# 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 ... | 0 | 10,593 | 0 | 311 | 0 | 0 | 0 | 397 | 354 |
f8613eef64462503488290cd7035f3213120d27a | 7,129 | py | Python | src/main/python/variants_pca.py | deflaux/spark-examples | 5e009fcab4fd13044a58f7fcf1fe0ad1b68d28a6 | [
"Apache-2.0"
] | 61 | 2015-01-13T11:49:49.000Z | 2020-10-22T09:53:14.000Z | src/main/python/variants_pca.py | deflaux/spark-examples | 5e009fcab4fd13044a58f7fcf1fe0ad1b68d28a6 | [
"Apache-2.0"
] | 31 | 2015-01-01T17:56:45.000Z | 2016-06-21T20:50:38.000Z | src/main/python/variants_pca.py | deflaux/spark-examples | 5e009fcab4fd13044a58f7fcf1fe0ad1b68d28a6 | [
"Apache-2.0"
] | 31 | 2015-01-23T06:37:57.000Z | 2020-07-05T22:06:43.000Z | # spark-submit --jars googlegenomics-spark-examples-assembly-1.0.jar \
# --driver-class-path googlegenomics-spark-examples-assembly-1.0.jar \
# src/main/python/variants_pca.py --client-secrets client_secrets.json
import json
import numpy
import operator
import sys
import pyspark
from pyspark import serializers... | 35.292079 | 80 | 0.662926 | # spark-submit --jars googlegenomics-spark-examples-assembly-1.0.jar \
# --driver-class-path googlegenomics-spark-examples-assembly-1.0.jar \
# src/main/python/variants_pca.py --client-secrets client_secrets.json
import json
import numpy
import operator
import sys
import pyspark
from pyspark import serializers... | 0 | 0 | 0 | 0 | 929 | 2,079 | 0 | 0 | 73 |
853fb99d2164e2dd9446025b29e70b1c84a7ae1c | 4,664 | py | Python | payments/views.py | oversabiproject/ghostrr | 0bf49537ddf0436d08d705b29bffbd49b66e7c65 | [
"MIT"
] | null | null | null | payments/views.py | oversabiproject/ghostrr | 0bf49537ddf0436d08d705b29bffbd49b66e7c65 | [
"MIT"
] | null | null | null | payments/views.py | oversabiproject/ghostrr | 0bf49537ddf0436d08d705b29bffbd49b66e7c65 | [
"MIT"
] | null | null | null | # payments/views.py
# new
| 37.918699 | 198 | 0.649014 | # payments/views.py
import stripe
import json
from django.conf import settings # new
from django.contrib.sites.shortcuts import get_current_site
from django.http.response import JsonResponse, HttpResponse
from django.views.decorators.csrf import csrf_exempt # new
from django.views.generic.base import TemplateView
fro... | 0 | 3,240 | 0 | 925 | 0 | 0 | 0 | 140 | 327 |
75c93999fa4977b8c68eb27d0e640428e6ca5a1c | 3,082 | py | Python | main.py | th0mas-w/Wordle | 5ace04bd009da55ae7d43eed3bc13a1893609e4d | [
"MIT"
] | null | null | null | main.py | th0mas-w/Wordle | 5ace04bd009da55ae7d43eed3bc13a1893609e4d | [
"MIT"
] | null | null | null | main.py | th0mas-w/Wordle | 5ace04bd009da55ae7d43eed3bc13a1893609e4d | [
"MIT"
] | null | null | null | import random, sys, pygame as pg
from tkinter import Tk, messagebox
size = width, height = 400,600
pg.init()
Tk().wm_withdraw()
black = 0,0,0
white = 255,255,255
orange = 255,165,0
green = 0,255,0
screen = pg.display.set_mode(size)
pg.display.set_caption("Wordle")
titleFont = pg.font.SysFont("bahnschri... | 34.629213 | 102 | 0.559701 | import random,sys, pygame as pg
from tkinter import Tk,messagebox
size = width, height = 400,600
pg.init()
Tk().wm_withdraw()
black = 0,0,0
white = 255,255,255
orange = 255,165,0
green = 0,255,0
screen = pg.display.set_mode(size)
pg.display.set_caption("Wordle")
titleFont = pg.font.SysFont("bahnschrift... | 0 | 0 | 0 | 523 | 0 | 186 | 0 | -2 | 49 |
3c5bcea151e26e6eb3230ce64f237194c16b667f | 482 | py | Python | lzw3/res/utils.py | Docheinstein/lzw3 | 39098f01b66f8860390123e2662ef0662667748d | [
"MIT"
] | 1 | 2020-06-11T10:16:55.000Z | 2020-06-11T10:16:55.000Z | lzw3/res/utils.py | Docheinstein/LZW3 | 39098f01b66f8860390123e2662ef0662667748d | [
"MIT"
] | 2 | 2019-03-05T22:51:19.000Z | 2021-01-27T22:45:44.000Z | lzw3/res/utils.py | Docheinstein/LZW3 | 39098f01b66f8860390123e2662ef0662667748d | [
"MIT"
] | null | null | null | import pkg_resources
from lzw3.commons.utils import read_textual_file
def read_textual_resource(res: str) -> str:
""" Reads the content of the given resource.
The resource is loaded relatively to the path "res/"
using pkg_resources of setuptools.
Args:
res (str): the path of the resource rel... | 25.368421 | 76 | 0.711618 | import pkg_resources
from lzw3.commons.utils import read_textual_file
def read_textual_resource(res: str) -> str:
""" Reads the content of the given resource.
The resource is loaded relatively to the path "res/"
using pkg_resources of setuptools.
Args:
res (str): the path of the resource rel... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be788a695806f43d2cfba0069186d03b3b2eccb2 | 462,019 | py | Python | NN_layers/SENet154.py | Mxbonn/zigzag_fork | 250ee5e22904ba846dfb106983d46b83bd9ee230 | [
"BSD-3-Clause"
] | 34 | 2020-08-11T14:38:29.000Z | 2022-03-30T10:32:34.000Z | NN_layers/SENet154.py | Mxbonn/zigzag_fork | 250ee5e22904ba846dfb106983d46b83bd9ee230 | [
"BSD-3-Clause"
] | 9 | 2020-11-16T19:19:48.000Z | 2022-03-31T18:29:24.000Z | NN_layers/SENet154.py | Mxbonn/zigzag_fork | 250ee5e22904ba846dfb106983d46b83bd9ee230 | [
"BSD-3-Clause"
] | 18 | 2020-08-24T07:26:51.000Z | 2022-01-06T00:59:11.000Z | layer_info = \
{1: {'B': 1, 'K': 64, 'C': 3, 'OY': 112, 'OX': 112, 'FY': 3, 'FX': 3, 'SY': 2, 'SX': 2, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1},
2: {'B': 1, 'K': 64, 'C': 64, 'OY': 112, 'OX': 112, 'FY': 3, 'FX': 3, 'SY': 1, 'SX': 1, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1},
3: {'B': 1, 'K': 128, 'C': 64, '... | 135.489443 | 140 | 0.343495 | layer_info = \
{1: {'B': 1, 'K': 64, 'C': 3, 'OY': 112, 'OX': 112, 'FY': 3, 'FX': 3, 'SY': 2, 'SX': 2, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1},
2: {'B': 1, 'K': 64, 'C': 64, 'OY': 112, 'OX': 112, 'FY': 3, 'FX': 3, 'SY': 1, 'SX': 1, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1},
3: {'B': 1, 'K': 128, 'C': 64, '... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86386def2e4638a3af0c4558d4a7203f858a527d | 5,474 | py | Python | moya/tests/test_templates.py | moyaproject/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 129 | 2015-02-16T12:02:50.000Z | 2021-11-06T00:20:01.000Z | moya/tests/test_templates.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 5 | 2015-02-19T15:56:41.000Z | 2015-09-08T18:58:35.000Z | moya/tests/test_templates.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 14 | 2015-02-19T17:20:34.000Z | 2022-03-28T01:38:09.000Z | from __future__ import unicode_literals
| 35.545455 | 83 | 0.591706 | from __future__ import unicode_literals
import unittest
import os
import time
from os.path import join
from fs.opener import open_fs
from moya.template.moyatemplates import MoyaTemplateEngine
from moya.archive import Archive
from moya.settings import SettingsContainer
class TestTemplates(unittest.TestCase):
def... | 0 | 0 | 0 | 5,179 | 0 | 0 | 0 | 53 | 201 |
22f7c62e57b2fd7b02f02ae289eed84533770279 | 2,113 | py | Python | nel/features/probability.py | psyML/nel | 5ce1f0b2ef6246f27113ffe2d80d9b95f05f884e | [
"MIT"
] | 196 | 2015-03-17T15:39:00.000Z | 2021-01-07T00:26:17.000Z | nel/features/probability.py | psyML/nel | 5ce1f0b2ef6246f27113ffe2d80d9b95f05f884e | [
"MIT"
] | 28 | 2015-03-17T23:55:38.000Z | 2019-11-12T14:10:02.000Z | nel/features/probability.py | psyML/nel | 5ce1f0b2ef6246f27113ffe2d80d9b95f05f884e | [
"MIT"
] | 52 | 2015-03-06T21:28:03.000Z | 2020-12-06T22:26:15.000Z | #!/usr/bin/env python
from nel import logging
log = logging.getLogger()
| 32.507692 | 80 | 0.672504 | #!/usr/bin/env python
import math
from .feature import Feature
from ..model import disambiguation
from ..process.candidates import CandidateGenerator
from nel import logging
log = logging.getLogger()
class LogFeature(Feature):
def compute(self, doc, chain, candidate, state):
return math.log(self.comp... | 0 | 1,616 | 0 | 226 | 0 | 0 | 0 | 40 | 158 |
b97a73603a7d3561ac43e2d08dd8dc3aa4aefb23 | 3,474 | py | Python | tests/crawler/media/test_sina.py | allenyummy/GoodInfo | 94ab7421d1377450ac4cfdfd6e4667fa52b20d0c | [
"MIT"
] | 1 | 2022-01-17T14:06:27.000Z | 2022-01-17T14:06:27.000Z | tests/crawler/media/test_sina.py | allenyummy/GoodInfo | 94ab7421d1377450ac4cfdfd6e4667fa52b20d0c | [
"MIT"
] | 9 | 2021-08-12T07:39:01.000Z | 2021-08-20T08:38:29.000Z | tests/crawler/media/test_sina.py | allenyummy/GoodInfo | 94ab7421d1377450ac4cfdfd6e4667fa52b20d0c | [
"MIT"
] | 1 | 2022-02-21T15:45:13.000Z | 2022-02-21T15:45:13.000Z | # encoding=utf-8
# Author: Yu-Lun Chiang
# Description: Test NewsCrawler
import logging
from collections import namedtuple
from src.utils.struct import NewsStruct
logger = logging.getLogger(__name__)
TEST_DATA = namedtuple(
typename="TEST_DATA",
field_names=[
"name",
"link",
"expecte... | 45.710526 | 944 | 0.729131 | # encoding=utf-8
# Author: Yu-Lun Chiang
# Description: Test NewsCrawler
import logging
import pytest
from collections import namedtuple
from src.crawler.media import sina
from src.utils.struct import NewsStruct
logger = logging.getLogger(__name__)
TEST_DATA = namedtuple(
typename="TEST_DATA",
field_names=[... | 4,161 | 534 | 0 | 0 | 0 | 0 | 0 | 5 | 90 |
9beaacdc5eb2a0518b1d76b1ec75b584b910a1e8 | 1,418 | py | Python | PMega/Section 16 - OOP/database_interactivity.py | peternewman22/Python_Courses | 07a798b6f264fc6069eb1205c9d429f00fb54bc5 | [
"MIT"
] | null | null | null | PMega/Section 16 - OOP/database_interactivity.py | peternewman22/Python_Courses | 07a798b6f264fc6069eb1205c9d429f00fb54bc5 | [
"MIT"
] | null | null | null | PMega/Section 16 - OOP/database_interactivity.py | peternewman22/Python_Courses | 07a798b6f264fc6069eb1205c9d429f00fb54bc5 | [
"MIT"
] | null | null | null | """
SQL Lite: based on a file rather than a web serviceself.
Therefore, you don't have to have SQL Lite installedself.
You can totally use Python to
Python sends SQL to interact with the DB
5 steps
1. Connect to DB
2. Cursor (pointer to rows in the DB)
3. SQL query
4. Commit changes to DB
5. Close connection
"""
... | 21.815385 | 93 | 0.655853 | """
SQL Lite: based on a file rather than a web serviceself.
Therefore, you don't have to have SQL Lite installedself.
You can totally use Python to
Python sends SQL to interact with the DB
5 steps
1. Connect to DB
2. Cursor (pointer to rows in the DB)
3. SQL query
4. Commit changes to DB
5. Close connection
"""
imp... | 0 | 0 | 0 | 0 | 0 | 882 | 0 | -13 | 160 |
b2dd4acbad31af2706622a39da77467375e14082 | 7,186 | py | Python | testrail/testrail_api_test_data.py | tate138/Martindale_Automation | 082169df9f88ddc96fa81365f9c5e8aa460f7d14 | [
"Apache-2.0"
] | null | null | null | testrail/testrail_api_test_data.py | tate138/Martindale_Automation | 082169df9f88ddc96fa81365f9c5e8aa460f7d14 | [
"Apache-2.0"
] | null | null | null | testrail/testrail_api_test_data.py | tate138/Martindale_Automation | 082169df9f88ddc96fa81365f9c5e8aa460f7d14 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.insert(0, '../glados/resources') # Import a module from other directory
| 46.064103 | 164 | 0.606318 | import sys
sys.path.insert(0, '../glados/resources') # Import a module from other directory
import re
from testrail.testrail import testrail_api_glados
class testrail_api_test_data:
def get_tables_from_testrail_data(self, case_id):
'''
Returns a list of tables detected from the testrail Data sect... | 0 | 0 | 0 | 7,009 | 0 | 0 | 0 | 16 | 68 |
97a3f637a741b97e0eea2c54131c6a3251af5784 | 1,546 | py | Python | jsv/__init__.py | akovner/json-separated-values | 29ffb94810c9f1f562dbb7ac98960cf2531c371c | [
"MIT"
] | null | null | null | jsv/__init__.py | akovner/json-separated-values | 29ffb94810c9f1f562dbb7ac98960cf2531c371c | [
"MIT"
] | 5 | 2018-03-20T23:02:56.000Z | 2018-12-11T14:42:22.000Z | jsv/__init__.py | akovner/jsv | 29ffb94810c9f1f562dbb7ac98960cf2531c371c | [
"MIT"
] | null | null | null | """
JSV is a simple library for representing many JSON objects with a similar structure. It is intended to replace json
lines, csv, and other similar formats.
Basic write usage
>>> import jsv
>>> data = [{'key_1': 1}, {'key_1': ['any','json','object'], 'other_key': None}]
>>> with jsv.JSVWriter('out.jsv',... | 27.122807 | 115 | 0.582794 | """
JSV is a simple library for representing many JSON objects with a similar structure. It is intended to replace json
lines, csv, and other similar formats.
Basic write usage
>>> import jsv
>>> data = [{'key_1': 1}, {'key_1': ['any','json','object'], 'other_key': None}]
>>> with jsv.JSVWriter('out.jsv',... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 215 | 89 |
3efc90ac60db18ec05cc1682f2e3e5c1fedc6a11 | 260 | py | Python | Exercicios/PythonExercicios/ex021 - 030/ex021.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | Exercicios/PythonExercicios/ex021 - 030/ex021.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | Exercicios/PythonExercicios/ex021 - 030/ex021.py | sggrilo/Curso-em-Video-Python | a0e6f3d80d89eb8709345a38e207d81a77891192 | [
"MIT"
] | null | null | null | # TOCANDO UM MP3 Faa um programa em Python que abra e reproduza udio de um arquivo MP3.
import pygame
pygame.init()
pygame.mixer.music.load('song.mp3')
pygame.mixer.music.play()
input('')
pygame.event.wait()
# import playsound
# playsound.playsound('')
| 20 | 91 | 0.738462 | # TOCANDO UM MP3 — Faça um programa em Python que abra e reproduza áudio de um arquivo MP3.
import pygame
pygame.init()
pygame.mixer.music.load('song.mp3')
pygame.mixer.music.play()
input('')
pygame.event.wait()
# import playsound
# playsound.playsound('')
| 7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c71eb1505e6c013fa6c9c30e18bb0309450e4f5 | 631 | py | Python | backend/core/views.py | dominikbullo/SportAgenda | fa130111e08aed38d93b9ab85e14684f362b1930 | [
"Apache-2.0"
] | null | null | null | backend/core/views.py | dominikbullo/SportAgenda | fa130111e08aed38d93b9ab85e14684f362b1930 | [
"Apache-2.0"
] | null | null | null | backend/core/views.py | dominikbullo/SportAgenda | fa130111e08aed38d93b9ab85e14684f362b1930 | [
"Apache-2.0"
] | null | null | null |
# TODO refactor
| 28.681818 | 76 | 0.679873 | from apps.events.models import Season
def get_object_custom_queryset(request, db_object):
if request.query_params.get('season') == "all":
print("Getting all events")
return db_object.objects.all()
# print("Getting ONLY CURRENT season data")
return db_object.objects.filter(season=Season.ob... | 0 | 0 | 0 | 0 | 0 | 529 | 0 | 16 | 67 |
e89a31d0f4abe365e17394a32c051bf9c45f7075 | 1,296 | py | Python | d10_karatsuba.py | kuThang/py100 | d808b8d8de7a97c4c00fa20e35a8bab1c56bd966 | [
"Apache-2.0"
] | null | null | null | d10_karatsuba.py | kuThang/py100 | d808b8d8de7a97c4c00fa20e35a8bab1c56bd966 | [
"Apache-2.0"
] | null | null | null | d10_karatsuba.py | kuThang/py100 | d808b8d8de7a97c4c00fa20e35a8bab1c56bd966 | [
"Apache-2.0"
] | null | null | null |
# x = '789456123'
# y = '898989898989'
x = '11'
y = '1111'
x_arr = list(map(int, reversed(x)))
y_arr = list(map(int, reversed(y)))
print(x_arr)
print(y_arr)
mul = karatsuba(x_arr, y_arr)
print(mul)
print(''.join(map(str, reversed(mul))))
| 19.938462 | 49 | 0.497685 | import numpy as np
from itertools import zip_longest
def add(x, y):
z, carry = [], 0
for xi, yi in zip_longest(x, y, fillvalue=0):
add_i = xi + yi + carry
carry = add_i // 10
z.append(add_i % 10)
if carry :
z.append(carry)
return z
def sub(x, y):
z, carry = [], 0
... | 0 | 0 | 0 | 0 | 0 | 932 | 0 | 9 | 112 |
a388e6639b6f82c5f7aafafa6227ed055bb95a9a | 923 | py | Python | declension_test.py | mihai3/ggana | 5b3599a87f0687d221bc052ee53bcdf7a0a5d834 | [
"MIT"
] | null | null | null | declension_test.py | mihai3/ggana | 5b3599a87f0687d221bc052ee53bcdf7a0a5d834 | [
"MIT"
] | null | null | null | declension_test.py | mihai3/ggana | 5b3599a87f0687d221bc052ee53bcdf7a0a5d834 | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main() | 36.92 | 88 | 0.654388 | import unittest
from declension import Declension, DeclensionResult
class DeclensionTest(unittest.TestCase):
def test_lemmatizer(self):
with Declension() as d:
self.assertEqual(d.lemmatize("Chinesinnen"), "Chinesin")
self.assertIsNone(d.lemmatize("Erfundeneswortdasesnichtgibt"))
... | 0 | 0 | 0 | 785 | 0 | 0 | 0 | 30 | 45 |
db9e7506df7ca129d96474119cf414c8ee734f80 | 3,281 | py | Python | deepchem/molnet/load_function/freesolv_dataset.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 3,782 | 2016-02-21T03:53:11.000Z | 2022-03-31T16:10:26.000Z | deepchem/molnet/load_function/freesolv_dataset.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 2,666 | 2016-02-11T01:54:54.000Z | 2022-03-31T11:14:33.000Z | deepchem/molnet/load_function/freesolv_dataset.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 1,597 | 2016-02-21T03:10:08.000Z | 2022-03-30T13:21:28.000Z | """
freesolv dataset loader.
"""
import deepchem as dc
from deepchem.molnet.load_function.molnet_loader import TransformerGenerator
from deepchem.data import Dataset
from typing import List, Optional, Tuple, Union
FREESOLV_URL = 'https://deepchemdata.s3.us-west-1.amazonaws.com/datasets/freesolv.csv.gz'
FREESOLV_TASKS ... | 40.012195 | 91 | 0.734532 | """
freesolv dataset loader.
"""
import os
import deepchem as dc
from deepchem.molnet.load_function.molnet_loader import TransformerGenerator, _MolnetLoader
from deepchem.data import Dataset
from typing import List, Optional, Tuple, Union
FREESOLV_URL = 'https://deepchemdata.s3.us-west-1.amazonaws.com/datasets/freesol... | 2 | 0 | 0 | 401 | 0 | 0 | 0 | 3 | 45 |
773e2c2c626727fe8b1a52f7790c86fd79ce3beb | 575 | py | Python | functions/recommendation_functions/google_suggest.py | Bernardo-Senna/keyword_recommender | 3cf1a4945786b9f63e76cf6c3198f3da311fa34b | [
"MIT"
] | null | null | null | functions/recommendation_functions/google_suggest.py | Bernardo-Senna/keyword_recommender | 3cf1a4945786b9f63e76cf6c3198f3da311fa34b | [
"MIT"
] | null | null | null | functions/recommendation_functions/google_suggest.py | Bernardo-Senna/keyword_recommender | 3cf1a4945786b9f63e76cf6c3198f3da311fa34b | [
"MIT"
] | null | null | null | import json
import requests
def get_recommendation_suggest(seed_keyword):
"""get the list of auto-complete suggestions of google search"""
try:
url = f'http://suggestqueries.google.com/complete/search?client=firefox&q={seed_keyword}'
headers = {'User-agent': 'Mozilla/5.0'}
response = re... | 35.9375 | 97 | 0.702609 | import json
import requests
def get_recommendation_suggest(seed_keyword):
"""get the list of auto-complete suggestions of google search"""
try:
url = f'http://suggestqueries.google.com/complete/search?client=firefox&q={seed_keyword}'
headers = {'User-agent': 'Mozilla/5.0'}
response = re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a6b393e29185eb639796c4a0c233dab86bcd235 | 2,644 | py | Python | download_jsons.py | kcliu/issue_aggregator | ddcf4393de8e4f3ab04989e688cac660e36a9a82 | [
"MIT"
] | null | null | null | download_jsons.py | kcliu/issue_aggregator | ddcf4393de8e4f3ab04989e688cac660e36a9a82 | [
"MIT"
] | null | null | null | download_jsons.py | kcliu/issue_aggregator | ddcf4393de8e4f3ab04989e688cac660e36a9a82 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
download()
| 26.707071 | 88 | 0.574508 | #!/usr/bin/env python3
import json
import os
import re
import requests
def get_authtoken():
with open('./config.json', 'r') as f:
config = json.load(f)
authtoken = config['token']
return authtoken
def download_repos(session, repo_list_fpath, out_fpath):
print('===== Download Repos St... | 0 | 0 | 0 | 0 | 0 | 2,432 | 0 | -40 | 181 |
c74f6af4e3f888812f14899b41c8b0d694dedd1b | 1,223 | py | Python | Media/nyts/Machinima/crowdScene/Scripts/WorldInit.py | dmacka/MultiverseClientServer | b64d7d754a0b2b1a3e5acabd4d6ebb80ab1d9379 | [
"MIT"
] | 5 | 2020-04-29T19:14:57.000Z | 2022-02-18T08:48:37.000Z | Media/nyts/Machinima/crowdScene/Scripts/WorldInit.py | dmacka/MultiverseClientServer | b64d7d754a0b2b1a3e5acabd4d6ebb80ab1d9379 | [
"MIT"
] | null | null | null | Media/nyts/Machinima/crowdScene/Scripts/WorldInit.py | dmacka/MultiverseClientServer | b64d7d754a0b2b1a3e5acabd4d6ebb80ab1d9379 | [
"MIT"
] | 2 | 2021-03-09T06:53:30.000Z | 2021-03-27T12:02:39.000Z | import ClientAPI
# This function is an event handler that runs when the world has been initialized.
# Register an event handler that will run when the world has been initialized.
ClientAPI.World.RegisterEventHandler('WorldInitialized', WorldInitHandler)
| 30.575 | 82 | 0.733442 | import System
import ClientAPI
import SAWorld
import SAUtil
def SetupPanorama():
camera = ClientAPI.GetPlayerCamera()
ClientAPI.GrabPlayerCamera()
camera.FieldOfView = 90
camera.Near = 15000
camera.ProjectionType = ClientAPI.Camera.Projection.Orthographic
pos, orient, props = SAWorld.... | 0 | 0 | 0 | 0 | 0 | 874 | 0 | -23 | 111 |
e6f74f61fc1265d7082537a796a7d601bab1f712 | 2,010 | py | Python | branches.py | AlfrescoLabs/bamboo-migration-tools | 8c47a0663d29aa514970027b1f9cf7ed59b26779 | [
"Apache-2.0"
] | null | null | null | branches.py | AlfrescoLabs/bamboo-migration-tools | 8c47a0663d29aa514970027b1f9cf7ed59b26779 | [
"Apache-2.0"
] | null | null | null | branches.py | AlfrescoLabs/bamboo-migration-tools | 8c47a0663d29aa514970027b1f9cf7ed59b26779 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import csv
import sys
from lib.config import get_or_create as get_or_create_config
from lib.rest import REST_CONFIG_FIELDS, api_get, api_get_paged
config = get_or_create_config('config.ini', 'bamboo', REST_CONFIG_FIELDS)
auth = (config['username'], config['password'])
base_path = config['url']
writ... | 46.744186 | 327 | 0.70398 | #!/usr/bin/python
import csv
import sys
from lib.config import get_or_create as get_or_create_config
from lib.rest import REST_CONFIG_FIELDS, api_get, api_get_paged
config = get_or_create_config('config.ini', 'bamboo', REST_CONFIG_FIELDS)
auth = (config['username'], config['password'])
base_path = config['url']
writ... | 0 | 0 | 0 | 0 | 0 | 961 | 0 | 0 | 92 |
90252ac71094874752fccb216c5531f908088155 | 250 | py | Python | Python/MAHASENA.py | sid-146/Python-RePo-sEm-6 | daf23074a411d38013329baf9eb2b8fb0c42fc54 | [
"MIT"
] | null | null | null | Python/MAHASENA.py | sid-146/Python-RePo-sEm-6 | daf23074a411d38013329baf9eb2b8fb0c42fc54 | [
"MIT"
] | null | null | null | Python/MAHASENA.py | sid-146/Python-RePo-sEm-6 | daf23074a411d38013329baf9eb2b8fb0c42fc54 | [
"MIT"
] | null | null | null | l = int(input())
evenChk, oddChk = 0, 0
for i in range(0, l):
number = int(input())
if number % 2 == 0:
evenChk += 1
else:
oddChk += 1
if evenChk > oddChk:
print("READY FOR BATTLE ")
else:
print("NOT READY") | 16.666667 | 30 | 0.524 | l = int(input())
evenChk, oddChk = 0, 0
for i in range(0, l):
number = int(input())
if number % 2 == 0:
evenChk += 1
else:
oddChk += 1
if evenChk > oddChk:
print("READY FOR BATTLE ")
else:
print("NOT READY") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
737fb7b203a4c82b499fc7ef3d16640aae568988 | 1,362 | py | Python | aoc/year2019/day17/day17.py | Godsmith/adventofcode | 3c59ea66830f82b63881e0ea19bfe3076f2a500d | [
"Unlicense"
] | null | null | null | aoc/year2019/day17/day17.py | Godsmith/adventofcode | 3c59ea66830f82b63881e0ea19bfe3076f2a500d | [
"Unlicense"
] | null | null | null | aoc/year2019/day17/day17.py | Godsmith/adventofcode | 3c59ea66830f82b63881e0ea19bfe3076f2a500d | [
"Unlicense"
] | null | null | null |
if __name__ == '__main__':
main()
| 21.967742 | 87 | 0.606461 | from aocd import data
from aoc.utils import ints
from aoc.year2019.intcode import Intcode
def main():
intcode = Intcode(ints(data))
outputs = intcode.run_to_next_input(None)
s = ''.join(map(chr, outputs))
print(s)
print(alignment_parameter_sum(s))
# part 2
activated_program = ints(data)
... | 0 | 0 | 0 | 0 | 0 | 1,110 | 0 | 24 | 182 |
9c383187182b70b63f075e3e258b0198ef936769 | 660 | py | Python | scripts/cache.py | the-mute-bow/the-mute-bow.github.io | 46a9f30b98928b212b69c85ad1384db6c6e5f586 | [
"RSA-MD"
] | null | null | null | scripts/cache.py | the-mute-bow/the-mute-bow.github.io | 46a9f30b98928b212b69c85ad1384db6c6e5f586 | [
"RSA-MD"
] | null | null | null | scripts/cache.py | the-mute-bow/the-mute-bow.github.io | 46a9f30b98928b212b69c85ad1384db6c6e5f586 | [
"RSA-MD"
] | null | null | null |
extentions = ['html', 'css', 'js', 'png', 'gif', 'mp3', 'woff', 'woff2']
black_list = ['.git', 'sw.js', 'old', 'CNAME', 'CACHE', '_base', 'anim']
data = ''
search('')
print('Finished\n')
with open('CACHE', 'w') as f:
f.write(data)
| 23.571429 | 72 | 0.536364 | from os import listdir
extentions = ['html', 'css', 'js', 'png', 'gif', 'mp3', 'woff', 'woff2']
black_list = ['.git', 'sw.js', 'old', 'CNAME', 'CACHE', '_base', 'anim']
data = ''
def search(IN: str) -> None:
global data
for file in listdir(IN if IN != '' else None):
path = ('./' + file) if IN == '' else ('./' + ... | 0 | 0 | 0 | 0 | 0 | 377 | 0 | 1 | 45 |
385c67364fb71e17a02b2708184a551d78ac2a8e | 321 | py | Python | messengerext/pages/urls.py | groupsome/groupsome | 4edcf30d66ff458c4df37d3198ef187219a768d7 | [
"MIT"
] | 6 | 2016-10-07T13:43:17.000Z | 2017-10-07T22:34:44.000Z | messengerext/pages/urls.py | groupsome/groupsome | 4edcf30d66ff458c4df37d3198ef187219a768d7 | [
"MIT"
] | null | null | null | messengerext/pages/urls.py | groupsome/groupsome | 4edcf30d66ff458c4df37d3198ef187219a768d7 | [
"MIT"
] | 1 | 2020-07-15T04:29:31.000Z | 2020-07-15T04:29:31.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^landing/?$', views.LandingView.as_view(), name='landing'),
url(r'^registration/?$', views.RegistrationView.as_view(), name='registration'),
url(r'^legal_notice/?$', views.LegalNoticeView.as_view(), name='legal_notice'),
]
| 32.1 | 84 | 0.697819 | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^landing/?$', views.LandingView.as_view(), name='landing'),
url(r'^registration/?$', views.RegistrationView.as_view(), name='registration'),
url(r'^legal_notice/?$', views.LegalNoticeView.as_view(), name='legal_notice'),
]... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 0 |
c2e1f1e34af41bae6e5ab19ea0818c727f5f9db8 | 424 | py | Python | examples/geschenken_fractieleden_example.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 9 | 2017-11-16T12:39:11.000Z | 2021-10-16T19:30:52.000Z | examples/geschenken_fractieleden_example.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 1 | 2017-11-16T14:20:20.000Z | 2017-11-20T18:49:14.000Z | examples/geschenken_fractieleden_example.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 3 | 2018-09-10T18:57:39.000Z | 2020-06-09T14:13:10.000Z |
if '__main__' == __name__:
example_geschenken_fractieleden_actief()
| 28.266667 | 63 | 0.70283 | from tkapi.util import queries
def example_geschenken_fractieleden_actief():
leden_actief = queries.get_fractieleden_actief()
for lid in leden_actief:
persoon = lid.persoon
print('{} ({})'.format(persoon, lid.fractie.afkorting))
for geschenk in lid.persoon.geschenken:
print... | 0 | 0 | 0 | 0 | 0 | 295 | 0 | 9 | 45 |
9ba50a22097073447a54847828922ff6be4ecf8e | 2,635 | py | Python | day7.py | DahlitzFlorian/advent-of-code-2018 | 09f3f6e40d75878dbb055c2ecc81f0165835f3e8 | [
"Apache-2.0"
] | null | null | null | day7.py | DahlitzFlorian/advent-of-code-2018 | 09f3f6e40d75878dbb055c2ecc81f0165835f3e8 | [
"Apache-2.0"
] | null | null | null | day7.py | DahlitzFlorian/advent-of-code-2018 | 09f3f6e40d75878dbb055c2ecc81f0165835f3e8 | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
main()
| 23.738739 | 80 | 0.580645 | import click
import collections
import operator
@click.command()
@click.option("--part", default=2, help="Part of the challenge (either 1 or 2)")
def main(part: int):
with open("input") as f:
instructions = [line.strip() for line in f.readlines()]
dependencies = {}
used_letters = set()
for i... | 0 | 825 | 0 | 0 | 0 | 1,602 | 0 | -18 | 181 |
47837c1d47d643ca13ab6bd7cc6ecb4d3655a30f | 1,219 | py | Python | src/oneagent/_impl/native/sdkdllinfo.py | Dynatrace/OneAgent-SDK-for-Python | fa4dd209b6a21407abca09a6fb8da1b85755ab0a | [
"Apache-2.0"
] | 20 | 2018-05-22T22:12:23.000Z | 2021-11-16T22:24:52.000Z | src/oneagent/_impl/native/sdkdllinfo.py | Dynatrace/OneAgent-SDK-for-Python | fa4dd209b6a21407abca09a6fb8da1b85755ab0a | [
"Apache-2.0"
] | 15 | 2018-12-11T15:02:39.000Z | 2021-01-15T12:06:18.000Z | src/oneagent/_impl/native/sdkdllinfo.py | Dynatrace/OneAgent-SDK-for-Python | fa4dd209b6a21407abca09a6fb8da1b85755ab0a | [
"Apache-2.0"
] | 6 | 2018-10-05T08:39:18.000Z | 2022-01-14T03:18:39.000Z | #
# Copyright 2018 Dynatrace LLC
#
# 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 writi... | 29.02381 | 77 | 0.692371 | #
# Copyright 2018 Dynatrace LLC
#
# 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 writi... | 0 | 0 | 0 | 0 | 0 | 312 | 0 | -2 | 67 |
4a97e6af009cae396da41dd9861365359d7c3749 | 4,155 | py | Python | migrate/views.py | pwqbot/eoj3 | 46be6a6f192798e74eab7b327bb8df7ca73575d9 | [
"MIT"
] | 107 | 2017-03-15T11:53:45.000Z | 2019-09-06T11:23:44.000Z | migrate/views.py | OS-EDU/eoj3 | f117dcd4e3cea7d150c3e3794e7255e00d486c88 | [
"MIT"
] | 27 | 2019-09-24T12:44:48.000Z | 2022-03-11T23:18:21.000Z | migrate/views.py | OS-EDU/eoj3 | f117dcd4e3cea7d150c3e3794e7255e00d486c88 | [
"MIT"
] | 25 | 2019-10-11T10:39:12.000Z | 2022-03-18T05:15:57.000Z | import logging
logger = logging.getLogger(__name__)
| 38.831776 | 110 | 0.619735 | import logging
import threading
import traceback
from hashlib import sha1
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.db import transaction
from django.shortcuts import render
from acc... | 0 | 1,088 | 0 | 2,150 | 0 | 168 | 0 | 248 | 445 |
c976908ca5479606e34da4eb7b1d1652d0ce7a93 | 3,049 | py | Python | apps/base/urls.py | samsagaz/pyerp | db61bca307f73c13f4ad5a2ffb4531132ea5b605 | [
"MIT"
] | 1 | 2020-02-26T19:36:08.000Z | 2020-02-26T19:36:08.000Z | apps/base/urls.py | samsagaz/pyerp | db61bca307f73c13f4ad5a2ffb4531132ea5b605 | [
"MIT"
] | null | null | null | apps/base/urls.py | samsagaz/pyerp | db61bca307f73c13f4ad5a2ffb4531132ea5b605 | [
"MIT"
] | 2 | 2020-02-26T19:36:12.000Z | 2020-03-16T16:30:57.000Z | from django.urls import path
from ..base.views import CustomerListView, PartnerDetailView, PartnerCreateView, PartnerUpdateView, DeletePartner, ProviderListView
from ..base.views import CompanyListView
from ..base.views import ProductListView, ProductDetailView, ProductCreateView, ProductUpdateView, DeleteProduct
from ... | 64.87234 | 135 | 0.737619 | from django.urls import path
from django.contrib.auth import views as auth_views
from ..base.views import CustomerListView, PartnerDetailView, PartnerCreateView, PartnerUpdateView, DeletePartner, ProviderListView
from ..base.views import CompanyListView
from ..base.views import ProductListView, ProductDetailView, Produ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 22 |
4358aeacf7c4277c6e1e276b9551e3c567c62891 | 5,680 | py | Python | exercises/adaboost_scenario.py | DanitYanowsky/IML.HUJI | 391b661ede3fdbb72ecdf900c32df69445b3868b | [
"MIT"
] | null | null | null | exercises/adaboost_scenario.py | DanitYanowsky/IML.HUJI | 391b661ede3fdbb72ecdf900c32df69445b3868b | [
"MIT"
] | null | null | null | exercises/adaboost_scenario.py | DanitYanowsky/IML.HUJI | 391b661ede3fdbb72ecdf900c32df69445b3868b | [
"MIT"
] | null | null | null |
import numpy as np
from typing import Tuple
def generate_data(n: int, noise_ratio: float) -> Tuple[np.ndarray, np.ndarray]:
"""
Generate a dataset in R^2 of specified size
Parameters
----------
n: int
Number of samples to generate
noise_ratio: float
Ratio of labels to invert... | 44.031008 | 117 | 0.608803 |
import numpy as np
from typing import Tuple
from IMLearn.metalearners.adaboost import AdaBoost
from IMLearn.learners.classifiers import DecisionStump
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
def generate_data(n: int, noise_ratio: float) -> Tuple[np.ndarray, np.... | 0 | 0 | 0 | 0 | 0 | 4,445 | 0 | 92 | 134 |
58239f3df351b904d535943af702ab1bd2af852c | 5,780 | py | Python | 1_dpp/dp.py | dongminlee94/supplement4deeprl | 4db1a83f5dd3254abd8135fe94734a0d8d14a957 | [
"MIT"
] | 1 | 2022-01-17T15:20:28.000Z | 2022-01-17T15:20:28.000Z | 1_dpp/dp.py | dongminlee94/supplement4deeprl | 4db1a83f5dd3254abd8135fe94734a0d8d14a957 | [
"MIT"
] | null | null | null | 1_dpp/dp.py | dongminlee94/supplement4deeprl | 4db1a83f5dd3254abd8135fe94734a0d8d14a957 | [
"MIT"
] | null | null | null | import gym
import time
import argparse
if __name__ == "__main__":
# Configurations
parser = argparse.ArgumentParser(description='Traditional RL algorithms in FrozenLake environment')
parser.add_argument('--algo', type=str, default='pi',
help='select an algorithm among policy iteration ... | 36.582278 | 106 | 0.592042 | import gym
import time
import argparse
import numpy as np
class DynamicProgramming(object):
"""An implementation of the policy iteration, value iteration."""
def __init__(self,
env,
obs_num,
act_num,
gamma=0.99,
epsilon=1e-6,
):
... | 0 | 0 | 0 | 4,613 | 0 | 0 | 0 | -3 | 45 |
165f93a5281773da762dc9944142b898b01b55ed | 1,690 | py | Python | tddata/bonds.py | dkkomesu/tddata | 9bf0f366850c74b784dc5edb2dd0d6f0948d5ab3 | [
"MIT"
] | 3 | 2021-05-16T21:17:40.000Z | 2022-02-22T14:46:43.000Z | tddata/bonds.py | dkkomesu/tddata | 9bf0f366850c74b784dc5edb2dd0d6f0948d5ab3 | [
"MIT"
] | 5 | 2021-04-06T18:16:31.000Z | 2021-04-09T20:46:33.000Z | tddata/bonds.py | dankkom/tddata | 9bf0f366850c74b784dc5edb2dd0d6f0948d5ab3 | [
"MIT"
] | null | null | null | BONDS = {
"aliases": {
"tesouro prefixado": "LTN",
"ltn": "LTN",
"tesouro prefixado com juros semestrais": "NTN-F",
"ntn-f": "NTN-F",
"ntnf": "NTN-F",
"tesouro ipca+": "NTN-B Principal",
"ntn-b principal": "NTN-B Principal",
"ntnbp": "NTN-B Principa... | 25.606061 | 73 | 0.454438 | BONDS = {
"aliases": {
"tesouro prefixado": "LTN",
"ltn": "LTN",
"tesouro prefixado com juros semestrais": "NTN-F",
"ntn-f": "NTN-F",
"ntnf": "NTN-F",
"tesouro ipca+": "NTN-B Principal",
"ntn-b principal": "NTN-B Principal",
"ntnbp": "NTN-B Principa... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ec1d22cec893f32caf8134f561c43c61687db779 | 11,262 | py | Python | resources/libraries/python/Map.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/Map.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/Map.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 Cisco and/or its affiliates.
# 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 ag... | 39.93617 | 80 | 0.554076 | # Copyright (c) 2018 Cisco and/or its affiliates.
# 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 ag... | 0 | 10,260 | 0 | 270 | 0 | 0 | 0 | 36 | 69 |
7316fdbb7007cc275db81c50dbf936356d886d0c | 2,039 | py | Python | examples/http-post.py | karpierz/libcurl | 531bd28ab32fb07c152e5b5ca4bd4dbde059b9a8 | [
"Zlib"
] | null | null | null | examples/http-post.py | karpierz/libcurl | 531bd28ab32fb07c152e5b5ca4bd4dbde059b9a8 | [
"Zlib"
] | null | null | null | examples/http-post.py | karpierz/libcurl | 531bd28ab32fb07c152e5b5ca4bd4dbde059b9a8 | [
"Zlib"
] | null | null | null | #***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|... | 33.42623 | 88 | 0.575282 | #***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|... | 0 | 0 | 0 | 0 | 0 | 851 | 0 | 6 | 98 |
0a529cfbaf77fcfa6763f418ccad45e7c7503777 | 6,889 | py | Python | Horse.py | acresende/data-mining-puc-final-task | 850f584e6f4fa9d3739fe2119ce3c37a41eab68e | [
"MIT"
] | null | null | null | Horse.py | acresende/data-mining-puc-final-task | 850f584e6f4fa9d3739fe2119ce3c37a41eab68e | [
"MIT"
] | null | null | null | Horse.py | acresende/data-mining-puc-final-task | 850f584e6f4fa9d3739fe2119ce3c37a41eab68e | [
"MIT"
] | 1 | 2019-11-26T13:39:34.000Z | 2019-11-26T13:39:34.000Z |
# coding: utf-8
# # Import Bibliotecas
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.feature_selection import RFE
from sklearn.linear_model import LogisticRegression
import pandas a... | 18.771117 | 136 | 0.689215 |
# coding: utf-8
# # Import Bibliotecas
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.feature_selection import RFE
from sklearn.linear_model import LogisticRegression
import pandas a... | 28 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 44 |
dd0801433e3c004df97331cb76c88aae59fb5c77 | 1,267 | py | Python | boupy/check/check.py | SeBecker/boupy | a540541435d1bddceecb981c4a829bfbc2ac0b75 | [
"MIT"
] | null | null | null | boupy/check/check.py | SeBecker/boupy | a540541435d1bddceecb981c4a829bfbc2ac0b75 | [
"MIT"
] | null | null | null | boupy/check/check.py | SeBecker/boupy | a540541435d1bddceecb981c4a829bfbc2ac0b75 | [
"MIT"
] | null | null | null | """This module provides some capabilities to check the integrity of the package."""
import os
from boupy.check.custom_exceptions import UserError
def check_consistency(init_dict):
"""This function performs some basic checks regarding the integrity
of the user's request. There should be no uncontrolled termin... | 36.2 | 88 | 0.659826 | """This module provides some capabilities to check the integrity of the package."""
import os
from boupy.check.custom_exceptions import UserError
def check_consistency(init_dict):
"""This function performs some basic checks regarding the integrity
of the user's request. There should be no uncontrolled termin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
05a33e294724d36037e2e4e46b357dfe2d6e125b | 9,548 | py | Python | experiments/twitter_event_data_2019/evaluation/keyword_evaluate.py | HHansi/WhatsUp | 87c3eb90570d2f997d8f1abc300a3553f8ef7ca9 | [
"Apache-2.0"
] | null | null | null | experiments/twitter_event_data_2019/evaluation/keyword_evaluate.py | HHansi/WhatsUp | 87c3eb90570d2f997d8f1abc300a3553f8ef7ca9 | [
"Apache-2.0"
] | null | null | null | experiments/twitter_event_data_2019/evaluation/keyword_evaluate.py | HHansi/WhatsUp | 87c3eb90570d2f997d8f1abc300a3553f8ef7ca9 | [
"Apache-2.0"
] | null | null | null | # Created by Hansi at 7/6/2021
import editdistance
import numpy as np
from scipy.optimize import linear_sum_assignment
def find_best_match(cluster, groundtruth_event, exact_match=True, cluster_n=None):
"""
Find best match (event duplicate) for the event cluster wrt the given event
parameters
-------... | 48.222222 | 120 | 0.630603 | # Created by Hansi at 7/6/2021
import editdistance
import numpy as np
from scipy.optimize import linear_sum_assignment
class MatchedCluster:
def __init__(self, cluster_words, gt_event_words, matched_words, keyword_n, keyword_tp):
self.cluster = cluster_words
self.gt_event = gt_event_words
... | 0 | 0 | 0 | 378 | 0 | 0 | 0 | 0 | 23 |
e3cc3e1dd009a0f81ef763bdb403fa42619b84b9 | 1,126 | py | Python | ip_country_search/main.py | manumathew23/ip-country-search | 37f4487faaca8df74c21c61ae97201349ae19846 | [
"MIT"
] | 2 | 2019-09-10T06:27:05.000Z | 2021-12-30T15:19:19.000Z | ip_country_search/main.py | manumathew23/ip-country-search | 37f4487faaca8df74c21c61ae97201349ae19846 | [
"MIT"
] | null | null | null | ip_country_search/main.py | manumathew23/ip-country-search | 37f4487faaca8df74c21c61ae97201349ae19846 | [
"MIT"
] | 1 | 2021-12-30T15:19:24.000Z | 2021-12-30T15:19:24.000Z | import itertools
rir_file = [rir + ".csv" for rir in list(RIR_URL_MAPPING.keys())]
# Parse RIR file data
data = list(itertools.chain(
parse_rir_file(rir_file[0]),
parse_rir_file(rir_file[1]),
parse_rir_file(rir_file[2]),
parse_rir_file(rir_file[3]),
parse_rir_file(rir_file[4])
))
data.sort(key=... | 26.809524 | 94 | 0.701599 | import concurrent.futures
import csv
import math
from ipaddress import ip_address, IPv4Address
import bisect
from urllib.parse import urlencode, quote_plus
import itertools
from .constants import *
from .helpers import *
def update_rir_files():
with concurrent.futures.ProcessPoolExecutor(max_workers=len(RIR_URL_... | 0 | 0 | 0 | 0 | 0 | 497 | 0 | 28 | 223 |
0b0a9dc713a85a0e9e52b654240b1a0c0342b452 | 1,138 | py | Python | var/spack/repos/builtin/packages/r-assertive-reflection/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-assertive-reflection/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-assertive-reflection/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 42.148148 | 97 | 0.73638 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAssertiveReflection(RPackage):
"""assertive.reflection: Assertions for Checking the State... | 0 | 0 | 0 | 896 | 0 | 0 | 0 | -2 | 46 |
53ef7d41cfd02d01bea136b337f6e4013ef28fde | 527 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/region_878.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | 4 | 2018-10-19T04:36:20.000Z | 2020-02-13T16:14:09.000Z | oscar/lib/python2.7/site-packages/phonenumbers/data/region_878.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | 5 | 2020-03-24T16:37:25.000Z | 2021-06-10T21:24:54.000Z | upibo-venv/Lib/site-packages/phonenumbers/data/region_878.py | smbpgroup/upibo | 625dcda9f9692c62aeb9fe8f7123a5d407c610ae | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. 878 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_878 = PhoneMetadata(id='001', country_code=878, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{11}', possible_length=(12,)),
... | 65.875 | 116 | 0.73814 | """Auto-generated file, do not edit by hand. 878 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_878 = PhoneMetadata(id='001', country_code=878, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{11}', possible_length=(12,)),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73c431bc255e30ab11e4c59b95bd0eec1d28f00c | 633 | py | Python | programmers/skill-test-lv2/skill_tree.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 3 | 2019-03-09T05:19:23.000Z | 2019-04-06T09:26:36.000Z | programmers/skill-test-lv2/skill_tree.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2020-02-23T10:38:04.000Z | 2020-02-23T10:38:04.000Z | programmers/skill-test-lv2/skill_tree.py | love-adela/algorithm | 4ccd02173c96f8369962f1fd4e5166a221690fa2 | [
"MIT"
] | 1 | 2019-05-22T13:47:53.000Z | 2019-05-22T13:47:53.000Z | # https://programmers.co.kr/learn/courses/30/lessons/49993
#
skill = 'CBD'
skill_trees = ["BACDE", "CBADF", "AECB", "BDA"]
cnt = 0
for tree in skill_trees:
if is_validate(tree, skill) == True:
cnt += 1
print(cnt) | 26.375 | 62 | 0.614534 | # https://programmers.co.kr/learn/courses/30/lessons/49993
# 스킬트리
def is_validate(item:str, string:str)->bool:
chr_list = [c for c in item if c in string]
check_list = []
for i in range(len(chr_list)):
if string[0] in chr_list and chr_list[i] == string[i]:
check_list.append(chr_list[i])... | 12 | 0 | 0 | 0 | 0 | 379 | 0 | 0 | 23 |
10bfec843465aa20129ae7e2999ed499ac8a8c51 | 12,885 | py | Python | models/Market1501TripletModel.py | rootadminWalker/autoencoder-siamese-experiments | 4f3584dea08eefe70dc3383a09a7baf5d2588f00 | [
"MIT"
] | null | null | null | models/Market1501TripletModel.py | rootadminWalker/autoencoder-siamese-experiments | 4f3584dea08eefe70dc3383a09a7baf5d2588f00 | [
"MIT"
] | null | null | null | models/Market1501TripletModel.py | rootadminWalker/autoencoder-siamese-experiments | 4f3584dea08eefe70dc3383a09a7baf5d2588f00 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 Thomas Leong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 35.108992 | 102 | 0.632674 | """
MIT License
Copyright (c) 2021 Thomas Leong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 0 | 1,818 | 0 | 9,506 | 0 | 0 | 0 | 0 | 204 |
2be9ca2d3248ef3f0d25a49d917718285ffdb912 | 637 | py | Python | settings.py | velrest/django-localized-fields | d308e773cf01ce84b7c91e97fd905de2434e3516 | [
"MIT"
] | null | null | null | settings.py | velrest/django-localized-fields | d308e773cf01ce84b7c91e97fd905de2434e3516 | [
"MIT"
] | null | null | null | settings.py | velrest/django-localized-fields | d308e773cf01ce84b7c91e97fd905de2434e3516 | [
"MIT"
] | null | null | null | import dj_database_url
DEBUG = True
TEMPLATE_DEBUG = True
SECRET_KEY = 'this is my secret key' # NOQA
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
DATABASES = {
'default': dj_database_url.config(default='postgres:///localized_fields')
}
DATABASES['default']['ENGINE'] = 'psqlextra.backend'
LANGUAGE_CODE ... | 19.30303 | 77 | 0.697017 | import dj_database_url
DEBUG = True
TEMPLATE_DEBUG = True
SECRET_KEY = 'this is my secret key' # NOQA
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
DATABASES = {
'default': dj_database_url.config(default='postgres:///localized_fields')
}
DATABASES['default']['ENGINE'] = 'psqlextra.backend'
LANGUAGE_CODE ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
107b40733098b87b14245c0bd302d56c75ccce38 | 169 | py | Python | src/PySiCroFClass/test.py | kazulagi/plantfem_min | ba7398c031636644aef8acb5a0dad7f9b99fcb92 | [
"MIT"
] | null | null | null | src/PySiCroFClass/test.py | kazulagi/plantfem_min | ba7398c031636644aef8acb5a0dad7f9b99fcb92 | [
"MIT"
] | null | null | null | src/PySiCroFClass/test.py | kazulagi/plantfem_min | ba7398c031636644aef8acb5a0dad7f9b99fcb92 | [
"MIT"
] | null | null | null | import SiCroF
world=SiCroF.SiCroF()
world.setDomainList("~/SiCroF/Debug_domainlist.txt")
world.setIfaceList("~/SiCroF/Debug_Ifacelist.txt")
world.exportFortranScript()
| 24.142857 | 52 | 0.810651 | import SiCroF
world=SiCroF.SiCroF()
world.setDomainList("~/SiCroF/Debug_domainlist.txt")
world.setIfaceList("~/SiCroF/Debug_Ifacelist.txt")
world.exportFortranScript()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f6fa3e6aafff0f07d5147e3506e4a9c2dce32ba4 | 748 | py | Python | arrayish/defaults.py | hameerabbasi/arrayish | 4d43fa1b5d28526c8ca52a4ea394edc6d9ec908b | [
"BSD-3-Clause"
] | 12 | 2018-04-20T16:12:13.000Z | 2019-07-12T00:02:51.000Z | arrayish/defaults.py | hameerabbasi/arrayish | 4d43fa1b5d28526c8ca52a4ea394edc6d9ec908b | [
"BSD-3-Clause"
] | 2 | 2018-04-29T00:26:43.000Z | 2018-05-13T10:17:14.000Z | arrayish/defaults.py | hameerabbasi/arrayish | 4d43fa1b5d28526c8ca52a4ea394edc6d9ec908b | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import multipledispatch as md
dot = md.Dispatcher('dot')
dot.add((object, object), np.dot)
tensordot = md.Dispatcher('tensordot')
tensordot.add((object, object), np.tensordot)
where = md.Dispatcher('where')
where.add((object,), np.where)
where.add((object, object, object), np.where)
nanmin = md.D... | 24.129032 | 45 | 0.72861 | import numpy as np
import multipledispatch as md
dot = md.Dispatcher('dot')
dot.add((object, object), np.dot)
tensordot = md.Dispatcher('tensordot')
tensordot.add((object, object), np.tensordot)
where = md.Dispatcher('where')
where.add((object,), np.where)
where.add((object, object, object), np.where)
nanmin = md.D... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ad807ba856901f3f1530a935b8e81a3c59878c53 | 6,239 | py | Python | rgd/geodata/permissions.py | Erotemic/ResonantGeoData | ff9aec9daf73353bcc95a9d30e98fcc5cdffc6e0 | [
"Apache-2.0"
] | null | null | null | rgd/geodata/permissions.py | Erotemic/ResonantGeoData | ff9aec9daf73353bcc95a9d30e98fcc5cdffc6e0 | [
"Apache-2.0"
] | null | null | null | rgd/geodata/permissions.py | Erotemic/ResonantGeoData | ff9aec9daf73353bcc95a9d30e98fcc5cdffc6e0 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
from django.core.exceptions import PermissionDenied
from django.db.models.functions import Coalesce
from rgd.geodata import models
def annotate_queryset(queryset):
"""Annotate the queryset to include a path to a collection.
Some models don't have a direct path to `collection`
... | 40.777778 | 128 | 0.717583 | from typing import Optional
from django.contrib.auth.backends import BaseBackend
from django.core.exceptions import PermissionDenied
from django.db.models.functions import Coalesce
from rgd.geodata import models
def annotate_queryset(queryset):
"""Annotate the queryset to include a path to a collection.
So... | 0 | 0 | 0 | 919 | 0 | 0 | 0 | 31 | 46 |
723492ba33c1b129438603a6ea6b609e25092c5f | 10,411 | py | Python | inventory/migrations/0001_initial.py | common1/newassetcms | 65eee3c2ed9dac4cc56bfff863a6cbaff9830d26 | [
"MIT"
] | null | null | null | inventory/migrations/0001_initial.py | common1/newassetcms | 65eee3c2ed9dac4cc56bfff863a6cbaff9830d26 | [
"MIT"
] | 7 | 2020-06-05T20:43:46.000Z | 2022-01-13T01:14:21.000Z | inventory/migrations/0001_initial.py | common1/newassetcms | 65eee3c2ed9dac4cc56bfff863a6cbaff9830d26 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.8 on 2019-05-27 22:42
| 67.603896 | 299 | 0.658726 | # Generated by Django 2.1.8 on 2019-05-27 22:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_userforeignkey.models.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependenc... | 0 | 0 | 0 | 10,188 | 0 | 0 | 0 | 62 | 112 |
f7dd57a14d4edf9afe97ac1fddf73b9a1f182d91 | 804 | py | Python | core/migrations/0029_auto_20170827_1818.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | core/migrations/0029_auto_20170827_1818.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | core/migrations/0029_auto_20170827_1818.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-27 15:18
| 33.5 | 207 | 0.616915 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-27 15:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0028_auto_20170802_1453'),
]
operations = [
migrations.AddField(
model_name='event',
... | 24 | 0 | 0 | 654 | 0 | 0 | 0 | 19 | 45 |
48779c72fda0d6c6afcecfc717e63401ad7ffc19 | 3,993 | py | Python | tests/test_objects.py | pershinghar/icinga-notificator | 44ca598157d93f9a5410844acaefdec0bb1f11cf | [
"MIT"
] | 1 | 2019-10-05T15:30:14.000Z | 2019-10-05T15:30:14.000Z | tests/test_objects.py | pershinghar/icinga-notificator | 44ca598157d93f9a5410844acaefdec0bb1f11cf | [
"MIT"
] | null | null | null | tests/test_objects.py | pershinghar/icinga-notificator | 44ca598157d93f9a5410844acaefdec0bb1f11cf | [
"MIT"
] | 1 | 2020-08-19T13:32:40.000Z | 2020-08-19T13:32:40.000Z |
# some tools
# EXITCODES = {0: "OK", 1: "WARNING", 2: "CRITICAL", 3: "UNKNOWN"}
# generate some list of notifications(obj from elastic, class)
# user generation class, sophistically generates data
| 35.026316 | 117 | 0.448535 | from icinga_notificator.classes import icingaNotification
import string
import random
# some tools
# EXITCODES = {0: "OK", 1: "WARNING", 2: "CRITICAL", 3: "UNKNOWN"}
def randomString(stringLength=10):
# Generate a random string of fixed length
letters = string.ascii_lowercase
return "".join(random.choic... | 0 | 0 | 0 | 3,467 | 0 | 169 | 0 | 20 | 133 |
72ebdd78153756ef79542cac5ce533121180ddf8 | 12,548 | py | Python | billing.py | sanketkr/Tkinter | 2a00e1c5cc060ab10c6f4c33cb72c357156befd5 | [
"MIT"
] | 1 | 2021-12-06T11:32:12.000Z | 2021-12-06T11:32:12.000Z | billing.py | sanketkr/Tkinter | 2a00e1c5cc060ab10c6f4c33cb72c357156befd5 | [
"MIT"
] | null | null | null | billing.py | sanketkr/Tkinter | 2a00e1c5cc060ab10c6f4c33cb72c357156befd5 | [
"MIT"
] | null | null | null | import mysql.connector
import pyzbar.pyzbar as pyzbar
root=Tk()
root.wm_state('zoomed')
# root.geometry("400x500")
root.configure(bg="blue")
mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="hp123",
database="mystore1"
)
my_c... | 43.418685 | 352 | 0.613564 | from os import kill
from tkinter import *
from tkinter.font import BOLD
from PIL import ImageTk, Image
import sqlite3
from babel.dates import DateTimeFormat
from tkcalendar import *
import mysql.connector
import pyzbar.pyzbar as pyzbar
import cv2
import qr
from tkinter.ttk import Combobox
from tkinter impor... | 0 | 0 | 0 | 10,673 | 0 | 0 | 0 | 25 | 375 |
e2ef0818daf4f7bc94f8fcbe75c5507a95914d73 | 386 | py | Python | FinalProject_SpeechRecognition/src/libs/inception/slim/slim.py | lev1khachatryan/ASDS_DL | ca00ce7b4cfb722f9bce545820cdb661ff8b643e | [
"MIT"
] | 3 | 2019-12-14T04:48:44.000Z | 2020-02-13T18:35:17.000Z | FinalProject_SpeechRecognition/src/libs/inception/slim/slim.py | lev1khachatryan/ASDS_DL | ca00ce7b4cfb722f9bce545820cdb661ff8b643e | [
"MIT"
] | 1 | 2020-01-10T08:21:59.000Z | 2020-01-10T08:21:59.000Z | FinalProject_SpeechRecognition/src/libs/inception/slim/slim.py | lev1khachatryan/ASDS_DL | ca00ce7b4cfb722f9bce545820cdb661ff8b643e | [
"MIT"
] | null | null | null | """
TF-Slim grouped API. Please see README.md for details and usage.
"""
# pylint: disable=unused-import
# Collapse tf-slim into a single namespace.
| 29.692308 | 64 | 0.810881 | """
TF-Slim grouped API. Please see README.md for details and usage.
"""
# pylint: disable=unused-import
# Collapse tf-slim into a single namespace.
from inception.slim import inception_model as inception
from inception.slim import losses
from inception.slim import ops
from inception.slim import scopes
from inception.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 104 | 132 |
45bc6c3be80613aa3f46f312965fa4881154d7b8 | 234 | py | Python | mw/lib/persistence/tests/test_tokenization.py | frankier/python-mediawiki-utilities | aa066d3d955daa3d20cf09bf5b0d46778dd67a7c | [
"MIT"
] | 23 | 2015-09-13T04:42:24.000Z | 2021-05-28T23:28:57.000Z | mw/lib/persistence/tests/test_tokenization.py | frankier/python-mediawiki-utilities | aa066d3d955daa3d20cf09bf5b0d46778dd67a7c | [
"MIT"
] | 23 | 2015-01-14T04:48:59.000Z | 2015-08-25T19:25:43.000Z | mw/lib/persistence/tests/test_tokenization.py | frankier/python-mediawiki-utilities | aa066d3d955daa3d20cf09bf5b0d46778dd67a7c | [
"MIT"
] | 14 | 2015-09-15T16:04:50.000Z | 2022-01-09T19:18:39.000Z |
from .. import tokenization
| 21.272727 | 67 | 0.542735 | from nose.tools import eq_
from .. import tokenization
def test_wikitext_split():
eq_(
list(tokenization.wikitext_split("foo bar herp {{derp}}")),
["foo", " ", "bar", " ", "herp", " ", "{{", "derp", "}}"]
)
| 0 | 0 | 0 | 0 | 0 | 154 | 0 | 5 | 45 |
051fe4eef239a443c1beb6f25b6a05972591b56a | 14,972 | py | Python | code/rnn/rnn_tensorflow/rnn_general_implement.py | Str0ngerCheng/Blog-Back-Up | 37b89c37a2b3d652e5eb7c3ab8c8cd31e8badde7 | [
"Apache-2.0"
] | null | null | null | code/rnn/rnn_tensorflow/rnn_general_implement.py | Str0ngerCheng/Blog-Back-Up | 37b89c37a2b3d652e5eb7c3ab8c8cd31e8badde7 | [
"Apache-2.0"
] | null | null | null | code/rnn/rnn_tensorflow/rnn_general_implement.py | Str0ngerCheng/Blog-Back-Up | 37b89c37a2b3d652e5eb7c3ab8c8cd31e8badde7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import urllib.request
import os
''''''
file_url = 'https://raw.githubusercontent.com/jcjohnson/torch-rnn/master/data/tiny-shakespeare.txt'
#file_url = 'https://gist.githubusercontent.com/spitis/59bfafe6966bfe60cc206ffbb760269f/'+\
#'raw/030a08754aada17cef14eed6fac7797cda830fe8/variousscripts.tx... | 42.655271 | 132 | 0.648878 | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import urllib.request
import os
import reader
import time
from LayerNormalizedLSTMCell import LayerNormalizedLSTMCell
'''下载数据并读取数据'''
file_url = 'https://raw.githubusercontent.com/jcjohnson/torch-rnn/master/data/tiny-sha... | 1,842 | 0 | 0 | 0 | 135 | 11,739 | 0 | 29 | 313 |
1a3eaeb0fec58e7bff5d49f796181be510f60976 | 1,304 | py | Python | tests/test_sync_session.py | 0dminnimda/brawlpython | b8ad04c643d3bd57a80d416214bd2dc30c562456 | [
"MIT"
] | 1 | 2020-08-24T02:02:42.000Z | 2020-08-24T02:02:42.000Z | tests/test_sync_session.py | 0dminnimda/brawlpython | b8ad04c643d3bd57a80d416214bd2dc30c562456 | [
"MIT"
] | 1 | 2020-10-05T21:10:01.000Z | 2020-10-15T02:51:06.000Z | tests/test_sync_session.py | 0dminnimda/brawlpython | b8ad04c643d3bd57a80d416214bd2dc30c562456 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from configobj import ConfigObj
url_uuid = "http://httpbin.org/uuid"
config = ConfigObj("config.ini")
api_key = config["DEFAULT"].get("API_KEY")
if __name__ == "__main__":
import run_tests
run_tests.run(__file__)
| 18.111111 | 59 | 0.681748 | # -*- coding: utf-8 -*-
from brawlpython.sessions import SyncSession
from brawlpython.api_toolkit import unique, same
from configobj import ConfigObj
import pytest
import time
url_uuid = "http://httpbin.org/uuid"
config = ConfigObj("config.ini")
api_key = config["DEFAULT"].get("API_KEY")
@pytest.yield_fixture
def... | 0 | 288 | 0 | 0 | 0 | 500 | 0 | 32 | 227 |
1dc1754e5b31a7e40e476f1220173250756fa8a6 | 2,524 | py | Python | src/textacy/similarity/hybrid.py | austinjp/textacy | dddfdbf0e0ab3bf756bc4eda042eab1001aac709 | [
"Apache-2.0"
] | 1,929 | 2016-02-14T08:30:38.000Z | 2022-03-31T03:00:35.000Z | src/textacy/similarity/hybrid.py | austinjp/textacy | dddfdbf0e0ab3bf756bc4eda042eab1001aac709 | [
"Apache-2.0"
] | 304 | 2016-02-18T15:52:22.000Z | 2022-03-31T18:06:54.000Z | src/textacy/similarity/hybrid.py | austinjp/textacy | dddfdbf0e0ab3bf756bc4eda042eab1001aac709 | [
"Apache-2.0"
] | 285 | 2016-03-20T04:25:08.000Z | 2022-03-24T11:31:17.000Z | """
Hybrid Metrics
--------------
:mod:`textacy.similarity.hybrid`: Normalized similarity metrics that combine edit-,
token-, and/or sequence-based algorithms.
"""
from __future__ import annotations
from typing import Callable, Sequence
from . import edits
from .. import constants
def token_sort_ratio(s1: str | Se... | 29.011494 | 83 | 0.655309 | """
Hybrid Metrics
--------------
:mod:`textacy.similarity.hybrid`: Normalized similarity metrics that combine edit-,
token-, and/or sequence-based algorithms.
"""
from __future__ import annotations
from typing import Callable, Sequence
from . import edits
from .. import constants
def token_sort_ratio(s1: str | Se... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1d19e32f3d0a46e1d0bea55d83a4142f54c91ec | 3,563 | py | Python | tests/formatters/pe.py | ir4n6/plaso | 010f9cbdfc82e21ed6658657fd09a7b44115c464 | [
"Apache-2.0"
] | null | null | null | tests/formatters/pe.py | ir4n6/plaso | 010f9cbdfc82e21ed6658657fd09a7b44115c464 | [
"Apache-2.0"
] | null | null | null | tests/formatters/pe.py | ir4n6/plaso | 010f9cbdfc82e21ed6658657fd09a7b44115c464 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the PE event formatters."""
from __future__ import unicode_literals
import unittest
if __name__ == '__main__':
unittest.main()
| 27.835938 | 73 | 0.740668 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the PE event formatters."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import pe
from tests.formatters import test_lib
class PECompilationTimeFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the PE compilation ... | 0 | 0 | 0 | 3,183 | 0 | 0 | 0 | 26 | 161 |
0199d21ce2f5f60f6da58ec6cb6b1c7954c4c4ea | 3,845 | py | Python | 07_upload_a_model.py | FAIRdom/api-workshop | ec9db7b7cc556d78d771c2e83234abd4428d9d67 | [
"BSD-3-Clause"
] | 2 | 2020-07-22T11:03:07.000Z | 2021-11-11T09:36:15.000Z | 07_upload_a_model.py | FAIRdom/api-workshop | ec9db7b7cc556d78d771c2e83234abd4428d9d67 | [
"BSD-3-Clause"
] | null | null | null | 07_upload_a_model.py | FAIRdom/api-workshop | ec9db7b7cc556d78d771c2e83234abd4428d9d67 | [
"BSD-3-Clause"
] | 2 | 2019-03-25T11:54:30.000Z | 2020-09-22T09:13:41.000Z | # -*- coding: utf-8 -*-
"""07 Upload a model.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ZaM-sNR9_6vqGBpRobWjTq7gkm4t9bbW
# 7 Uploading Model files
Demonstrates uploading a file (rather than registering a URL). This requires multiple steps,... | 36.971154 | 264 | 0.728218 | # -*- coding: utf-8 -*-
"""07 Upload a model.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ZaM-sNR9_6vqGBpRobWjTq7gkm4t9bbW
# 7 Uploading Model files
Demonstrates uploading a file (rather than registering a URL). This requires multiple steps,... | 0 | 0 | 0 | 0 | 0 | 189 | 0 | -18 | 67 |
d798f0f5170e8e0e2b4fc5e9f5b7fc5115904d0b | 1,489 | py | Python | fashionnets/util/io.py | NiklasHoltmeyer/FashionNets | 918e57f122b8cfa36dba1d0b993c763ba35ac815 | [
"MIT"
] | null | null | null | fashionnets/util/io.py | NiklasHoltmeyer/FashionNets | 918e57f122b8cfa36dba1d0b993c763ba35ac815 | [
"MIT"
] | null | null | null | fashionnets/util/io.py | NiklasHoltmeyer/FashionNets | 918e57f122b8cfa36dba1d0b993c763ba35ac815 | [
"MIT"
] | null | null | null |
def string_serializer(obj):
"""
Helper Function to Serialize Objects. Keeps List / Dict Structure, but will Convert everything else to String.
"""
if type(obj) in [list, tuple]:
return list(map(string_serializer, obj))
if type(obj) == dict:
copy = {}
for k, v in obj.i... | 25.237288 | 114 | 0.638012 | import json
from pathlib import Path
from fashiondatasets.utils.logger.defaultLogger import defaultLogger
def read_file(path, flag="r"):
with open(path, flag) as f:
return f.read()
def write_file(path, data, append=False):
op = "w+" if not append else "a+"
with open(path, op) as f:
f.w... | 0 | 0 | 0 | 0 | 0 | 833 | 0 | 40 | 205 |
33c39e7be077d0eb2f365f388b8273ba5be37adb | 1,430 | py | Python | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Power/Fuel_Cell/Discharge/find_power_larminie.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Power/Fuel_Cell/Discharge/find_power_larminie.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Power/Fuel_Cell/Discharge/find_power_larminie.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | ## @ingroup Methods-Power-Fuel_Cell-Discharge
# find_power_larminie.py
#
# Created : Apr 2015, M. Vegh
# Modified: Sep 2015, M. Vegh
# Feb 2016, E. Botero
# ----------------------------------------------------------------------
# Imports
# -------------------------------------------------------------------... | 31.086957 | 92 | 0.516783 | ## @ingroup Methods-Power-Fuel_Cell-Discharge
# find_power_larminie.py
#
# Created : Apr 2015, M. Vegh
# Modified: Sep 2015, M. Vegh
# Feb 2016, E. Botero
# ----------------------------------------------------------------------
# Imports
# -------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 22 |
22e9d6b1423538ae1ff71fd135ba403b223d1f2f | 4,094 | py | Python | codes/utils.py | MMORTAR/CRPGCN | 3461b1e64a4354f3ea97e1c347b490207e45b77f | [
"Apache-2.0"
] | 1 | 2021-12-08T03:35:11.000Z | 2021-12-08T03:35:11.000Z | codes/utils.py | enjoytoshare/CRPGCN | e926906ce5efdf78e32258a65435bce28a77cda8 | [
"Apache-2.0"
] | 3 | 2021-11-13T08:22:01.000Z | 2021-12-20T08:05:34.000Z | codes/utils.py | enjoytoshare/CRPGCN | e926906ce5efdf78e32258a65435bce28a77cda8 | [
"Apache-2.0"
] | 3 | 2021-11-13T08:24:27.000Z | 2021-12-08T03:37:50.000Z |
def parse_index_file(filename):
"""Parse index file."""
index = []
for line in open(filename):
index.append(int(line.strip()))
return index
def sample_mask(idx, l):
"""Create mask."""
mask = np.zeros(l)
mask[idx] = 1
return np.array(mask, dtype=np.bool)
def normalize_adj(... | 34.694915 | 110 | 0.613092 | from pylab import *
import random
from codes.inits import *
def parse_index_file(filename):
"""Parse index file."""
index = []
for line in open(filename):
index.append(int(line.strip()))
return index
def sample_mask(idx, l):
"""Create mask."""
mask = np.zeros(l)
mask[idx] = 1
... | 0 | 0 | 0 | 0 | 0 | 2,564 | 0 | -6 | 158 |
afa1ad0c77ec7be1acf6ae02fa710c19954c77d0 | 777 | py | Python | FieldConvolution/data_code/process_data.py | zshyang/FieldConvolution | ca88df568a6f2143dcb85d22c005fce4562a7523 | [
"MIT"
] | 1 | 2021-01-03T18:53:06.000Z | 2021-01-03T18:53:06.000Z | FieldConvolution/data_code/process_data.py | zshyang/FieldConvolution | ca88df568a6f2143dcb85d22c005fce4562a7523 | [
"MIT"
] | null | null | null | FieldConvolution/data_code/process_data.py | zshyang/FieldConvolution | ca88df568a6f2143dcb85d22c005fce4562a7523 | [
"MIT"
] | null | null | null | import os
def save_obj():
"""Save the obj file.
"""
os.makedirs(OBJ_FLDR, exist_ok=True)
for stage in STAGE_LIST:
with open(os.path.join(META_FLDR, stage + ".json"), "r") as file:
meta_list = json.load(file)
for meta in tqdm(meta_list):
os.makedirs(os.path.join(... | 32.375 | 73 | 0.534106 | import os
def save_obj():
"""Save the obj file.
"""
os.makedirs(OBJ_FLDR, exist_ok=True)
for stage in STAGE_LIST:
with open(os.path.join(META_FLDR, stage + ".json"), "r") as file:
meta_list = json.load(file)
for meta in tqdm(meta_list):
os.makedirs(os.path.join(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |