hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 3 972 | max_issues_repo_name stringlengths 6 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 3 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1f0f391b40b6e4cd93087c650971f8c404f520a2 | 2,726 | py | Python | src/estimation/extendedCV.py | christianhilscher/dynasim | 881cfd3bd9d4b9291d289d703ec7da4a617a479a | [
"MIT"
] | null | null | null | src/estimation/extendedCV.py | christianhilscher/dynasim | 881cfd3bd9d4b9291d289d703ec7da4a617a479a | [
"MIT"
] | 2 | 2020-08-06T10:01:59.000Z | 2021-05-17T12:14:44.000Z | src/estimation/extendedCV.py | christianhilscher/dynasim | 881cfd3bd9d4b9291d289d703ec7da4a617a479a | [
"MIT"
] | 2 | 2020-08-19T06:52:09.000Z | 2021-12-10T08:57:54.000Z | from pathlib import Path
import numpy as np
import pandas as pd
import pickle
import statsmodels.api as sm
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split, GridSearchCV
import lightgbm as lgb
from sklearn.linear_model import LogisticRegression, LinearRegression
f... | 32.452381 | 80 | 0.596478 |
62202cbf94eab7ef7aa6bede7f6c779ab244e720 | 1,584 | py | Python | python/Strong_Password.py | leewalter/coding | 2afd9dbfc1ecb94def35b953f4195a310d6953c9 | [
"Apache-2.0"
] | null | null | null | python/Strong_Password.py | leewalter/coding | 2afd9dbfc1ecb94def35b953f4195a310d6953c9 | [
"Apache-2.0"
] | null | null | null | python/Strong_Password.py | leewalter/coding | 2afd9dbfc1ecb94def35b953f4195a310d6953c9 | [
"Apache-2.0"
] | 1 | 2020-08-29T17:12:52.000Z | 2020-08-29T17:12:52.000Z | '''
https://www.hackerrank.com/challenges/strong-password/submissions/code/103472161
'''
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the minimumNumber function below.
def minimumNumber(n, password):
# Return the minimum number of characters to make the password strong
# ... | 22.309859 | 93 | 0.587121 |
5f67d64458e477f962010840ae3c50069311fafd | 1,593 | py | Python | listening-test-server/handlers/administration/template_handler.py | MirageJian/listening-test | d387aa0a4f6b8304f74dc1c4117787607494e8f2 | [
"MIT"
] | 7 | 2020-09-15T09:20:30.000Z | 2022-03-24T23:15:39.000Z | listening-test-server/handlers/administration/template_handler.py | MirageJian/listening-test | d387aa0a4f6b8304f74dc1c4117787607494e8f2 | [
"MIT"
] | 5 | 2021-01-20T22:29:22.000Z | 2022-02-28T03:24:04.000Z | listening-test-server/handlers/administration/template_handler.py | MirageJian/listening-test | d387aa0a4f6b8304f74dc1c4117787607494e8f2 | [
"MIT"
] | 3 | 2020-08-26T16:50:47.000Z | 2020-11-06T22:33:37.000Z | from handlers.base import BaseHandler
from handlers.miscellanea.task_name_mapping import switch_task_collection
class TemplateHandler(BaseHandler):
# Get all templates based on test type
async def get(self):
test_type = self.get_argument('testType')
collection = switch_task_collection(self, te... | 39.825 | 107 | 0.594476 |
131430567350f002a3415d33ac931172460459f4 | 7,853 | py | Python | sandbox/lib/jumpscale/JumpScale9Lib/clients/google_compute/GoogleCompute.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 2 | 2017-06-07T08:11:47.000Z | 2017-11-10T02:19:48.000Z | JumpScale9Lib/clients/google_compute/GoogleCompute.py | Jumpscale/lib9 | 82224784ef2a7071faeb48349007211c367bc673 | [
"Apache-2.0"
] | 188 | 2017-06-21T06:16:13.000Z | 2020-06-17T14:20:24.000Z | sandbox/lib/jumpscale/JumpScale9Lib/clients/google_compute/GoogleCompute.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 3 | 2018-06-12T05:18:28.000Z | 2019-09-24T06:49:17.000Z | from js9 import j
from pprint import pprint
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
# https://cloud.google.com/compute/docs/reference/latest/instances/list
JSBASE = j.application.jsbase_get_class()
class GoogleCompute(JSBASE):
def __init__(self):
self.__j... | 36.022936 | 148 | 0.540048 |
2869b6b1f8afe68b19b6beff7df3d879432f81bf | 71,676 | py | Python | vendor-local/src/httplib2/python2/httplib2test.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 2 | 2015-04-06T15:20:29.000Z | 2016-12-30T12:25:11.000Z | vendor-local/src/httplib2/python2/httplib2test.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:38:02.000Z | 2019-03-28T03:49:16.000Z | vendor-local/src/httplib2/python2/httplib2test.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 1 | 2019-03-28T03:49:18.000Z | 2019-03-28T03:49:18.000Z | #!/usr/bin/env python2.4
"""
httplib2test
A set of unit tests for httplib2.py.
Requires Python 2.4 or later
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__license__ = "MIT"
__history__ = """ """
__version__ = "0.1 ($Rev: 118 $)"
import St... | 46.034682 | 314 | 0.64772 |
57c9409b401d3448ab9228168d7fdc3d20f7af56 | 1,356 | py | Python | course/lesson05/task03/white_space.py | mstepovanyy/python-training | 0a6766674855cbe784bc1195774016aee889ad6c | [
"MIT",
"Unlicense"
] | null | null | null | course/lesson05/task03/white_space.py | mstepovanyy/python-training | 0a6766674855cbe784bc1195774016aee889ad6c | [
"MIT",
"Unlicense"
] | null | null | null | course/lesson05/task03/white_space.py | mstepovanyy/python-training | 0a6766674855cbe784bc1195774016aee889ad6c | [
"MIT",
"Unlicense"
] | null | null | null | #!/usr/bin/python3
"""
Remove all leading and trailing white-space from a file and print a number of
modified lines.
"""
import re
from course.lesson05.task01.task01 import get_output_file
def strip(input_file_name):
"""
Remove all leading and trailing white-spaces, from 'input_file_name'.
And output resu... | 33.9 | 90 | 0.609882 |
075138fd0d9dbf29d2a70f36fba8ac8df35c02b4 | 10,220 | py | Python | celery/backends/amqp.py | aleszoulek/celery | a179038fec68808d50c0a1f42aa26d315a3817ad | [
"BSD-3-Clause"
] | 2 | 2021-04-30T02:01:12.000Z | 2022-02-18T05:30:28.000Z | celery/backends/amqp.py | aleszoulek/celery | a179038fec68808d50c0a1f42aa26d315a3817ad | [
"BSD-3-Clause"
] | null | null | null | celery/backends/amqp.py | aleszoulek/celery | a179038fec68808d50c0a1f42aa26d315a3817ad | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import socket
import time
from datetime import timedelta
from kombu.entity import Exchange, Queue
from kombu.messaging import Consumer, Producer
from celery import states
from celery.backends.base import BaseDictBackend
from celery.exceptions import TimeoutError
from celery.utils im... | 37.29927 | 78 | 0.580137 |
b61adceda0fcb39bc36cbc4ff75ce8ac61b58732 | 2,241 | py | Python | habari/urls.py | ppolle/habari | 671b98c361ce593f708bc15f69dd3aa6fe72b128 | [
"MIT"
] | 3 | 2020-06-08T08:39:06.000Z | 2020-07-30T10:46:22.000Z | habari/urls.py | ppolle/habari | 671b98c361ce593f708bc15f69dd3aa6fe72b128 | [
"MIT"
] | 9 | 2021-03-19T11:18:58.000Z | 2022-02-10T15:48:35.000Z | habari/urls.py | ppolle/habari | 671b98c361ce593f708bc15f69dd3aa6fe72b128 | [
"MIT"
] | 1 | 2021-09-22T07:23:03.000Z | 2021-09-22T07:23:03.000Z | """habari URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | 41.5 | 146 | 0.672468 |
ab9c948546ec63451d13112d968c331dacbc361a | 158 | py | Python | code/code/code/test1/hcj_undergraduate_code/solver/__init__.py | ChunjunHu/SemanticSegmentationofCropRemoteSensingBasedonDeepLearning | 740f88f6e11ef7e9b84949441d74f19ec06e56d2 | [
"MIT"
] | 2 | 2022-01-06T02:26:24.000Z | 2022-01-28T00:04:35.000Z | code/code/code/test1/hcj_undergraduate_code/solver/__init__.py | ChunjunHu/SemanticSegmentationofCropRemoteSensingBasedonDeepLearning | 740f88f6e11ef7e9b84949441d74f19ec06e56d2 | [
"MIT"
] | null | null | null | code/code/code/test1/hcj_undergraduate_code/solver/__init__.py | ChunjunHu/SemanticSegmentationofCropRemoteSensingBasedonDeepLearning | 740f88f6e11ef7e9b84949441d74f19ec06e56d2 | [
"MIT"
] | null | null | null | '''
Author : now more
Connect : lin.honghui@qq.com
LastEditors : now more
Description :
LastEditTime: 2019-07-02 14:12:10
'''
from .build import *
| 15.8 | 33 | 0.664557 |
45b8c6790c1c6bea952aea79461045bcd5c50203 | 101 | py | Python | flocker/acceptance/__init__.py | stackriot/flocker | eaa586248986d7cd681c99c948546c2b507e44de | [
"Apache-2.0"
] | 2,690 | 2015-01-02T11:12:11.000Z | 2022-03-15T15:41:51.000Z | flocker/acceptance/__init__.py | stackriot/flocker | eaa586248986d7cd681c99c948546c2b507e44de | [
"Apache-2.0"
] | 2,102 | 2015-01-02T18:49:40.000Z | 2021-01-21T18:49:47.000Z | flocker/acceptance/__init__.py | stackriot/flocker | eaa586248986d7cd681c99c948546c2b507e44de | [
"Apache-2.0"
] | 333 | 2015-01-10T01:44:01.000Z | 2022-03-08T15:03:04.000Z | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Acceptance tests for ``flocker``.
"""
| 16.833333 | 57 | 0.693069 |
17709bd89ca3fb4106c778acfd0b9eef2389e1db | 96 | py | Python | city_housing_index/local_admin/apps.py | Sinope-Nanto/city_house | 73589bb07c415b1deecf8a0618b79d376d5a6e88 | [
"MIT"
] | null | null | null | city_housing_index/local_admin/apps.py | Sinope-Nanto/city_house | 73589bb07c415b1deecf8a0618b79d376d5a6e88 | [
"MIT"
] | null | null | null | city_housing_index/local_admin/apps.py | Sinope-Nanto/city_house | 73589bb07c415b1deecf8a0618b79d376d5a6e88 | [
"MIT"
] | 1 | 2021-05-05T13:13:56.000Z | 2021-05-05T13:13:56.000Z | from django.apps import AppConfig
class LocalAdminConfig(AppConfig):
name = 'local_admin'
| 16 | 34 | 0.770833 |
f508f476d2a6dfd8ff156c03f6a1ce82cb3c8ef0 | 1,607 | py | Python | src/ramstk/models/dbtables/commondb_site_info_table.py | weibullguy/ramstk | 3ec41d7e2933045a7a8028aed6c6b04365495095 | [
"BSD-3-Clause"
] | 4 | 2018-08-26T09:11:36.000Z | 2019-05-24T12:01:02.000Z | src/ramstk/models/dbtables/commondb_site_info_table.py | weibullguy/ramstk | 3ec41d7e2933045a7a8028aed6c6b04365495095 | [
"BSD-3-Clause"
] | 52 | 2018-08-24T12:51:22.000Z | 2020-12-28T04:59:42.000Z | src/ramstk/models/dbtables/commondb_site_info_table.py | weibullguy/ramstk | 3ec41d7e2933045a7a8028aed6c6b04365495095 | [
"BSD-3-Clause"
] | 1 | 2018-10-11T07:57:55.000Z | 2018-10-11T07:57:55.000Z | # -*- coding: utf-8 -*-
#
# ramstk.models.commondb.site_info.table.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Site Information Table Model."""
# Standard Library Imports
from typing import Type
# RAMSTK Lo... | 27.706897 | 88 | 0.696951 |
d0497ef921c607268ad3911d963b8a8a0727f78d | 12,347 | py | Python | ClusterEnsembles/ClusterEnsembles.py | tsano430/ClusterEnsembles | 63d872eb1267fbd08138eaa39892376b1155273a | [
"MIT"
] | 32 | 2021-02-15T08:57:45.000Z | 2022-03-19T01:03:39.000Z | ClusterEnsembles/ClusterEnsembles.py | ashuein/ClusterEnsembles | 63d872eb1267fbd08138eaa39892376b1155273a | [
"MIT"
] | 20 | 2021-02-03T12:10:32.000Z | 2022-03-25T18:08:12.000Z | ClusterEnsembles/ClusterEnsembles.py | ashuein/ClusterEnsembles | 63d872eb1267fbd08138eaa39892376b1155273a | [
"MIT"
] | 11 | 2021-04-23T23:17:29.000Z | 2022-03-22T03:42:59.000Z | # coding: utf-8
# ClusterEnsembles.py
# Author: Takehiro Sano
# Contact: tsano430@gmail.com
# License: MIT License
import os
import warnings
from typing import Optional
import numpy as np
import pymetis
import kahypar
from scipy import sparse
from sklearn.metrics import normalized_mutual_info_score
from sklea... | 29.609113 | 92 | 0.617802 |
b53ecaf1c7b47785375a731caa715e1de1706083 | 13,025 | py | Python | worker/workers/__init__.py | nnamon/worker | 3d2a2c659a58a031eccd31e6f05148c7e146964b | [
"BSD-2-Clause"
] | 8 | 2016-08-20T23:39:33.000Z | 2020-11-06T22:46:31.000Z | worker/workers/__init__.py | nnamon/worker | 3d2a2c659a58a031eccd31e6f05148c7e146964b | [
"BSD-2-Clause"
] | null | null | null | worker/workers/__init__.py | nnamon/worker | 3d2a2c659a58a031eccd31e6f05148c7e146964b | [
"BSD-2-Clause"
] | 6 | 2016-08-21T13:15:27.000Z | 2020-11-06T22:46:43.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import contextlib
import os
import pickle
import signal
import socket
import tempfile
import time
import paramiko
import stopit
import subprocess32 as subprocess
import tracer
from farnsworth.models import TracerC... | 41.613419 | 116 | 0.605067 |
0b5d802c7810eb09cbd5cd9daa6444f174e6054c | 2,915 | py | Python | fsc_delta.py | vtlim/GLIC | 90e00e7030748c70ad284cda8785745b6c16ecbb | [
"MIT"
] | 1 | 2019-08-22T06:43:23.000Z | 2019-08-22T06:43:23.000Z | fsc_delta.py | vtlim/GLIC | 90e00e7030748c70ad284cda8785745b6c16ecbb | [
"MIT"
] | null | null | null | fsc_delta.py | vtlim/GLIC | 90e00e7030748c70ad284cda8785745b6c16ecbb | [
"MIT"
] | null | null | null |
import natsort
import glob
import xmltodict
import matplotlib.pyplot as plt
import numpy as np
def plot_format(plt, delta=True):
plt.legend(fontsize=16, loc=1) # discrete
# plt.legend(fontsize=16, loc=1, ncol=2) # diverging
# set plot limits
# plt.ylim(-0.1, 1.1)
# set figure size
plt... | 29.15 | 108 | 0.622985 |
07fb02b354f4ccfaab484620b6f728bebff64b12 | 8,381 | py | Python | Main.py | SebasJin/Investo | 376ec98de094f9c7f507d2f216e8443e02b048a3 | [
"MIT"
] | null | null | null | Main.py | SebasJin/Investo | 376ec98de094f9c7f507d2f216e8443e02b048a3 | [
"MIT"
] | 5 | 2021-05-07T17:50:16.000Z | 2021-06-25T00:48:31.000Z | Main.py | SebasJin/Investo | 376ec98de094f9c7f507d2f216e8443e02b048a3 | [
"MIT"
] | null | null | null | # Import
import requests # Downloads Required Stock Data
import json # stores UserData and others
import os # ya just need it
from os import path
from time import sleep
from datetime import datetime
global url
url = ''
global user_info
user_info = []
global type
type = ''
class Color:
PURPLE = '\033[95m'
CY... | 38.444954 | 136 | 0.602076 |
9f082edb12649c9101c0693ef97b0b714b07bb7b | 3,794 | py | Python | src/sdi_pandas/oneHotEncoding/oneHotEncoding.py | thhapke/DI_Pandas | 7a9108007459260a30ea7ee404a76b42861c81c5 | [
"MIT"
] | 2 | 2020-01-02T19:54:46.000Z | 2020-03-09T08:49:33.000Z | src/sdi_pandas/oneHotEncoding/oneHotEncoding.py | thhapke/DI_Pandas | 7a9108007459260a30ea7ee404a76b42861c81c5 | [
"MIT"
] | null | null | null | src/sdi_pandas/oneHotEncoding/oneHotEncoding.py | thhapke/DI_Pandas | 7a9108007459260a30ea7ee404a76b42861c81c5 | [
"MIT"
] | 1 | 2020-03-28T22:53:16.000Z | 2020-03-28T22:53:16.000Z | import sdi_utils.gensolution as gs
import sdi_utils.set_logging as slog
import sdi_utils.textfield_parser as tfp
import pandas as pd
EXAMPLE_ROWS = 5
try:
api
except NameError:
class api:
class Message:
def __init__(self,body = None,attributes = ""):
self.body = body
... | 33.280702 | 155 | 0.583026 |
eb065fed5d1c99cc19796e9808e2b46a781ca669 | 656 | py | Python | test/mustache.py | roualdes/TestBank | b1435294ab0be3eebab15868a7a88adb4a6a6de7 | [
"BSD-3-Clause"
] | 1 | 2020-07-27T23:17:33.000Z | 2020-07-27T23:17:33.000Z | test/mustache.py | roualdes/testbank | b1435294ab0be3eebab15868a7a88adb4a6a6de7 | [
"BSD-3-Clause"
] | 3 | 2019-06-18T22:23:33.000Z | 2022-01-22T05:21:40.000Z | test/mustache.py | roualdes/TestBank | b1435294ab0be3eebab15868a7a88adb4a6a6de7 | [
"BSD-3-Clause"
] | null | null | null | import json
import numpy as np
seed = #< SEEAD >#
id = '#< ID >#'
npint = np.iinfo(np.int)
if seed is None:
seed = np.random.randint(1, npint.max)
random.seed(seed)
#< #exercise >#
ex = "This problem has no key 'id' in the exercise schema."
output = json.dumps({'seed': seed,
'context': ex,
... | 22.62069 | 59 | 0.501524 |
8e2557ca281f6ef3706e962149593c6e4d81fb67 | 820 | py | Python | auctions/apps.py | AH-SALAH/CS50W-commerce | 19663da14721b5fbadb691763d79d9ae66a40faa | [
"CNRI-Python"
] | null | null | null | auctions/apps.py | AH-SALAH/CS50W-commerce | 19663da14721b5fbadb691763d79d9ae66a40faa | [
"CNRI-Python"
] | null | null | null | auctions/apps.py | AH-SALAH/CS50W-commerce | 19663da14721b5fbadb691763d79d9ae66a40faa | [
"CNRI-Python"
] | null | null | null | from django.apps import AppConfig
from django.db.models.signals import post_delete, post_save, pre_save
class AuctionsConfig(AppConfig):
name = 'auctions'
def ready(self):
# importing model classes
from .models import Bid, Listing
# load it here to avoid 'apps aren't loaded yet err'
... | 35.652174 | 108 | 0.704878 |
0c262cfee9914341953e63fa3cb653bcb52d4c88 | 750 | py | Python | PornHub/PornHub/pipelines.py | dizhi333/WebHubBot | 1f643906727d64334fdd3770fb3694fcaddc59a6 | [
"MIT"
] | 5 | 2018-02-02T14:41:40.000Z | 2020-11-22T14:15:22.000Z | PornHub/PornHub/pipelines.py | 0xsb/WebHubBot | 012c16c62eeded18de7426cf68adc6c3d4fd9f8f | [
"MIT"
] | 3 | 2021-03-31T18:53:16.000Z | 2022-02-11T03:41:21.000Z | PornHub/PornHub/pipelines.py | 0xsb/WebHubBot | 012c16c62eeded18de7426cf68adc6c3d4fd9f8f | [
"MIT"
] | 3 | 2019-05-05T10:19:07.000Z | 2020-08-28T03:27:34.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
from items import PornVideoItem
class PornhubMongoDBPipeline(object):
def __init__(self):
clinet =... | 26.785714 | 65 | 0.62 |
1f84ca4ff155fd421b90bd769f8d7d8f32a54934 | 3,496 | py | Python | src/data/clean_data.py | javierAraluce/ARAGAN | 5954cb8f5975b16b506ed33aaf842fc1cd715044 | [
"MIT"
] | 1 | 2022-02-02T20:06:15.000Z | 2022-02-02T20:06:15.000Z | src/data/clean_data.py | javierAraluce/ARAGAN | 5954cb8f5975b16b506ed33aaf842fc1cd715044 | [
"MIT"
] | null | null | null | src/data/clean_data.py | javierAraluce/ARAGAN | 5954cb8f5975b16b506ed33aaf842fc1cd715044 | [
"MIT"
] | null | null | null | import numpy as np
import os
from tqdm import tqdm
# path of training images
imgs_train_path = 'dataset/BDDA/training/camera_images/'
# path of training maps
maps_train_path = 'dataset/BDDA/training/gazemap_images_resized/'
# path of validation images
imgs_val_path = 'dataset/BDDA/validation/camera_images/'
# path of... | 43.7 | 100 | 0.618421 |
83905f23090a09e0af4b9eb2b8054cc3e9765981 | 48 | py | Python | docker/distorm3/verify.py | ThisIsNotTheUserYouAreLookingFor/dockerfiles | f92673b0d15c457e4abe215cf260afbb5b25cf2e | [
"MIT"
] | 48 | 2018-12-12T12:18:09.000Z | 2022-03-05T02:23:42.000Z | docker/distorm3/verify.py | ThisIsNotTheUserYouAreLookingFor/dockerfiles | f92673b0d15c457e4abe215cf260afbb5b25cf2e | [
"MIT"
] | 7,201 | 2018-12-24T17:14:17.000Z | 2022-03-31T13:39:12.000Z | docker/distorm3/verify.py | ThisIsNotTheUserYouAreLookingFor/dockerfiles | f92673b0d15c457e4abe215cf260afbb5b25cf2e | [
"MIT"
] | 94 | 2018-12-17T10:59:21.000Z | 2022-03-29T12:59:30.000Z | import pefile
import distorm3
print("All OK!")
| 9.6 | 16 | 0.75 |
09e84d4dc4cb9affa10fd9d25029e2905e9ee26c | 2,129 | py | Python | fastlmmhpc/pyplink/altset_list/Consecutive.py | epiproject/FaST-LMM-HPC | 5d6df81268aeff19015194ab0718a9163b8d33af | [
"Apache-2.0"
] | 2 | 2019-12-10T09:55:40.000Z | 2019-12-11T20:58:10.000Z | fastlmmhpc/pyplink/altset_list/Consecutive.py | epiproject/FaST-LMM-HPC | 5d6df81268aeff19015194ab0718a9163b8d33af | [
"Apache-2.0"
] | null | null | null | fastlmmhpc/pyplink/altset_list/Consecutive.py | epiproject/FaST-LMM-HPC | 5d6df81268aeff19015194ab0718a9163b8d33af | [
"Apache-2.0"
] | null | null | null | import numpy as SP
import subprocess, sys, os.path
from itertools import *
from fastlmmhpc.pyplink.snpset import *
import math
class Consecutive(object): # implements ISnpSetList
"""
The sets should be every consecutive set of SNPs within a 2cM window of each user
(distance in cM is in the 3rd column of ... | 33.793651 | 160 | 0.638328 |
fec0ec4650ac291cadb42a928141bd293bed3b89 | 7,615 | py | Python | examples/pwr_run/checkpointing/final_eval/random/job61.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final_eval/random/job61.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final_eval/random/job61.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.682403 | 118 | 0.692974 |
01fba698973de3a6f6eb147c5866ed238fff9d4a | 7,543 | py | Python | Data_gen/data_process_audspec_7params_bpass_filter.py | Yashish92/MirrorNet-for-Audio-synthesizer-controls | 99145b7cb524ebb68e1991701f7f0c264ecb4996 | [
"MIT"
] | 1 | 2022-02-19T08:27:49.000Z | 2022-02-19T08:27:49.000Z | Data_gen/data_process_audspec_7params_bpass_filter.py | Yashish92/MirrorNet-for-Audio-synthesizer-controls | 99145b7cb524ebb68e1991701f7f0c264ecb4996 | [
"MIT"
] | null | null | null | Data_gen/data_process_audspec_7params_bpass_filter.py | Yashish92/MirrorNet-for-Audio-synthesizer-controls | 99145b7cb524ebb68e1991701f7f0c264ecb4996 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import matplotlib
SERVER = True # This variable enable or disable matplotlib, set it to true when you use the server!
if SERVER:
matplotlib.use('Agg')
import numpy as np
from scipy import signal
import os
import string
import librosa
import time
import random
import h5py
# ... | 39.082902 | 126 | 0.601087 |
129a7ac979700281256ea66f8839177308f3f2f5 | 4,816 | py | Python | python3/koans/about_class_attributes.py | mullikine/python_koans | 77fc56696cd9c5712ca9d5a28b03c4ca5691f7fe | [
"MIT"
] | 11 | 2016-07-15T14:14:34.000Z | 2020-09-16T06:10:21.000Z | python3/koans/about_class_attributes.py | mullikine/python_koans | 77fc56696cd9c5712ca9d5a28b03c4ca5691f7fe | [
"MIT"
] | 3 | 2016-02-19T13:07:16.000Z | 2019-09-24T22:26:28.000Z | python3/koans/about_class_attributes.py | mullikine/python_koans | 77fc56696cd9c5712ca9d5a28b03c4ca5691f7fe | [
"MIT"
] | 14 | 2016-01-16T09:58:03.000Z | 2021-06-29T16:38:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutClassMethods in the Ruby Koans
#
from runner.koan import *
class AboutClassAttributes(Koan):
class Dog:
pass
def test_objects_are_objects(self):
fido = self.Dog()
self.assertEqual(True, isinstance(fido, object))
def... | 31.070968 | 92 | 0.623754 |
5e607e8cc1b41e3e37a4baad1aba26bfbe80629e | 4,990 | py | Python | bikeshed/wpt/wptElement.py | sideshowbarker/bikeshed | 1bdc5b25e90441d987cf722e1e1178f4dbb1ee92 | [
"CC0-1.0"
] | 1 | 2017-12-24T05:55:06.000Z | 2017-12-24T05:55:06.000Z | bikeshed/wpt/wptElement.py | toji/bikeshed | c9be1fd32a93cdf394ae251db3bbccc87c5e82a9 | [
"CC0-1.0"
] | null | null | null | bikeshed/wpt/wptElement.py | toji/bikeshed | c9be1fd32a93cdf394ae251db3bbccc87c5e82a9 | [
"CC0-1.0"
] | 1 | 2017-12-24T05:54:38.000Z | 2017-12-24T05:54:38.000Z | # -*- coding: utf-8 -*-
import io
from .. import config
from ..html import findAll, textContent, removeNode, E, addClass, appendChild, clearContents
from ..messages import *
def processWptElements(doc):
pathPrefix = doc.md.wptPathPrefix
atLeastOneElement = False
testData = None
# <wpt> elements
wptElements = ... | 29.011628 | 131 | 0.703407 |
f112ba293ab4f0da14428f48eb931868c61a08ef | 209 | py | Python | src/pretix/plugins/ticketoutputpdf/urls.py | MaxRink/pretix | f561ece9d1591673a495a6226db812e809ab3aec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/ticketoutputpdf/urls.py | MaxRink/pretix | f561ece9d1591673a495a6226db812e809ab3aec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/ticketoutputpdf/urls.py | MaxRink/pretix | f561ece9d1591673a495a6226db812e809ab3aec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^control/event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/pdfoutput/editor/$', views.EditorView.as_view(),
name='editor'),
]
| 23.222222 | 111 | 0.631579 |
f2b41363868ca26aac34aab7d665d435d18297dc | 15,220 | py | Python | addons/blender_mmd_tools-main/mmd_tools/operators/model.py | V-Sekai/V-Sekai-Blender-tools | 3473ad4abb737756290a9007273519460742960d | [
"MIT"
] | 2 | 2021-12-21T16:38:58.000Z | 2022-01-08T00:56:35.000Z | addons/blender_mmd_tools-main/mmd_tools/operators/model.py | V-Sekai/V-Sekai-Blender-game-tools | 3473ad4abb737756290a9007273519460742960d | [
"MIT"
] | 1 | 2022-01-29T05:46:50.000Z | 2022-01-29T05:46:50.000Z | addons/blender_mmd_tools-main/mmd_tools/operators/model.py | V-Sekai/V-Sekai-Blender-game-tools | 3473ad4abb737756290a9007273519460742960d | [
"MIT"
] | 1 | 2021-11-07T19:41:34.000Z | 2021-11-07T19:41:34.000Z | # -*- coding: utf-8 -*-
import bpy
import mmd_tools.core.model as mmd_model
from bpy.types import Operator
from mmd_tools import register_wrap
from mmd_tools.bpyutils import SceneOp
from mmd_tools.core.bone import FnBone
@register_wrap
class MorphSliderSetup(Operator):
bl_idname = 'mmd_tools.morph_slider_setup'
... | 36.238095 | 125 | 0.645269 |
30cee60190195e34730a2579c0147bba5e01dc37 | 4,253 | py | Python | _posts/2020-12-18-目标检测专题/code/chapter02_image_classification_introduction/2.2_introduction_of_image_classification/classical_cnn_models/AlexNet/AlexNet.py | CarmanZheng/CarmanZheng.github.io | bb969ad037f3db4dae7b0d5edf99b365f9d589cb | [
"MIT"
] | null | null | null | _posts/2020-12-18-目标检测专题/code/chapter02_image_classification_introduction/2.2_introduction_of_image_classification/classical_cnn_models/AlexNet/AlexNet.py | CarmanZheng/CarmanZheng.github.io | bb969ad037f3db4dae7b0d5edf99b365f9d589cb | [
"MIT"
] | null | null | null | _posts/2020-12-18-目标检测专题/code/chapter02_image_classification_introduction/2.2_introduction_of_image_classification/classical_cnn_models/AlexNet/AlexNet.py | CarmanZheng/CarmanZheng.github.io | bb969ad037f3db4dae7b0d5edf99b365f9d589cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from tqdm import tqdm
import torch.nn.functional as F
# Device configuration
device = torch.device('cuda:1' if torch.cuda.is_available() else 'cpu')
print("You are using:", device)
# Hyper paramet... | 33.488189 | 90 | 0.555373 |
85e894bfb08b202d8fd4f47b132592e6005348e4 | 500 | py | Python | molecule/default/tests/test_default.py | bossjones/boss-ansible-role-update-hosts | e00ba0a9b910ebbd529513139f1d09f58d4fa8b5 | [
"Apache-2.0"
] | null | null | null | molecule/default/tests/test_default.py | bossjones/boss-ansible-role-update-hosts | e00ba0a9b910ebbd529513139f1d09f58d4fa8b5 | [
"Apache-2.0"
] | 4 | 2021-04-07T23:17:55.000Z | 2022-02-07T22:26:17.000Z | molecule/default/tests/test_default.py | bossjones/boss-ansible-role-update-hosts | e00ba0a9b910ebbd529513139f1d09f58d4fa8b5 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_hosts_file(host):
f = host.file('/etc/hosts.molecule')
assert f.exists
assert f.user == 'root'
assert f.g... | 27.777778 | 81 | 0.73 |
d9e3ece63c2a87bf465d139175635bfaf6a046ae | 76,804 | py | Python | mongomock/collection.py | aie0/mongomock | f0114d954831df81665819779e0b666c3eca3d94 | [
"BSD-3-Clause"
] | null | null | null | mongomock/collection.py | aie0/mongomock | f0114d954831df81665819779e0b666c3eca3d94 | [
"BSD-3-Clause"
] | null | null | null | mongomock/collection.py | aie0/mongomock | f0114d954831df81665819779e0b666c3eca3d94 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
import collections
from collections import OrderedDict
import copy
from datetime import datetime
import functools
import itertools
import json
import math
import threading
import time
import warnings
try:
from bson import json_util, SON, BSON
except ImportError:
json_utils = SON... | 41.515676 | 100 | 0.507018 |
b9b53926bf1ae576cd6e1e64a029c9869e3be822 | 9,801 | py | Python | venus.py | AlexCPU/VictronVenus-InfluxDB | 1d04b8a44d6629736407463dcb904ccf6c6eb74c | [
"Apache-2.0"
] | null | null | null | venus.py | AlexCPU/VictronVenus-InfluxDB | 1d04b8a44d6629736407463dcb904ccf6c6eb74c | [
"Apache-2.0"
] | null | null | null | venus.py | AlexCPU/VictronVenus-InfluxDB | 1d04b8a44d6629736407463dcb904ccf6c6eb74c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import datetime
import logging
import numpy as np
from aiohttp import ClientConnectionError
from pyModbusTCP.client import ModbusClient
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder
import asyncio
from aioinflux import InfluxDBClient, Inf... | 44.753425 | 117 | 0.55678 |
879f520d53d38f557f3143d2bd9889b78edc9ed9 | 2,491 | py | Python | src/symbol_table.py | Wynjones1/pycompiler | dd6f0f3a5e4a4b6c7b110080d66e05724ade6627 | [
"MIT"
] | null | null | null | src/symbol_table.py | Wynjones1/pycompiler | dd6f0f3a5e4a4b6c7b110080d66e05724ade6627 | [
"MIT"
] | null | null | null | src/symbol_table.py | Wynjones1/pycompiler | dd6f0f3a5e4a4b6c7b110080d66e05724ade6627 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
import syntax_tree as ast
from collections import OrderedDict
_global_symbol_table = None
class SymbolTable(object):
""" SymbolTable contains the mapping of identifiers to types
it can contain point to one of
function or type
"""
def __init__(self, parent = None)... | 29.654762 | 71 | 0.600161 |
9bf3a64ed0098c06e2a187d46b7342df36eab534 | 1,193 | py | Python | _train_resnet50.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | _train_resnet50.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | _train_resnet50.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | import logging
import shlex
import subprocess
import time
import torch
# from torchvision.models import resnet50
from pytorch_model.resnet import resnet50
_logger = logging.getLogger(__name__)
def get_memory_free() -> bool:
output = subprocess.check_output(
shlex.split(
'nvidi... | 22.509434 | 79 | 0.629505 |
3dc71b2a43a321e29b143f1d86112581a47ec2e4 | 943 | py | Python | issue2/imperative_gluon.py | KexinFeng/incubator-mxnet | 66cdc16f3ab9ebda0fe82dcdd612db615c80b007 | [
"Apache-2.0",
"MIT"
] | null | null | null | issue2/imperative_gluon.py | KexinFeng/incubator-mxnet | 66cdc16f3ab9ebda0fe82dcdd612db615c80b007 | [
"Apache-2.0",
"MIT"
] | null | null | null | issue2/imperative_gluon.py | KexinFeng/incubator-mxnet | 66cdc16f3ab9ebda0fe82dcdd612db615c80b007 | [
"Apache-2.0",
"MIT"
] | null | null | null | # This is bug free, since `_api_internal.invoke(CachedOp.handle, ...)`
# is called.
# `unit_test.py` has bug when `static_alloc` is set in `_bind`.
# It calls `_LIB.MXInvokeCachedOp`
import mxnet as mx
from mxnet.gluon import HybridBlock
from mxnet import autograd as ag
class AddBlock(HybridBlock):
def __init__... | 23 | 71 | 0.651113 |
7b0cf2e7e4d2654a37b6c8a9ad4efe8aa8e12f52 | 191 | py | Python | src/services/message_management/publish.py | b1team/trada | 22ceaf4d50fe3a38ff402315c029e574773ca9e0 | [
"MIT"
] | null | null | null | src/services/message_management/publish.py | b1team/trada | 22ceaf4d50fe3a38ff402315c029e574773ca9e0 | [
"MIT"
] | 1 | 2021-03-12T15:16:03.000Z | 2021-03-12T15:16:03.000Z | src/services/message_management/publish.py | b1team/trada | 22ceaf4d50fe3a38ff402315c029e574773ca9e0 | [
"MIT"
] | null | null | null | import redis
import json
def publish_event(redis_uri, channel, event):
r = redis.Redis.from_url(redis_uri)
pub = r.publish(channel=channel, message=json.dumps(event))
return pub | 23.875 | 63 | 0.73822 |
a5c22b272c1a7bf50883ddfbf6d899017fab7170 | 13,834 | py | Python | MNIST/Deep_AE_overfit.py | Sungyeop/IPRL | 6ee17f415998ac5cc058c63cea06a5cad40b267c | [
"MIT"
] | 2 | 2021-02-08T05:34:45.000Z | 2021-03-02T08:36:06.000Z | MNIST/Deep_AE_overfit.py | Sungyeop/IPRL | 6ee17f415998ac5cc058c63cea06a5cad40b267c | [
"MIT"
] | null | null | null | MNIST/Deep_AE_overfit.py | Sungyeop/IPRL | 6ee17f415998ac5cc058c63cea06a5cad40b267c | [
"MIT"
] | null | null | null | import numpy as np
import copy
import torch
import torchvision
from torch import nn, optim
from torchvision import transforms, datasets
from scipy.spatial.distance import pdist, squareform
from scipy.special import expit
import matplotlib.pyplot as plt
# Training Options
#=============================================... | 36.21466 | 122 | 0.582117 |
186e18187d344594ae0bcf33fa38b6ae55a6ab39 | 2,179 | py | Python | betconnect/utils.py | betcode-org/betconnect | 055158f8fc89a7491d19396f91373de0dfee81b4 | [
"MIT"
] | 4 | 2022-03-24T11:35:10.000Z | 2022-03-25T20:32:33.000Z | betconnect/utils.py | betcode-org/betconnect | 055158f8fc89a7491d19396f91373de0dfee81b4 | [
"MIT"
] | 6 | 2022-03-24T11:32:07.000Z | 2022-03-29T17:18:53.000Z | betconnect/utils.py | varneyo/betconnect | 5463977a9053fec1d9a759995aed44209ee73d43 | [
"MIT"
] | 1 | 2022-03-29T12:56:24.000Z | 2022-03-29T12:56:24.000Z | from __future__ import annotations
import hashlib
from typing import List, Union, TYPE_CHECKING
from uuid import UUID
if TYPE_CHECKING:
from betconnect.resources import SelectionsForMarket
# "https://stackoverflow.com/questions/19989481/how-to-determine-if-a-string-is-a-valid-v4-uuid"
def is_valid_uuid(uuid_to_te... | 29.849315 | 99 | 0.673245 |
fc4e3a4118e66e2502cc4e7a89b4df23c256f677 | 3,527 | py | Python | docs/conf.py | ajyoung/cheroot | b6edd3a2ff579e3e6d8276b0a262fd7fbb54adce | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | ajyoung/cheroot | b6edd3a2ff579e3e6d8276b0a262fd7fbb54adce | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | ajyoung/cheroot | b6edd3a2ff579e3e6d8276b0a262fd7fbb54adce | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
# Requires Python 3.6+
# pylint: disable=invalid-name
"""Configuration of Sphinx documentation generator."""
from pathlib import Path
import sys
# Make in-tree extension importable in non-tox setups/envs, like RTD.
# Refs:
# https://github.com/readthedocs/readthedocs.org/issues/6311
# https:/... | 32.357798 | 78 | 0.694074 |
8ea7cc4ea4b3cd2e2107e212d2c00d47db569b2a | 382 | py | Python | tests/fixtures/fabfile.py | kevin1024/fabric_remote | b564638cb54ec511d54945217ba4049dbcb824a1 | [
"Unlicense",
"MIT"
] | 19 | 2015-03-03T10:57:09.000Z | 2019-06-22T03:03:28.000Z | tests/fixtures/fabfile.py | chojayr/fabric_remote | 054496e675c3480979494d011c785bb2e4dbfd17 | [
"MIT",
"Unlicense"
] | 2 | 2017-05-16T12:26:04.000Z | 2021-10-21T01:59:22.000Z | tests/fixtures/fabfile.py | chojayr/fabric_remote | 054496e675c3480979494d011c785bb2e4dbfd17 | [
"MIT",
"Unlicense"
] | 5 | 2015-06-22T21:09:45.000Z | 2017-05-16T12:26:32.000Z | import os
from fabric.api import task, run, local, env
import time
@task
def host_type():
"""
test description
"""
local('uname -a')
local('ls -l /usr/lib')
local('echo blah')
time.sleep(4)
local('echo blah')
local('echo blah')
local('echo blah')
env['foo'] = 'bar'
retur... | 16.608696 | 44 | 0.58377 |
71e75a13ec6a4a915cdee8cf0fb8744111789294 | 1,266 | py | Python | var/spack/repos/builtin/packages/r-argparse/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-argparse/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-argparse/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RArgparse(RPackage):
"""Command Line Optional and Positional Argument Parser.
A comma... | 42.2 | 95 | 0.718799 |
6a9d07a07e1c6e3c00493cf351fd2d489f9be3c8 | 1,909 | py | Python | trac/upgrades/db40.py | pkdevbox/trac | d044fc469e4dcbc5901c992b1b4160e9cbecee25 | [
"BSD-3-Clause"
] | null | null | null | trac/upgrades/db40.py | pkdevbox/trac | d044fc469e4dcbc5901c992b1b4160e9cbecee25 | [
"BSD-3-Clause"
] | null | null | null | trac/upgrades/db40.py | pkdevbox/trac | d044fc469e4dcbc5901c992b1b4160e9cbecee25 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software consists of vo... | 41.5 | 76 | 0.687271 |
a6fab152d4d180e7da42afd6811994f8380fb7df | 3,905 | py | Python | Dr. CovidAI/Dr. CovidAI/flaskblog/routs.py | Shreyas-l/Dr.CovidAI | a09eb779db8d7f38fe4545d3ab71fac8a78f1054 | [
"MIT"
] | null | null | null | Dr. CovidAI/Dr. CovidAI/flaskblog/routs.py | Shreyas-l/Dr.CovidAI | a09eb779db8d7f38fe4545d3ab71fac8a78f1054 | [
"MIT"
] | 1 | 2020-04-13T15:56:55.000Z | 2020-04-13T15:56:55.000Z | Dr. CovidAI/Dr. CovidAI/flaskblog/routs.py | Shreyas-l/CODE19-Pyrocrats | a09eb779db8d7f38fe4545d3ab71fac8a78f1054 | [
"MIT"
] | null | null | null |
from flask import render_template, url_for, flash, redirect, abort, request, jsonify, make_response
#from flaskblog.models import User,Post
#from flaskblog.forms import RegistrationForm, LoginForm,PostForm
from flaskblog import app
from flask_login import login_user, current_user, logout_user, login_required
import re... | 30.507813 | 256 | 0.691677 |
d724899859168e9c8bec42cae3ae2d011f5a757f | 3,923 | py | Python | neurogym/envs/delaycomparison.py | ruyuanzhang/neurogym | b4b456f3d41ab2f1648243828c2c907453f51f80 | [
"MIT"
] | 112 | 2020-07-31T14:52:53.000Z | 2022-03-30T16:53:25.000Z | neurogym/envs/delaycomparison.py | ruyuanzhang/neurogym | b4b456f3d41ab2f1648243828c2c907453f51f80 | [
"MIT"
] | 15 | 2020-10-13T15:59:41.000Z | 2021-05-22T03:30:12.000Z | neurogym/envs/delaycomparison.py | ruyuanzhang/neurogym | b4b456f3d41ab2f1648243828c2c907453f51f80 | [
"MIT"
] | 23 | 2020-10-24T04:26:06.000Z | 2022-03-09T07:40:57.000Z | # -*- coding: utf-8 -*-
import numpy as np
import neurogym as ngym
from neurogym import spaces
class DelayComparison(ngym.TrialEnv):
"""Delayed comparison.
The agent needs to compare the magnitude of two stimuli are separated by a
delay period. The agent reports its decision of the stronger stimulus
... | 31.894309 | 79 | 0.513892 |
b90eda429a3ee4743ecb381d91eeb1a8a043b12f | 4,193 | py | Python | cinder/volume/drivers/macrosan/config.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/volume/drivers/macrosan/config.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/volume/drivers/macrosan/config.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | # Copyright (c) 2019 MacroSAN Technologies Co., Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 45.576087 | 78 | 0.611018 |
5babfc065e03f7fcb31d87ed78c899bab47b0ec1 | 764 | py | Python | setup.py | disqus/menagerie | 97f15624aeabfdf5378ba8232f6051695e4f1d6d | [
"Apache-2.0"
] | 18 | 2015-03-15T13:50:34.000Z | 2020-09-14T09:04:21.000Z | setup.py | disqus/menagerie | 97f15624aeabfdf5378ba8232f6051695e4f1d6d | [
"Apache-2.0"
] | 1 | 2015-03-11T16:44:35.000Z | 2015-03-12T10:42:00.000Z | setup.py | disqus/menagerie | 97f15624aeabfdf5378ba8232f6051695e4f1d6d | [
"Apache-2.0"
] | null | null | null | import sys
from setuptools import find_packages, setup
try:
import multiprocessing # noqa
except ImportError:
pass
install_requires = [
'Django>=1.2,<1.5',
'kazoo>=0.5,<0.9',
]
tests_require = [
'exam==0.6.2',
'nose',
'unittest2',
]
setup_requires = []
if 'nosetests' in sys.argv[1:]:
... | 19.589744 | 47 | 0.662304 |
471787d4a711c79ec9062babb411bd653b0297f2 | 1,954 | py | Python | lib/surface/compute/vpn_gateways/list.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/vpn_gateways/list.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/compute/vpn_gateways/list.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... | 38.313725 | 77 | 0.790174 |
c917240c01e1db24b2d3a5c5a56ce45dcc13a604 | 8,271 | py | Python | cirq/experiments/google_v2_supremacy_circuit.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | 1 | 2020-05-23T08:23:26.000Z | 2020-05-23T08:23:26.000Z | cirq/experiments/google_v2_supremacy_circuit.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | cirq/experiments/google_v2_supremacy_circuit.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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 ... | 36.117904 | 80 | 0.56015 |
583991e53bd59b60fbc4278b31de7411fbcaa6dd | 5,120 | py | Python | src/util.py | pyomeca/pyosim_aws | 91c225b597d52523a1cf30839082c134fb88a4c9 | [
"Apache-2.0"
] | 2 | 2020-09-14T22:22:06.000Z | 2021-06-07T20:44:09.000Z | src/util.py | pyomeca/pyosim_aws | 91c225b597d52523a1cf30839082c134fb88a4c9 | [
"Apache-2.0"
] | 1 | 2020-04-03T16:41:23.000Z | 2020-04-03T16:41:23.000Z | src/util.py | pyomeca/pyosim_aws | 91c225b597d52523a1cf30839082c134fb88a4c9 | [
"Apache-2.0"
] | 1 | 2019-11-30T23:27:02.000Z | 2019-11-30T23:27:02.000Z | import numpy as np
import pandas as pd
import numpy as np
import altair as alt
def parse_conditions(df, filename_col="filename", prefix="", suffix=""):
return df.assign(
filename=lambda x: x[filename_col]
.str.replace(prefix, "")
.str.replace(suffix, ""),
participant=lambda x: x[fil... | 33.684211 | 110 | 0.532617 |
46d3dcd26b97747db61943c6fd427a5502ebc4cd | 696 | py | Python | Gentree/cfg.py | hoefkensj/gentree | 2cf19cb534ac3c756cace2a79e0725a1bfda5f81 | [
"MIT"
] | null | null | null | Gentree/cfg.py | hoefkensj/gentree | 2cf19cb534ac3c756cace2a79e0725a1bfda5f81 | [
"MIT"
] | null | null | null | Gentree/cfg.py | hoefkensj/gentree | 2cf19cb534ac3c756cace2a79e0725a1bfda5f81 | [
"MIT"
] | null | null | null | def spawn(file_name):
with open(f'{file_name}.ini' , 'w') as file:
file.write(f'[DEFAULT]\nfilename\t:\t{file_name}\nfiletype\t:\tini')
def create(file_Config,dct_Config, cfg_config):
cfg= tocfg(dct_Config, cfg_config)
write(file_Config, cfg)
def read(file_Config, cfg_Config):
cfg_Config.read(file_Config)
re... | 19.885714 | 70 | 0.718391 |
acebe039ac554a40c93300e61eb0ac13d0bb90a3 | 3,509 | py | Python | json_ref_dict/uri.py | RangelReale/json-ref-dict | 1ed1c96707359b5d648bafd3062a4446b469b682 | [
"MIT"
] | null | null | null | json_ref_dict/uri.py | RangelReale/json-ref-dict | 1ed1c96707359b5d648bafd3062a4446b469b682 | [
"MIT"
] | null | null | null | json_ref_dict/uri.py | RangelReale/json-ref-dict | 1ed1c96707359b5d648bafd3062a4446b469b682 | [
"MIT"
] | null | null | null | from os import path
import re
from typing import NamedTuple
from urllib.parse import urlparse
from json_ref_dict.exceptions import ReferenceParseError
JSON_REF_REGEX = r"^((?P<uri_base>.*)\/)?(?P<uri_name>.*)#(?P<pointer>\/.*)"
class URI(NamedTuple):
"""URI for a schema or subschema."""
uri_base: str
... | 32.794393 | 76 | 0.589057 |
5d8aaf65d57e463c41d33fd140cef0a69eec3eed | 27,160 | py | Python | ckan/logic/schema.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | 1 | 2020-08-05T21:21:56.000Z | 2020-08-05T21:21:56.000Z | ckan/logic/schema.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | null | null | null | ckan/logic/schema.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from functools import wraps
import inspect
from six import text_type
import ckan.model
import ckan.plugins as plugins
from ckan.logic import get_validator
def validator_args(fn):
u'''collect validator names from argument names
and pass them to wrapped function'''
args = inspect.getarg... | 34.292929 | 79 | 0.677025 |
4fce944e04c4f2868eb1dfd2a8b9ea093f20f8fd | 2,063 | py | Python | source_test.py | Prachigarg1/Prachi | 1a84a1af46ac8a1cd06c3317130dc44072e3c80e | [
"Apache-2.0"
] | 3 | 2015-03-01T07:46:49.000Z | 2020-02-24T18:14:10.000Z | source_test.py | Prachigarg1/Prachi | 1a84a1af46ac8a1cd06c3317130dc44072e3c80e | [
"Apache-2.0"
] | null | null | null | source_test.py | Prachigarg1/Prachi | 1a84a1af46ac8a1cd06c3317130dc44072e3c80e | [
"Apache-2.0"
] | 2 | 2016-01-04T21:01:04.000Z | 2020-02-24T18:14:12.000Z | import scanner
import source
import unittest
import symboltypes
class SourceTestCase(unittest.TestCase):
def testScanSource(self):
test_source = source.ScanScript(_TEST_SCRIPT)
self.assertEquals(
set(['goog.aaa', 'goog.bbb']), test_source.provides)
self.assertEquals(
set(['goog.ccc', 'g... | 25.7875 | 78 | 0.696558 |
5a7f094825e36fbaa602c11c09a3626698d9be29 | 303 | py | Python | glimmer/util/__init__.py | phip123/glimmer | 5e7e1ac22379e69e869afa1d83a3c0d92ef91e7f | [
"MIT"
] | 1 | 2020-02-27T12:03:31.000Z | 2020-02-27T12:03:31.000Z | glimmer/util/__init__.py | phip123/glimmer | 5e7e1ac22379e69e869afa1d83a3c0d92ef91e7f | [
"MIT"
] | null | null | null | glimmer/util/__init__.py | phip123/glimmer | 5e7e1ac22379e69e869afa1d83a3c0d92ef91e7f | [
"MIT"
] | null | null | null | import dataclasses
import json
import time
class EnhancedJSONEncoder(json.JSONEncoder):
def default(self, o):
if dataclasses.is_dataclass(o):
return dataclasses.asdict(o)
return super().default(o)
def generate_node_name() -> str:
return str(time.time_ns())[5:-5]
| 20.2 | 44 | 0.679868 |
ab8408e280d388472b888456342ae3a61c59a365 | 22,733 | py | Python | readthedocs/builds/tasks.py | codeday-init/readthedocs.org | 464f20e77b63f550d10dcdaa0de9bab7a7f2e349 | [
"MIT"
] | null | null | null | readthedocs/builds/tasks.py | codeday-init/readthedocs.org | 464f20e77b63f550d10dcdaa0de9bab7a7f2e349 | [
"MIT"
] | null | null | null | readthedocs/builds/tasks.py | codeday-init/readthedocs.org | 464f20e77b63f550d10dcdaa0de9bab7a7f2e349 | [
"MIT"
] | null | null | null | import json
from io import BytesIO
import requests
import structlog
from django.conf import settings
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from readthedocs import __version__
from readthedocs.api.v2.serializers import BuildCommandSeria... | 35.027735 | 140 | 0.577706 |
dc6241d87643216fbf1b884643596f40aa212846 | 14,434 | py | Python | string_grouper/test/test_string_grouper.py | Nuttenscl/string_grouper-1 | 75a946d0a954a25e3056f90a62c32f189112a78c | [
"MIT"
] | null | null | null | string_grouper/test/test_string_grouper.py | Nuttenscl/string_grouper-1 | 75a946d0a954a25e3056f90a62c32f189112a78c | [
"MIT"
] | null | null | null | string_grouper/test/test_string_grouper.py | Nuttenscl/string_grouper-1 | 75a946d0a954a25e3056f90a62c32f189112a78c | [
"MIT"
] | null | null | null | import unittest
import pandas as pd
import numpy as np
from scipy.sparse.csr import csr_matrix
from string_grouper.string_grouper import DEFAULT_MIN_SIMILARITY, \
DEFAULT_MAX_N_MATCHES, DEFAULT_REGEX, \
DEFAULT_NGRAM_SIZE, DEFAULT_N_PROCESSES, DEFAULT_IGNORE_CASE, \
StringGrouperConfig, StringGrouper, Strin... | 50.292683 | 115 | 0.625606 |
78d15aa0a9e793ee716592c60b727a51047aaeba | 8,621 | py | Python | env/lib/python3.8/site-packages/prompt_toolkit/shortcuts/dialogs.py | juansjimenez/goodocity-backend | 77b2ab3f11047e2896e81358b8d8c63d7952b521 | [
"MIT"
] | 1,318 | 2019-07-11T10:34:39.000Z | 2022-03-29T15:05:19.000Z | env/lib/python3.8/site-packages/prompt_toolkit/shortcuts/dialogs.py | juansjimenez/goodocity-backend | 77b2ab3f11047e2896e81358b8d8c63d7952b521 | [
"MIT"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | env/lib/python3.8/site-packages/prompt_toolkit/shortcuts/dialogs.py | juansjimenez/goodocity-backend | 77b2ab3f11047e2896e81358b8d8c63d7952b521 | [
"MIT"
] | 66 | 2019-11-11T15:33:12.000Z | 2022-03-01T07:55:55.000Z | import functools
from asyncio import get_event_loop
from typing import Any, Callable, List, Optional, Tuple, TypeVar
from prompt_toolkit.application import Application
from prompt_toolkit.application.current import get_app
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.completion import Completer
from pr... | 27.195584 | 86 | 0.639021 |
68926399a9e5e6274010cb2c2e60d02aa23f9080 | 3,151 | py | Python | example/speech-demo/speechSGD.py | Liuxg16/BrainMatrix | 0ec70edd4e12dd3719d20dd14d4e24438c60326f | [
"Apache-2.0"
] | 9 | 2018-06-12T12:12:56.000Z | 2020-11-26T01:45:15.000Z | example/speech-demo/speechSGD.py | achao2013/mxnet-quantify | ae77c896da6db35530390e3cf8e524d553bba112 | [
"Apache-2.0"
] | 1 | 2020-01-26T19:53:49.000Z | 2020-01-26T19:53:49.000Z | example/speech-demo/speechSGD.py | achao2013/mxnet-quantify | ae77c896da6db35530390e3cf8e524d553bba112 | [
"Apache-2.0"
] | 14 | 2016-11-18T07:21:41.000Z | 2019-09-30T08:48:22.000Z | import mxnet as mx
from mxnet.base import _LIB, check_call
from mxnet.base import c_array, mx_uint, mx_float, c_str
from mxnet.base import OptimizerHandle, OptimizerCreator
from mxnet.ndarray import NDArray, zeros, clip, sqrt
from mxnet.random import normal
@mx.optimizer.register
class speechSGD(mx.optimizer.Optimize... | 27.640351 | 79 | 0.584259 |
74f1fc0f5f520119c8b56d1fd6771a966ec9a0ec | 3,393 | py | Python | src/apex/algo/iud_removal.py | kpwhri/apex_iud_nlp | f59afbd5d19d6bae21264f6de7ee24382ccb694e | [
"MIT"
] | 1 | 2021-09-23T18:24:15.000Z | 2021-09-23T18:24:15.000Z | src/apex/algo/iud_removal.py | kpwhri/apex_iud_nlp | f59afbd5d19d6bae21264f6de7ee24382ccb694e | [
"MIT"
] | null | null | null | src/apex/algo/iud_removal.py | kpwhri/apex_iud_nlp | f59afbd5d19d6bae21264f6de7ee24382ccb694e | [
"MIT"
] | 1 | 2021-09-23T18:24:19.000Z | 2021-09-23T18:24:19.000Z | from apex.algo.shared import IUD, boilerplate, safe_may, hypothetical, in_place
from apex.algo.pattern import Document, Pattern
from apex.algo.result import Status, Result
negation = r'(ready|should|sometimes|must|decline|\bnot\b)'
other = r'(fibroid|v25.1\d|tampon)'
tool_remove = r'(introducer|inserter|tenaculum|inst... | 42.949367 | 92 | 0.604775 |
0722e739893b1f562b46b1b26325fbdd6c1a7fd8 | 4,161 | py | Python | server/src/weblab/core/login/web/uned_sso.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 15 | 2015-03-12T12:15:41.000Z | 2021-12-20T17:53:24.000Z | server/src/weblab/core/login/web/uned_sso.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 44 | 2015-01-07T09:22:05.000Z | 2017-01-31T22:44:21.000Z | server/src/weblab/core/login/web/uned_sso.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 22 | 2015-01-13T13:55:48.000Z | 2021-12-16T17:07:00.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | 31.285714 | 141 | 0.68349 |
67a0e964273a6482ebf3794e3fdecba36a464a0d | 3,779 | py | Python | lib-python/2.7/json/tests/test_unicode.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | lib-python/2.7/json/tests/test_unicode.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 75 | 2016-01-14T16:03:02.000Z | 2020-04-29T22:51:53.000Z | lib-python/2.7/json/tests/test_unicode.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | from collections import OrderedDict
from json.tests import PyTest, CTest
class TestUnicode(object):
def test_encoding1(self):
encoder = self.json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encod... | 39.364583 | 78 | 0.582429 |
edb29b31a7494fb90c7c359bea71cde8036f8dd3 | 1,026 | py | Python | test/unit/app/command/test_dispatcher.py | Tastyep/Pi-OpenCast | 1ed07130c26e6dd70184446af3c9143094d0c9a0 | [
"MIT"
] | 31 | 2019-10-05T14:23:10.000Z | 2022-02-27T19:38:55.000Z | test/unit/app/command/test_dispatcher.py | Tastyep/RaspberryCast | 8ae8cf986b373b04c43d248ee72c77b1a29daa43 | [
"MIT"
] | 199 | 2020-08-30T16:33:03.000Z | 2022-03-28T04:10:06.000Z | test/unit/app/command/test_dispatcher.py | Tastyep/RaspberryCast | 8ae8cf986b373b04c43d248ee72c77b1a29daa43 | [
"MIT"
] | 1 | 2019-10-05T16:00:49.000Z | 2019-10-05T16:00:49.000Z | from test.util import TestCase
from unittest.mock import Mock
from OpenCast.app.command.dispatcher import CommandDispatcher
class CommandDispatcherTest(TestCase):
def setUp(self):
def execute_handler(handler, *args):
handler(*args)
self.executor = Mock()
self.executor.submit ... | 32.0625 | 64 | 0.701754 |
52e0780f563481ab3430cb918939306d787076df | 7,893 | py | Python | research/cv/fairmot/fairmot_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/fairmot/fairmot_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/fairmot/fairmot_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.324607 | 112 | 0.627518 |
e519553538862e6f450cbc1e5368deb31e500460 | 305 | py | Python | config.py | lucienraeg/ai-social | bdc7e3022f6da2bf784a3b59664f8046445f3346 | [
"MIT"
] | null | null | null | config.py | lucienraeg/ai-social | bdc7e3022f6da2bf784a3b59664f8046445f3346 | [
"MIT"
] | null | null | null | config.py | lucienraeg/ai-social | bdc7e3022f6da2bf784a3b59664f8046445f3346 | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__name__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'abcd1234'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'app.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False | 38.125 | 65 | 0.721311 |
d1482e103e0ef0be6eda027fce71e50510487966 | 3,154 | py | Python | Spyder/Sesiones/Sesion 3.1 y Sesion 4.py | AlexPC23/Python | 77689d74c5444faa1aa253a122602307e52ac581 | [
"Apache-2.0"
] | null | null | null | Spyder/Sesiones/Sesion 3.1 y Sesion 4.py | AlexPC23/Python | 77689d74c5444faa1aa253a122602307e52ac581 | [
"Apache-2.0"
] | null | null | null | Spyder/Sesiones/Sesion 3.1 y Sesion 4.py | AlexPC23/Python | 77689d74c5444faa1aa253a122602307e52ac581 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 12 20:30:28 2021
@author: Alex
"""
reset -f
import os #sistema operativo
import pandas as pd #gestionar datframes
import numpy as np #numeric python (vectores, matrices,...)
import matp... | 29.476636 | 102 | 0.676918 |
54d6c67cd8872a0c1a45deeef793038f7270948c | 2,243 | py | Python | site_search/tests/test_view.py | AccentDesign/djangocms-site-search | 90ed1e5ab5fe96be8f1a4a74994f18164a7363aa | [
"MIT"
] | 1 | 2019-06-06T12:56:30.000Z | 2019-06-06T12:56:30.000Z | site_search/tests/test_view.py | AccentDesign/djangocms-site-search | 90ed1e5ab5fe96be8f1a4a74994f18164a7363aa | [
"MIT"
] | null | null | null | site_search/tests/test_view.py | AccentDesign/djangocms-site-search | 90ed1e5ab5fe96be8f1a4a74994f18164a7363aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from cms.api import create_page
from ..helpers import get_request
from ..views impo... | 32.985294 | 69 | 0.669193 |
dbf209ae724d0d600822b26749e7de200d0d36a6 | 548 | py | Python | jalabel_site/jalabel_app/models.py | JaewonAC/image-server | a93b44566800b74d07133c8098b3290f16ef62bb | [
"MIT"
] | null | null | null | jalabel_site/jalabel_app/models.py | JaewonAC/image-server | a93b44566800b74d07133c8098b3290f16ef62bb | [
"MIT"
] | 5 | 2021-03-19T01:41:58.000Z | 2021-09-22T18:51:03.000Z | jalabel_site/jalabel_app/models.py | JaewonAC/image-server | a93b44566800b74d07133c8098b3290f16ef62bb | [
"MIT"
] | null | null | null | from django.db import models
from sorl import thumbnail
from django.urls import reverse
class FixtureData(models.Model):
lot_number = models.CharField(max_length=20)
image_data = thumbnail.ImageField(upload_to='fixture/', blank=True)
message = models.CharField(max_length=20, default='unknown')
uploade... | 32.235294 | 71 | 0.748175 |
7be396d7d8b068a57463a067f6758a1aae7be8ba | 1,025 | py | Python | easy/28_implement_strstr.py | Sukhrobjon/leetcode | 547c200b627c774535bc22880b16d5390183aeba | [
"MIT"
] | null | null | null | easy/28_implement_strstr.py | Sukhrobjon/leetcode | 547c200b627c774535bc22880b16d5390183aeba | [
"MIT"
] | null | null | null | easy/28_implement_strstr.py | Sukhrobjon/leetcode | 547c200b627c774535bc22880b16d5390183aeba | [
"MIT"
] | null | null | null | class Solution(object):
def strStr(self, text, pattern):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
if pattern == "":
return 0
starter = 0 # the starting index of the patterin in the text
index = 0 # index for text
... | 26.282051 | 91 | 0.52 |
3a63c6e0cca065115f1e4bd60c0289000dcc6ce2 | 81,176 | py | Python | Lib/fontTools/feaLib/parser.py | tomarcher101/fonttools | 0b9348080853ab637c4826a4aa293a2b4d60449c | [
"Apache-2.0",
"MIT"
] | null | null | null | Lib/fontTools/feaLib/parser.py | tomarcher101/fonttools | 0b9348080853ab637c4826a4aa293a2b4d60449c | [
"Apache-2.0",
"MIT"
] | 1 | 2020-05-22T09:01:31.000Z | 2020-05-22T09:47:18.000Z | Lib/fontTools/feaLib/parser.py | tomarcher101/fonttools | 0b9348080853ab637c4826a4aa293a2b4d60449c | [
"Apache-2.0",
"MIT"
] | null | null | null | from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.lexer import Lexer, IncludingLexer, NonIncludingLexer
from fontTools.misc.encodingTools import getEncoding
from fontTools.misc.py23 import *
import fontTools.feaLib.ast as ast
import logging
import os
import re
log = logging.getLogger(__name__)
... | 45.223398 | 160 | 0.575613 |
7180c75b394d74566e586ce53a8223ddcc0fb8b4 | 23,943 | py | Python | .venv/lib/python2.7/site-packages/smmap/mman.py | aruneli/rancher-tests | f0ff5539420ac354fc951ed239b002cecde52505 | [
"Apache-2.0"
] | null | null | null | .venv/lib/python2.7/site-packages/smmap/mman.py | aruneli/rancher-tests | f0ff5539420ac354fc951ed239b002cecde52505 | [
"Apache-2.0"
] | 11 | 2017-01-22T11:05:33.000Z | 2017-01-22T11:14:48.000Z | .venv/lib/python2.7/site-packages/smmap/mman.py | aruneli/rancher-tests | f0ff5539420ac354fc951ed239b002cecde52505 | [
"Apache-2.0"
] | null | null | null | """Module containing a memory memory manager which provides a sliding window on a number of memory mapped files"""
from .util import (
MapWindow,
MapRegion,
MapRegionList,
is_64_bit,
string_types,
buffer,
)
import sys
from functools import reduce
__all__ = ["StaticWindowMapManager", "SlidingWi... | 41.209983 | 124 | 0.618302 |
2b25616364b32726b07c55ee114a1319f7fac20e | 92,633 | py | Python | src/pudl/transform/eia861.py | kevinsung/pudl | fe2086a12282b84523883a474bad9905a4b662e5 | [
"MIT"
] | 285 | 2017-05-26T02:42:04.000Z | 2022-03-25T09:06:11.000Z | src/pudl/transform/eia861.py | kevinsung/pudl | fe2086a12282b84523883a474bad9905a4b662e5 | [
"MIT"
] | 1,398 | 2017-05-27T15:46:08.000Z | 2022-03-31T19:50:07.000Z | src/pudl/transform/eia861.py | kevinsung/pudl | fe2086a12282b84523883a474bad9905a4b662e5 | [
"MIT"
] | 76 | 2017-06-22T17:31:28.000Z | 2022-01-23T22:17:57.000Z | """Module to perform data cleaning functions on EIA861 data tables.
All transformations include:
- Replace . values with NA.
"""
import logging
import pandas as pd
import pudl
from pudl import constants as pc
logger = logging.getLogger(__name__)
BA_ID_NAME_FIXES = (
pd.DataFrame([
# report_date, util... | 37.564071 | 131 | 0.60744 |
9561a03377388a344ac779b6644678bd5602e472 | 5,714 | py | Python | train.py | yoyoismee/Sarkhans-Constitution-Generator | d7511521c9f73b2fd3725f8e2ffa29761dfa0137 | [
"WTFPL",
"MIT"
] | 1 | 2018-04-05T06:01:40.000Z | 2018-04-05T06:01:40.000Z | train.py | yoyoismee/Sarkhans-Constitution-Generator | d7511521c9f73b2fd3725f8e2ffa29761dfa0137 | [
"WTFPL",
"MIT"
] | null | null | null | train.py | yoyoismee/Sarkhans-Constitution-Generator | d7511521c9f73b2fd3725f8e2ffa29761dfa0137 | [
"WTFPL",
"MIT"
] | null | null | null |
import numpy as np
import argparse
import pickle
parser = argparse.ArgumentParser()
parser.add_argument('file',
type=str,
help='input file')
data_dir = parser.parse_args().file
with open(data_dir, "r") as f:
text = f.read()
scenes = text.split('\n\n')
sentence_count_sc... | 32.101124 | 183 | 0.666258 |
cce98f819f43e65e8890d86e943f7876d8f7de17 | 1,815 | py | Python | demos/ant.core/10-scan.py | asantacreu/python-ant | 894e9281d0a5811b8acec1ad9ac2efbc9fb4b0f3 | [
"MIT"
] | 3 | 2021-05-09T18:51:02.000Z | 2022-03-23T16:53:08.000Z | demos/ant.core/10-scan.py | asantacreu/python-ant | 894e9281d0a5811b8acec1ad9ac2efbc9fb4b0f3 | [
"MIT"
] | null | null | null | demos/ant.core/10-scan.py | asantacreu/python-ant | 894e9281d0a5811b8acec1ad9ac2efbc9fb4b0f3 | [
"MIT"
] | 1 | 2018-09-12T15:19:41.000Z | 2018-09-12T15:19:41.000Z | """
Extending on demo-04, re-implements the event callbackso we can parse the results of the scan.
"""
import sys
import time
from ant.core import driver
from ant.core import node
from ant.core import event
from ant.core import message
from ant.core.constants import *
from config import *
NETKEY = '\xB9\xA5\x21\xF... | 27.923077 | 94 | 0.69697 |
a9d1eaa34095398289eef8cb0ff46c746d022ae1 | 9,462 | py | Python | research/lstm_object_detection/inputs/seq_dataset_builder_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | research/lstm_object_detection/inputs/seq_dataset_builder_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | research/lstm_object_detection/inputs/seq_dataset_builder_test.py | hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow 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... | 33.434629 | 81 | 0.577679 |
d151ff6390424787fd5aeb7815b3f96f08a97468 | 3,899 | py | Python | ubimaior/commands.py | forthelols/ubimaior | 30ee55673022942e1cdf5c3a005696122ddbf231 | [
"Apache-2.0",
"MIT"
] | null | null | null | ubimaior/commands.py | forthelols/ubimaior | 30ee55673022942e1cdf5c3a005696122ddbf231 | [
"Apache-2.0",
"MIT"
] | 316 | 2018-04-22T09:27:23.000Z | 2022-02-28T00:54:47.000Z | ubimaior/commands.py | forthelols/ubimaior | 30ee55673022942e1cdf5c3a005696122ddbf231 | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Command line tools to view, query and manipulate hierarchical configurations."""
import collections
import itertools
import click
import ubimaior
import ubimaior.configurations
import ubimaior.formats
# TODO: Add options to override 'schema' and 'scopes'
@click.group()
@click.option(
... | 31.699187 | 97 | 0.674532 |
9ebf9455d47452b610940fec6a73a154a7760b84 | 9,970 | py | Python | Map_Match.py | NeowithU/Trajectory | d575aa9182cb1c7c155e4a0ec067a37bbb617ffd | [
"MIT"
] | null | null | null | Map_Match.py | NeowithU/Trajectory | d575aa9182cb1c7c155e4a0ec067a37bbb617ffd | [
"MIT"
] | null | null | null | Map_Match.py | NeowithU/Trajectory | d575aa9182cb1c7c155e4a0ec067a37bbb617ffd | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
__author__ = 'Neo'
import os
import math
import datetime
import utilities
import unicodecsv
INER_DATA_DIR = "Intermediate"
GRIDE_FILE = 'grids_dict'
TEST_FOLDER = 'B61962'
LONGITUDE_POSITION_IN_CSV = 2
LATITUDE_POSITION_IN_CSV = 3
RADIUS = 6371000
MAXDIST = 99999999
STEP = 0.02
# Map_Match 只有... | 35.35461 | 89 | 0.607121 |
18838dee89bfee526fe0ef285d6eb83b1e1b4e57 | 167 | py | Python | koila/interfaces/components/meminfo.py | techthiyanes/koila | b665482ff99a02bfeeceaa1323589fb89495a30c | [
"MIT"
] | null | null | null | koila/interfaces/components/meminfo.py | techthiyanes/koila | b665482ff99a02bfeeceaa1323589fb89495a30c | [
"MIT"
] | null | null | null | koila/interfaces/components/meminfo.py | techthiyanes/koila | b665482ff99a02bfeeceaa1323589fb89495a30c | [
"MIT"
] | null | null | null | from typing import Protocol
from .datatypes import DataType
from .multidim import MultiDimensional
class MemoryInfo(MultiDimensional, DataType, Protocol):
pass
| 18.555556 | 55 | 0.814371 |
0c7d8819125e36c3bef0c46f0c977fa9b3ccbea8 | 4,860 | py | Python | docs/conf.py | relaton/relaton-bib-py | 03b601d9a5482e6142b90d6b6cca5a05879452c8 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | relaton/relaton-bib-py | 03b601d9a5482e6142b90d6b6cca5a05879452c8 | [
"BSD-3-Clause"
] | 7 | 2021-08-18T04:02:25.000Z | 2022-01-28T19:22:42.000Z | docs/conf.py | relaton/relaton-bib-py | 03b601d9a5482e6142b90d6b6cca5a05879452c8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# relaton_bib documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | 29.815951 | 77 | 0.688477 |
7551bdeedb6cd27685141b815d4a2990a4c0dcbd | 5,391 | py | Python | tests/presentation/_rpc.py | WshgL/pyuavcan | f2b8d2d743f09ad4af8d62fc96d8f0b013aeb8b0 | [
"MIT"
] | null | null | null | tests/presentation/_rpc.py | WshgL/pyuavcan | f2b8d2d743f09ad4af8d62fc96d8f0b013aeb8b0 | [
"MIT"
] | null | null | null | tests/presentation/_rpc.py | WshgL/pyuavcan | f2b8d2d743f09ad4af8d62fc96d8f0b013aeb8b0 | [
"MIT"
] | null | null | null | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
import typing
import asyncio
import pytest
import pyuavcan
from .conftest import TransportFactory
pytestmark = pytest.mark.asyncio
async def _unittest_slow_presentati... | 42.117188 | 117 | 0.750696 |
ea1870d84423572e880e2bb427e88af888cf671a | 79,765 | py | Python | indrops.py | kenichi-shimada/indrops_langenau | 03f30bf034f22f208a97fe68eab61131ea4e50bd | [
"Xnet",
"Linux-OpenIB",
"X11"
] | 1 | 2022-01-23T19:50:02.000Z | 2022-01-23T19:50:02.000Z | indrops.py | kenichi-shimada/indrops_langenau | 03f30bf034f22f208a97fe68eab61131ea4e50bd | [
"Xnet",
"Linux-OpenIB",
"X11"
] | null | null | null | indrops.py | kenichi-shimada/indrops_langenau | 03f30bf034f22f208a97fe68eab61131ea4e50bd | [
"Xnet",
"Linux-OpenIB",
"X11"
] | null | null | null | import os, subprocess
import itertools
import operator
from collections import defaultdict, OrderedDict
import errno
# cPickle is a faster version of pickle that isn't installed in python3
# inserted try statement just in case
try:
import cPickle as pickle
except:
import pickle
from io import BytesIO
import nu... | 48.696581 | 274 | 0.626653 |
a347c9e03fbaac2dae15a8a5a58cd3c4bcfc16f1 | 618 | py | Python | core/migrations/0001_initial.py | Gadeonio/Django_ItCode | 2cf5386365417b605c80e9c7c9ef74666fa66b10 | [
"MIT"
] | null | null | null | core/migrations/0001_initial.py | Gadeonio/Django_ItCode | 2cf5386365417b605c80e9c7c9ef74666fa66b10 | [
"MIT"
] | 6 | 2022-03-07T12:59:38.000Z | 2022-03-25T20:02:46.000Z | core/migrations/0001_initial.py | Gadeonio/Django_ItCode | 2cf5386365417b605c80e9c7c9ef74666fa66b10 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.1 on 2022-03-01 05:47
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.BigAutoField(... | 26.869565 | 117 | 0.597087 |
624fa90053d7f68be7d17d358f6aba6eda91832a | 22,721 | py | Python | test/engine/test_logging.py | bowlofeggs/sqlalchemy | 4042792348481e8c00515f8df6af503ca4d0ee73 | [
"MIT"
] | null | null | null | test/engine/test_logging.py | bowlofeggs/sqlalchemy | 4042792348481e8c00515f8df6af503ca4d0ee73 | [
"MIT"
] | null | null | null | test/engine/test_logging.py | bowlofeggs/sqlalchemy | 4042792348481e8c00515f8df6af503ca4d0ee73 | [
"MIT"
] | 1 | 2021-11-23T17:59:42.000Z | 2021-11-23T17:59:42.000Z | import logging.handlers
import sqlalchemy as tsa
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import MetaData
from sqlalchemy import or_
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import util
from sqlalchemy.sql import util... | 34.90169 | 79 | 0.529598 |
e121856bb571c277cb208936e115bf3e1e70fb94 | 660 | py | Python | ledfx/api/find_devices.py | Mattallmighty/LedFx-OLD | 9734e7ebf20e9a4b67aca32f932572003badca4d | [
"MIT"
] | null | null | null | ledfx/api/find_devices.py | Mattallmighty/LedFx-OLD | 9734e7ebf20e9a4b67aca32f932572003badca4d | [
"MIT"
] | 1 | 2022-02-19T06:33:19.000Z | 2022-02-19T06:33:19.000Z | ledfx/api/find_devices.py | Mattallmighty/LedFx-OLD | 9734e7ebf20e9a4b67aca32f932572003badca4d | [
"MIT"
] | null | null | null | from ledfx.config import save_config
from ledfx.api import RestEndpoint
from ledfx.utils import generate_id, async_fire_and_forget
from aiohttp import web
import logging
import json
_LOGGER = logging.getLogger(__name__)
class FindDevicesEndpoint(RestEndpoint):
"""REST end-point for detecting and adding wled devic... | 33 | 88 | 0.739394 |
efc2512fd7be7f1848a97e2e7ac1d02be4b85119 | 289 | py | Python | Modulo_1/semana4/practica_jueves/utileria/consola/fondo_colores.py | rubens233/cocid_python | 492ebdf21817e693e5eb330ee006397272f2e0cc | [
"MIT"
] | null | null | null | Modulo_1/semana4/practica_jueves/utileria/consola/fondo_colores.py | rubens233/cocid_python | 492ebdf21817e693e5eb330ee006397272f2e0cc | [
"MIT"
] | null | null | null | Modulo_1/semana4/practica_jueves/utileria/consola/fondo_colores.py | rubens233/cocid_python | 492ebdf21817e693e5eb330ee006397272f2e0cc | [
"MIT"
] | 1 | 2022-03-04T00:57:18.000Z | 2022-03-04T00:57:18.000Z | def fondo_amarillo(texto):
return '\x1b[0;39;43m' + texto
def fondo_rojo(texto):
return '\033[41m' + texto
def fondo_verde(texto):
return '\033[42m' + texto
def fondo_azul(texto):
return '\033[44m' + texto
def fondo_restablecer(texto):
return '\033[0m' + texto
| 15.210526 | 34 | 0.653979 |
b4f79bda2551704bf1b7c87c3e502c9a1eeb69a4 | 293,469 | py | Python | pandas/core/frame.py | mike-cramblett/pandas | 597f9f31639eeb5724e49bec602e15b9bf8be092 | [
"BSD-3-Clause"
] | 1 | 2019-01-20T13:14:24.000Z | 2019-01-20T13:14:24.000Z | pandas/core/frame.py | mike-cramblett/pandas | 597f9f31639eeb5724e49bec602e15b9bf8be092 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/frame.py | mike-cramblett/pandas | 597f9f31639eeb5724e49bec602e15b9bf8be092 | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=E1101
# pylint: disable=W0212,W0703,W0622
"""
DataFrame
---------
An efficient 2D container for potentially mixed-type time series or other
labeled data series.
Similar to its R counterpart, data.frame, except providing automatic data
alignment and a host of useful data manipulation methods having to... | 36.752536 | 169 | 0.528598 |
fbae21cfc708328d1c58acdcdd05f5d05c1db1f3 | 1,491 | py | Python | tests/test_exceptions.py | lkolacek/osbs-client | 90c6db9a414214c681c777468079bcbe7dd7c809 | [
"BSD-3-Clause"
] | 4 | 2020-05-16T22:30:32.000Z | 2021-11-09T22:26:38.000Z | tests/test_exceptions.py | lkolacek/osbs-client | 90c6db9a414214c681c777468079bcbe7dd7c809 | [
"BSD-3-Clause"
] | 183 | 2019-06-06T09:10:24.000Z | 2022-03-30T12:05:15.000Z | tests/test_exceptions.py | lkolacek/osbs-client | 90c6db9a414214c681c777468079bcbe7dd7c809 | [
"BSD-3-Clause"
] | 10 | 2019-10-29T21:55:03.000Z | 2021-01-18T14:20:34.000Z | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import, unicode_literals
import pytest
import logging
from osbs.conf import Configuration
from osbs.api impor... | 28.132075 | 96 | 0.688799 |
2b58922fb8e220ead0391b9751b9355d704aff8d | 373 | py | Python | setup.py | emmmile/simpleimage | 6b079592ce64d67903bf9c085a132ddd9712fba8 | [
"MIT"
] | null | null | null | setup.py | emmmile/simpleimage | 6b079592ce64d67903bf9c085a132ddd9712fba8 | [
"MIT"
] | null | null | null | setup.py | emmmile/simpleimage | 6b079592ce64d67903bf9c085a132ddd9712fba8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
VERSION = '0.0.1'
setup(
name = "simpleimage",
version = VERSION,
author = '@emmmile',
install_requires = [
'opencv-python'
],
license = 'MIT',
test_suite = 'tests',
python_requires = '>=3'... | 17.761905 | 48 | 0.589812 |
e181fa5b69012a5dfefd71707e825764158b5b60 | 1,124 | py | Python | websetup.py | milos85vasic/Apache-Factory-Toolkit | c68727f899c8d1ac6debf6d5d18d2b0814d403b7 | [
"Apache-2.0"
] | 2 | 2019-06-04T19:12:57.000Z | 2019-12-13T08:51:39.000Z | websetup.py | milos85vasic/Apache-Factory-Toolkit | c68727f899c8d1ac6debf6d5d18d2b0814d403b7 | [
"Apache-2.0"
] | null | null | null | websetup.py | milos85vasic/Apache-Factory-Toolkit | c68727f899c8d1ac6debf6d5d18d2b0814d403b7 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import subprocess
import time
toolkit_directory = "Toolkit"
toolkit_repo = "https://github.com/milos85vasic/Apache-Factory-Toolkit.git"
if __name__ == '__main__':
exists = True
steps = []
if not os.path.exists(toolkit_directory):
exists = False
steps.extend(
... | 22.938776 | 93 | 0.545374 |
71e9a4805bfe7baa8faf8f88d6bb0e880b80251a | 1,733 | py | Python | yt_dlp/extractor/photobucket.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 11 | 2022-01-06T22:09:50.000Z | 2022-03-12T22:26:22.000Z | yt_dlp/extractor/photobucket.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 4 | 2022-02-25T08:20:18.000Z | 2022-03-17T16:16:20.000Z | yt_dlp/extractor/photobucket.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 3 | 2022-02-19T08:59:13.000Z | 2022-03-06T16:11:21.000Z | import json
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class PhotobucketIE(InfoExtractor):
_VALID_URL = r'https?://(?:[a-z0-9]+\.)?photobucket\.com/.*(([\?\&]current=)|_)(?P<id>.*)\.(?P<ext>(flv)|(mp4))'
_TEST = {
'url': 'http://media.photobucket.com/user/racha... | 39.386364 | 215 | 0.582804 |
1b71b9b37917358de721437cb199318ff69a7e75 | 6,243 | py | Python | scripts/study_case/ID_4/torch_geometric/datasets/shapenet.py | kzbnb/numerical_bugs | bc22e72bcc06df6ce7889a25e0aeed027bde910b | [
"Apache-2.0"
] | 8 | 2021-06-30T06:55:14.000Z | 2022-03-18T01:57:14.000Z | scripts/study_case/ID_4/torch_geometric/datasets/shapenet.py | kzbnb/numerical_bugs | bc22e72bcc06df6ce7889a25e0aeed027bde910b | [
"Apache-2.0"
] | 1 | 2021-06-30T03:08:15.000Z | 2021-06-30T03:08:15.000Z | scripts/study_case/ID_4/torch_geometric/datasets/shapenet.py | kzbnb/numerical_bugs | bc22e72bcc06df6ce7889a25e0aeed027bde910b | [
"Apache-2.0"
] | 2 | 2021-11-17T11:19:48.000Z | 2021-11-18T03:05:58.000Z | import os
import os.path as osp
import glob
import torch
from scripts.study_case.ID_4.torch_geometric.data import (Data, InMemoryDataset, download_url,
extract_zip)
from scripts.study_case.ID_4.torch_geometric.read import read_txt_array
class ShapeNet(InMemoryDataset):
r""" The ... | 41.072368 | 94 | 0.584975 |
5a20a279b57973c0de6477818a24424e1a85780c | 8,848 | py | Python | salt/daemons/flo/worker.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | 1 | 2021-04-05T19:46:35.000Z | 2021-04-05T19:46:35.000Z | salt/daemons/flo/worker.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | salt/daemons/flo/worker.py | dv-trading/salt | f5d4334178c50d0dfcd205d5a7fb9cfb27fd369e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The core behaviors used by minion and master
'''
# pylint: disable=W0232
# pylint: disable=3rd-party-module-not-gated
from __future__ import absolute_import
# Import python libs
import time
import os
import multiprocessing
import logging
from salt.ext.six.moves import range
# Import salt ... | 35.96748 | 92 | 0.527916 |
fe5710f10f34ef28c1f83358c15ae7c7aa251bf1 | 903 | py | Python | source/core/python/modules/data_provider.py | Heimdall-Framework/heimdall-framework | d35766e793888a8f512a3d6586adef97cb468c6b | [
"MIT"
] | 13 | 2020-06-11T11:01:20.000Z | 2021-11-01T14:18:10.000Z | source/core/python/modules/data_provider.py | Heimdall-Framework/heimdall-framework | d35766e793888a8f512a3d6586adef97cb468c6b | [
"MIT"
] | null | null | null | source/core/python/modules/data_provider.py | Heimdall-Framework/heimdall-framework | d35766e793888a8f512a3d6586adef97cb468c6b | [
"MIT"
] | null | null | null | import string
import random
from .logger import Logger
class DataProvider():
def generate_random_data_file(self):
"""
Generates a file, containing pseudorandom data
"""
try:
file_content = self.__generate_pseudorandom_string(128)
file = open('dum... | 28.21875 | 91 | 0.603544 |
f93a1a7aee00e1a10d5f9d5e89c0344164fe48fa | 23 | py | Python | progeny/__init__.py | grst/progeny-py | d8aa468e87667e5c8769eefe2a067dc51df86a0d | [
"MIT"
] | 12 | 2021-03-11T08:59:11.000Z | 2021-11-08T15:51:56.000Z | progeny/__init__.py | grst/progeny-py | d8aa468e87667e5c8769eefe2a067dc51df86a0d | [
"MIT"
] | 4 | 2021-03-23T16:15:43.000Z | 2021-09-29T10:49:05.000Z | progeny/__init__.py | grst/progeny-py | d8aa468e87667e5c8769eefe2a067dc51df86a0d | [
"MIT"
] | 2 | 2021-03-23T15:18:47.000Z | 2021-04-02T12:30:31.000Z | from .progeny import *
| 11.5 | 22 | 0.73913 |
4879fdd686d08e525b63e67f9e6a5fee4d470e0f | 7,921 | py | Python | examples/school/categories.py | abimurali1993/dev | 295182a75b9b6031656b5c6c10866d517a1992cf | [
"Apache-2.0"
] | 1 | 2018-05-13T09:32:50.000Z | 2018-05-13T09:32:50.000Z | examples/school/categories.py | abimurali1993/dev | 295182a75b9b6031656b5c6c10866d517a1992cf | [
"Apache-2.0"
] | null | null | null | examples/school/categories.py | abimurali1993/dev | 295182a75b9b6031656b5c6c10866d517a1992cf | [
"Apache-2.0"
] | null | null | null | from __future__ import print_statement
from words import *
from nltk.wordnet import *
from operator import itemgetter
import nltk
import re
from string import join
def build_word_associations():
cfd = nltk.ConditionalFreqDist()
# get a list of all English stop words
stopwords_list = nltk.corpus.stopwords... | 35.520179 | 109 | 0.549552 |
ada2f83335426f6fe8067780b492557ff19bd54e | 517 | py | Python | sample.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | 1 | 2020-01-14T02:14:05.000Z | 2020-01-14T02:14:05.000Z | sample.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | 2 | 2018-06-02T18:40:59.000Z | 2020-03-10T00:03:50.000Z | sample.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | null | null | null | from mapping import ResponseMapper
from constants import APIS
BASE_URI = APIS["pokeapi"]["base_uri"]
ENDPOINTS = APIS["pokeapi"]["endpoints"]
def uri(key): return BASE_URI + ENDPOINTS[key]
mapper = ResponseMapper()
@mapper.maps(uri('test'))
def test_mapping(self, exchange):
json = exchange.response.json()
j... | 22.478261 | 46 | 0.696325 |
44724d5f8b76987e8f294a0c001061874dafd5d0 | 691 | py | Python | hydroDL/master/cmd/WRTDS.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | null | null | null | hydroDL/master/cmd/WRTDS.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | null | null | null | hydroDL/master/cmd/WRTDS.py | fkwai/geolearn | 30cb4353d22af5020a48100d07ab04f465a315b0 | [
"MIT"
] | 2 | 2021-04-04T02:45:59.000Z | 2022-03-19T09:41:39.000Z | import argparse
import os
from hydroDL.master import basinFull
from hydroDL.app.waterQuality import WRTDS
from hydroDL.data import usgs
from hydroDL import kPath
import numpy as np
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-D', dest='dataName', type=str)
parser.add_... | 36.368421 | 74 | 0.720695 |
d7bf27bff2fe2dbd7ab9c481ce141c31786d3beb | 450 | py | Python | tests/webutil.py | matsub/slashcommands | 28e96a9c43b740868d08fafb176f3c97f8db8816 | [
"MIT"
] | 4 | 2017-04-05T13:30:39.000Z | 2018-12-04T13:42:56.000Z | tests/webutil.py | matsub/slashcommands | 28e96a9c43b740868d08fafb176f3c97f8db8816 | [
"MIT"
] | null | null | null | tests/webutil.py | matsub/slashcommands | 28e96a9c43b740868d08fafb176f3c97f8db8816 | [
"MIT"
] | 2 | 2020-11-15T10:52:27.000Z | 2020-11-16T00:46:28.000Z | # coding: utf-8
import urllib.request
import urllib.parse
class Client:
def __init__(self, baseurl):
self.baseurl = baseurl
def get(self, url):
url = urllib.parse.urljoin(self.baseurl, url)
return urllib.request.urlopen(url)
def post(self, url, data):
url = urllib.parse... | 22.5 | 53 | 0.653333 |
3ccb5e0f1143775019b267f636b20a53811d90f5 | 223 | py | Python | spacy_pattern_builder/exceptions.py | cyclecycle/spacy-dependency-pattern-builder | 51a1eb9a2cbd56163103e0e903af585442f8f912 | [
"MIT"
] | 32 | 2019-11-05T00:19:20.000Z | 2021-04-28T09:08:53.000Z | spacy_pattern_builder/exceptions.py | cyclecycle/spacy-dependency-pattern-builder | 51a1eb9a2cbd56163103e0e903af585442f8f912 | [
"MIT"
] | 1 | 2020-01-28T09:06:14.000Z | 2020-09-19T21:28:06.000Z | spacy_pattern_builder/exceptions.py | cyclecycle/spacy-dependency-pattern-builder | 51a1eb9a2cbd56163103e0e903af585442f8f912 | [
"MIT"
] | 6 | 2020-01-27T10:21:40.000Z | 2022-02-21T18:44:31.000Z | class TokensNotFullyConnectedError(Exception):
pass
class DuplicateTokensError(Exception):
pass
class TokenNotInMatchTokensError(Exception):
pass
class FeaturesMissingFromPatternError(Exception):
pass
| 14.866667 | 49 | 0.793722 |
6eab03e8f65a79b94da735ca3986924b2acf77c9 | 26,119 | py | Python | hubspot/cms/performance/models/performance_view.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | 1 | 2020-11-12T08:46:32.000Z | 2020-11-12T08:46:32.000Z | hubspot/cms/performance/models/performance_view.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/cms/performance/models/performance_view.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
CMS Performance API
Use these endpoints to get a time series view of your website's performance. # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubspot.cms.performance... | 30.692127 | 108 | 0.590107 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.