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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8ca0d061956f4a636d11ec510aa630a4398db3d6 | 13,043 | py | Python | lib/account.py | ben1schofield/antiope | 601d9b1db1aaf87fa51eb1a75e1579d4faa7aa79 | [
"Apache-2.0"
] | 1 | 2019-10-02T17:31:03.000Z | 2019-10-02T17:31:03.000Z | lib/account.py | PoeBlu/antiope | 6f20035bd6a408457aa27d230075287ef2c56c4e | [
"Apache-2.0"
] | null | null | null | lib/account.py | PoeBlu/antiope | 6f20035bd6a408457aa27d230075287ef2c56c4e | [
"Apache-2.0"
] | null | null | null | import logging
import logging
logger = logging.getLogger()
| 39.644377 | 140 | 0.593805 |
import boto3
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
import json
import os
import logging
import datetime
from dateutil import tz
from pprint import pprint
from lib.vpc import *
import logging
logger = logging.getLogger()
class AWSAccount(object):
"""Class to repre... | 0 | 0 | 0 | 12,676 | 0 | 0 | 0 | 11 | 292 |
c06bd8687329534b74ba4ee409c884cfe3399967 | 3,155 | py | Python | scripts/image_res_dead_spot_results.py | Russ76/teach-repeat | de79d2e6dc82539f5d3082182a7ff04101b6689b | [
"BSD-2-Clause"
] | 20 | 2021-01-25T13:36:47.000Z | 2022-03-21T07:12:03.000Z | scripts/image_res_dead_spot_results.py | Russ76/teach-repeat | de79d2e6dc82539f5d3082182a7ff04101b6689b | [
"BSD-2-Clause"
] | 17 | 2020-10-28T22:04:00.000Z | 2022-03-24T15:51:34.000Z | scripts/image_res_dead_spot_results.py | Russ76/teach-repeat | de79d2e6dc82539f5d3082182a7ff04101b6689b | [
"BSD-2-Clause"
] | 4 | 2021-01-29T18:38:18.000Z | 2021-07-22T05:53:03.000Z | import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import collections
# deadspots = 175.2 (full fov) / res / 2 * discretisation
# eg. 115x44 disc. 5 -> 175.2/115/2*5 = 3.81 deg
# 2nd July (93a92648a5e774c97e3368e3306782382f626b6d) - SR=1, rho=0.1, theta=5 deg
data = {
'115x44':{
... | 29.212963 | 146 | 0.602219 | import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import collections
import copy
# deadspots = 175.2 (full fov) / res / 2 * discretisation
# eg. 115x44 disc. 5 -> 175.2/115/2*5 = 3.81 deg
# 2nd July (93a92648a5e774c97e3368e3306782382f626b6d) - SR=1, rho=0.1, theta=5 deg
data = {
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
4308b7e60bc1b6e948ac4b2df528bfc55040f7e7 | 1,652 | py | Python | 165-compare-version-numbers.py | daicang/Leetcode | 676b05c1222670f73294eb2ed2665433eac148f4 | [
"MIT"
] | null | null | null | 165-compare-version-numbers.py | daicang/Leetcode | 676b05c1222670f73294eb2ed2665433eac148f4 | [
"MIT"
] | null | null | null | 165-compare-version-numbers.py | daicang/Leetcode | 676b05c1222670f73294eb2ed2665433eac148f4 | [
"MIT"
] | null | null | null |
s = Solution()
data = [
['0.1', '0.1.0.0'],
['1.0.1', '1'],
['7.5.2.4', '7.3'],
['1.1', '1.01'],
["19.8.3.17.5.01.0.0.4.0.0.0.0.0.0.0.0.0.0.0.0.0.00.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0... | 36.711111 | 323 | 0.458838 |
class Solution:
def compareVersion(self, version1: str, version2: str) -> int:
v1 = version1.split('.')
v2 = version2.split('.')
for i, val in enumerate(v1):
start = 0
while start < len(val)-1 and val[start] == '0':
start += 1
v1[i] = val[... | 0 | 0 | 0 | 815 | 0 | 0 | 0 | 0 | 23 |
be1b69c5d0ea234f2d671d2a89d76f21628570ee | 29,884 | py | Python | tests/test_app/test_data_store.py | aberki1234/cogent3 | af98b248a999bfeefd4cfed6bd59b4f30442e2d4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_app/test_data_store.py | aberki1234/cogent3 | af98b248a999bfeefd4cfed6bd59b4f30442e2d4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_app/test_data_store.py | aberki1234/cogent3 | af98b248a999bfeefd4cfed6bd59b4f30442e2d4 | [
"BSD-3-Clause"
] | null | null | null | from unittest import main
__author__ = "Gavin Huttley"
__copyright__ = "Copyright 2007-2020, The Cogent Project"
__credits__ = ["Gavin Huttley"]
__license__ = "BSD-3"
__version__ = "2020.7.2a"
__maintainer__ = "Gavin Huttley"
__email__ = "Gavin.Huttley@anu.edu.au"
__status__ = "Alpha"
if __name__ == "__main__... | 40.603261 | 123 | 0.592893 | import json
import os
import shutil
import sys
import zipfile
from tempfile import TemporaryDirectory
from unittest import TestCase, main, skipIf
from cogent3.app.data_store import (
OVERWRITE,
DataStoreMember,
ReadOnlyDirectoryDataStore,
ReadOnlyTinyDbDataStore,
ReadOnlyZippedDataStore,
Singl... | 0 | 1,985 | 0 | 26,947 | 0 | 0 | 0 | 302 | 316 |
e82b51207277c755304ddcf908ffc4afb8f7a161 | 421 | py | Python | temp_post/codepro/label.py | hjunlee91/hjunlee91.github.io | cb9665d12137c4d30018940e3c942f4c52576aa2 | [
"MIT"
] | null | null | null | temp_post/codepro/label.py | hjunlee91/hjunlee91.github.io | cb9665d12137c4d30018940e3c942f4c52576aa2 | [
"MIT"
] | null | null | null | temp_post/codepro/label.py | hjunlee91/hjunlee91.github.io | cb9665d12137c4d30018940e3c942f4c52576aa2 | [
"MIT"
] | null | null | null | N = int(input())
A = []
s2 = set()
for _ in range(N):
x,i = map(int, input().split())
A.append([x,i])
s2.add(i)
ID = dict()
cnt_id = 0
for i in sorted(list(s2)):
ID[i]=cnt_id
cnt_id+=1
B = []
for a,b in A:
B.append([a, ID[b]])
B.sort()
check = [0]*cnt_id
S=0
ans=1000000000
for E in range(len(B)):
check[B[E][1... | 14.033333 | 33 | 0.553444 | N = int(input())
A = []
s2 = set()
for _ in range(N):
x,i = map(int, input().split())
A.append([x,i])
s2.add(i)
ID = dict()
cnt_id = 0
for i in sorted(list(s2)):
ID[i]=cnt_id
cnt_id+=1
B = []
for a,b in A:
B.append([a, ID[b]])
B.sort()
check = [0]*cnt_id
S=0
ans=1000000000
for E in range(len(B)):
check[B[E][1... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58a703e4551acbea1e3f6f81266195e65582ec5b | 926 | py | Python | patterns/creational/singleton.py | TrendingTechnology/python-patterns-1 | 426482f58b86a0a7525e303444338e9bb73698de | [
"BSD-3-Clause"
] | 2 | 2021-09-23T16:41:42.000Z | 2021-11-20T11:54:42.000Z | patterns/creational/singleton.py | TrendingTechnology/python-patterns-1 | 426482f58b86a0a7525e303444338e9bb73698de | [
"BSD-3-Clause"
] | null | null | null | patterns/creational/singleton.py | TrendingTechnology/python-patterns-1 | 426482f58b86a0a7525e303444338e9bb73698de | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ********************************************************
# Author and developer: Aleksandr Suvorov
# --------------------------------------------------------
# Licensed: BSD 3-Clause License (see LICENSE for details)
# --------------------------------------------------------
# Url: https://git... | 29.870968 | 61 | 0.403888 | # -*- coding: utf-8 -*-
# ********************************************************
# Author and developer: Aleksandr Suvorov
# --------------------------------------------------------
# Licensed: BSD 3-Clause License (see LICENSE for details)
# --------------------------------------------------------
# Url: https://git... | 2 | 0 | 0 | 148 | 0 | 72 | 0 | 0 | 46 |
5cd6fc7fcc3026c381564cc53655cb8d630830e1 | 1,486 | py | Python | src/chain_of_responsibility.py | MrRezoo/design-patterns-python | 8f8e2501ad8e05f1a75ce5be659d926c0ec99698 | [
"MIT"
] | 6 | 2021-03-21T08:39:34.000Z | 2021-06-08T13:05:34.000Z | src/chain_of_responsibility.py | MrRezoo/design-patterns-python | 8f8e2501ad8e05f1a75ce5be659d926c0ec99698 | [
"MIT"
] | null | null | null | src/chain_of_responsibility.py | MrRezoo/design-patterns-python | 8f8e2501ad8e05f1a75ce5be659d926c0ec99698 | [
"MIT"
] | 1 | 2021-12-26T16:59:19.000Z | 2021-12-26T16:59:19.000Z | """
Behavioral pattern:
Chain of responsibility
"""
# -----------------------------------------------------------------
# -----------------------------------------------------------------
request = [3, 14, 34, 9]
c1 = Client()
c1.delegate(request)
| 24.766667 | 76 | 0.579408 | """
Behavioral pattern:
Chain of responsibility
"""
from abc import ABC, abstractmethod
class AbstractHandler(ABC):
def __init__(self, successor):
self._successor = successor
def handle(self, request):
handled = self.process_request(request)
if not handled:
se... | 0 | 47 | 0 | 1,019 | 0 | 0 | 0 | 14 | 136 |
af16ed4c83f7e0a7a4adb93e851d893b2b8fda24 | 212 | py | Python | core/admin.py | jhonnyperalta/trivago-serve | 50d8394200ae1e9a4b19b55fb6e23395832989aa | [
"MIT"
] | null | null | null | core/admin.py | jhonnyperalta/trivago-serve | 50d8394200ae1e9a4b19b55fb6e23395832989aa | [
"MIT"
] | 2 | 2020-06-05T18:31:15.000Z | 2021-06-10T20:29:29.000Z | core/admin.py | jhonnyperalta/trivago-serve | 50d8394200ae1e9a4b19b55fb6e23395832989aa | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, Persona
# Register your models here.
admin.site.register(User, UserAdmin)
admin.site.register(Persona)
| 23.555556 | 47 | 0.811321 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, Persona
# Register your models here.
admin.site.register(User, UserAdmin)
admin.site.register(Persona)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8430e8f299b05738722d11d0be6c76aaef30be80 | 1,703 | py | Python | runtime/recompile.py | blapplejuice/ByteClient | 5f04232468dfe5b609c043e3d4b094ff667d9c51 | [
"MIT"
] | 5 | 2021-06-01T14:25:01.000Z | 2022-02-11T10:15:10.000Z | runtime/recompile.py | blapplejuice/ByteClient | 5f04232468dfe5b609c043e3d4b094ff667d9c51 | [
"MIT"
] | 3 | 2021-02-23T08:47:27.000Z | 2021-02-26T11:58:18.000Z | runtime/recompile.py | blapplejuice/ByteClient | 5f04232468dfe5b609c043e3d4b094ff667d9c51 | [
"MIT"
] | 2 | 2021-03-27T15:43:42.000Z | 2021-03-27T15:50:42.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 8 16:54:36 2011
@author: ProfMobius
@version: v1.0
"""
if __name__ == '__main__':
main()
| 29.362069 | 117 | 0.637111 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 8 16:54:36 2011
@author: ProfMobius
@version: v1.0
"""
import sys
import logging
from optparse import OptionParser
from commands import Commands, CLIENT, SERVER, CalledProcessError
from mcp import recompile_side
def main():
parser = OptionParser(version='MCP %s' ... | 0 | 0 | 0 | 0 | 0 | 1,353 | 0 | 47 | 158 |
a33bf98e7a492b45a1af1b77fdb0e03823a18c50 | 43 | py | Python | modules/math-codes/modules/algebra/intro-to-equations/src/eq02.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | 1 | 2020-09-06T22:17:19.000Z | 2020-09-06T22:17:19.000Z | modules/math-codes/modules/algebra/intro-to-equations/src/eq02.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | modules/math-codes/modules/algebra/intro-to-equations/src/eq02.py | drigols/Studies | 9c293156935b491ded24be6b511daac67fd43538 | [
"MIT"
] | null | null | null | x = 4
result = 3*x - 2 == 10
print(result)
| 10.75 | 22 | 0.55814 | x = 4
result = 3*x - 2 == 10
print(result)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
83ff113379169d48d07485d451ef7cdc5cccdbfb | 1,457 | py | Python | morphine/number_model.py | kmike/morphine | 30f06f348042fa67687f315151d00c0ed41c5c38 | [
"MIT"
] | 11 | 2015-03-24T12:17:17.000Z | 2021-01-27T15:49:06.000Z | morphine/number_model.py | kmike/morphine | 30f06f348042fa67687f315151d00c0ed41c5c38 | [
"MIT"
] | 2 | 2018-11-04T15:18:29.000Z | 2020-06-19T07:41:19.000Z | morphine/number_model.py | kmike/morphine | 30f06f348042fa67687f315151d00c0ed41c5c38 | [
"MIT"
] | 3 | 2015-11-04T19:00:55.000Z | 2017-05-11T13:26:57.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
| 33.883721 | 91 | 0.57035 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from morphine import features
from morphine.feature_extractor import FeatureExtractor
from morphine.basetagger import PartialTagger
class NumberFeatureExtractor(FeatureExtractor):
IGNORE = {'Arch', 'intg', 'real', 'GNdr', 'Ms-f'}
def __init__(se... | 0 | 0 | 0 | 1,213 | 0 | 0 | 0 | 66 | 113 |
968c1fe44a134e1f5c61ae57ac247871e0b20d7e | 712 | py | Python | tests/app/migrations/0007_cloudinaryimageexample_image_public.py | dldevinc/paper-uploads | 9414b6e6fbaa52eadacd9852ce3c4d84c6c2c939 | [
"BSD-3-Clause"
] | 3 | 2020-06-05T10:43:05.000Z | 2022-02-22T16:46:16.000Z | tests/app/migrations/0007_cloudinaryimageexample_image_public.py | dldevinc/paper-uploads | 9414b6e6fbaa52eadacd9852ce3c4d84c6c2c939 | [
"BSD-3-Clause"
] | 2 | 2021-04-03T12:25:20.000Z | 2022-02-02T06:10:46.000Z | tests/app/migrations/0007_cloudinaryimageexample_image_public.py | dldevinc/paper-uploads | 9414b6e6fbaa52eadacd9852ce3c4d84c6c2c939 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-25 13:48
| 32.363636 | 218 | 0.712079 | # Generated by Django 3.2.6 on 2021-08-25 13:48
from django.db import migrations
import django.db.models.deletion
import paper_uploads.cloudinary.models.fields.image
class Migration(migrations.Migration):
dependencies = [
('paper_uploads_cloudinary', '0002_auto_20210407_0627'),
('app', '0006_aut... | 0 | 0 | 0 | 521 | 0 | 0 | 0 | 52 | 90 |
2a098b6427c2f6a9f8f4fe7a40dfaa6948fd59f1 | 8,116 | py | Python | language/processors/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | 2 | 2016-01-10T08:45:29.000Z | 2019-10-25T06:53:39.000Z | language/processors/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | 3 | 2016-01-07T15:43:40.000Z | 2016-01-09T14:44:08.000Z | language/processors/__init__.py | nathanIL/openews | 17f07de528342944f26855192db8019a0dbcc3a0 | [
"Apache-2.0"
] | null | null | null | import nltk
nltk.data.path.append('nltk_data')
| 37.059361 | 119 | 0.645515 | from nltk.tokenize import word_tokenize
from server.db import MongoClientContext
from operator import itemgetter
from server import server_app
from collections import defaultdict
from itertools import chain
import string
import tempfile
import os
import nltk
import logging
nltk.data.path.append('nltk_data')
class Si... | 0 | 1,880 | 0 | 5,902 | 0 | 0 | 0 | 42 | 243 |
30794d69ff6dd39f95cd378399c5d770d7faac71 | 16,284 | py | Python | clip_optimizer.py | igg002/stylegan2-ada-pytorch | f9e58945e599ce09d3a21bb2c49dd5fdab2d5f54 | [
"BSD-Source-Code"
] | null | null | null | clip_optimizer.py | igg002/stylegan2-ada-pytorch | f9e58945e599ce09d3a21bb2c49dd5fdab2d5f54 | [
"BSD-Source-Code"
] | null | null | null | clip_optimizer.py | igg002/stylegan2-ada-pytorch | f9e58945e599ce09d3a21bb2c49dd5fdab2d5f54 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... | 44.370572 | 227 | 0.616126 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... | 0 | 5,906 | 0 | 0 | 0 | 8,499 | 0 | -64 | 269 |
69af445a04a27d56d243c63c31d68a12f611d97f | 5,116 | py | Python | Python_Scripts/loadModels.py | ICB-DCM/solverstudy | 0aea105c115bbf92d13cc19d88ab554438abdd38 | [
"MIT"
] | null | null | null | Python_Scripts/loadModels.py | ICB-DCM/solverstudy | 0aea105c115bbf92d13cc19d88ab554438abdd38 | [
"MIT"
] | 3 | 2020-11-22T21:32:07.000Z | 2020-11-22T21:54:09.000Z | Python_Scripts/loadModels.py | ICB-DCM/solverstudy | 0aea105c115bbf92d13cc19d88ab554438abdd38 | [
"MIT"
] | null | null | null | # load every working model from the model collection into workspace
import sys
import os
import importlib
import pandas as pd
import numpy as np
import libsbml
from C import DIR_MODELS
def get_submodel(submodel_path: str,
model_info: pd.DataFrame):
"""
This function load an amici model modu... | 37.617647 | 84 | 0.707389 | # load every working model from the model collection into workspace
import sys
import os
import importlib
import pandas as pd
import numpy as np
import libsbml
from C import DIR_MODELS_REGROUPED, DIR_MODELS
def get_submodel(submodel_path: str,
model_info: pd.DataFrame):
"""
This function lo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 0 |
2456dcdadaf8eaca99afd2460faae69a7a71c048 | 23,563 | py | Python | python/mlfeaturizer/core/featurizer.py | adobe/ml-featurizer | 3e142f22c92cb57e85fe093ed322fec903bec23a | [
"Apache-2.0"
] | 13 | 2018-05-18T23:11:40.000Z | 2021-01-24T23:37:16.000Z | python/mlfeaturizer/core/featurizer.py | adobe/ml-featurizer | 3e142f22c92cb57e85fe093ed322fec903bec23a | [
"Apache-2.0"
] | 16 | 2018-06-15T20:48:16.000Z | 2019-01-23T01:19:56.000Z | python/mlfeaturizer/core/featurizer.py | adobe/ml-featurizer | 3e142f22c92cb57e85fe093ed322fec903bec23a | [
"Apache-2.0"
] | 4 | 2018-05-19T10:03:28.000Z | 2020-09-26T15:48:36.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 us... | 35.168657 | 116 | 0.619997 | #
# 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 us... | 0 | 21,683 | 0 | 0 | 0 | 0 | 0 | 237 | 499 |
8ac1df06bf5f8802f34f809cd97112ac920267ea | 6,026 | py | Python | evoltree/fitness/sequence_match.py | p-pereira/MGEDT | 99e4b3ee2d07d4ba5b261e09d0ee20f83497af53 | [
"MIT"
] | 3 | 2021-06-17T17:25:44.000Z | 2021-09-07T14:13:11.000Z | evoltree/fitness/sequence_match.py | p-pereira/evoltree | 99e4b3ee2d07d4ba5b261e09d0ee20f83497af53 | [
"MIT"
] | null | null | null | evoltree/fitness/sequence_match.py | p-pereira/evoltree | 99e4b3ee2d07d4ba5b261e09d0ee20f83497af53 | [
"MIT"
] | null | null | null |
import editdistance # https://pypi.python.org/pypi/editdistance
import lzstring # https://pypi.python.org/pypi/lzstring/
import dtw # https://pypi.python.org/pypi/dtw
"""
This fitness function is for a sequence-match problem: we're given
an integer sequence target, say [0, 5, 0, 5, 0, 5], and we try to synthesize... | 25.974138 | 79 | 0.579821 | from ..algorithm.parameters import params
from ..fitness.base_ff_classes.base_ff import base_ff
import editdistance # https://pypi.python.org/pypi/editdistance
import lzstring # https://pypi.python.org/pypi/lzstring/
import dtw # https://pypi.python.org/pypi/dtw
"""
This fitness function is for a sequence-match p... | 0 | 0 | 0 | 2,672 | 205 | 0 | 0 | 52 | 90 |
371284f9460d6c0e7ac059fc543b46adea1828f3 | 2,554 | py | Python | constants.py | kkairos/unreliable-cartographer-plus | de777491f19d74554c85f6a84f51149e1c2c1969 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | constants.py | kkairos/unreliable-cartographer-plus | de777491f19d74554c85f6a84f51149e1c2c1969 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | constants.py | kkairos/unreliable-cartographer-plus | de777491f19d74554c85f6a84f51149e1c2c1969 | [
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | from math import radians, cos, sin
THETAS = []
for theta in range(1080):
theta = radians(float(theta/3))
xd_d = float(cos(theta))
yd_d = float(sin(theta))
THETAS.append((xd_d,yd_d))
LINES = {
"top-left" : 201,
"bottom-right" : 188,
"top-right" : 187,
"left-right" : 186,
"bottom-left" : 200,... | 17.026667 | 69 | 0.472592 | from enum import Enum
from math import radians, cos, sin
class Faction(Enum):
Ally = 0
Enemy = 1
class DrawOrder(Enum):
FLOOR = 0
NPC = 1
PLAYER = 2
THETAS = []
for theta in range(1080):
theta = radians(float(theta/3))
xd_d = float(cos(theta))
yd_d = float(sin(theta))
THETAS.append((xd_d,... | 0 | 0 | 0 | 58 | 0 | 0 | 0 | 0 | 73 |
e92880792f08d15d4ba8d2c8c5ab8d7fc898ab79 | 13,823 | py | Python | kmip/core/messages/payloads/set_attribute.py | ondrap/PyKMIP | c8ea17d8faf827e0f9d004972835128a1a71569f | [
"Apache-2.0"
] | 179 | 2015-03-20T06:08:59.000Z | 2022-03-14T02:24:38.000Z | kmip/core/messages/payloads/set_attribute.py | imharshr/PyKMIP | 9403ff3d2aa83de4c786b8eedeb85d169fd4a594 | [
"Apache-2.0"
] | 600 | 2015-04-08T14:14:48.000Z | 2022-03-28T13:49:47.000Z | kmip/core/messages/payloads/set_attribute.py | imharshr/PyKMIP | 9403ff3d2aa83de4c786b8eedeb85d169fd4a594 | [
"Apache-2.0"
] | 131 | 2015-03-30T12:51:49.000Z | 2022-03-23T04:34:34.000Z | # Copyright (c) 2019 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 34.5575 | 79 | 0.604717 | # Copyright (c) 2019 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | 0 | 1,481 | 0 | 11,439 | 0 | 0 | 0 | 54 | 202 |
124b512d26fa5122c6456d7112680cc8b2389891 | 655 | py | Python | api/sonetworks/migrations/0040_auto_20170520_0339.py | gvaldez81/semitki | 6c7cbb2bb2260db79478de48a9b2e71b8ed633ff | [
"MIT"
] | null | null | null | api/sonetworks/migrations/0040_auto_20170520_0339.py | gvaldez81/semitki | 6c7cbb2bb2260db79478de48a9b2e71b8ed633ff | [
"MIT"
] | 51 | 2017-02-07T22:30:49.000Z | 2022-03-11T23:15:55.000Z | api/sonetworks/migrations/0040_auto_20170520_0339.py | gvaldez81/semitki | 6c7cbb2bb2260db79478de48a9b2e71b8ed633ff | [
"MIT"
] | 1 | 2017-10-09T14:21:35.000Z | 2017-10-09T14:21:35.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-20 03:39
from __future__ import unicode_literals
| 25.192308 | 74 | 0.603053 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-20 03:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0039_auto_20170520_0305'),
]
operations = [
migrations.AddFie... | 0 | 0 | 0 | 476 | 0 | 0 | 0 | 19 | 46 |
649ef46b4ed4f8ea1e945cb524909f25b6f177d8 | 8,713 | py | Python | iscc_service/main.py | iscc/iscc-service | bd33bb9de20b2d4b79115cab0afb7a3e436ddfa1 | [
"MIT"
] | 6 | 2020-01-29T14:07:50.000Z | 2021-06-11T04:40:19.000Z | iscc_service/main.py | iscc/iscc-service | bd33bb9de20b2d4b79115cab0afb7a3e436ddfa1 | [
"MIT"
] | 22 | 2020-01-31T17:27:48.000Z | 2022-01-27T12:17:49.000Z | iscc_service/main.py | iscc/iscc-service | bd33bb9de20b2d4b79115cab0afb7a3e436ddfa1 | [
"MIT"
] | 1 | 2021-01-16T13:11:35.000Z | 2021-01-16T13:11:35.000Z | import uvicorn
from fastapi import FastAPI
import iscc_service
from iscc_service.config import ALLOWED_ORIGINS
from starlette.middleware.cors import CORSMiddleware
app = FastAPI(
title="ISCC Web Service API",
version=iscc_service.__version__,
description="Microservice for creating ISCC Codes from Media Fi... | 28.106452 | 88 | 0.641226 | import os
import shutil
import uuid
from os.path import join, splitext
from typing import List
import mobi
import uvicorn
from fastapi import FastAPI, UploadFile, File, Form, HTTPException
import iscc
from iscc_cli.tika import detector, parser
from iscc_cli.const import SUPPORTED_MIME_TYPES, GMT
import iscc_service
fr... | 0 | 6,884 | 0 | 0 | 0 | 80 | 0 | 543 | 582 |
d6471f7e03a8cbee3d2cadbc9b631349b42b4c19 | 1,684 | py | Python | Custom.py | bopchik/Simple-minecraft-mod-launcher | 52e4e8ec351b0bac7eb4fe707f21de8da14b9ac9 | [
"BSD-2-Clause"
] | 1 | 2021-06-17T18:19:41.000Z | 2021-06-17T18:19:41.000Z | Custom.py | bopchik/Simple-minecraft-mod-launcher | 52e4e8ec351b0bac7eb4fe707f21de8da14b9ac9 | [
"BSD-2-Clause"
] | null | null | null | Custom.py | bopchik/Simple-minecraft-mod-launcher | 52e4e8ec351b0bac7eb4fe707f21de8da14b9ac9 | [
"BSD-2-Clause"
] | 3 | 2021-06-17T18:19:44.000Z | 2021-06-17T22:18:34.000Z |
Modpack_name = "My modpack" #appears in the about dialog
Modpack_author = "My name" #appears in the about dialog
Modpack_url = "http://example.com/" #link to this appears in the about dialog
M... | 76.545455 | 204 | 0.597387 |
Modpack_name = "My modpack" #appears in the about dialog
Modpack_author = "My name" #appears in the about dialog
Modpack_url = "http://example.com/" #link to this appears in the about dialog
M... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3fb493466694145d2a51bd90378fde63859be5a5 | 3,828 | py | Python | cognito/scripts/cli.py | nibir-paul/cognito | 01ae134af44b911b0220fbc27c5f8fd032de63c3 | [
"BSD-3-Clause"
] | null | null | null | cognito/scripts/cli.py | nibir-paul/cognito | 01ae134af44b911b0220fbc27c5f8fd032de63c3 | [
"BSD-3-Clause"
] | null | null | null | cognito/scripts/cli.py | nibir-paul/cognito | 01ae134af44b911b0220fbc27c5f8fd032de63c3 | [
"BSD-3-Clause"
] | null | null | null | import os
import yaml
import click
import pickle
from pyfiglet import Figlet
def save_to(path, df, encoder):
"""
Save the encoded dataframe to csv file and
picle file.
:param path: The path
:type path: { type_description }
:param df: { parameter_descriptio... | 23.925 | 113 | 0.599791 | import os
import six
import shutil
import yaml
import click
import pickle
import pandas as pd
from pyfiglet import figlet_format, Figlet
from prettytable import PrettyTable
from cognito.table import Table
from datetime import datetime
from tqdm import tqdm, trange
def get_all_files():
import os
files = [f fo... | 0 | 1,804 | 0 | 0 | 0 | 92 | 0 | 34 | 246 |
6ad6f42ef33eb179b12a3228c8683d74f5416b4d | 1,151 | py | Python | test.py | ANDROID564/pc_cyber_lab | 704aa94ec74f78d9221f4c0f96cfa62a9e10d3ef | [
"Apache-2.0"
] | null | null | null | test.py | ANDROID564/pc_cyber_lab | 704aa94ec74f78d9221f4c0f96cfa62a9e10d3ef | [
"Apache-2.0"
] | null | null | null | test.py | ANDROID564/pc_cyber_lab | 704aa94ec74f78d9221f4c0f96cfa62a9e10d3ef | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 12 12:51:11 2018
@author: admin
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 15:12:22 2018
@author: admin
"""
import cv2
cap = cv2.VideoCapture('2.avi')
hsv_original = cv2.cvtColor(original_image, cv2.COLOR_BGR2HSV)
roi = cv2.imread("per... | 25.021739 | 82 | 0.672459 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 12 12:51:11 2018
@author: admin
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 15:12:22 2018
@author: admin
"""
from video_pixels import video
import numpy as np
import cv2
from matplotlib import pyplot as plt
cap = cv2.VideoCapture('2.avi')
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 69 |
7a5863d2407acb1f2e6db530343f711587a28bda | 188 | py | Python | tests/source/input/import_variable.py | tomaarsen/module_dependencies | 4b452bf9dcea28df4ed2e632f33eda627b2363f5 | [
"MIT"
] | 1 | 2022-01-22T17:11:20.000Z | 2022-01-22T17:11:20.000Z | tests/source/input/import_variable.py | tomaarsen/module_dependencies | 4b452bf9dcea28df4ed2e632f33eda627b2363f5 | [
"MIT"
] | null | null | null | tests/source/input/import_variable.py | tomaarsen/module_dependencies | 4b452bf9dcea28df4ed2e632f33eda627b2363f5 | [
"MIT"
] | null | null | null | from nltk import corpus, stopwords, tokenize
output = tokenize.TextTilingTokenizer().tokenize(corpus.brown.raw()[0:10000])
output = [token for token in output if token not in stopwords]
| 31.333333 | 77 | 0.776596 | from nltk import corpus, stopwords, tokenize
output = tokenize.TextTilingTokenizer().tokenize(corpus.brown.raw()[0:10000])
output = [token for token in output if token not in stopwords]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c5774bdf1404bb966d68c427702b7029734839e4 | 2,347 | py | Python | citest/kube_testing/kubectl_agent.py | armory-io/citest | 56f2dfa991a377519e9be4c7f472fb9c80ec9fac | [
"Apache-2.0"
] | 69 | 2016-04-05T15:15:49.000Z | 2021-10-21T01:29:36.000Z | citest/kube_testing/kubectl_agent.py | armory-io/citest | 56f2dfa991a377519e9be4c7f472fb9c80ec9fac | [
"Apache-2.0"
] | 95 | 2016-04-06T13:31:09.000Z | 2020-08-13T22:53:40.000Z | citest/kube_testing/kubectl_agent.py | armory-io/citest | 56f2dfa991a377519e9be4c7f472fb9c80ec9fac | [
"Apache-2.0"
] | 50 | 2016-04-05T14:10:57.000Z | 2021-10-21T01:29:26.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.029851 | 80 | 0.716233 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 500 | 0 | 1,064 | 0 | 0 | 0 | 22 | 67 |
8204c955a6fee36a3b286df9d79307d50056cea7 | 52,892 | py | Python | hera_cal/tests/test_io.py | LBJ-Wade/hera_cal | 868122b04b8e7f627aa72317427f89ca3eaf7d60 | [
"MIT"
] | 10 | 2017-06-22T22:14:23.000Z | 2022-03-08T17:33:45.000Z | hera_cal/tests/test_io.py | LBJ-Wade/hera_cal | 868122b04b8e7f627aa72317427f89ca3eaf7d60 | [
"MIT"
] | 610 | 2017-06-22T22:16:27.000Z | 2022-03-31T16:11:34.000Z | hera_cal/tests/test_io.py | LBJ-Wade/hera_cal | 868122b04b8e7f627aa72317427f89ca3eaf7d60 | [
"MIT"
] | 8 | 2017-10-30T18:16:19.000Z | 2021-04-01T09:20:18.000Z | # -*- coding: utf-8 -*-
# Copyright 2019 the HERA Project
# Licensed under the MIT License
'''Tests for io.py'''
from .. import io
| 45.675302 | 168 | 0.604231 | # -*- coding: utf-8 -*-
# Copyright 2019 the HERA Project
# Licensed under the MIT License
'''Tests for io.py'''
import pytest
import numpy as np
import os
import warnings
import shutil
import copy
from collections import OrderedDict as odict
import pyuvdata
from pyuvdata import UVCal, UVData, UVFlag
from pyuvdata.ut... | 0 | 30,211 | 0 | 16,350 | 0 | 5,470 | 0 | 113 | 605 |
53aa16faa7c602e62edd721652f7060aa128c59d | 1,758 | py | Python | test/docs/wiki_usage_test_2.py | acaceres2176/massweb | 153d1e00ee293f467e88e7f5ce98617a5c13cfb7 | [
"Apache-2.0"
] | null | null | null | test/docs/wiki_usage_test_2.py | acaceres2176/massweb | 153d1e00ee293f467e88e7f5ce98617a5c13cfb7 | [
"Apache-2.0"
] | null | null | null | test/docs/wiki_usage_test_2.py | acaceres2176/massweb | 153d1e00ee293f467e88e7f5ce98617a5c13cfb7 | [
"Apache-2.0"
] | null | null | null | """
>>> from massweb.mass_requests.mass_request import MassRequest
>>> from massweb.targets.target import Target
>>>
>>> target_1 = Target(url=u"http://course.hyperiongray.com/vuln1", data={"password": "blh123"}, ttype="post")
>>> target_2 = Target(url=u"http://course.hyperiongray.com/vuln2/898538a7... | 46.263158 | 148 | 0.695677 | """
>>> from massweb.mass_requests.mass_request import MassRequest
>>> from massweb.targets.target import Target
>>>
>>> target_1 = Target(url=u"http://course.hyperiongray.com/vuln1", data={"password": "blh123"}, ttype="post")
>>> target_2 = Target(url=u"http://course.hyperiongray.com/vuln2/898538a7... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a1141842d664fe3836f21c40666cdb5c03cce59 | 1,427 | py | Python | ingest.py | rahiml31/nfl-conversion-rate | c39ba67eb572b15a949f0d15de388803795ae9c2 | [
"MIT"
] | null | null | null | ingest.py | rahiml31/nfl-conversion-rate | c39ba67eb572b15a949f0d15de388803795ae9c2 | [
"MIT"
] | null | null | null | ingest.py | rahiml31/nfl-conversion-rate | c39ba67eb572b15a949f0d15de388803795ae9c2 | [
"MIT"
] | null | null | null | import sys
if __name__ == '__main__':
main(sys.argv)
| 29.122449 | 77 | 0.622285 | import pandas as pd
import sys
import json
import sqlite3
def main(args):
try:
# Parse out the command-line arguments #
props_path = args[1]
data_path = args[2]
# Read in the properties file #
with open(props_path) as x:
props = json.load(x)
# Read in t... | 0 | 0 | 0 | 0 | 0 | 1,294 | 0 | -19 | 93 |
1a5ffaa37a47a6f64a4feec2a441751b9328238e | 559 | py | Python | spacy.py | ambuj1234/NLP | 141b019df93f2830ba7fee2a3f62a9aff017b922 | [
"Apache-2.0"
] | null | null | null | spacy.py | ambuj1234/NLP | 141b019df93f2830ba7fee2a3f62a9aff017b922 | [
"Apache-2.0"
] | null | null | null | spacy.py | ambuj1234/NLP | 141b019df93f2830ba7fee2a3f62a9aff017b922 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""spacy.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1PvWiuiOWi9TFTT6hZQJrobxF87dT5LBY
"""
!pip3 install spacy
import spacy
import time
nlp=spacy.load('en') # this will use nltk_data folder to load library
data="i ... | 20.703704 | 77 | 0.728086 | # -*- coding: utf-8 -*-
"""spacy.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1PvWiuiOWi9TFTT6hZQJrobxF87dT5LBY
"""
!pip3 install spacy
import spacy
import time
nlp=spacy.load('en') # this will use nltk_data folder to load library
data="i ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
938e116c2945a7e10e587b5f42ef6ecd34d814a7 | 6,312 | py | Python | bchydro/api.py | Nebual/bchydro | 4db88308d6fa2f8a245fd7408b8572c062e5a75b | [
"MIT"
] | null | null | null | bchydro/api.py | Nebual/bchydro | 4db88308d6fa2f8a245fd7408b8572c062e5a75b | [
"MIT"
] | null | null | null | bchydro/api.py | Nebual/bchydro | 4db88308d6fa2f8a245fd7408b8572c062e5a75b | [
"MIT"
] | null | null | null | import logging
_LOGGER = logging.getLogger(__name__)
| 36.068571 | 94 | 0.520596 | import aiohttp
import logging
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup
from .types import (
BCHydroAccount,
BCHydroInterval,
BCHydroRates,
BCHydroDailyElectricity,
BCHydroDailyUsage,
)
from .const import (
USER_AGENT,
URL_POST_LOGIN,
URL_GET_ACCOUNT_JSON,
UR... | 0 | 0 | 4,850 | 1,053 | 0 | 0 | 0 | 219 | 135 |
589dc0ead3c64441eaeb8ceda3713a90bf911c59 | 1,392 | py | Python | get_duration.py | bhaaratchetty/Extract-Fashion-from-Videos | a6a0459dea8a7f4ed22ec2b874576d2cecdbf2cd | [
"MIT"
] | 5 | 2018-01-21T16:47:59.000Z | 2021-09-07T17:42:17.000Z | get_duration.py | bhaaratchetty/Extract-Fashion-from-Videos | a6a0459dea8a7f4ed22ec2b874576d2cecdbf2cd | [
"MIT"
] | 2 | 2018-02-07T16:45:52.000Z | 2018-02-26T15:38:48.000Z | get_duration.py | bhaaratchetty/Extract-Fashion-from-Videos | a6a0459dea8a7f4ed22ec2b874576d2cecdbf2cd | [
"MIT"
] | 1 | 2019-03-26T14:34:53.000Z | 2019-03-26T14:34:53.000Z | # 1. After getting the duration iterate through each second and get the frames
# at each second
# 2. Next step is to get how much ever frames you want in that second with the upper-
# bound of min(X,FPS)
# 3. Need to see whether to save the images /Frames and then randomly select min(X,FPS)
# ... | 29 | 107 | 0.611351 | # 1. After getting the duration iterate through each second and get the frames
# at each second
# 2. Next step is to get how much ever frames you want in that second with the upper-
# bound of min(X,FPS)
# 3. Need to see whether to save the images /Frames and then randomly select min(X,FPS)
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7b688e26273b41c038141ad6693a1fea669051b7 | 372 | py | Python | main/replace-words/replace-words-roughscratch.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/replace-words/replace-words-roughscratch.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/replace-words/replace-words-roughscratch.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | WORD_MARK = None
| 18.6 | 32 | 0.395161 | WORD_MARK = None
def build_trie(words):
trie = {}
for word in words:
node = trie
for ch in word:
try:
node = node[ch]
except KeyError:
child = {}
node[ch] = child
node = child
... | 0 | 0 | 0 | 0 | 0 | 332 | 0 | 0 | 23 |
27b25eda62b0da6c6884161f79c2edb610b9eb68 | 344 | py | Python | Scripts/test/test_pipeline.py | thesyght/ny-ride-share-analysis | e496874c0665176472738b48be8023a275b87e7d | [
"Unlicense"
] | null | null | null | Scripts/test/test_pipeline.py | thesyght/ny-ride-share-analysis | e496874c0665176472738b48be8023a275b87e7d | [
"Unlicense"
] | null | null | null | Scripts/test/test_pipeline.py | thesyght/ny-ride-share-analysis | e496874c0665176472738b48be8023a275b87e7d | [
"Unlicense"
] | null | null | null | ''' Runs unit tests for Util functionality '''
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
| 26.461538 | 73 | 0.752907 | ''' Runs unit tests for Util functionality '''
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import unittest
from main.consolidate_uber_data import Pipeline
class PieplineTests(unittest.TestCase):
def test_csv_list(self):
self.assertEqual(len(Pipeline().get_list_... | 0 | 0 | 0 | 121 | 0 | 0 | 0 | 20 | 68 |
88dbbd363dedaa6ade14df5482dd1634d3ee6090 | 8,818 | py | Python | tarot_deck.py | williamsonf/tarot-deck | acce545be0a475674e2c00684809164507fc0973 | [
"MIT"
] | null | null | null | tarot_deck.py | williamsonf/tarot-deck | acce545be0a475674e2c00684809164507fc0973 | [
"MIT"
] | null | null | null | tarot_deck.py | williamsonf/tarot-deck | acce545be0a475674e2c00684809164507fc0973 | [
"MIT"
] | null | null | null | '''
Created on May 10, 2021
@author: Fred
'''
if __name__ == '__main__':
deck = tdeck()
table = card_table('Tester', deck, 'Seven')
while table.draw_max > len(table.deck.hand):
table.next_step()
print(table.deck.get_name())
print(table.deck.get_desc())
tabl... | 39.542601 | 103 | 0.532774 | '''
Created on May 10, 2021
@author: Fred
'''
from PIL import Image
from datetime import datetime
import random, os
class tdeck():
'''
classdocs
'''
def __init__(self, card_dir='./card_images/', invert=True, invert_chance=25):
'''
Args
----
card_dir :... | 0 | 0 | 0 | 8,354 | 0 | 0 | 0 | 4 | 127 |
d529b8c0a54392e230daf1dcd8e3ab15ac3577e5 | 1,225 | py | Python | akutil/akutil/util.py | ak47mrj/arkouda | a9167e674aff57e02e1bed49fbb0c3cf1b2f2707 | [
"MIT"
] | 75 | 2019-10-21T17:20:41.000Z | 2021-05-10T22:01:19.000Z | akutil/akutil/util.py | ak47mrj/arkouda | a9167e674aff57e02e1bed49fbb0c3cf1b2f2707 | [
"MIT"
] | 424 | 2019-10-21T16:48:45.000Z | 2021-05-12T11:49:18.000Z | akutil/akutil/util.py | ak47mrj/arkouda | a9167e674aff57e02e1bed49fbb0c3cf1b2f2707 | [
"MIT"
] | 36 | 2019-10-23T17:45:44.000Z | 2021-04-17T01:15:03.000Z | import arkouda as ak
def expand(size, segs, vals):
""" Expand an array with values placed into the indicated segments.
Parameters
----------
size : ak.pdarray
The size of the array to be expanded
segs : ak.pdarray
The indices where the values should be placed
vals : ak.pdarray
... | 26.06383 | 71 | 0.613878 | import akutil as aku
import arkouda as ak
def expand(size, segs, vals):
""" Expand an array with values placed into the indicated segments.
Parameters
----------
size : ak.pdarray
The size of the array to be expanded
segs : ak.pdarray
The indices where the values should be placed
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
5a5d711c24a0ef42b4dadbb8b8c5f642248dbe7a | 13,616 | py | Python | src/utils/monitor.py | WebsmartAPI/smartapi | 4b65c612ded8e200191ecff2f382f9aaf0e552fe | [
"MIT"
] | null | null | null | src/utils/monitor.py | WebsmartAPI/smartapi | 4b65c612ded8e200191ecff2f382f9aaf0e552fe | [
"MIT"
] | 1 | 2017-02-28T17:44:32.000Z | 2017-02-28T17:44:32.000Z | src/utils/monitor.py | WebsmartAPI/smartapi | 4b65c612ded8e200191ecff2f382f9aaf0e552fe | [
"MIT"
] | null | null | null | """
API Uptime Monitor
Author:
Kevin Xin
Amiteshk Sharma
Status:
Good,
Bad,
Incompatible,
Unknown
"""
import requests
# pylint:disable=import-error, ungrouped-imports
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.pac... | 37.202186 | 109 | 0.48913 | """
API Uptime Monitor
Author:
Kevin Xin
Amiteshk Sharma
Status:
Good,
Bad,
Incompatible,
Unknown
"""
import logging
from enum import Enum
import requests
# pylint:disable=import-error, ungrouped-imports
from requests.packages.urllib3.exceptions impor... | 0 | 0 | 0 | 12,904 | 0 | 0 | 0 | -7 | 160 |
4801814d7013b1a113077add52ea91df87430228 | 741 | py | Python | app/modules/organizations/parameters.py | karenc/houston | 4eaaaf11d61394035e34b55bb847ea7eb4099c61 | [
"Apache-2.0"
] | 6 | 2021-04-06T19:50:52.000Z | 2022-01-19T17:42:33.000Z | app/modules/organizations/parameters.py | WildMeOrg/houston | 8102229421388e44234c07ee6cb73bf705b6fba0 | [
"Apache-2.0"
] | 491 | 2021-01-20T01:10:00.000Z | 2022-03-31T19:30:48.000Z | app/modules/organizations/parameters.py | karenc/houston | 4eaaaf11d61394035e34b55bb847ea7eb4099c61 | [
"Apache-2.0"
] | 2 | 2021-03-12T02:33:55.000Z | 2021-03-16T20:18:43.000Z | # -*- coding: utf-8 -*-
"""
Input arguments (Parameters) for Organizations resources RESTful API
-----------------------------------------------------------
"""
# from flask_marshmallow import base_fields
| 30.875 | 83 | 0.723347 | # -*- coding: utf-8 -*-
"""
Input arguments (Parameters) for Organizations resources RESTful API
-----------------------------------------------------------
"""
# from flask_marshmallow import base_fields
from flask_restx_patched import Parameters, PatchJSONParameters
from . import schemas
from .models import Organiz... | 0 | 0 | 0 | 367 | 0 | 0 | 0 | 53 | 113 |
3576ad930ce3335f3b6f6b882209208e6d1398f5 | 181 | py | Python | natunits/mksa.py | hajifkd/hepunits | 174b9903a584e60885e2ac4b2fdef02ca67e4ecd | [
"MIT"
] | null | null | null | natunits/mksa.py | hajifkd/hepunits | 174b9903a584e60885e2ac4b2fdef02ca67e4ecd | [
"MIT"
] | null | null | null | natunits/mksa.py | hajifkd/hepunits | 174b9903a584e60885e2ac4b2fdef02ca67e4ecd | [
"MIT"
] | null | null | null |
N = kg * m / s**2
J = N * m
W = J / s
Pa = N / m**2
# electricity
A = coulomb / s
V = W / A
ohm = V / A
T = kg * s**-2 / A
F = coulomb / V
gauss = 10**-4 * T
| 11.3125 | 19 | 0.458564 | from .unit import *
N = kg * m / s**2
J = N * m
W = J / s
Pa = N / m**2
# electricity
A = coulomb / s
V = W / A
ohm = V / A
T = kg * s**-2 / A
F = coulomb / V
gauss = 10**-4 * T
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
1daf58ba95a3239317ecf7dd78989ecf73a0d885 | 1,363 | py | Python | server/routes/index.py | vincihb/stock-price-predictor | 17f46bed7360817835a160ea4f1a6e057de4032d | [
"MIT"
] | null | null | null | server/routes/index.py | vincihb/stock-price-predictor | 17f46bed7360817835a160ea4f1a6e057de4032d | [
"MIT"
] | 1 | 2021-06-02T03:12:17.000Z | 2021-06-02T03:12:17.000Z | server/routes/index.py | vincihb/stock-price-predictor | 17f46bed7360817835a160ea4f1a6e057de4032d | [
"MIT"
] | null | null | null |
valid_report_types = ['NLU', 'NLU_Timing', 'Refresh_DD', 'Markov_Chain']
| 40.088235 | 127 | 0.679384 | from os import listdir, path
from client.util.HTMLUtil import HTMLUtil
from client.util.html.ButtonBuilder import ButtonBuilder
from client.util.html.ListBuilder import ListBuilder
from client.util.html.LinkBuider import LinkBuilder
valid_report_types = ['NLU', 'NLU_Timing', 'Refresh_DD', 'Markov_Chain']
def index_r... | 0 | 887 | 0 | 0 | 0 | 144 | 0 | 123 | 133 |
8b48fd4069d16ca65836b437ae61871dacdad01f | 5,066 | py | Python | faker_fdw/__init__.py | olleolleolle/faker_fdw | 56e323732460a1b3537dca553787f523a950083d | [
"PostgreSQL"
] | null | null | null | faker_fdw/__init__.py | olleolleolle/faker_fdw | 56e323732460a1b3537dca553787f523a950083d | [
"PostgreSQL"
] | null | null | null | faker_fdw/__init__.py | olleolleolle/faker_fdw | 56e323732460a1b3537dca553787f523a950083d | [
"PostgreSQL"
] | null | null | null | #
# Copyright (c) 2016-2019 Dickson S. Guedes.
#
# This module is free software; you can redistribute it and/or modify it under
# the [PostgreSQL License](http://www.opensource.org/licenses/postgresql).
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fe... | 32.063291 | 95 | 0.624556 | #
# Copyright (c) 2016-2019 Dickson S. Guedes.
#
# This module is free software; you can redistribute it and/or modify it under
# the [PostgreSQL License](http://www.opensource.org/licenses/postgresql).
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fe... | 0 | 2,052 | 0 | 1,658 | 0 | 0 | 0 | 95 | 111 |
83626bb2d1e3333cca1bda2ba2806dfca59ce85b | 184,425 | py | Python | operators/kogito-operator/python/pulumi_pulumi_kubernetes_crds_operators_kogito_operator/app/v1beta1/_inputs.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | operators/kogito-operator/python/pulumi_pulumi_kubernetes_crds_operators_kogito_operator/app/v1beta1/_inputs.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | 2 | 2020-09-18T17:12:23.000Z | 2020-12-30T19:40:56.000Z | operators/kogito-operator/python/pulumi_pulumi_kubernetes_crds_operators_kogito_operator/app/v1beta1/_inputs.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
from ... import _utilities, _tables
__all__ = [
'KogitoBuildSpecArgs',
'KogitoBuildSpecArtifactArgs',
'KogitoBuildSpecEnvArgs',
'Kogito... | 44.600967 | 739 | 0.676432 | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'... | 0 | 179,093 | 0 | 0 | 0 | 0 | 0 | 31 | 1,700 |
0a59c2ee062911147c3e2adbf76f541fa9a1e8a3 | 17,503 | py | Python | predicu/plot/flux_dept_lits_dept_visu_4panels.py | rth/predicu | 7b1afc89ac42f7ecc8b5eca07435cfd2a8cd46a7 | [
"MIT"
] | 2 | 2020-05-04T09:32:02.000Z | 2020-05-04T14:58:29.000Z | predicu/plot/flux_dept_lits_dept_visu_4panels.py | rth/predicu | 7b1afc89ac42f7ecc8b5eca07435cfd2a8cd46a7 | [
"MIT"
] | null | null | null | predicu/plot/flux_dept_lits_dept_visu_4panels.py | rth/predicu | 7b1afc89ac42f7ecc8b5eca07435cfd2a8cd46a7 | [
"MIT"
] | 1 | 2020-05-04T12:20:39.000Z | 2020-05-04T12:20:39.000Z | import sys
import numpy as np
import pandas as pd
import icubam
import icubam.predicu.data
data_source = ["bedcounts", "combined_bedcounts_public"]
# Logic of this code: the computation of quantities, even when seemingly simple,
# is performed separately from the plotting. The computing is done once, at the
# dept ... | 38.216157 | 176 | 0.638062 | import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import icubam
import icubam.predicu.data
import icubam.predicu.plot
data_source = ["bedcounts", "combined_bedcounts_public"]
# Logic of this code: the computation of quantities, even when seemingly simple,
# is performed separately fr... | 148 | 0 | 0 | 0 | 0 | 8,836 | 0 | 15 | 114 |
21c599109bf55573755fbe8ec000d8bf3b3b02c7 | 1,263 | py | Python | Lutece-VJudge-prototype/codechef.py | HeRaNO/ChickenRibs | 9aa8dd8f915aa39a7168940b5ff99a1d665f5212 | [
"MIT"
] | 14 | 2020-03-02T09:55:44.000Z | 2021-09-17T09:39:40.000Z | Lutece-VJudge-prototype/codechef.py | HeRaNO/ChickenRibs | 9aa8dd8f915aa39a7168940b5ff99a1d665f5212 | [
"MIT"
] | null | null | null | Lutece-VJudge-prototype/codechef.py | HeRaNO/ChickenRibs | 9aa8dd8f915aa39a7168940b5ff99a1d665f5212 | [
"MIT"
] | 8 | 2020-06-08T12:38:56.000Z | 2021-06-27T14:23:30.000Z | import requests
from bs4 import BeautifulSoup
username = "" # Fill it
passwd = "" # Fill it
session = requests.Session()
url = "https://www.codechef.com/login"
r = session.get(url, verify = False)
soup = BeautifulSoup(r.text, features = "lxml")
_csrf = soup.find("input", attrs = {"name": "csrfToken"})["value"]
f... | 21.40678 | 115 | 0.658749 | import requests
from bs4 import BeautifulSoup
import sys
username = "" # Fill it
passwd = "" # Fill it
session = requests.Session()
url = "https://www.codechef.com/login"
r = session.get(url, verify = False)
soup = BeautifulSoup(r.text, features = "lxml")
_csrf = soup.find("input", attrs = {"name": "csrfToken"})[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
2b9a672364a19a2db68338da24db4f81a59a2988 | 3,729 | py | Python | tests/graph_test.py | dahvid/graphutil | 7e5380c7be84db79ee61d52b3cdaea8061df6850 | [
"MIT"
] | null | null | null | tests/graph_test.py | dahvid/graphutil | 7e5380c7be84db79ee61d52b3cdaea8061df6850 | [
"MIT"
] | 2 | 2020-03-24T17:10:33.000Z | 2021-02-02T22:02:19.000Z | tests/graph_test.py | dahvid/graphutil | 7e5380c7be84db79ee61d52b3cdaea8061df6850 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
test_arcs()
test_write()
test_connected_components()
test_bfs()
test_bfs_full()
test_substitute()
| 23.161491 | 67 | 0.519979 | from graphutil import Graph
def test_arcs():
g = Graph()
g.add_node("A")
g.add_node("B")
g.add_node("C")
g.add_node("D")
g.add_edge("A", "B", "edge_data")
g.add_edge("A", "C", "edge_data")
g.add_edge("A", "D", "edge_data")
g.add_edge("B", "D", "edge_data")
g.add_edge("C", "D"... | 0 | 0 | 0 | 0 | 0 | 3,410 | 0 | 6 | 160 |
1375a8f99fc58b129c6942c69b2c6e60ce85f55d | 575 | py | Python | src/pgsignals/enums.py | CJIABKA/django-pgsignals | 80224f646481f6da32a8090c2e85f241fc397e23 | [
"MIT"
] | null | null | null | src/pgsignals/enums.py | CJIABKA/django-pgsignals | 80224f646481f6da32a8090c2e85f241fc397e23 | [
"MIT"
] | null | null | null | src/pgsignals/enums.py | CJIABKA/django-pgsignals | 80224f646481f6da32a8090c2e85f241fc397e23 | [
"MIT"
] | 1 | 2022-01-27T16:26:39.000Z | 2022-01-27T16:26:39.000Z |
__all__ = ("EventKind", "ALL_EVENTS")
ALL_EVENTS = (
EventKind.INSERT,
EventKind.UPDATE,
EventKind.DELETE
)
| 16.911765 | 47 | 0.624348 | import enum
__all__ = ("EventKind", "ALL_EVENTS")
class EventKind(enum.Enum):
INSERT = 'INSERT'
UPDATE = 'UPDATE'
DELETE = 'DELETE'
@property
def is_create(self) -> bool:
return self is self.INSERT
@property
def is_update(self) -> bool:
return self is self.UPDATE
@... | 0 | 235 | 0 | 180 | 0 | 0 | 0 | -10 | 45 |
b41ff77976149a0c233e3e246f92aee9ded9461e | 942 | py | Python | Segmentation/evaluate.py | neuhofmo/calcium-imaging-neuorn-segmentation | 1f86d9210219cf82f375b2b3ad52b3218b788405 | [
"MIT"
] | 2 | 2019-11-01T17:29:05.000Z | 2021-11-28T19:14:07.000Z | Segmentation/evaluate.py | neuhofmo/calcium-imaging-neuron-detection | 1f86d9210219cf82f375b2b3ad52b3218b788405 | [
"MIT"
] | null | null | null | Segmentation/evaluate.py | neuhofmo/calcium-imaging-neuron-detection | 1f86d9210219cf82f375b2b3ad52b3218b788405 | [
"MIT"
] | null | null | null | from subprocess import check_output
from ast import literal_eval
from Segmentation.params import regions_file
from Segmentation.utilities import fix_json_fname
import numpy as np
def evaluation(fname_to_check, regions_fname=regions_file):
"""Evaluate results with neurofinder"""
fname_to_check = fix_jso... | 39.25 | 117 | 0.739915 | from subprocess import check_output
from ast import literal_eval
from Segmentation.params import regions_file
from Segmentation.utilities import fix_json_fname
import numpy as np
def evaluation(fname_to_check, regions_fname=regions_file):
"""Evaluate results with neurofinder"""
fname_to_check = fix_jso... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aa1bcf7312cdbe3817a77aec2dc84d44fee05eb3 | 201 | py | Python | Project/plugins/Extract_Crop.py | sushrutt12/faceswap | e1fbc1a4cc4f9e680954e0b928c3e7ebeba70718 | [
"MIT"
] | 1 | 2020-01-27T15:43:08.000Z | 2020-01-27T15:43:08.000Z | Project/plugins/Extract_Crop.py | sushrutt12/faceswap | e1fbc1a4cc4f9e680954e0b928c3e7ebeba70718 | [
"MIT"
] | 11 | 2020-01-28T22:15:22.000Z | 2022-02-10T00:20:04.000Z | Project/plugins/Extract_Crop.py | sushrutt12/faceswap | e1fbc1a4cc4f9e680954e0b928c3e7ebeba70718 | [
"MIT"
] | 1 | 2021-03-31T13:08:21.000Z | 2021-03-31T13:08:21.000Z | # Based on the original https://www.reddit.com/r/deepfakes/ code sample | 28.714286 | 71 | 0.701493 | # Based on the original https://www.reddit.com/r/deepfakes/ code sample
import cv2
class Extract(object):
def extract(self, image, face, size):
return cv2.resize(face.image, (size, size)) | 0 | 0 | 0 | 95 | 0 | 0 | 0 | -11 | 46 |
336f50eff226f7ae2d0f118fc8091df4a1deeeba | 781 | py | Python | face_sync/example_maker/video_to_image.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 40 | 2020-09-21T05:35:17.000Z | 2022-02-06T04:41:34.000Z | face_sync/example_maker/video_to_image.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 4 | 2020-05-22T15:44:13.000Z | 2020-07-17T07:41:33.000Z | face_sync/example_maker/video_to_image.py | lilly9117/Cross-Cutting | d534e8b5d4bf071883b7cb5f1832bba74b9a52d0 | [
"Apache-2.0"
] | 8 | 2020-10-03T06:08:39.000Z | 2021-12-17T15:50:30.000Z | # import the necessary packages
#
if __name__ == '__main__':
video_path = './fifth_season9/fifth_season_landmark.mp4'
save_dir = './fifth_season9'
out_name = 'landmark_img'
video_to_image(video_path, save_dir, out_name)
| 22.970588 | 60 | 0.65557 | # import the necessary packages
from moviepy.editor import VideoFileClip
import time
import os
# 프레임당 이미지로 저장
def video_to_image(video_path, save_dir, out_name):
# Load video
video = VideoFileClip(video_path)
time.sleep(4)
# Save frame as image
for i in range(int(video.duration*video.fps)):
... | 72 | 0 | 0 | 0 | 0 | 428 | 0 | -3 | 88 |
e093dc962019d426f9bf23085c3a22aeaffe224d | 6,191 | py | Python | git_wrapper/log.py | jpichon/git_wrapper | 4ea59b341a2a2d92102300a6bbd1b2bdc28cffe1 | [
"MIT"
] | null | null | null | git_wrapper/log.py | jpichon/git_wrapper | 4ea59b341a2a2d92102300a6bbd1b2bdc28cffe1 | [
"MIT"
] | null | null | null | git_wrapper/log.py | jpichon/git_wrapper | 4ea59b341a2a2d92102300a6bbd1b2bdc28cffe1 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""This module acts as an interface for acting on git logs"""
| 41 | 134 | 0.600711 | #! /usr/bin/env python
"""This module acts as an interface for acting on git logs"""
from string import Template
from git_wrapper import exceptions
from git_wrapper.utils.decorators import reference_exists
class GitLog(object):
def __init__(self, git_repo, logger):
"""Constructor for GitLog object
... | 0 | 3,323 | 0 | 2,636 | 0 | 0 | 0 | 55 | 91 |
d60d2809ddd7d9f7b4d8f67338c38856764769f6 | 1,338 | py | Python | src/main.py | Lukasz1928/lichess-fide | b454539caae3de4890f2bb660c0154b454351494 | [
"MIT"
] | null | null | null | src/main.py | Lukasz1928/lichess-fide | b454539caae3de4890f2bb660c0154b454351494 | [
"MIT"
] | null | null | null | src/main.py | Lukasz1928/lichess-fide | b454539caae3de4890f2bb660c0154b454351494 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 37.166667 | 106 | 0.822123 | from src.data.download import download_database
from src.data.ranking_file import read_rankings
from src.data.rankings import get_and_save_rankings
from src.data.raw import save_names_from_database
from src.ranking.differences import calculate_ranking_difference_across_variants, save_ranking_differences
from src.rankin... | 0 | 0 | 0 | 0 | 0 | 760 | 0 | 314 | 222 |
218a597040f0db1e31fa6e000f17d995916e7020 | 2,092 | py | Python | app/api/v1/views/property_views.py | MurungaKibaara/Kukodi | 870a8b37d02ea438c571dbf373b43ad9f924b08f | [
"MIT"
] | 3 | 2019-07-20T04:22:53.000Z | 2019-07-31T22:45:53.000Z | app/api/v1/views/property_views.py | MurungaKibaara/Kukodi | 870a8b37d02ea438c571dbf373b43ad9f924b08f | [
"MIT"
] | 1 | 2021-06-01T23:59:09.000Z | 2021-06-01T23:59:09.000Z | app/api/v1/views/property_views.py | MurungaKibaara/Kukodi | 870a8b37d02ea438c571dbf373b43ad9f924b08f | [
"MIT"
] | 4 | 2019-07-21T17:24:10.000Z | 2020-01-04T13:40:48.000Z | from flask import Blueprint
from app.api.v1.models.property_models import PropertyRecords
from app.api.v1.models.database import init_db
INIT_DB = init_db()
PROPERTY = Blueprint('property', __name__)
PROPERTY_RECORDS = PropertyRecords()
| 32.6875 | 106 | 0.690249 | import re
import psycopg2
from werkzeug.security import generate_password_hash, check_password_hash
from flask import Blueprint, request, jsonify, make_response
from app.api.v1.models.property_models import PropertyRecords
from app.api.v1.models.database import init_db
from app.api.v1.utils.validators import validate
f... | 0 | 1,528 | 0 | 0 | 0 | 0 | 0 | 122 | 202 |
b4f75b33feec52ab53efc6da37c94a8904be52e5 | 26,022 | py | Python | lib/GameSystem.py | approvers/musical_typer | 010873f9bc5869c0ad8dfb430e118b493efd0c86 | [
"MIT"
] | 5 | 2020-02-15T10:37:27.000Z | 2020-12-02T19:08:04.000Z | lib/GameSystem.py | brokenManager/musical_typer | 010873f9bc5869c0ad8dfb430e118b493efd0c86 | [
"MIT"
] | 32 | 2020-02-10T04:22:31.000Z | 2020-05-26T04:44:06.000Z | lib/GameSystem.py | brokenManager/musical_typer | 010873f9bc5869c0ad8dfb430e118b493efd0c86 | [
"MIT"
] | 4 | 2020-02-16T08:04:44.000Z | 2020-02-18T06:06:25.000Z | ##############################
# #
# loxygenK/musical_typer #
# #
# (c)2020 loxygenK #
# All rights reversed. #
# #
##############################
def set_val_to_dictionary(dictionary, key, value):
"""
:par... | 25.996004 | 112 | 0.523134 | ##############################
# #
# loxygenK/musical_typer #
# ゲームシステム #
# (c)2020 loxygenK #
# All rights reversed. #
# #
##############################
import re
import chardet
import pygame
import romkan
from lib import Drawin... | 7,218 | 1,746 | 0 | 21,151 | 0 | 0 | 0 | -19 | 228 |
fdccac5c888ee1442ac43d8d2308072faed7c6ae | 28 | py | Python | python/arm_pcie/sophon/__init__.py | sophon-ai-algo/sophon-inference | f923413b76615e265af28fd1dd2b43e5eb303dcd | [
"Apache-2.0"
] | 18 | 2020-02-21T03:06:33.000Z | 2022-03-21T03:41:56.000Z | python/arm_pcie/sophon/__init__.py | sophon-ai-algo/sophon-inference | f923413b76615e265af28fd1dd2b43e5eb303dcd | [
"Apache-2.0"
] | null | null | null | python/arm_pcie/sophon/__init__.py | sophon-ai-algo/sophon-inference | f923413b76615e265af28fd1dd2b43e5eb303dcd | [
"Apache-2.0"
] | 6 | 2020-07-10T08:55:38.000Z | 2021-12-28T01:36:04.000Z | """sophon python module
"""
| 9.333333 | 23 | 0.642857 | """sophon python module
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4f46379330fa29cea35efeb244b09e6353956e1 | 357 | py | Python | legacy/RE8.2/all_glosses.py | jblowe/RE | d694b254eb72e3798817fcf78a8beaada70580de | [
"MIT"
] | null | null | null | legacy/RE8.2/all_glosses.py | jblowe/RE | d694b254eb72e3798817fcf78a8beaada70580de | [
"MIT"
] | null | null | null | legacy/RE8.2/all_glosses.py | jblowe/RE | d694b254eb72e3798817fcf78a8beaada70580de | [
"MIT"
] | null | null | null | import utils
import read
from argparser import args, project_dir
settings = read.read_settings_file(f'{project_dir}/{args.project}.parameters.xml',
mel=args.mel,
recon=args.recon)
for gloss in utils.all_glosses(read.read_attested_lexicons(settings)... | 32.454545 | 82 | 0.644258 | import utils
import read
from argparser import args, need_to_compare, project_dir
settings = read.read_settings_file(f'{project_dir}/{args.project}.parameters.xml',
mel=args.mel,
recon=args.recon)
for gloss in utils.all_glosses(read.read_attested_l... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0 |
54a5e9b8b7f1b86f7498369a1e7d804ffdca1df5 | 7,568 | py | Python | sdk/python/pulumi_spotinst/tables.py | 346/pulumi-spotinst | 7a9805f2f5ce96174c8122225772baffb87252c3 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-06-28T00:48:35.000Z | 2019-06-28T00:48:35.000Z | sdk/python/pulumi_spotinst/tables.py | 346/pulumi-spotinst | 7a9805f2f5ce96174c8122225772baffb87252c3 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-12-10T22:44:29.000Z | 2019-12-10T22:44:29.000Z | sdk/python/pulumi_spotinst/tables.py | 346/pulumi-spotinst | 7a9805f2f5ce96174c8122225772baffb87252c3 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-07-21T11:19:13.000Z | 2019-07-21T11:19:13.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
_SNAKE_TO_CAMEL_CASE_TABLE = {
"availability_zones": "availabilityZones",
"backend_services": "backendServices",
"beanstalk... | 44.517647 | 106 | 0.736654 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
_SNAKE_TO_CAMEL_CASE_TABLE = {
"availability_zones": "availabilityZones",
"backend_services": "backendServices",
"beanstalk... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
102c0183a5e9f30a41b7e0856b919d78efae8f7e | 1,546 | py | Python | designateclient/v2/blacklists.py | mythus/python-designateclient | 6b6a8969465324bd2bee7a05a91d19d24bd4cd68 | [
"Apache-2.0"
] | 34 | 2015-01-16T21:45:17.000Z | 2021-11-15T09:38:53.000Z | designateclient/v2/blacklists.py | mythus/python-designateclient | 6b6a8969465324bd2bee7a05a91d19d24bd4cd68 | [
"Apache-2.0"
] | null | null | null | designateclient/v2/blacklists.py | mythus/python-designateclient | 6b6a8969465324bd2bee7a05a91d19d24bd4cd68 | [
"Apache-2.0"
] | 15 | 2015-01-16T21:45:27.000Z | 2020-05-26T05:07:29.000Z | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.com>
#
# 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/lice... | 31.55102 | 75 | 0.686287 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.com>
#
# 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/lice... | 0 | 0 | 0 | 818 | 0 | 0 | 0 | 27 | 45 |
0ce4e57ae634f64beb6b12d151aac770a1ff4d8a | 800 | py | Python | Face Detection program/face.py | shantanukaushik97/Face-Detection | b4ef77018cca6d1517c20d5c3101bea0ff1600e8 | [
"MIT"
] | 2 | 2021-06-13T06:52:31.000Z | 2021-06-13T06:52:36.000Z | Face Detection program/face.py | shantanukaushik97/Face-Detection | b4ef77018cca6d1517c20d5c3101bea0ff1600e8 | [
"MIT"
] | null | null | null | Face Detection program/face.py | shantanukaushik97/Face-Detection | b4ef77018cca6d1517c20d5c3101bea0ff1600e8 | [
"MIT"
] | null | null | null | import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade=cv2.CascadeClassifier('haarcascade_eye.xml')
cap = cv2.VideoCapture(0)
while True:
ret,img = cap.read()
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
faces=face_cascade.detectMultiScale(gray,1.3,5)
... | 27.586207 | 76 | 0.62625 | import cv2
import numpy as np
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye_cascade=cv2.CascadeClassifier('haarcascade_eye.xml')
cap = cv2.VideoCapture(0)
while True:
ret,img = cap.read()
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
faces=face_cascade.detectMul... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 23 |
b608743d3e0ce5db0451935d0a926d8254270e51 | 3,310 | py | Python | python/federatedml/ensemble/__init__.py | hubert-he/FATE | 6758e150bd7ca7d6f788f9a7a8c8aea7e6500363 | [
"Apache-2.0"
] | 3,787 | 2019-08-30T04:55:10.000Z | 2022-03-31T23:30:07.000Z | python/federatedml/ensemble/__init__.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 1,439 | 2019-08-29T16:35:52.000Z | 2022-03-31T11:55:31.000Z | python/federatedml/ensemble/__init__.py | JavaGreenHands/FATE | ea1e94b6be50c70c354d1861093187e523af32f2 | [
"Apache-2.0"
] | 1,179 | 2019-08-29T16:18:32.000Z | 2022-03-31T12:55:38.000Z | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 66.2 | 129 | 0.84713 | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0 |
74c674f9e49a88c166a61bc6238191a95dece600 | 835 | py | Python | startup/SST/HW/mirrors.py | NSLS-II-SST/profile_collection | e2c9d1fce421e7ed8a60fb744c34a770f7780803 | [
"BSD-3-Clause"
] | null | null | null | startup/SST/HW/mirrors.py | NSLS-II-SST/profile_collection | e2c9d1fce421e7ed8a60fb744c34a770f7780803 | [
"BSD-3-Clause"
] | 12 | 2019-05-30T15:08:15.000Z | 2021-04-29T03:24:10.000Z | startup/SST/HW/mirrors.py | NSLS-II-SST/profile_collection | e2c9d1fce421e7ed8a60fb744c34a770f7780803 | [
"BSD-3-Clause"
] | 2 | 2019-05-23T17:13:04.000Z | 2019-10-20T14:52:05.000Z | from ophyd import EpicsSignal
from ..CommonFunctions.functions import run_report
from ..Base.mirrors import HexapodMirror, FMBHexapodMirror
run_report(__file__)
mir2_type = EpicsSignal(
"XF:07ID1-OP{Mono:PGM1-Ax:MirX}Mtr_TYPE_MON", name="SST 1 Mirror 2 Stripe"
)
mir4OLD = HexapodMirror(
"XF:07ID2-OP{Mir:M4... | 29.821429 | 87 | 0.71018 | from ophyd import EpicsSignal
from ..CommonFunctions.functions import run_report
from ..Base.mirrors import HexapodMirror, FMBHexapodMirror
run_report(__file__)
mir2_type = EpicsSignal(
"XF:07ID1-OP{Mono:PGM1-Ax:MirX}Mtr_TYPE_MON", name="SST 1 Mirror 2 Stripe"
)
mir4OLD = HexapodMirror(
"XF:07ID2-OP{Mir:M4... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2e9da797fe88d7bb0d255e7dc0aa73d9e3c222ab | 9,547 | py | Python | RaspberrySensorsBot.py | khode-mohsen/RaspberrySensorsBot | 71c358877cdb80548983491243c36809569ce76e | [
"Apache-2.0"
] | 19 | 2016-11-09T18:28:18.000Z | 2021-09-27T10:31:50.000Z | RaspberrySensorsBot.py | khode-mohsen/RaspberrySensorsBot | 71c358877cdb80548983491243c36809569ce76e | [
"Apache-2.0"
] | 1 | 2020-04-05T18:13:02.000Z | 2020-04-05T18:13:02.000Z | RaspberrySensorsBot.py | khode-mohsen/RaspberrySensorsBot | 71c358877cdb80548983491243c36809569ce76e | [
"Apache-2.0"
] | 5 | 2016-11-09T19:29:15.000Z | 2020-01-08T22:15:28.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Telegram bot @RaspberyPi3Bot
"""
"""
import sys
if not 'win' in sys.platform.lower():
import RPi.GPIO as GPIO
import Adafruit_DHT
HOME_PATH='/home/pi/myscripts/'
GPIO.setmode(GPIO.BCM)
#DHT
#Adafruit: instructions and wiring
... | 40.2827 | 134 | 0.577983 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Telegram bot @RaspberyPi3Bot
"""
"""
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, Job
import telegram
import logging
import pickle
import os
from subprocess import call
import datetime
import sys
if not 'win' in sys.plat... | 0 | 0 | 0 | 8,354 | 0 | 0 | 0 | 24 | 213 |
6f645a8363878231f152bb4d1f996dc0004be6fd | 3,388 | py | Python | src/commands/es.py | parkiino/kibbe | c62a6ac2ab5fa13b44dd6b54c256e14196e50c64 | [
"MIT"
] | null | null | null | src/commands/es.py | parkiino/kibbe | c62a6ac2ab5fa13b44dd6b54c256e14196e50c64 | [
"MIT"
] | null | null | null | src/commands/es.py | parkiino/kibbe | c62a6ac2ab5fa13b44dd6b54c256e14196e50c64 | [
"MIT"
] | null | null | null | import re
pathDataRe = re.compile(r"path\.data\s?=", re.IGNORECASE)
| 33.88 | 201 | 0.661157 | import re
from src.util import merge_params, unparsed_to_map
import subprocess
from termcolor import colored
from src.config import get_config, persist_config
import click
import tempfile
from pathlib import Path
pathDataRe = re.compile(r"path\.data\s?=", re.IGNORECASE)
@click.command(context_settings=dict(
ign... | 0 | 2,019 | 0 | 0 | 0 | 1,000 | 0 | 49 | 247 |
85b20f576ceeadd0f2e6734b8a6204c058be3246 | 1,096 | py | Python | Python3-StandardLibrary/Chapter17_Socket05_select.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-StandardLibrary/Chapter17_Socket05_select.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | Python3-StandardLibrary/Chapter17_Socket05_select.py | anliven/Reading-Code-Learning-Python | a814cab207bbaad6b5c69b9feeb8bf2f459baf2b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import socket
import select
s = socket.socket()
# host = socket.gethostname()
host = '127.0.0.1'
port = 1234
s.bind((host, port))
s.listen(5)
inputs = [s]
while True:
rs, ws, es = select.select(inputs, [], [], 5) # select
for r in rs:
if r is s:
c, address = s.accept()
... | 23.826087 | 71 | 0.568431 | # coding=utf-8
import socket
import select
s = socket.socket()
# host = socket.gethostname()
host = '127.0.0.1'
port = 1234
s.bind((host, port))
s.listen(5)
inputs = [s]
while True:
rs, ws, es = select.select(inputs, [], [], 5) # select函数
for r in rs:
if r is s:
c, address = s.accept()
... | 663 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa446e80bebf1dbdb084d6b2890cccdc671fb543 | 5,972 | py | Python | semantic_lstm_fc.py | tadityasrinivas/quora_semantic_equivalence | 828e9ee01f26378a9a97be1b04fcf061b5e9ea8b | [
"MIT"
] | 5 | 2017-02-08T10:43:49.000Z | 2019-06-15T11:06:52.000Z | semantic_lstm_fc.py | tadityasrinivas/quora_semantic_equivalence | 828e9ee01f26378a9a97be1b04fcf061b5e9ea8b | [
"MIT"
] | null | null | null | semantic_lstm_fc.py | tadityasrinivas/quora_semantic_equivalence | 828e9ee01f26378a9a97be1b04fcf061b5e9ea8b | [
"MIT"
] | 2 | 2017-06-07T03:20:37.000Z | 2019-06-14T16:11:16.000Z | import numpy as np
import random
from keras.models import Sequential, Model
from keras.layers import Dense, LSTM, Dropout, merge, Input
from keras.layers.embeddings import Embedding
from keras.regularizers import l2
from keras.callbacks import ModelCheckpoint
import cPickle
# Create data matrices and labels list from... | 34.125714 | 162 | 0.749163 | import numpy as np
import random
from keras.models import Sequential, Model
from keras.layers import Dense, LSTM, Dropout, merge, Input
from keras.layers.embeddings import Embedding
from keras.regularizers import l2
from keras.callbacks import ModelCheckpoint
import cPickle
# Create data matrices and labels list from... | 0 | 0 | 0 | 0 | 0 | 880 | 0 | 0 | 22 |
cab8dd82d065e0fcdf8fe077d7bccd98a610f749 | 601 | py | Python | models/classifier.py | corenel/pytorch-arda | eae00b8f0c31d52a194402487ba69bd9c3875a96 | [
"MIT"
] | 56 | 2017-10-13T04:48:41.000Z | 2020-12-09T07:54:32.000Z | models/classifier.py | corenel/pytorch-arda | eae00b8f0c31d52a194402487ba69bd9c3875a96 | [
"MIT"
] | 4 | 2017-08-30T01:54:02.000Z | 2019-06-12T03:35:28.000Z | models/classifier.py | corenel/pytorch-arda | eae00b8f0c31d52a194402487ba69bd9c3875a96 | [
"MIT"
] | 12 | 2017-09-20T08:22:53.000Z | 2020-04-07T13:21:17.000Z | """Classifier for ARDA.
guarantee learned domain-invariant representations are discriminative enough
to accomplish the final classification task
"""
| 25.041667 | 76 | 0.665557 | """Classifier for ARDA.
guarantee learned domain-invariant representations are discriminative enough
to accomplish the final classification task
"""
import torch.nn.functional as F
from torch import nn
class Classifier(nn.Module):
"""LeNet classifier model for ARDA."""
def __init__(self):
"""Init L... | 0 | 0 | 0 | 373 | 0 | 0 | 0 | 9 | 68 |
9f60c2e7300814789615b91c943158a8ae8b61f1 | 1,613 | py | Python | cobl/lexicon/templatetags/lexicon_utils.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | 3 | 2017-05-30T04:40:43.000Z | 2019-04-25T14:54:54.000Z | cobl/lexicon/templatetags/lexicon_utils.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | null | null | null | cobl/lexicon/templatetags/lexicon_utils.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | 3 | 2018-07-02T13:42:12.000Z | 2019-05-17T13:11:13.000Z | # encoding: utf-8
from django import template
register = template.Library()
| 26.442623 | 77 | 0.601984 | # encoding: utf-8
from django import template
from django.utils.safestring import mark_safe
from django.utils.html import escape
import re
register = template.Library()
@register.filter
def in_list(value, a_list):
return value in a_list
@register.filter
def is_truncated(value, length):
return len(value.spl... | 18 | 1,317 | 0 | 0 | 0 | 0 | 0 | 27 | 181 |
02216a3f218d47421ffabb05d471b32da3324721 | 429 | py | Python | notebooks/computer_science/high_performance_python/generators/generators_1.py | NathanielDake/nathanieldake.github.io | 82b7013afa66328e06e51304b6af10e1ed648eb8 | [
"MIT"
] | 3 | 2018-03-30T06:28:21.000Z | 2018-04-25T15:43:24.000Z | notebooks/computer_science/high_performance_python/generators/generators_1.py | NathanielDake/nathanieldake.github.io | 82b7013afa66328e06e51304b6af10e1ed648eb8 | [
"MIT"
] | null | null | null | notebooks/computer_science/high_performance_python/generators/generators_1.py | NathanielDake/nathanieldake.github.io | 82b7013afa66328e06e51304b6af10e1ed648eb8 | [
"MIT"
] | 3 | 2018-02-07T22:21:33.000Z | 2018-05-04T20:16:43.000Z |
for i in range(1, 10000):
pass
for i in xrange(1, 10000):
pass
| 17.875 | 92 | 0.65035 | from notebooks.computer_science.high_performance_python.profiling.utils_timing import timefn
@timefn
def range(start, stop, step=1):
numbers = []
while start < stop:
numbers.append(start)
start += step
return numbers
@timefn
def xrange(start, stop, step=1):
while start < stop:
... | 0 | 215 | 0 | 0 | 0 | 0 | 0 | 71 | 68 |
3343351fcf13b69349827a374b8edcd16a53b272 | 21,327 | py | Python | django_gotolong/phealth/views.py | surinder432/gotolong | 5c5e3ddf56325391c8a115e2f4f8ded1d58fcd4f | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 15 | 2019-12-06T16:19:45.000Z | 2021-08-20T13:22:22.000Z | django_gotolong/phealth/views.py | surinder432/gotolong | 5c5e3ddf56325391c8a115e2f4f8ded1d58fcd4f | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 14 | 2020-12-08T10:45:05.000Z | 2021-09-21T17:23:45.000Z | django_gotolong/phealth/views.py | surinder432/gotolong | 5c5e3ddf56325391c8a115e2f4f8ded1d58fcd4f | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 9 | 2020-01-01T03:04:29.000Z | 2021-04-18T08:42:30.000Z | # Create your views here.
# from django_gotolong.ftwhl.views import ftwhl_fetch
# Insufficient data
| 53.992405 | 116 | 0.651146 | # Create your views here.
from django.views.generic.list import ListView
from django_gotolong.amfi.models import Amfi
from django_gotolong.bhav.models import Bhav
from django_gotolong.corpact.models import Corpact
from django_gotolong.dematsum.models import DematSum
from django_gotolong.demattxn.models import Dema... | 0 | 390 | 0 | 19,863 | 0 | 0 | 0 | 490 | 477 |
1409278584b0defcaa53015885fc24c0177410a7 | 603 | py | Python | 2_intermediate/chapter9/solutions/characters.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 4 | 2021-03-01T00:32:45.000Z | 2021-05-21T22:01:52.000Z | 2_intermediate/chapter9/solutions/characters.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 29 | 2020-09-12T22:56:04.000Z | 2021-09-25T17:08:42.000Z | 2_intermediate/chapter9/solutions/characters.py | code4tomorrow/Python | 035b6f5d8fd635a16caaff78bcd3f582663dadc3 | [
"MIT"
] | 7 | 2021-02-25T01:50:55.000Z | 2022-02-28T00:00:42.000Z | # Characters
# Write a Python program to create
# a dictionary from a string where
# the keys are the characters
# and the values are the frequency
# of the characters.
#
# Your program should ask the user
# to enter a string, convert it into
# the dictionary described above,
# and print the resulting dictionary.
#
# E... | 22.333333 | 50 | 0.666667 | # Characters
# Write a Python program to create
# a dictionary from a string where
# the keys are the characters
# and the values are the frequency
# of the characters.
#
# Your program should ask the user
# to enter a string, convert it into
# the dictionary described above,
# and print the resulting dictionary.
#
# E... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17275645440ec7415818823c7ebd9ba80050e9ff | 4,929 | py | Python | 3d_elev_animations.py | simon-m-mudd/LSDMappingTools | d9137710ea18e54f3dc5b6782c5696cafdd2999f | [
"MIT"
] | 34 | 2017-01-31T17:03:26.000Z | 2021-09-15T17:23:21.000Z | 3d_elev_animations.py | simon-m-mudd/LSDMappingTools | d9137710ea18e54f3dc5b6782c5696cafdd2999f | [
"MIT"
] | 14 | 2017-01-11T19:45:08.000Z | 2020-11-03T16:36:38.000Z | 3d_elev_animations.py | LSDtopotools/LSDMappingTools | d9137710ea18e54f3dc5b6782c5696cafdd2999f | [
"MIT"
] | 21 | 2015-11-26T10:24:19.000Z | 2021-09-15T17:23:22.000Z | """
Create 3d elevation plots of model runs and then animate them
"""
import sys
def animate_plots(base_directory, fname_prefix):
"""
This function creates a movie of the plots using ffmpeg
Args:
base_directory (str): the directory with the plots.
fname_prefix (str): the filename for t... | 35.207143 | 183 | 0.603368 | """
Create 3d elevation plots of model runs and then animate them
"""
from LSDPlottingTools import LSDMap_GDALIO as IO
import matplotlib.pyplot as plt
from mayavi import mlab
from mayavi.modules.grid_plane import GridPlane
from matplotlib import cm
import numpy as np
import os
from sys import platform
import sys
from... | 0 | 0 | 0 | 0 | 0 | 1,986 | 0 | 57 | 267 |
a0641d289ba22504061826cb78b391d7fd96b0c6 | 7,342 | py | Python | redisbench_admin/export/export.py | RedisLabsModules/redisbench-admin | d8573d3414e5e846411d2875555deca5c8a7d0f1 | [
"Apache-2.0"
] | 5 | 2021-08-03T12:38:30.000Z | 2022-03-23T07:35:38.000Z | redisbench_admin/export/export.py | RedisLabsModules/redisbench-admin | d8573d3414e5e846411d2875555deca5c8a7d0f1 | [
"Apache-2.0"
] | 91 | 2021-03-17T12:05:35.000Z | 2022-03-29T22:20:00.000Z | redisbench_admin/export/export.py | RedisLabsModules/redisbench-admin | d8573d3414e5e846411d2875555deca5c8a7d0f1 | [
"Apache-2.0"
] | 2 | 2021-06-07T14:06:58.000Z | 2021-07-27T10:37:15.000Z | # Apache License Version 2.0
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
| 34.308411 | 116 | 0.574639 | # Apache License Version 2.0
#
# Copyright (c) 2021., Redis Labs Modules
# All rights reserved.
#
import csv
import json
import logging
import datetime
import redis
from redistimeseries.client import Client
from redisbench_admin.export.common.common import split_tags_string
from redisbench_admin.run.git import git... | 0 | 0 | 0 | 0 | 0 | 6,711 | 0 | 237 | 291 |
e176bbd5951100d09bf157b03fcb151a74e27911 | 47 | py | Python | lithops/wait/utils.py | gfinol/lithops | e165a78e0facbb70c852d7627a7407e8a8d1b946 | [
"Apache-2.0"
] | null | null | null | lithops/wait/utils.py | gfinol/lithops | e165a78e0facbb70c852d7627a7407e8a8d1b946 | [
"Apache-2.0"
] | null | null | null | lithops/wait/utils.py | gfinol/lithops | e165a78e0facbb70c852d7627a7407e8a8d1b946 | [
"Apache-2.0"
] | null | null | null | ALL_COMPLETED = 1
ANY_COMPLETED = 2
ALWAYS = 3
| 11.75 | 17 | 0.744681 | ALL_COMPLETED = 1
ANY_COMPLETED = 2
ALWAYS = 3
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d3cd93e2682fbdc57b3aad6d8bc4034d86ade17e | 1,450 | py | Python | catalyst/dl/callbacks/metrics/functional.py | TeAmP0is0N/catalyst | 445e366266196a2f1076cc7fa2438d66dfa58c14 | [
"Apache-2.0"
] | 1 | 2020-09-24T00:34:06.000Z | 2020-09-24T00:34:06.000Z | catalyst/dl/callbacks/metrics/functional.py | TeAmP0is0N/catalyst | 445e366266196a2f1076cc7fa2438d66dfa58c14 | [
"Apache-2.0"
] | null | null | null | catalyst/dl/callbacks/metrics/functional.py | TeAmP0is0N/catalyst | 445e366266196a2f1076cc7fa2438d66dfa58c14 | [
"Apache-2.0"
] | 1 | 2020-09-24T00:34:07.000Z | 2020-09-24T00:34:07.000Z | from typing import List
import numpy as np
def calculate_dice(
true_positives: np.array,
false_positives: np.array,
false_negatives: np.array,
) -> np.array:
"""
Calculate list of Dice coefficients.
Args:
true_positives: true positives numpy tensor
false_positives: false posi... | 21.969697 | 72 | 0.613793 | from typing import List
import numpy as np
def calculate_dice(
true_positives: np.array,
false_positives: np.array,
false_negatives: np.array,
) -> np.array:
"""
Calculate list of Dice coefficients.
Args:
true_positives: true positives numpy tensor
false_positives: false posi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
32d9605e0b45ff9de4fe34b514a5e92fd4a4fdf2 | 6,306 | py | Python | weather.py | wcyuan/weather-mailer | c25d718e69ecc012253fb9c6ad7bc4e57e86a205 | [
"Apache-2.0"
] | null | null | null | weather.py | wcyuan/weather-mailer | c25d718e69ecc012253fb9c6ad7bc4e57e86a205 | [
"Apache-2.0"
] | null | null | null | weather.py | wcyuan/weather-mailer | c25d718e69ecc012253fb9c6ad7bc4e57e86a205 | [
"Apache-2.0"
] | null | null | null | import os
import jinja2
import webapp2
# ------------------------------------------------------------------------- #
API_KEY = "8e635b5992d237d6"
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2.ext.autoescape'],
autoescape=True)
# ... | 37.094118 | 165 | 0.633365 | import contextlib
import json
import os
import sys
import urllib
import urllib2
from google.appengine.api import users
from google.appengine.ext import ndb
import jinja2
import webapp2
# ------------------------------------------------------------------------- #
API_KEY = "8e635b5992d237d6"
JINJA_ENVIRONMENT = ji... | 0 | 0 | 0 | 551 | 0 | 0 | 0 | -8 | 178 |
02da7dce59ef635242e4166ca60f49d79854697b | 2,217 | py | Python | source/existsUI.py | MChenLiang/MPlayer | 10fac8f2b2c5fefb7f3aabdd69b08190c3ffb4ab | [
"MIT"
] | 1 | 2019-12-16T06:27:39.000Z | 2019-12-16T06:27:39.000Z | source/existsUI.py | MChenLiang/MPlayer | 10fac8f2b2c5fefb7f3aabdd69b08190c3ffb4ab | [
"MIT"
] | null | null | null | source/existsUI.py | MChenLiang/MPlayer | 10fac8f2b2c5fefb7f3aabdd69b08190c3ffb4ab | [
"MIT"
] | 1 | 2019-12-16T03:56:13.000Z | 2019-12-16T03:56:13.000Z | #!/user/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'miaoChenLiang'
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# import++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# +++++++++++++++++++++++++++++++... | 34.640625 | 104 | 0.410465 | #!/user/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'miaoChenLiang'
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# import++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #
# ↓++++++++++++++++++++++++++++++... | 6 | 0 | 0 | 1,335 | 0 | 0 | 0 | 5 | 66 |
18fc20011fa916f50ee897bb8fd3460ae19247c2 | 1,515 | py | Python | test.py | IkuzakIkuzok/4-4-4-4 | 30be078daa77fc603e5fd71e654e945bced3932d | [
"MIT"
] | null | null | null | test.py | IkuzakIkuzok/4-4-4-4 | 30be078daa77fc603e5fd71e654e945bced3932d | [
"MIT"
] | null | null | null | test.py | IkuzakIkuzok/4-4-4-4 | 30be078daa77fc603e5fd71e654e945bced3932d | [
"MIT"
] | null | null | null |
# (c) 2020 Kazuki KOHZUKI
BOARD = [[
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0]],
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0]],
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0]],
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0... | 40.945946 | 78 | 0.267987 |
# (c) 2020 Kazuki KOHZUKI
import cpu
from utils import *
BOARD = [[
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0]],
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0]],
[[ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0], [ 0, 0, 0, 0]],
[[ 0, 0, ... | 0 | 0 | 0 | 0 | 0 | 34 | 0 | -13 | 68 |
0a8c32c926b39674c4b096367d139333d686a8bd | 234 | py | Python | data_types_and_variables/more_exercises/exchange_integers.py | PetkoAndreev/Python-fundamentals | dcf2ecb65d7a82a6688a7529a14eb8a331a83256 | [
"MIT"
] | null | null | null | data_types_and_variables/more_exercises/exchange_integers.py | PetkoAndreev/Python-fundamentals | dcf2ecb65d7a82a6688a7529a14eb8a331a83256 | [
"MIT"
] | null | null | null | data_types_and_variables/more_exercises/exchange_integers.py | PetkoAndreev/Python-fundamentals | dcf2ecb65d7a82a6688a7529a14eb8a331a83256 | [
"MIT"
] | null | null | null | num1 = input()
num2 = input()
nums = [num1, num2]
result = ''
result += 'Before:\n'
result += f'a = {nums[0]}\n'
result += f'b = {nums[1]}\n'
result += 'After:\n'
result += f'a = {nums[1]}\n'
result += f'b = {nums[0]}'
print(result)
| 18 | 28 | 0.542735 | num1 = input()
num2 = input()
nums = [num1, num2]
result = ''
result += 'Before:\n'
result += f'a = {nums[0]}\n'
result += f'b = {nums[1]}\n'
result += 'After:\n'
result += f'a = {nums[1]}\n'
result += f'b = {nums[0]}'
print(result)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5f1e19816953739730dfcbc842d9fe2291bde675 | 9,768 | py | Python | scripts/main_dbastar.py | IMRCLab/kinodynamic-motion-planning-benchmark | 2b978b6400e5ce38f858293126a5db57da3019c6 | [
"MIT"
] | null | null | null | scripts/main_dbastar.py | IMRCLab/kinodynamic-motion-planning-benchmark | 2b978b6400e5ce38f858293126a5db57da3019c6 | [
"MIT"
] | null | null | null | scripts/main_dbastar.py | IMRCLab/kinodynamic-motion-planning-benchmark | 2b978b6400e5ce38f858293126a5db57da3019c6 | [
"MIT"
] | null | null | null | import shutil
import sys
import os
sys.path.append(os.getcwd())
# ./dbastar -i ../benchmark/dubins/kink_0.yaml -m motions.yaml -o output.yaml --delta 0.3
if __name__ == '__main__':
main()
| 31.81759 | 122 | 0.679668 | import shutil
import numpy as np
from scp import SCP
import robots
import yaml
import argparse
import subprocess
import time
import random
import copy
import shutil
from collections import defaultdict
import tempfile
from pathlib import Path
import msgpack
import sys
import os
sys.path.append(os.getcwd())
import main... | 0 | 0 | 0 | 0 | 0 | 9,118 | 0 | -55 | 511 |
5ba4f24c4f51237591eefb6a86a89496a0de04f1 | 1,369 | py | Python | projects/DA-project-3/problem-3.py | metanitesh/Data-Structure-Algorithm-Python | 48c4e74909700a3b4438f79050c7f974cd95b9a2 | [
"MIT"
] | null | null | null | projects/DA-project-3/problem-3.py | metanitesh/Data-Structure-Algorithm-Python | 48c4e74909700a3b4438f79050c7f974cd95b9a2 | [
"MIT"
] | null | null | null | projects/DA-project-3/problem-3.py | metanitesh/Data-Structure-Algorithm-Python | 48c4e74909700a3b4438f79050c7f974cd95b9a2 | [
"MIT"
] | null | null | null |
print("Test-1------------------------")
print(rearrange_digits([4, 6, 2, 5, 9, 8]))
# [964, 852]
print(rearrange_digits([1, 2, 3, 4, 5]))
# [42, 531]
print("Test-2------------------------")
print(rearrange_digits([]))
# At least 2 numbers required
print("Test-3------------------------")
print(rearrange_digits([1... | 21.390625 | 58 | 0.567568 | def mergesort(items):
if len(items) <= 1:
return items
mid = len(items) // 2
left = items[:mid]
right = items[mid:]
left = mergesort(left)
right = mergesort(right)
return merge(left, right)
def merge(left, right):
merged = []
leftIndex = 0
rightIndex = 0
... | 0 | 0 | 0 | 0 | 0 | 943 | 0 | 0 | 72 |
47678e733f9adde02f7e1aa0886ae2c2490b182b | 5,687 | py | Python | docs/source/auto_tutorials/tutorial_merfish.py | theislab/squidpy_notebooks | 371ddeab15c26140d74da531ce7e63eda4d5ea89 | [
"MIT"
] | 9 | 2021-02-16T08:22:42.000Z | 2022-02-21T05:49:33.000Z | docs/source/auto_tutorials/tutorial_merfish.py | theislab/squidpy_notebooks | 371ddeab15c26140d74da531ce7e63eda4d5ea89 | [
"MIT"
] | 32 | 2021-02-14T17:10:40.000Z | 2022-03-09T20:52:26.000Z | tutorials/tutorial_merfish.py | theislab/squidpy_notebooks | 371ddeab15c26140d74da531ce7e63eda4d5ea89 | [
"MIT"
] | 3 | 2021-04-01T17:10:27.000Z | 2022-02-09T12:54:14.000Z | #!/usr/bin/env python
"""
Analyze Merfish data
========================
This tutorial shows how to apply Squidpy for the analysis of Merfish data.
The data used here was obtained from :cite:`Moffitt2018-me`.
We provide a pre-processed subset of the data, in :class:`anndata.AnnData` format.
For details on how it was p... | 47.391667 | 108 | 0.653596 | #!/usr/bin/env python
"""
Analyze Merfish data
========================
This tutorial shows how to apply Squidpy for the analysis of Merfish data.
The data used here was obtained from :cite:`Moffitt2018-me`.
We provide a pre-processed subset of the data, in :class:`anndata.AnnData` format.
For details on how it was p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
462f8712db091c920a8ecff82d10458b1fb63e2d | 781 | py | Python | app/apis/demo/routes.py | axiaoxin/flask-ping | 933d64ff8ea815111a65dcde715b25f4d01fce43 | [
"Apache-2.0"
] | 8 | 2017-11-30T09:31:48.000Z | 2020-03-20T11:45:25.000Z | app/apis/demo/routes.py | axiaoxin/flask-ping | 933d64ff8ea815111a65dcde715b25f4d01fce43 | [
"Apache-2.0"
] | 3 | 2017-12-05T03:26:08.000Z | 2019-10-21T10:35:19.000Z | app/apis/demo/routes.py | axiaoxin/flask-ping | 933d64ff8ea815111a65dcde715b25f4d01fce43 | [
"Apache-2.0"
] | 3 | 2018-06-07T06:15:12.000Z | 2018-11-18T09:03:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from . import views
message_api = Blueprint('message', __name__)
#
message_api.add_url_rule('/entry', view_func=views.EntryView.as_view('entry'))
#
message_api.add_url_rule(
'/notify_task/<task_id>',
view_func=views.NotifyTaskView.as... | 26.931034 | 78 | 0.723431 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Blueprint
from . import views
message_api = Blueprint('message', __name__)
# 消息入口
message_api.add_url_rule('/entry', view_func=views.EntryView.as_view('entry'))
# 查询任务状态
message_api.add_url_rule(
'/notify_task/<task_id>',
view_func=views.NotifyT... | 69 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
142378270ba484bc1e634a46f593c78aa12f808d | 2,481 | py | Python | Python/design_patterns/structural_patterns/factory_method/solution_1.py | J0shu4B0y/Practice | ea6af3773520f12afcf72f25952a80614d0c13ef | [
"MIT"
] | 1 | 2021-07-18T08:40:05.000Z | 2021-07-18T08:40:05.000Z | Python/design_patterns/structural_patterns/factory_method/solution_1.py | J0shu4B0y/Practice | ea6af3773520f12afcf72f25952a80614d0c13ef | [
"MIT"
] | 3 | 2020-02-21T13:43:44.000Z | 2020-02-21T13:54:57.000Z | Python/design_patterns/structural_patterns/factory_method/solution_1.py | J0shu4B0y/Practice-Python | ea6af3773520f12afcf72f25952a80614d0c13ef | [
"MIT"
] | 2 | 2019-07-19T10:09:08.000Z | 2020-09-20T08:07:36.000Z |
# class Song:
# def __init__(self, song_id, title, artist):
# self.song_id = song_id
# self.title = title
# self.artist = artist
#
#
# class SongSerializer:
# def serialize(self, song, format):
# if format == "JSON":
# song_info = {"id": song.song_id, "title": song.... | 32.220779 | 90 | 0.618299 | import json
import xml.etree.ElementTree as et
# class Song:
# def __init__(self, song_id, title, artist):
# self.song_id = song_id
# self.title = title
# self.artist = artist
#
#
# class SongSerializer:
# def serialize(self, song, format):
# if format == "JSON":
# ... | 0 | 0 | 0 | 1,324 | 0 | 0 | 0 | 3 | 90 |
544ced764fb5b2c4fa2df8a0d0b3443697493b3c | 60,102 | py | Python | util/pydevd/pysrc/pydevd.py | hinesmr/mica | 82d26b9c6b04e1b8cea7d80c054e2cf482a58520 | [
"Apache-2.0"
] | 6 | 2015-01-26T16:14:43.000Z | 2019-08-22T01:29:24.000Z | util/pydevd/pysrc/pydevd.py | hinesmr/mica | 82d26b9c6b04e1b8cea7d80c054e2cf482a58520 | [
"Apache-2.0"
] | 3 | 2015-01-06T13:31:28.000Z | 2016-10-11T16:52:09.000Z | util/pydevd/pysrc/pydevd.py | hinesmr/mica | 82d26b9c6b04e1b8cea7d80c054e2cf482a58520 | [
"Apache-2.0"
] | null | null | null | #IMPORTANT: pydevd_constants must be the 1st thing defined because it'll keep a reference to the original sys._getframe
from pydevd_comm import PydevdLog
import traceback
import pydevd_vm_type
threadingEnumerate = threading.enumerate
threadingCurrentThread = threading.currentThread
DONT_TRACE = {
#commo... | 43.114778 | 154 | 0.550564 | #IMPORTANT: pydevd_constants must be the 1st thing defined because it'll keep a reference to the original sys._getframe
from pydevd_constants import * #@UnusedWildImport
import pydev_imports
from pydevd_comm import CMD_CHANGE_VARIABLE, \
CMD_EVALUATE_EXPRESSION, \
CMD_... | 0 | 0 | 0 | 40,006 | 0 | 7,255 | 0 | 2,277 | 495 |
3340984533747003e19a7a3675c80518dfb0e50b | 5,997 | py | Python | linefinder/utils/file_management_new.py | zhafen/linefinder | 0f4f36a83246f1b833d0c281e635d86be3d1eb95 | [
"MIT"
] | null | null | null | linefinder/utils/file_management_new.py | zhafen/linefinder | 0f4f36a83246f1b833d0c281e635d86be3d1eb95 | [
"MIT"
] | 12 | 2018-08-26T14:10:18.000Z | 2021-04-15T21:48:58.000Z | linefinder/utils/file_management_new.py | zhafen/linefinder | 0f4f36a83246f1b833d0c281e635d86be3d1eb95 | [
"MIT"
] | 1 | 2021-05-19T16:45:21.000Z | 2021-05-19T16:45:21.000Z | #!/usr/bin/env python
'''Simple functions and variables for easily accessing common files and choices
of parameters.
'''
########################################################################
########################################################################
| 27.383562 | 79 | 0.41921 | #!/usr/bin/env python
'''Simple functions and variables for easily accessing common files and choices
of parameters.
'''
import os
import linefinder.config as l_config
########################################################################
########################################################################
c... | 0 | 0 | 0 | 5,655 | 0 | 0 | 0 | 3 | 69 |
846cd4ef6e4106fe2de5f252a2ef28a8a17759d7 | 18,621 | py | Python | tickets/views.py | b1pb1p/opensource-job-portal | 26aaf8415ed27112b94f4111d5136ec6f65b2205 | [
"MIT"
] | 199 | 2019-12-14T02:25:05.000Z | 2022-03-31T11:26:12.000Z | tickets/views.py | b1pb1p/opensource-job-portal | 26aaf8415ed27112b94f4111d5136ec6f65b2205 | [
"MIT"
] | 91 | 2019-12-12T12:19:34.000Z | 2022-03-25T05:52:04.000Z | tickets/views.py | datatalking/opensource-job-portal | 26aaf8415ed27112b94f4111d5136ec6f65b2205 | [
"MIT"
] | 131 | 2019-12-13T06:26:06.000Z | 2022-03-29T19:45:18.000Z | """
Support module for recruiter, will generate a notification
email to recruiter when admin gives suggestions
"""
TICKET_STATUS = (
("Open", "Open"),
("Closed", "Closed"),
)
TICKET_STATUS = (
("Open", "Open"),
("Closed", "Closed"),
("Ongoing", "Ongoing"),
)
| 37.466801 | 97 | 0.60029 | """
Support module for recruiter, will generate a notification
email to recruiter when admin gives suggestions
"""
import json
from django.shortcuts import render
from django.http.response import HttpResponse
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django... | 0 | 17,617 | 0 | 0 | 0 | 0 | 0 | 225 | 476 |
73c77153cf1c0f23f5c74934f62f20d949ff14f8 | 2,347 | py | Python | dumpsdkfuncs.py | TheGreatRambler/NintendoSwitchGameToNative | 90dee5e3b24325f781ee3adf0f3ce083c47bf13d | [
"MIT"
] | 7 | 2021-01-22T23:17:02.000Z | 2022-03-04T22:16:24.000Z | dumpsdkfuncs.py | TheGreatRambler/NintendoSwitchGameToNative | 90dee5e3b24325f781ee3adf0f3ce083c47bf13d | [
"MIT"
] | null | null | null | dumpsdkfuncs.py | TheGreatRambler/NintendoSwitchGameToNative | 90dee5e3b24325f781ee3adf0f3ce083c47bf13d | [
"MIT"
] | 1 | 2021-11-19T04:37:20.000Z | 2021-11-19T04:37:20.000Z | import idautils
import idaapi
import idc
import subprocess
import pycparser
import ida_typeinf
import ida_nalt
sdk_funcs_file = open(idc.ARGV[1], "w")
sdk_funcs_header = open(idc.ARGV[2], "w")
# Uses demumble as a drop in replacment
cppfilt_path = idc.ARGV[3]
print "Wait for auto analysis"
idc.auto_wait()
# Disable ... | 31.293333 | 129 | 0.727738 | import idautils
import idaapi
import idc
import subprocess
import pycparser
import ida_typeinf
import ida_nalt
sdk_funcs_file = open(idc.ARGV[1], "w")
sdk_funcs_header = open(idc.ARGV[2], "w")
# Uses demumble as a drop in replacment
cppfilt_path = idc.ARGV[3]
print "Wait for auto analysis"
idc.auto_wait()
# Disable ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
498533813f644dc095adf8e752c316aaac3a4d3d | 1,925 | py | Python | pd_multiprocessing/map.py | stavrakidis/pd_multithreading | f5737e907b59448fae0d2102a90f9db4d863418a | [
"MIT"
] | null | null | null | pd_multiprocessing/map.py | stavrakidis/pd_multithreading | f5737e907b59448fae0d2102a90f9db4d863418a | [
"MIT"
] | 14 | 2019-02-20T15:18:17.000Z | 2021-06-02T00:38:20.000Z | pd_multiprocessing/map.py | stavrakidis/pd_multiprocessing | f5737e907b59448fae0d2102a90f9db4d863418a | [
"MIT"
] | null | null | null | import os
import math
from concurrent.futures import ProcessPoolExecutor
import multiprocessing as mp
import logging
import pandas as pd
def df_map(func, df: pd.DataFrame, no_of_cores: int = None, no_of_cores_perc: float = None) -> pd.DataFrame:
"""
Maps function func to DataFrame df using multithreading
... | 36.320755 | 113 | 0.674805 | import os
import math
from concurrent.futures import ProcessPoolExecutor
import multiprocessing as mp
import logging
import pandas as pd
def df_map(func, df: pd.DataFrame, no_of_cores: int = None, no_of_cores_perc: float = None) -> pd.DataFrame:
"""
Maps function func to DataFrame df using multithreading
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f18cc174083e8b7a6086e82a39214edff0f35939 | 6,623 | py | Python | demo_half_whole.py | esw0116/Super-SloMo | 876f0f61b8365306cdadcde976c2ddc6a8e20bf8 | [
"MIT"
] | 1 | 2021-12-27T21:53:00.000Z | 2021-12-27T21:53:00.000Z | demo_half_whole.py | esw0116/Super-SloMo | 876f0f61b8365306cdadcde976c2ddc6a8e20bf8 | [
"MIT"
] | null | null | null | demo_half_whole.py | esw0116/Super-SloMo | 876f0f61b8365306cdadcde976c2ddc6a8e20bf8 | [
"MIT"
] | null | null | null |
#[Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
import argparse
import torch
import torchvision.transforms as transforms
import torch.nn as nn
from model import superslomo_half as superslomo
from model.extraction import ends, MPRNet
from utils import load_image
impor... | 37.630682 | 140 | 0.633701 |
#[Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
from model import superslomo_half as superslomo
from model.extraction import center, ends, MPRNet
from ut... | 0 | 0 | 0 | 0 | 0 | 3,721 | 0 | 17 | 90 |
9fa18845b79ed070eedab9183ca15369a7440fab | 845 | py | Python | python/day03/3b.py | mkinsner/aoc2021 | b1d40114af1887e97d224e69cde9868bc6ba05ee | [
"Unlicense"
] | null | null | null | python/day03/3b.py | mkinsner/aoc2021 | b1d40114af1887e97d224e69cde9868bc6ba05ee | [
"Unlicense"
] | null | null | null | python/day03/3b.py | mkinsner/aoc2021 | b1d40114af1887e97d224e69cde9868bc6ba05ee | [
"Unlicense"
] | null | null | null | import numpy as np
with open("input.txt") as f:
lines = f.readlines()
chars = [list(x.strip()) for x in lines]
oxy_arr = np.array(chars, dtype=int)
co2_arr = np.copy(oxy_arr)
num_cols = len(chars[0])
for i in range(num_cols):
keep_val = int(np.median(oxy_arr[:,i]) + 0.5) # +0.5 to round. round() is ... | 28.166667 | 86 | 0.617751 | import numpy as np
import string as s
with open("input.txt") as f:
lines = f.readlines()
chars = [list(x.strip()) for x in lines]
oxy_arr = np.array(chars, dtype=int)
co2_arr = np.copy(oxy_arr)
num_cols = len(chars[0])
for i in range(num_cols):
keep_val = int(np.median(oxy_arr[:,i]) + 0.5) # +0.5 to... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 23 |
4d0e9ae2320bbe5d9201f5e3952ed30edb810e83 | 8,154 | py | Python | rrsm.py | MTD-group/amlt | 568a37b06f2dd289d2b62c960406e3044195fb14 | [
"MIT"
] | 2 | 2020-07-15T20:11:41.000Z | 2022-03-31T17:47:38.000Z | rrsm.py | MTD-group/amlt | 568a37b06f2dd289d2b62c960406e3044195fb14 | [
"MIT"
] | null | null | null | rrsm.py | MTD-group/amlt | 568a37b06f2dd289d2b62c960406e3044195fb14 | [
"MIT"
] | 1 | 2019-05-02T22:05:37.000Z | 2019-05-02T22:05:37.000Z |
from ase.data import covalent_radii as ase_covalent_radii
from ase.data import chemical_symbols
default_element_radii = {}
default_hard_radii = {}
for z in range(len(ase_covalent_radii)):
default_element_radii[chemical_symbols[z]] = ase_covalent_radii[z]
default_hard_radii[chemical_symbols[z]] = 0.9*ase... | 32.746988 | 115 | 0.583027 |
def try_mkdir(structure_direct):
from os import mkdir
try:
mkdir(structure_direct)
except:
pass
from ase.data import covalent_radii as ase_covalent_radii
from ase.data import chemical_symbols
default_element_radii = {}
default_hard_radii = {}
for z in range(len(ase_covalent_radii)):... | 0 | 0 | 0 | 0 | 0 | 6,920 | 0 | 5 | 107 |
07df079d48ba8384415b650e186bd64622fd91b7 | 14,870 | py | Python | src/python/bezier/hazmat/clipping.py | KIKI007/bezier | 66c0fbe0eea1193c4b47e0f838bb27fc1a6ef60d | [
"Apache-2.0"
] | null | null | null | src/python/bezier/hazmat/clipping.py | KIKI007/bezier | 66c0fbe0eea1193c4b47e0f838bb27fc1a6ef60d | [
"Apache-2.0"
] | null | null | null | src/python/bezier/hazmat/clipping.py | KIKI007/bezier | 66c0fbe0eea1193c4b47e0f838bb27fc1a6ef60d | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 34.183908 | 79 | 0.615804 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4192cd8e6f947aef4dd57ac5d3d072e4209f9189 | 15,697 | py | Python | termpair/share.py | dumpmemory/termpair | 543d84af21e2892a8b6f177d1c397b88973b0e98 | [
"MIT"
] | null | null | null | termpair/share.py | dumpmemory/termpair | 543d84af21e2892a8b6f177d1c397b88973b0e98 | [
"MIT"
] | null | null | null | termpair/share.py | dumpmemory/termpair | 543d84af21e2892a8b6f177d1c397b88973b0e98 | [
"MIT"
] | null | null | null | """
Establish a websocket connection and replace local terminal with a pty
that sends all output to the server.
"""
import asyncio
max_read_bytes = 1024 * 2
ws_queue: asyncio.Queue = asyncio.Queue()
JS_MAX_SAFE_INTEGER = 2**53 - 1
| 36.168203 | 103 | 0.558578 | """
Establish a websocket connection and replace local terminal with a pty
that sends all output to the server.
"""
import asyncio
import base64
import datetime
import json
import os
import pty
import signal
import ssl
import sys
import webbrowser
from math import floor
from typing import Callable, List, Optional
from... | 4 | 98 | 8,066 | 6,708 | 0 | 108 | 0 | 17 | 462 |
76af35b9da8f9fbd5ad085635e474a9edbeba94c | 769 | py | Python | agent/ccExceptions.py | gregdickason/consensuscircle | 28bdfb71691f91c8ff85aa600f3948f22d8935f0 | [
"MIT"
] | null | null | null | agent/ccExceptions.py | gregdickason/consensuscircle | 28bdfb71691f91c8ff85aa600f3948f22d8935f0 | [
"MIT"
] | 1 | 2019-12-01T11:16:59.000Z | 2019-12-01T11:16:59.000Z | agent/ccExceptions.py | gregdickason/consensuscircle | 28bdfb71691f91c8ff85aa600f3948f22d8935f0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
| 24.806452 | 81 | 0.642393 | #!/usr/bin/python
class Error(Exception):
"""Base class for exceptions """
pass
class BlockError(Error):
"""Raised when Block processing fails. Rollback not required
Attributes:
reason -- what caused the block to fail (eg instruction that is invalid)
id -- id of the block that faile... | 0 | 0 | 0 | 681 | 0 | 0 | 0 | 0 | 69 |
104f53d7f8f5a6c2441e805a1024dd1e26942cb8 | 207 | py | Python | ch06_dash_layout/circle_css/dash_layout_assets_style.py | Ethan0621/plotly-dash-dev | abe478824db1ee511a2d92f88e5dad49f5d6e27e | [
"MIT"
] | 21 | 2020-10-02T08:17:33.000Z | 2022-03-22T06:10:17.000Z | ch06_dash_layout/circle_css/dash_layout_assets_style.py | Ethan0621/plotly-dash-dev | abe478824db1ee511a2d92f88e5dad49f5d6e27e | [
"MIT"
] | 4 | 2019-07-18T04:43:31.000Z | 2021-10-31T10:30:25.000Z | ch06_dash_layout/circle_css/dash_layout_assets_style.py | Ethan0621/plotly-dash-dev | abe478824db1ee511a2d92f88e5dad49f5d6e27e | [
"MIT"
] | 12 | 2019-07-23T05:36:57.000Z | 2021-07-11T08:57:47.000Z | import dash
import dash_html_components as html
app = dash.Dash(__name__)
app.layout = html.Div([html.Div(className="circle")]) # className
if __name__ == "__main__":
app.run_server(debug=True)
| 20.7 | 71 | 0.73913 | import dash
import dash_html_components as html
app = dash.Dash(__name__)
app.layout = html.Div([html.Div(className="circle")]) # className属性を設定
if __name__ == "__main__":
app.run_server(debug=True)
| 15 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
57ced8ede4c54e9cf9d5b1b5f3a8192195339a71 | 2,333 | py | Python | octokit/settings.py | irqed/octokit.py | 9598024110d22b7dc698327a61d03db3e0e059d1 | [
"MIT"
] | 3 | 2015-06-05T03:36:50.000Z | 2022-03-23T12:45:39.000Z | octokit/settings.py | irqed/octokit.py | 9598024110d22b7dc698327a61d03db3e0e059d1 | [
"MIT"
] | null | null | null | octokit/settings.py | irqed/octokit.py | 9598024110d22b7dc698327a61d03db3e0e059d1 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""Settings class and default values for an API client.
"""
from .version import __version__
# Default API endpoint
API_ENDPOINT = "https://api.github.com/"
# Default WEB endpoint
WEB_ENDPOINT = "https://github.com"
# Default User Agent header string
USER_AGENT = "octokit.py/%s" % __version__
# ... | 27.77381 | 71 | 0.671239 | # encoding: utf-8
"""Settings class and default values for an API client.
"""
from os import environ
from .version import __version__
# Default API endpoint
API_ENDPOINT = "https://api.github.com/"
# Default WEB endpoint
WEB_ENDPOINT = "https://github.com"
# Default User Agent header string
USER_AGENT = "octokit.... | 0 | 271 | 0 | 1,446 | 0 | 0 | 0 | 1 | 46 |
97a2608580380efc2e2e2af2dbb236545d111996 | 1,037 | py | Python | powderday/gridstats.py | smlower/powderday | 99e7cec28bfbcba40ec1cff367fa564f51d9b62c | [
"BSD-3-Clause"
] | 18 | 2019-09-04T09:48:54.000Z | 2022-02-08T20:45:19.000Z | powderday/gridstats.py | smlower/powderday | 99e7cec28bfbcba40ec1cff367fa564f51d9b62c | [
"BSD-3-Clause"
] | 79 | 2019-09-05T15:09:02.000Z | 2022-02-25T13:29:51.000Z | powderday/gridstats.py | smlower/powderday | 99e7cec28bfbcba40ec1cff367fa564f51d9b62c | [
"BSD-3-Clause"
] | 14 | 2019-08-30T18:24:52.000Z | 2021-08-05T15:33:13.000Z | from __future__ import print_function
| 30.5 | 70 | 0.540984 | from __future__ import print_function
import numpy as np
def gridstats(fc1,fw1):
volume = (fw1**3)
xmin = fc1[:,0]-fw1[:,0]/2.
xmax = fc1[:,0]+fw1[:,0]/2.
ymin = fc1[:,1]-fw1[:,1]/2.
ymax = fc1[:,1]+fw1[:,1]/2.
zmin = fc1[:,2]-fw1[:,2]/2.
zmax = fc1[:,2]+fw1[:,2]/2.
print ('-------... | 0 | 0 | 0 | 0 | 0 | 950 | 0 | -3 | 45 |
0f1e89f133a0f47ef3f2604981cca82cdc85c730 | 8,544 | py | Python | ui/Ui_apiwindow.py | EUFAR/asmm-eufar | 69ede7a24f757392e63f04091e86c50ab129016f | [
"BSD-3-Clause"
] | null | null | null | ui/Ui_apiwindow.py | EUFAR/asmm-eufar | 69ede7a24f757392e63f04091e86c50ab129016f | [
"BSD-3-Clause"
] | 2 | 2015-06-12T09:28:29.000Z | 2015-06-12T09:34:16.000Z | ui/Ui_apiwindow.py | eufarn7sp/asmm-eufar | 69ede7a24f757392e63f04091e86c50ab129016f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'apiwindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
| 55.122581 | 965 | 0.708099 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'apiwindow.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_apiWindow(object):
def setupUi(self, apiWindow):
apiWindow.s... | 0 | 0 | 0 | 8,282 | 0 | 0 | 0 | 21 | 46 |
37f7c8aa844f6c3a138611ccb45501a1375104fa | 1,134 | py | Python | old/pepper1/src/test/parser/test_quoted_code.py | andybalaam/pepper | f0d12379c7c6e2d82003c0c1d6130bfac685e1c3 | [
"MIT"
] | 2 | 2018-12-19T16:32:46.000Z | 2019-01-10T09:00:33.000Z | old/pepper1/src/test/parser/test_quoted_code.py | andybalaam/pepper | f0d12379c7c6e2d82003c0c1d6130bfac685e1c3 | [
"MIT"
] | null | null | null | old/pepper1/src/test/parser/test_quoted_code.py | andybalaam/pepper | f0d12379c7c6e2d82003c0c1d6130bfac685e1c3 | [
"MIT"
] | null | null | null | # Copyright (C) 2012 Andy Balaam and The Pepper Developers
# Released under the MIT License. See the file COPYING.txt for details.
| 17.181818 | 72 | 0.559965 | # Copyright (C) 2012 Andy Balaam and The Pepper Developers
# Released under the MIT License. See the file COPYING.txt for details.
from assert_parser_result import assert_parser_result
from assert_parser_result import assert_parser_result_from_code
def test_quoted_sum():
assert_parser_result(
r"""
0001:0... | 0 | 0 | 0 | 0 | 0 | 832 | 0 | 74 | 91 |
707705c057111731ef5e1a07bc276225b62c6207 | 787 | py | Python | django_hello/migrations/0003_auto_20210213_1835.py | andyanday33/python-docs-hello-django | 4641ec085e00c9e6c310629ae493c3786871807b | [
"MIT"
] | null | null | null | django_hello/migrations/0003_auto_20210213_1835.py | andyanday33/python-docs-hello-django | 4641ec085e00c9e6c310629ae493c3786871807b | [
"MIT"
] | null | null | null | django_hello/migrations/0003_auto_20210213_1835.py | andyanday33/python-docs-hello-django | 4641ec085e00c9e6c310629ae493c3786871807b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-13 15:35
| 31.48 | 171 | 0.636595 | # Generated by Django 3.1.6 on 2021-02-13 15:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20210213_1408'),
]
operations = [
migrations.AlterField(
model_name='oeauser'... | 0 | 0 | 0 | 640 | 0 | 0 | 0 | 30 | 68 |
e7f76e57c7391a3b27d98ce108d77bb81be6628e | 1,429 | py | Python | 02_some_web_anti-crawl_cases/CSS_offset/case.py | zlj-zz/anti-crawlCase | a6ed670ad332bd456572eeff707bd5fc14186b3d | [
"MIT"
] | 1 | 2020-04-23T23:34:14.000Z | 2020-04-23T23:34:14.000Z | 02_some_web_anti-crawl_cases/CSS_offset/case.py | zlj-zz/Anti-crawlCase | a6ed670ad332bd456572eeff707bd5fc14186b3d | [
"MIT"
] | null | null | null | 02_some_web_anti-crawl_cases/CSS_offset/case.py | zlj-zz/Anti-crawlCase | a6ed670ad332bd456572eeff707bd5fc14186b3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:UTF-8 -*-
__author__ = 'zachary'
"""
File Name: case.py
Created Time: 2020-04-04 19:32:10
Last Modified:
"""
import re
from parsel import Selector
if __name__ == "__main__":
# url = ''
# resp = requests.get(url)
resp = open('./html/flight.html').read()
sel = Select... | 29.163265 | 74 | 0.552834 | #!/usr/bin/env python3
# -*- coding:UTF-8 -*-
__author__ = 'zachary'
"""
File Name: case.py
Created Time: 2020-04-04 19:32:10
Last Modified:
"""
import requests
import os
import re
from parsel import Selector
if __name__ == "__main__":
# url = ''
# resp = requests.get(url)
resp = open('./html/flight.html... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 45 |