hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a80ea8db8393ec99d96d8435d8171be1d7077820 | 14,999 | py | Python | web/core/serializers.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | null | null | null | web/core/serializers.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 1 | 2020-02-17T11:01:03.000Z | 2020-02-17T11:01:03.000Z | web/core/serializers.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | null | null | null | from rest_framework import serializers
from core.models import CarbureLot, CarbureLotEvent, CarbureLotComment, CarbureNotification, CarbureStock, CarbureStockTransformation, Depot, Entity, EntityCertificate, EntityDepot, GenericCertificate, GenericError, SustainabilityDeclaration
from doublecount.serializers import Bi... | 48.228296 | 241 | 0.709914 | from rest_framework import serializers
from core.models import CarbureLot, CarbureLotEvent, CarbureLotComment, CarbureNotification, CarbureStock, CarbureStockTransformation, Depot, Entity, EntityCertificate, EntityDepot, GenericCertificate, GenericError, SustainabilityDeclaration
from doublecount.serializers import Bi... | 2,627 | 11,510 | 414 |
c5ab3612499c4751ef3cdabd9f75dfe4d55d690b | 2,791 | py | Python | autoio/mess_io/writer/_etrans.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | null | null | null | autoio/mess_io/writer/_etrans.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 1 | 2022-02-15T19:35:14.000Z | 2022-02-15T19:35:14.000Z | autoio/mess_io/writer/_etrans.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 13 | 2020-06-24T05:21:11.000Z | 2021-05-05T19:58:30.000Z | """
Writes the energy transfer section of a MESS input file
"""
import os
from ioformat import build_mako_str
# OBTAIN THE PATH TO THE DIRECTORY CONTAINING THE TEMPLATES #
SRC_PATH = os.path.dirname(os.path.realpath(__file__))
TEMPLATE_PATH = os.path.join(SRC_PATH, 'templates')
SECTION_PATH = os.path.join(TEMPLATE_P... | 34.036585 | 79 | 0.663561 | """
Writes the energy transfer section of a MESS input file
"""
import os
from ioformat import build_mako_str
# OBTAIN THE PATH TO THE DIRECTORY CONTAINING THE TEMPLATES #
SRC_PATH = os.path.dirname(os.path.realpath(__file__))
TEMPLATE_PATH = os.path.join(SRC_PATH, 'templates')
SECTION_PATH = os.path.join(TEMPLATE_P... | 0 | 0 | 0 |
9852ce69d9d099cdb1ac59ae840558471ebda9a9 | 1,842 | py | Python | mnm/common/templatetags/paginator.py | agateblue/mnm | adf45c5f86611851ef3f51b60c30150095dba638 | [
"MIT"
] | 2 | 2021-02-09T06:49:24.000Z | 2021-07-19T00:44:39.000Z | mnm/common/templatetags/paginator.py | agateblue/mnm | adf45c5f86611851ef3f51b60c30150095dba638 | [
"MIT"
] | null | null | null | mnm/common/templatetags/paginator.py | agateblue/mnm | adf45c5f86611851ef3f51b60c30150095dba638 | [
"MIT"
] | 1 | 2021-06-07T10:39:07.000Z | 2021-06-07T10:39:07.000Z | # Based on: http://www.djangosnippets.org/snippets/73/
#
# Modified by Sean Reifschneider to be smarter about surrounding page
# link context. For usage documentation see:
#
# http://www.tummy.com/Community/Articles/django-pagination/
from django import template
register = template.Library()
def paginator(c... | 32.892857 | 79 | 0.677524 | # Based on: http://www.djangosnippets.org/snippets/73/
#
# Modified by Sean Reifschneider to be smarter about surrounding page
# link context. For usage documentation see:
#
# http://www.tummy.com/Community/Articles/django-pagination/
from django import template
register = template.Library()
def paginator(c... | 0 | 0 | 0 |
096155ef6e2ac8dd164eb7499dfe5671e0f127db | 431 | py | Python | Hill Climbing with Noise Scaling/policy.py | rakshithramagiri/bipedal_walker | e439cfd0bac02008e3e11e03bc6a202318be0b10 | [
"MIT"
] | null | null | null | Hill Climbing with Noise Scaling/policy.py | rakshithramagiri/bipedal_walker | e439cfd0bac02008e3e11e03bc6a202318be0b10 | [
"MIT"
] | null | null | null | Hill Climbing with Noise Scaling/policy.py | rakshithramagiri/bipedal_walker | e439cfd0bac02008e3e11e03bc6a202318be0b10 | [
"MIT"
] | null | null | null | import numpy as np
| 25.352941 | 80 | 0.647332 | import numpy as np
class POLICY:
def __init__(self, state_size, action_size, seed):
self.state_size = state_size
self.action_size = action_size
np.random.seed(seed)
self.weights = 1e-4 * np.random.randn(self.state_size, self.action_size)
def forward(self, state):
out... | 342 | -8 | 76 |
8b44c1be35b503ee33b9a79c0841c139b73a52b8 | 5,839 | py | Python | src/model.py | westphal-jan/peer-data | 5dd331c683f2c904d91d8400df1429a97a76da6b | [
"MIT"
] | 6 | 2021-06-26T12:06:30.000Z | 2022-03-04T10:32:17.000Z | src/model.py | westphal-jan/peer-data | 5dd331c683f2c904d91d8400df1429a97a76da6b | [
"MIT"
] | null | null | null | src/model.py | westphal-jan/peer-data | 5dd331c683f2c904d91d8400df1429a97a76da6b | [
"MIT"
] | null | null | null | from sentence_transformers.util import batch_to_device
from torch import Tensor
import pytorch_lightning as pl
from torch import nn, sigmoid, tensor
from torchmetrics import Accuracy, F1, Recall, Precision, MatthewsCorrcoef, StatScores
from sentence_transformers import SentenceTransformer
import transformers
import tor... | 43.574627 | 154 | 0.609693 | from sentence_transformers.util import batch_to_device
from torch import Tensor
import pytorch_lightning as pl
from torch import nn, sigmoid, tensor
from torchmetrics import Accuracy, F1, Recall, Precision, MatthewsCorrcoef, StatScores
from sentence_transformers import SentenceTransformer
import transformers
import tor... | 5,022 | 27 | 346 |
9371d0a71f17fd2b0bb6c278d4e571d05df5f7e5 | 5,043 | py | Python | src/Python/Visualization/QuadricVisualization.py | sankhesh/vtk-examples | 2d50e847ad62ce0eb71b66c029ad8abb302cd39f | [
"Apache-2.0"
] | null | null | null | src/Python/Visualization/QuadricVisualization.py | sankhesh/vtk-examples | 2d50e847ad62ce0eb71b66c029ad8abb302cd39f | [
"Apache-2.0"
] | null | null | null | src/Python/Visualization/QuadricVisualization.py | sankhesh/vtk-examples | 2d50e847ad62ce0eb71b66c029ad8abb302cd39f | [
"Apache-2.0"
] | 1 | 2022-02-16T08:20:41.000Z | 2022-02-16T08:20:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
if __name__ == '__main__':
main()
| 29.319767 | 72 | 0.688479 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
def main():
colors = vtk.vtkNamedColors()
renderer = vtk.vtkRenderer()
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)
interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(renderWindow)
... | 4,825 | 0 | 115 |
fa65f02583726a5d9fcb1c58e9267baaa87e34d8 | 1,062 | py | Python | manage.py | benjaminhuanghuang/rest_bank_project | 6e1f04f3aaf90418b44e51ccfcb4bba290d86825 | [
"MIT"
] | null | null | null | manage.py | benjaminhuanghuang/rest_bank_project | 6e1f04f3aaf90418b44e51ccfcb4bba290d86825 | [
"MIT"
] | null | null | null | manage.py | benjaminhuanghuang/rest_bank_project | 6e1f04f3aaf90418b44e51ccfcb4bba290d86825 | [
"MIT"
] | null | null | null | from app import create_app
from app.models.user import User
from flask_script import Manager, Server
app = create_app('production')
manager = Manager(app)
server = Server(port=9527)
manager.add_command("run", server)
@manager.command
@manager.command
def adduser(user_name, email, role=2):
"""
Register a... | 25.285714 | 71 | 0.669492 | from app import create_app
from app.models.user import User
from flask_script import Manager, Server
app = create_app('production')
manager = Manager(app)
server = Server(port=9527)
manager.add_command("run", server)
@manager.command
def test():
from subprocess import call
call(['nosetests', '-v',
'... | 239 | 0 | 44 |
d1fd0a49ab84af32632c8827662d853198d1f33f | 1,211 | py | Python | feature_extraction/pkt2fft/pkt2csv_with_label.py | GTA-UFRJ-team/FENED | adb6443bc4bbdfd77d35ea1615dae79edc3a7942 | [
"MIT"
] | null | null | null | feature_extraction/pkt2fft/pkt2csv_with_label.py | GTA-UFRJ-team/FENED | adb6443bc4bbdfd77d35ea1615dae79edc3a7942 | [
"MIT"
] | null | null | null | feature_extraction/pkt2fft/pkt2csv_with_label.py | GTA-UFRJ-team/FENED | adb6443bc4bbdfd77d35ea1615dae79edc3a7942 | [
"MIT"
] | null | null | null | # coding:utf-8
#
# Author: Lucas Airam Castro de Souza
# Laboratory: Grupo de Teleinformática e Automação
# University: Universidade Federal do Rio de Janeiro
#
#
#
#
#
#
#
#
# Usage: python pkt2csv.py <pcap_path> <path_to_write> <pcap_class> -1 or 1
import pickle
import pyshark
import sys
pcap_file = pyshark.File... | 22.849057 | 84 | 0.585467 | # coding:utf-8
#
# Author: Lucas Airam Castro de Souza
# Laboratory: Grupo de Teleinformática e Automação
# University: Universidade Federal do Rio de Janeiro
#
#
#
#
#
#
#
#
# Usage: python pkt2csv.py <pcap_path> <path_to_write> <pcap_class> -1 or 1
import pickle
import pyshark
import sys
pcap_file = pyshark.File... | 0 | 0 | 0 |
fe0c161458b6669fde0dd0890ec591ecd5dfb46c | 3,422 | py | Python | med_social/views/site.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | med_social/views/site.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | med_social/views/site.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | from django.core.urlresolvers import reverse, reverse_lazy
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView, DetailView, CreateView
from django.shortcuts import get_object_or_404, redirect
from allauth.account.adapter import get_adapter
from allauth.socialaccount.models import... | 28.756303 | 123 | 0.678551 | from django.core.urlresolvers import reverse, reverse_lazy
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView, DetailView, CreateView
from django.shortcuts import get_object_or_404, redirect
from allauth.account.adapter import get_adapter
from allauth.socialaccount.models import... | 1,491 | 945 | 313 |
632596081c5b35d045dac6f782cc3ba733c6dbf8 | 6,736 | py | Python | python/PyTorch-CartPole/bullets-simple-sb3.py | yisyang/playground | 7281b1c2f84f217c5537f6666b8fdef435b2c299 | [
"MIT"
] | null | null | null | python/PyTorch-CartPole/bullets-simple-sb3.py | yisyang/playground | 7281b1c2f84f217c5537f6666b8fdef435b2c299 | [
"MIT"
] | null | null | null | python/PyTorch-CartPole/bullets-simple-sb3.py | yisyang/playground | 7281b1c2f84f217c5537f6666b8fdef435b2c299 | [
"MIT"
] | null | null | null | import click
import gym
from pynput import keyboard
from pynput.keyboard import Key
from stable_baselines3 import DQN
from stable_baselines3.dqn import MlpPolicy
from stable_baselines3.common.env_util import make_vec_env
from stable_baselines3.common.env_checker import check_env
@click.command()
@click.option('-m', '... | 30.757991 | 120 | 0.54617 | import click
import gym
from pynput import keyboard
from pynput.keyboard import Key
from stable_baselines3 import DQN
from stable_baselines3.dqn import MlpPolicy
from stable_baselines3.common.env_util import make_vec_env
from stable_baselines3.common.env_checker import check_env
@click.command()
@click.option('-m', '... | 5,655 | 0 | 121 |
832fda175aac75717c533e1096ea5553f6e4b33a | 386 | py | Python | event_handler/utils/storage.py | mrmegapolys/event_handler | 55b38b4456ec65cd48515ececabde60dcac99a68 | [
"MIT"
] | null | null | null | event_handler/utils/storage.py | mrmegapolys/event_handler | 55b38b4456ec65cd48515ececabde60dcac99a68 | [
"MIT"
] | null | null | null | event_handler/utils/storage.py | mrmegapolys/event_handler | 55b38b4456ec65cd48515ececabde60dcac99a68 | [
"MIT"
] | null | null | null | from threading import Lock
from copy import deepcopy
| 22.705882 | 41 | 0.57513 | from threading import Lock
from copy import deepcopy
class Storage:
def __init__(self):
self._lock = Lock()
self._storage = {}
def get_data(self, key):
with self._lock:
data = self._storage.get(key)
return deepcopy(data)
def put_data(self, key, data):
... | 229 | -7 | 103 |
be0eb67f7b9bf2b84cbc8deaa197c42bdd52376b | 825 | py | Python | src/control/vt_steering_controller/setup.py | Nova-UTD/navigator | 1db2c614f9c53fb012842b8653ae1bed58a7ffdf | [
"Apache-2.0"
] | 11 | 2021-11-26T14:06:51.000Z | 2022-03-18T16:49:33.000Z | src/control/vt_steering_controller/setup.py | Nova-UTD/navigator | 1db2c614f9c53fb012842b8653ae1bed58a7ffdf | [
"Apache-2.0"
] | 222 | 2021-10-29T22:00:27.000Z | 2022-03-29T20:56:34.000Z | src/control/vt_steering_controller/setup.py | Nova-UTD/navigator | 1db2c614f9c53fb012842b8653ae1bed58a7ffdf | [
"Apache-2.0"
] | 1 | 2021-12-10T18:05:03.000Z | 2021-12-10T18:05:03.000Z | from setuptools import setup
from glob import glob
import os
package_name = 'vt_steering_controller'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + pac... | 27.5 | 74 | 0.648485 | from setuptools import setup
from glob import glob
import os
package_name = 'vt_steering_controller'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + pac... | 0 | 0 | 0 |
a085486a97ce5a97cd97744bff9c46f3b5d03d4c | 2,365 | py | Python | tests/three/test_tv_episodes.py | Cologler/ezapi-tmdb | 6a8a1a0a3da99cb18d11f47f1b40bbffb2a16be6 | [
"MIT"
] | 4 | 2017-05-16T02:30:52.000Z | 2021-07-01T13:21:27.000Z | tests/three/test_tv_episodes.py | Cologler/ezapi-tmdb | 6a8a1a0a3da99cb18d11f47f1b40bbffb2a16be6 | [
"MIT"
] | 4 | 2020-09-03T03:19:49.000Z | 2021-12-21T05:24:04.000Z | tests/three/test_tv_episodes.py | Cologler/ezapi-tmdb | 6a8a1a0a3da99cb18d11f47f1b40bbffb2a16be6 | [
"MIT"
] | 3 | 2021-02-15T18:13:08.000Z | 2021-04-10T03:53:58.000Z | import pytest
from . import polite
tv_id = 1418 # The Big Bang Theory
season_number = 12
episode_number = 1
@polite
@polite
@polite
@pytest.mark.parametrize("with_guest_session", [True, False])
@polite
@pytest.mark.parametrize("with_guest_session", [True, False])
@polite
@polite
@polite
@polite
@p... | 27.183908 | 88 | 0.727696 | import pytest
from . import polite
tv_id = 1418 # The Big Bang Theory
season_number = 12
episode_number = 1
@polite
def test_get_tv_episode_details(tmdb):
assert tmdb.get_tv_episode_details(tv_id, season_number, episode_number) is not None
@polite
def test_get_tv_episode_changes(tmdb):
episode_id = tmdb... | 1,841 | 0 | 198 |
53e4835d9242d831a2e13eece8a0850b49e74299 | 2,952 | py | Python | utilipy/data_utils/tests/test_decorators.py | nstarman/utilipy | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 2 | 2020-11-15T01:48:45.000Z | 2020-12-02T20:44:20.000Z | utilipy/data_utils/tests/test_decorators.py | nstarman/astroPHD | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 22 | 2020-09-13T17:58:24.000Z | 2022-02-04T19:05:23.000Z | utilipy/data_utils/tests/test_decorators.py | nstarman/utilipy | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 1 | 2020-04-21T22:41:01.000Z | 2020-04-21T22:41:01.000Z | # -*- coding: utf-8 -*-
"""Test data_util :mod:`~utilipy.data_utils.decorators`."""
__all__ = [
"test_idxDecorator_standard",
"test_idxDecorator_defaults",
"test_idxDecorator_new_decorator",
"test_idxDecorator_existing_function",
]
###################################################################... | 20.788732 | 78 | 0.4729 | # -*- coding: utf-8 -*-
"""Test data_util :mod:`~utilipy.data_utils.decorators`."""
__all__ = [
"test_idxDecorator_standard",
"test_idxDecorator_defaults",
"test_idxDecorator_new_decorator",
"test_idxDecorator_existing_function",
]
###################################################################... | 98 | 0 | 104 |
f00c64fe956fe698e5519b4b72b3a3dc7f83e349 | 108 | py | Python | forum_modules/sphinxfulltext/handlers.py | Stackato-Apps/osqa | 728bb43ae913e33769c52f40cadb26721faaf2b2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2017-07-14T09:58:07.000Z | 2017-07-14T09:58:07.000Z | forum_modules/sphinxfulltext/handlers.py | Stackato-Apps/osqa | 728bb43ae913e33769c52f40cadb26721faaf2b2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | forum_modules/sphinxfulltext/handlers.py | Stackato-Apps/osqa | 728bb43ae913e33769c52f40cadb26721faaf2b2 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from forum.models import Question | 27 | 42 | 0.814815 | from forum.models import Question
def question_search(keywords):
return Question.search.query(keywords) | 52 | 0 | 23 |
831e486a51ca30a5152ea0678cd55e2428b54903 | 4,448 | py | Python | node/make_config.py | hiramf/cardocker | 0a3c3897e39af89aa09f1fbb7b9b5bf47833cd8d | [
"MIT"
] | null | null | null | node/make_config.py | hiramf/cardocker | 0a3c3897e39af89aa09f1fbb7b9b5bf47833cd8d | [
"MIT"
] | null | null | null | node/make_config.py | hiramf/cardocker | 0a3c3897e39af89aa09f1fbb7b9b5bf47833cd8d | [
"MIT"
] | null | null | null | import logging
import os
import secrets
import socket
import sys
from timeit import default_timer as timer
from urllib import request
import yaml
logging.basicConfig(level=logging.DEBUG,
# Use Jormungandr logging format
format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message... | 35.023622 | 89 | 0.654676 | import logging
import os
import secrets
import socket
import sys
from timeit import default_timer as timer
from urllib import request
import yaml
logging.basicConfig(level=logging.DEBUG,
# Use Jormungandr logging format
format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message... | 805 | 0 | 23 |
1a05197544e1a4fdf2c8f4c0861ec0668bf4ae2a | 310 | py | Python | ex057.py | mateusguida/ExerciciosPython | 70f2df0a2a7bfd152205bcce228e2161c11f5888 | [
"MIT"
] | null | null | null | ex057.py | mateusguida/ExerciciosPython | 70f2df0a2a7bfd152205bcce228e2161c11f5888 | [
"MIT"
] | null | null | null | ex057.py | mateusguida/ExerciciosPython | 70f2df0a2a7bfd152205bcce228e2161c11f5888 | [
"MIT"
] | null | null | null | import os
os.system("cls") #limpa janela terminal antes da execução
sexo = str(input("Informe seu sexo: [M/F] ")).strip().upper()[0]
while sexo not in 'MmFf':
print(sexo)
sexo = str(input("Dados inválidos. Informe seu sexo: [M/F] ")).strip().upper()[0]
print(f'Sexo {sexo} registrado com sucesso!')
| 28.181818 | 85 | 0.664516 | import os
os.system("cls") #limpa janela terminal antes da execução
sexo = str(input("Informe seu sexo: [M/F] ")).strip().upper()[0]
while sexo not in 'MmFf':
print(sexo)
sexo = str(input("Dados inválidos. Informe seu sexo: [M/F] ")).strip().upper()[0]
print(f'Sexo {sexo} registrado com sucesso!')
| 0 | 0 | 0 |
600e8b8e415d5e978d743be23312d6ea3d660243 | 5,516 | py | Python | model/DFN.py | SultanAbuGhazal/CGNet | f10b976b984ba09be26b902ed4da97cd1311cf17 | [
"MIT"
] | 230 | 2018-09-19T12:40:35.000Z | 2022-03-28T03:00:01.000Z | model/DFN.py | cyanymore/CGNet | cfccea377a6f0a659e807e8759c82dbffba02d7f | [
"MIT"
] | 27 | 2018-11-22T02:59:14.000Z | 2021-10-06T10:19:16.000Z | model/DFN.py | cyanymore/CGNet | cfccea377a6f0a659e807e8759c82dbffba02d7f | [
"MIT"
] | 54 | 2018-11-16T02:34:39.000Z | 2022-03-25T06:57:21.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Xiangtai(lxtpku@pku.edu.cn)
# Implementation of Paper Learning a Discriminative Feature Network for Semantic Segmentation (CVPR2018)(face_plus_plus)
import torch
import torch.nn as nn
from model.resnet import resnet101
#from torchvision.models import resnet101
_... | 36.773333 | 120 | 0.618927 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Xiangtai(lxtpku@pku.edu.cn)
# Implementation of Paper Learning a Discriminative Feature Network for Semantic Segmentation (CVPR2018)(face_plus_plus)
import torch
import torch.nn as nn
from model.resnet import resnet101
#from torchvision.models import resnet101
_... | 4,674 | 0 | 256 |
b4e3ab9bfe09de17aafc408152b9ac73a386dc08 | 681 | py | Python | possibleYears.py | ben-dent/Contract-Cheating-Analysis | 28999b5ac73dbb6f4a65ef3d8f8dd4db677c42df | [
"MIT"
] | null | null | null | possibleYears.py | ben-dent/Contract-Cheating-Analysis | 28999b5ac73dbb6f4a65ef3d8f8dd4db677c42df | [
"MIT"
] | null | null | null | possibleYears.py | ben-dent/Contract-Cheating-Analysis | 28999b5ac73dbb6f4a65ef3d8f8dd4db677c42df | [
"MIT"
] | null | null | null | import sqlite3 as lite
con = lite.connect('JobDetails.db')
cur = con.cursor()
cur.execute("SELECT ReviewID, DateRange FROM Reviews")
results = cur.fetchall()
for result in results:
rID = result[0]
r = result[1]
split = r.split("-")
slash = r.split("/")
if len(split) == 1:
years = str(2... | 21.967742 | 98 | 0.550661 | import sqlite3 as lite
con = lite.connect('JobDetails.db')
cur = con.cursor()
cur.execute("SELECT ReviewID, DateRange FROM Reviews")
results = cur.fetchall()
for result in results:
rID = result[0]
r = result[1]
split = r.split("-")
slash = r.split("/")
if len(split) == 1:
years = str(2... | 0 | 0 | 0 |
88007f97d0685f5597a4ffc988c7191ca747d589 | 97 | py | Python | pandasql/run_test.py | nikicc/anaconda-recipes | 9c611a5854bf41bbc5e7ed9853dc71c0851a62ef | [
"BSD-3-Clause"
] | 130 | 2015-07-28T03:41:21.000Z | 2022-03-16T03:07:41.000Z | pandasql/run_test.py | nikicc/anaconda-recipes | 9c611a5854bf41bbc5e7ed9853dc71c0851a62ef | [
"BSD-3-Clause"
] | 119 | 2015-08-01T00:54:06.000Z | 2021-01-05T13:00:46.000Z | pandasql/run_test.py | nikicc/anaconda-recipes | 9c611a5854bf41bbc5e7ed9853dc71c0851a62ef | [
"BSD-3-Clause"
] | 72 | 2015-07-29T02:35:56.000Z | 2022-02-26T14:31:15.000Z | import unittest
import pandasql.tests.test_pandasql
unittest.main(pandasql.tests.test_pandasql)
| 19.4 | 43 | 0.865979 | import unittest
import pandasql.tests.test_pandasql
unittest.main(pandasql.tests.test_pandasql)
| 0 | 0 | 0 |
1c2bab093580a45c29e395e0ee2a8e16331e5f1d | 7,116 | py | Python | eodag/plugins/crunch/filter_overlap.py | sbrunato/eodag | 70aa45515b7b7c11326419abcf616979e7b6e024 | [
"Apache-2.0"
] | 149 | 2019-12-13T21:12:36.000Z | 2022-03-26T09:56:31.000Z | eodag/plugins/crunch/filter_overlap.py | sbrunato/eodag | 70aa45515b7b7c11326419abcf616979e7b6e024 | [
"Apache-2.0"
] | 200 | 2020-06-18T17:30:58.000Z | 2022-03-30T09:54:59.000Z | eodag/plugins/crunch/filter_overlap.py | sbrunato/eodag | 70aa45515b7b7c11326419abcf616979e7b6e024 | [
"Apache-2.0"
] | 23 | 2019-12-12T14:36:49.000Z | 2022-03-29T07:11:28.000Z | # -*- coding: utf-8 -*-
# Copyright 2021, CS GROUP - France, https://www.csgroup.eu/
#
# This file is part of EODAG project
# https://www.github.com/CS-SI/EODAG
#
# 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 c... | 42.610778 | 111 | 0.56113 | # -*- coding: utf-8 -*-
# Copyright 2021, CS GROUP - France, https://www.csgroup.eu/
#
# This file is part of EODAG project
# https://www.github.com/CS-SI/EODAG
#
# 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 c... | 0 | 0 | 0 |
00219cfd9b60966bd9ae5f6c6467986bd3c1455c | 488 | py | Python | eNMS/__init__.py | afourmy/e-napalm | 622c531bf2251917b17461a895dc26f891588ddf | [
"MIT"
] | 25 | 2017-11-21T09:05:55.000Z | 2017-12-13T09:43:42.000Z | eNMS/__init__.py | afourmy/e-napalm | 622c531bf2251917b17461a895dc26f891588ddf | [
"MIT"
] | 11 | 2017-11-18T21:49:42.000Z | 2017-12-08T09:49:13.000Z | eNMS/__init__.py | afourmy/e-napalm | 622c531bf2251917b17461a895dc26f891588ddf | [
"MIT"
] | 2 | 2017-11-30T20:46:32.000Z | 2017-12-07T23:33:07.000Z | from eNMS.controller import controller
from eNMS.custom import CustomApp # noqa: F401
from eNMS.database import db
from eNMS.environment import env
from eNMS.forms import form_factory
from eNMS.server import server
from eNMS.variables import vs
initialize()
| 23.238095 | 47 | 0.764344 | from eNMS.controller import controller
from eNMS.custom import CustomApp # noqa: F401
from eNMS.database import db
from eNMS.environment import env
from eNMS.forms import form_factory
from eNMS.server import server
from eNMS.variables import vs
def initialize():
server.register_plugins()
first_init = db._ini... | 203 | 0 | 23 |
1c021bc0e405cbdfa70c4f051fe29c5f0b00acf8 | 1,336 | py | Python | mathipy/__init__.py | BatiDyDx/maths-tools-python | e9a58aa669b5f36d7ee01402fe1f16a1db7b0e50 | [
"MIT"
] | 1 | 2021-02-02T02:58:38.000Z | 2021-02-02T02:58:38.000Z | mathipy/__init__.py | BatiDyDx/maths-tools-python | e9a58aa669b5f36d7ee01402fe1f16a1db7b0e50 | [
"MIT"
] | null | null | null | mathipy/__init__.py | BatiDyDx/maths-tools-python | e9a58aa669b5f36d7ee01402fe1f16a1db7b0e50 | [
"MIT"
] | null | null | null | __version__ = '0.1dev'
from . import (
math,
arithmetic,
datastr,
functions,
numeric_operations
)
from .math import (
complex_math,
ntheory,
calculus,
geometry,
trigonometry,
linalg,
polynomial,
statistics,
quaternion,
octonion,
)
from .arithmetic import (
... | 17.813333 | 104 | 0.652695 | __version__ = '0.1dev'
from . import (
math,
arithmetic,
datastr,
functions,
numeric_operations
)
from .math import (
complex_math,
ntheory,
calculus,
geometry,
trigonometry,
linalg,
polynomial,
statistics,
quaternion,
octonion,
)
from .arithmetic import (
... | 0 | 0 | 0 |
7c3a98dd0298c456b0a4f0fcfff759cb3da7ba73 | 11,794 | py | Python | samples/classification/ram/architecture/ram_modules.py | aivclab/vision | 6c644dd72f68bca608a2900e5d9461e90fe841eb | [
"Apache-2.0"
] | 1 | 2019-07-03T04:33:51.000Z | 2019-07-03T04:33:51.000Z | samples/classification/ram/architecture/ram_modules.py | aivclab/vision | 6c644dd72f68bca608a2900e5d9461e90fe841eb | [
"Apache-2.0"
] | 5 | 2019-07-03T04:38:07.000Z | 2021-09-10T15:40:44.000Z | samples/classification/ram/architecture/ram_modules.py | aivclab/vision | 6c644dd72f68bca608a2900e5d9461e90fe841eb | [
"Apache-2.0"
] | 3 | 2019-10-03T06:14:40.000Z | 2021-01-31T14:31:39.000Z | import torch
from torch import nn
from torch.distributions import Normal
from typing import Tuple
from torch.nn import functional
class GlimpseSensor(nn.Module):
"""The glimpse network.
Combines the "what" and the "where" into a glimpse
feature vector `g_t`.
- "what": glimpse extracted from the re... | 32.312329 | 88 | 0.596151 | import torch
from torch import nn
from torch.distributions import Normal
from typing import Tuple
from torch.nn import functional
class GlimpseSensor(nn.Module):
"""The glimpse network.
Combines the "what" and the "where" into a glimpse
feature vector `g_t`.
- "what": glimpse extracted from the re... | 1,257 | 0 | 166 |
873e58e0f2b38e939e146b10e301fe0d4b1009c8 | 1,164 | py | Python | tests/alert/test_plugins.py | fsbraun/djangocms-bootstrap5 | 368f736fa1ce264086493153a256eb90dd8c4df0 | [
"BSD-3-Clause"
] | 7 | 2022-01-28T14:21:14.000Z | 2022-03-29T20:07:11.000Z | tests/alert/test_plugins.py | marksweb/djangocms-frontend | c74130cbd15cfacb588933bb4adaf1a7d780daaf | [
"BSD-3-Clause"
] | 13 | 2022-02-23T21:10:07.000Z | 2022-03-30T08:33:20.000Z | tests/alert/test_plugins.py | marksweb/djangocms-frontend | c74130cbd15cfacb588933bb4adaf1a7d780daaf | [
"BSD-3-Clause"
] | 2 | 2022-02-07T14:48:11.000Z | 2022-02-23T23:55:18.000Z | from cms.api import add_plugin
from cms.test_utils.testcases import CMSTestCase
from djangocms_frontend.contrib.alert.cms_plugins import AlertPlugin
from djangocms_frontend.contrib.alert.forms import AlertForm
from ..fixtures import TestFixture
| 34.235294 | 77 | 0.634021 | from cms.api import add_plugin
from cms.test_utils.testcases import CMSTestCase
from djangocms_frontend.contrib.alert.cms_plugins import AlertPlugin
from djangocms_frontend.contrib.alert.forms import AlertForm
from ..fixtures import TestFixture
class AlertPluginTestCase(TestFixture, CMSTestCase):
def test_plugi... | 836 | 31 | 49 |
4c7270885d997bb44774f0d0228b132952cb7ea2 | 2,035 | py | Python | cpymad_lhc/coupling_knob.py | JoschD/cpymad_lhc | 15eb15e5d8bfd497d756ae95982f4023f8100b7a | [
"MIT"
] | null | null | null | cpymad_lhc/coupling_knob.py | JoschD/cpymad_lhc | 15eb15e5d8bfd497d756ae95982f4023f8100b7a | [
"MIT"
] | null | null | null | cpymad_lhc/coupling_knob.py | JoschD/cpymad_lhc | 15eb15e5d8bfd497d756ae95982f4023f8100b7a | [
"MIT"
] | null | null | null | """
Coupling Knob
------------------
Creates a coupling knob from current optics.
Not implemented yet. TODO!
"""
from operator import itemgetter
from typing import Sequence
# from optics_functions.coupling import coupling_via_cmatrix
import pandas as pd
from cpymad.madx import Madx
import numpy as np
import logging... | 30.833333 | 112 | 0.700737 | """
Coupling Knob
------------------
Creates a coupling knob from current optics.
Not implemented yet. TODO!
"""
from operator import itemgetter
from typing import Sequence
# from optics_functions.coupling import coupling_via_cmatrix
import pandas as pd
from cpymad.madx import Madx
import numpy as np
import logging... | 536 | 0 | 73 |
5bc9479464c05faa6678a012db1074871118915e | 1,704 | py | Python | Model/G2E/seq2seq/Layers/Decoder.py | Yottaxx/T-LSTM | 92618d8c3ee2418b194a2e1592512548da955b77 | [
"MIT"
] | 9 | 2020-05-23T05:40:27.000Z | 2021-11-19T01:29:36.000Z | Model/G2E/seq2seq/Layers/Decoder.py | ayyyq/T-LSTM | 36dbc88ac710d3925851cd87c2368ecfc7061b70 | [
"MIT"
] | 1 | 2020-11-29T04:35:52.000Z | 2021-01-29T07:39:37.000Z | Model/G2E/seq2seq/Layers/Decoder.py | Yottaxx/T-LSTM | 92618d8c3ee2418b194a2e1592512548da955b77 | [
"MIT"
] | 2 | 2020-10-26T13:42:49.000Z | 2020-11-01T02:01:33.000Z | import torch.nn as nn
import torch.nn.functional as F
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = Decoder(10, 10*3, 1).to(device)
x = torch.rand(4, 5, 10).to(device)
h = torch.rand(4, 5, 20).to(device)
trigger = torch.tensor([1, 2, 3, 4]).to(device)
mask = torch.ones(4... | 36.255319 | 101 | 0.610329 | import torch.nn as nn
import torch.nn.functional as F
import torch
class Decoder(nn.Module):
def __init__(self, in_size, out_size, num_layers, dropout=0.3, bi=True):
super(Decoder, self).__init__()
self.in_size = in_size
self.out_size = out_size
self.linear_a = nn.Linear(in_size*3,... | 1,239 | 4 | 76 |
c52225fbf11940b1b3c3870dc266dd41e8aaf53c | 4,491 | py | Python | openstack_dashboard/test/integration_tests/pages/identity/projectspage.py | Tesora-Release/tesora-horizon | 4b0f26d48551783c1fe3ae362d1f8d27570195a9 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/integration_tests/pages/identity/projectspage.py | Tesora-Release/tesora-horizon | 4b0f26d48551783c1fe3ae362d1f8d27570195a9 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/test/integration_tests/pages/identity/projectspage.py | Tesora-Release/tesora-horizon | 4b0f26d48551783c1fe3ae362d1f8d27570195a9 | [
"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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 37.425 | 78 | 0.672233 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 2,315 | 1,328 | 23 |
864a0c9bbe245e56c77fbc8c499c30468b0d8f25 | 3,215 | py | Python | pxr/base/tf/testenv/testTfPyOptional.py | yurivict/USD | 3b097e3ba8fabf1777a1256e241ea15df83f3065 | [
"Apache-2.0"
] | 1 | 2018-02-23T05:39:27.000Z | 2018-02-23T05:39:27.000Z | pxr/base/tf/testenv/testTfPyOptional.py | yurivict/USD | 3b097e3ba8fabf1777a1256e241ea15df83f3065 | [
"Apache-2.0"
] | null | null | null | pxr/base/tf/testenv/testTfPyOptional.py | yurivict/USD | 3b097e3ba8fabf1777a1256e241ea15df83f3065 | [
"Apache-2.0"
] | 1 | 2020-10-24T00:43:14.000Z | 2020-10-24T00:43:14.000Z | #!/pxrpythonsubst
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 42.866667 | 95 | 0.690513 | #!/pxrpythonsubst
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 1,864 | 21 | 104 |
83d102470d63238232c3b2ad24f1ea92933153c0 | 937 | py | Python | Python-37.py | fabiobarreto-data-science/Data-Science---Let-s-Code | df60c8351141d3fcbd96589c4dd27e1054fed712 | [
"MIT"
] | null | null | null | Python-37.py | fabiobarreto-data-science/Data-Science---Let-s-Code | df60c8351141d3fcbd96589c4dd27e1054fed712 | [
"MIT"
] | null | null | null | Python-37.py | fabiobarreto-data-science/Data-Science---Let-s-Code | df60c8351141d3fcbd96589c4dd27e1054fed712 | [
"MIT"
] | null | null | null | """
Desafio 1 | Faça um programa que peça para o usuário digitar o nome e a idade de um aluno e o número de provas que esse aluno fez. Depois, o programa deve pedir para o usuário digitar as notas de cada prova do aluno. Ao final o programa deve imprimir uma lista contendo:
a. Nome do aluno na posição 0
b. Idade do a... | 24.025641 | 270 | 0.696905 | """
Desafio 1 | Faça um programa que peça para o usuário digitar o nome e a idade de um aluno e o número de provas que esse aluno fez. Depois, o programa deve pedir para o usuário digitar as notas de cada prova do aluno. Ao final o programa deve imprimir uma lista contendo:
a. Nome do aluno na posição 0
b. Idade do a... | 0 | 0 | 0 |
1b45a4e1596f65fd16d89aa55b989ee9e19a6048 | 3,500 | py | Python | webServer/person.py | ndkjing/usv | 132e021432a0344a22914aaf68da7d7955d7331f | [
"MIT"
] | null | null | null | webServer/person.py | ndkjing/usv | 132e021432a0344a22914aaf68da7d7955d7331f | [
"MIT"
] | null | null | null | webServer/person.py | ndkjing/usv | 132e021432a0344a22914aaf68da7d7955d7331f | [
"MIT"
] | 1 | 2021-09-04T10:27:30.000Z | 2021-09-04T10:27:30.000Z | import cv2 as cv
import numpy as np
import time
import get_eviz_url
import upload_file
if __name__ == '__main__':
obj = DetectVideo()
# detect_img(src="person.png")
# 获取地址 (萤石云产品序列号)
src_rtmp = get_eviz_url.get_url(serial_str='F77671789')
# 检测视频流
obj.detect_video(src=src_rtmp)
| 32.71028 | 78 | 0.551429 | import cv2 as cv
import numpy as np
import time
import get_eviz_url
import upload_file
class DetectVideo:
def __init__(self):
self.last_save_time = None
self.save_interval = 300 # 暂时设置保存间隔时间300秒
self.max_save_interval = 5 * 60 * 60 # 暂时设置最大保存间隔时间5*60*60秒
ip_local = '192.168.199.1... | 3,034 | 257 | 23 |
091807ab6c335f03ebfb4b06c41eabdb8c75d816 | 354 | py | Python | app/lib/db_query/tweets/__init__.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 10 | 2019-03-22T07:07:41.000Z | 2022-01-26T00:57:45.000Z | app/lib/db_query/tweets/__init__.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 70 | 2017-07-12T19:49:38.000Z | 2020-09-02T10:03:28.000Z | app/lib/db_query/tweets/__init__.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 2 | 2017-06-30T07:13:39.000Z | 2020-12-04T00:39:12.000Z | """
Initialization file for tweets library module.
These exist here in lib as some of them are useful as help functions of other
scripts (such as getting available campaigns). However, these could be moved to
utils/reporting/ as individual scripts. And they could be called directly or
with make, to avoid having multip... | 39.333333 | 79 | 0.79096 | """
Initialization file for tweets library module.
These exist here in lib as some of them are useful as help functions of other
scripts (such as getting available campaigns). However, these could be moved to
utils/reporting/ as individual scripts. And they could be called directly or
with make, to avoid having multip... | 0 | 0 | 0 |
7c7994cba3a9ae7a756dcd57ac8ceeab2a0ef3d7 | 1,345 | py | Python | examples/cython/usm_memory/reference_black_scholes.py | diptorupd/dpctl | 99aba3bd4a1f4d963c97a15815160085241ffbed | [
"Apache-2.0"
] | 39 | 2020-09-29T16:00:59.000Z | 2022-03-30T19:08:05.000Z | examples/cython/usm_memory/reference_black_scholes.py | PokhodenkoSA/pydppl | 9b8644b167a2bc9d1067e5c0d13d3abef0bff82b | [
"Apache-2.0"
] | 600 | 2020-09-22T22:47:43.000Z | 2022-03-31T16:20:13.000Z | examples/cython/usm_memory/reference_black_scholes.py | PokhodenkoSA/dpctl | 9b8644b167a2bc9d1067e5c0d13d3abef0bff82b | [
"Apache-2.0"
] | 14 | 2020-10-02T09:45:56.000Z | 2022-02-08T09:20:25.000Z | # Data Parallel Control (dpctl)
#
# Copyright 2020-2021 Intel Corporation
#
# 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.... | 24.017857 | 74 | 0.575465 | # Data Parallel Control (dpctl)
#
# Copyright 2020-2021 Intel Corporation
#
# 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.... | 668 | 0 | 23 |
2899cff6619ff353de2e5650df03c94fa51b4b97 | 483 | py | Python | raven/views/base_api.py | dantin/raven | 4cf741174532aacbcd71696eafcf1bd302651b2e | [
"BSD-3-Clause"
] | null | null | null | raven/views/base_api.py | dantin/raven | 4cf741174532aacbcd71696eafcf1bd302651b2e | [
"BSD-3-Clause"
] | null | null | null | raven/views/base_api.py | dantin/raven | 4cf741174532aacbcd71696eafcf1bd302651b2e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from typing import List
from flask_appbuilder import ModelRestApi
logger = logging.getLogger(__name__)
class BaseRavenModelRestApi(ModelRestApi):
"""
Extends FAB's ModelResApi to implement specific raven generic functionality.
"""
csrf_exempt = False
add_... | 20.125 | 80 | 0.699793 | # -*- coding: utf-8 -*-
import logging
from typing import List
from flask_appbuilder import ModelRestApi
logger = logging.getLogger(__name__)
class BaseRavenModelRestApi(ModelRestApi):
"""
Extends FAB's ModelResApi to implement specific raven generic functionality.
"""
csrf_exempt = False
add_... | 33 | 0 | 27 |
8393003c530ece2565148a8192507f484b6930db | 151 | py | Python | yager/core/version.py | undp/yager | c8a1e471fa7c5ec962cb62d2a64fb93db4bbb378 | [
"MIT"
] | 1 | 2021-05-23T17:20:38.000Z | 2021-05-23T17:20:38.000Z | yager/core/version.py | undp/yager | c8a1e471fa7c5ec962cb62d2a64fb93db4bbb378 | [
"MIT"
] | 1 | 2020-10-20T02:57:08.000Z | 2020-10-20T07:26:54.000Z | yager/core/version.py | undp/yager | c8a1e471fa7c5ec962cb62d2a64fb93db4bbb378 | [
"MIT"
] | 2 | 2021-05-23T17:20:44.000Z | 2022-03-25T01:18:11.000Z | # -*- coding: utf-8 -*-
"""App version module."""
from .. import __version__
def get_version():
"""Return app version."""
return __version__
| 16.777778 | 29 | 0.622517 | # -*- coding: utf-8 -*-
"""App version module."""
from .. import __version__
def get_version():
"""Return app version."""
return __version__
| 0 | 0 | 0 |
ca3517f873b528a68972d8a98a499d953c5ffd47 | 199 | py | Python | code/python/other_structure_struct.py | evmorov/ruby-coffeescript | 1c61c5ce351509b210e26feceee6efab0b255442 | [
"MIT"
] | 29 | 2016-06-15T09:19:18.000Z | 2022-03-21T14:34:47.000Z | code/python/other_structure_struct.py | evmorov/ruby-coffeescript | 1c61c5ce351509b210e26feceee6efab0b255442 | [
"MIT"
] | 7 | 2016-06-16T07:02:43.000Z | 2020-01-08T21:12:30.000Z | code/python/other_structure_struct.py | evmorov/ruby-coffeescript | 1c61c5ce351509b210e26feceee6efab0b255442 | [
"MIT"
] | 7 | 2016-06-15T14:57:46.000Z | 2021-12-09T17:57:22.000Z | import collections
print(Customer('Dave', '123 Main').greeting())
| 24.875 | 67 | 0.688442 | import collections
class Customer(collections.namedtuple('Customer', 'name address')):
def greeting(self):
return "Hello %s!" % self.name
print(Customer('Dave', '123 Main').greeting())
| 37 | 46 | 49 |
eaf28efccb42d2a9eb9fa1612b33f1f1a6fbea67 | 152 | py | Python | package/cc_pathlib/__init__.py | yota-code/cc-pathlib | 8f752192d99455185888e1fe4ec3ea8020daeff7 | [
"0BSD"
] | null | null | null | package/cc_pathlib/__init__.py | yota-code/cc-pathlib | 8f752192d99455185888e1fe4ec3ea8020daeff7 | [
"0BSD"
] | null | null | null | package/cc_pathlib/__init__.py | yota-code/cc-pathlib | 8f752192d99455185888e1fe4ec3ea8020daeff7 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
from cc_pathlib.path import Path
from cc_pathlib.case import CaseCollation
from cc_pathlib.uniw import UniversalWriter
| 19 | 44 | 0.789474 | #!/usr/bin/env python3
from cc_pathlib.path import Path
from cc_pathlib.case import CaseCollation
from cc_pathlib.uniw import UniversalWriter
| 0 | 0 | 0 |
d2064fed0834f29f5a4d5844db178d84d4a5a264 | 1,199 | py | Python | fastweb/util/thread.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | 123 | 2017-06-06T04:59:07.000Z | 2019-07-11T10:20:35.000Z | fastweb/util/thread.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | null | null | null | fastweb/util/thread.py | BSlience/fastweb | 2c1b956e9846c4205d0201d39d09891d088754e4 | [
"Apache-2.0"
] | 2 | 2017-06-28T05:58:39.000Z | 2018-09-25T00:18:33.000Z | # coding:utf8
from threading import Thread, Event
from fastweb.util.log import recorder
class FThread(Thread):
"""封装系统thread,方便线程停止"""
_fthreads = []
def __init__(self, name, task, period=0, frequency=-1):
"""初始化线程
:parameter:
- `name`: 线程名
- `task`: 任务函数,线程名会作为参数传递给... | 22.622642 | 61 | 0.574646 | # coding:utf8
from threading import Thread, Event
from fastweb.util.log import recorder
class FThread(Thread):
"""封装系统thread,方便线程停止"""
_fthreads = []
def __init__(self, name, task, period=0, frequency=-1):
"""初始化线程
:parameter:
- `name`: 线程名
- `task`: 任务函数,线程名会作为参数传递给... | 59 | 0 | 27 |
c0ba8ffc57c5e888d0bf850433494385fd130c2f | 110 | py | Python | gamebeater/games/tests.py | GTmmiller/gamebeater | bf523ced890f596d470cb4a55abc18703e46146f | [
"MIT"
] | 1 | 2016-07-19T02:17:47.000Z | 2016-07-19T02:17:47.000Z | gamebeater/games/tests.py | GTmmiller/gamebeater | bf523ced890f596d470cb4a55abc18703e46146f | [
"MIT"
] | 12 | 2016-07-19T02:21:37.000Z | 2016-07-19T03:25:22.000Z | gamebeater/games/tests.py | GTmmiller/gamebeater | bf523ced890f596d470cb4a55abc18703e46146f | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.utils import timezone
from .models import Game, Platform, Genre
| 22 | 41 | 0.818182 | from django.test import TestCase
from django.utils import timezone
from .models import Game, Platform, Genre
| 0 | 0 | 0 |
0148750e974da2d7cf0f9b400430d284d1f294fe | 10,563 | py | Python | packages/syft/tests/syft/core/tensor/adp/phi_tensor_test.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/tests/syft/core/tensor/adp/phi_tensor_test.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | packages/syft/tests/syft/core/tensor/adp/phi_tensor_test.py | jackbandy/PySyft | 0e20e90abab6a7a7ca672d6eedfa1e7f83c4981b | [
"Apache-2.0"
] | null | null | null | # third party
import numpy as np
import pytest
# syft absolute
import syft as sy
from syft.core.adp.data_subject import DataSubject
from syft.core.tensor.autodp.phi_tensor import PhiTensor as PT
from syft.core.tensor.tensor import Tensor
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest... | 27.797368 | 98 | 0.667235 | # third party
import numpy as np
import pytest
# syft absolute
import syft as sy
from syft.core.adp.data_subject import DataSubject
from syft.core.tensor.autodp.phi_tensor import PhiTensor as PT
from syft.core.tensor.tensor import Tensor
@pytest.fixture
def ishan() -> DataSubject:
return DataSubject(name="φhisha... | 1,348 | 0 | 134 |
2177bc70a0844667a22a1abe8b27f7bf5a1cff60 | 6,449 | py | Python | isee/infrastructure/configure.py | team-mayes/isEE | c22d7cc78a43f0c0a7b2ec18fbc3b628ddef8d54 | [
"BSD-3-Clause"
] | null | null | null | isee/infrastructure/configure.py | team-mayes/isEE | c22d7cc78a43f0c0a7b2ec18fbc3b628ddef8d54 | [
"BSD-3-Clause"
] | 1 | 2021-09-17T18:20:36.000Z | 2021-10-06T16:56:34.000Z | isee/infrastructure/configure.py | team-mayes/isEE | c22d7cc78a43f0c0a7b2ec18fbc3b628ddef8d54 | [
"BSD-3-Clause"
] | null | null | null | """
configure.py
Takes user input file and returns settings namespace object
"""
import argparse
import pytraj # to support pytraj calls in input file
import mdtraj # to support mdtraj calls in the input file
import numpy # to support numpy calls in input file
import numpy as np # to support numpy... | 37.935294 | 184 | 0.641495 | """
configure.py
Takes user input file and returns settings namespace object
"""
import argparse
import pytraj # to support pytraj calls in input file
import mdtraj # to support mdtraj calls in the input file
import numpy # to support numpy calls in input file
import numpy as np # to support numpy... | 0 | 3,444 | 27 |
08c6d8e51ddbbf8996189a2b5db8ec22a4e92b8d | 4,094 | py | Python | ArvoreBinariaDeBusca.py | RosarioMvs/PythonAlgorithms | 69588d9fe642e02c76f948e6d120e0477d114247 | [
"Apache-2.0"
] | null | null | null | ArvoreBinariaDeBusca.py | RosarioMvs/PythonAlgorithms | 69588d9fe642e02c76f948e6d120e0477d114247 | [
"Apache-2.0"
] | null | null | null | ArvoreBinariaDeBusca.py | RosarioMvs/PythonAlgorithms | 69588d9fe642e02c76f948e6d120e0477d114247 | [
"Apache-2.0"
] | null | null | null |
# Arvore Binaria de Busca em Python
# Kelvin Salton do Prado
# 2015
############# Metodos de Busca #############
############################################
############ Metodo de Insercao ############
############################################
########### Metodos de Impressao ###########
ImprimeAr... | 23.129944 | 79 | 0.604299 |
# Arvore Binaria de Busca em Python
# Kelvin Salton do Prado
# 2015
class Arvore:
def __init__(self, chave):
self.chave = chave;
self.esquerda = None;
self.direita = None;
############# Metodos de Busca #############
def buscaRecursiva(no, chave):
if no is None:
print str(chave) + ' nao f... | 2,142 | -8 | 317 |
234277f79faade3ae3d913a2e5111ccaf5457e47 | 757 | py | Python | 4_Recursion/recursive_tree.py | AnthonyRChao/Problem-Solving-With-Algorithms-And-Data-Structures | be29b46b9f4e579644ca2d44675c0ce7dcb29b3b | [
"MIT"
] | 6 | 2020-09-28T08:18:01.000Z | 2022-01-15T19:38:38.000Z | 4_Recursion/recursive_tree.py | AnthonyRChao/Problem-Solving-With-Algorithms-And-Data-Structures | be29b46b9f4e579644ca2d44675c0ce7dcb29b3b | [
"MIT"
] | null | null | null | 4_Recursion/recursive_tree.py | AnthonyRChao/Problem-Solving-With-Algorithms-And-Data-Structures | be29b46b9f4e579644ca2d44675c0ce7dcb29b3b | [
"MIT"
] | 3 | 2020-09-28T08:18:05.000Z | 2021-04-24T21:22:28.000Z | """
Use the turtle module to draw a tree recursively.
"""
import turtle
from random import randrange
main()
| 20.459459 | 61 | 0.616909 | """
Use the turtle module to draw a tree recursively.
"""
import turtle
from random import randrange
def tree(branch_len, thickness, t):
if branch_len > 5:
branch_angle = randrange(15, 45)
branch_decrement = randrange(10,20)
t.pensize(thickness)
t.forward(branch_len)
t.ri... | 597 | 0 | 46 |
f3f4c564278abdeaa095f01289b355f5c1b62d62 | 10,226 | py | Python | model/ivy/examples/ivyprobe.py | achrafJhidri/LeCompteEstBon | 06e1a3b3ca1ea9db2807e942ab8ab1bfe050ef90 | [
"MIT"
] | null | null | null | model/ivy/examples/ivyprobe.py | achrafJhidri/LeCompteEstBon | 06e1a3b3ca1ea9db2807e942ab8ab1bfe050ef90 | [
"MIT"
] | null | null | null | model/ivy/examples/ivyprobe.py | achrafJhidri/LeCompteEstBon | 06e1a3b3ca1ea9db2807e942ab8ab1bfe050ef90 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""An ivyprobe script for ivy-python
"""
import getopt
import os
import signal
import sys
import time
from ivy.std_api import *
try:
import readline
except ImportError:
pass
# The next line taken from https://pythonhosted.org/six/
# Copyright (c) 2010-2016 Benjamin Peterson
PY2 = sys.ve... | 31.95625 | 121 | 0.527968 | #!/usr/bin/env python
"""An ivyprobe script for ivy-python
"""
import getopt
import os
import signal
import sys
import time
from ivy.std_api import *
try:
import readline
except ImportError:
pass
# The next line taken from https://pythonhosted.org/six/
# Copyright (c) 2010-2016 Benjamin Peterson
PY2 = sys.ve... | 1,744 | 0 | 207 |
13f0bf3f81720f7d748fb3f51e9a0deabec5c318 | 2,619 | py | Python | code/threed/bunny-8.py | geo7/scientific-visualization-book | 71f6bac4db7ee2f26e88052fe7faa800303d8b00 | [
"BSD-2-Clause"
] | 2 | 2021-11-17T15:10:09.000Z | 2021-12-24T13:31:10.000Z | code/threed/bunny-8.py | WuShichao/scientific-visualization-book | 389766215aa6b234ed1cf560a3768437d41d1d37 | [
"BSD-2-Clause"
] | 1 | 2021-12-12T11:37:48.000Z | 2021-12-12T11:39:00.000Z | code/threed/bunny-8.py | WuShichao/scientific-visualization-book | 389766215aa6b234ed1cf560a3768437d41d1d37 | [
"BSD-2-Clause"
] | 2 | 2021-12-30T12:20:07.000Z | 2022-02-24T06:36:41.000Z | # ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: Nicolas P. Rougier
# License: BSD
# ----------------------------------------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
from mat... | 27.861702 | 86 | 0.498282 | # ----------------------------------------------------------------------------
# Title: Scientific Visualisation - Python & Matplotlib
# Author: Nicolas P. Rougier
# License: BSD
# ----------------------------------------------------------------------------
import numpy as np
import matplotlib.pyplot as plt
from mat... | 952 | 0 | 115 |
51d2d075f4d0557cd2911f1eddc617e7a8ab3538 | 2,254 | py | Python | usernames.py | bellisk/junkdrawer | 82aed500678ed60be61170c91371a4fc357b0e0c | [
"MIT"
] | null | null | null | usernames.py | bellisk/junkdrawer | 82aed500678ed60be61170c91371a4fc357b0e0c | [
"MIT"
] | null | null | null | usernames.py | bellisk/junkdrawer | 82aed500678ed60be61170c91371a4fc357b0e0c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8
"""
On sites where I don't want to use my standard username (@alexwlchan) --
for example, if I'm starring content but not creating anything -- I create
alliterative usernames from the names provided by Docker.
e.g. on GitHub I might use "goofy_galileo"
This script generates... | 24.769231 | 99 | 0.562999 | #!/usr/bin/env python
# -*- encoding: utf-8
"""
On sites where I don't want to use my standard username (@alexwlchan) --
for example, if I'm starring content but not creating anything -- I create
alliterative usernames from the names provided by Docker.
e.g. on GitHub I might use "goofy_galileo"
This script generates... | 1,464 | 0 | 23 |
5de2a6d52bf943d56f35adeb9187f13e7f5ef367 | 1,634 | py | Python | weblogic/domain/set_domain_web_app.py | codejsha/infrastructure | 01ff58fea0a7980fce30e37cb02a7c1217c46d9f | [
"Apache-2.0"
] | 4 | 2021-02-13T03:39:38.000Z | 2022-01-30T19:41:43.000Z | weblogic/domain/set_domain_web_app.py | codejsha/infrastructure | 01ff58fea0a7980fce30e37cb02a7c1217c46d9f | [
"Apache-2.0"
] | null | null | null | weblogic/domain/set_domain_web_app.py | codejsha/infrastructure | 01ff58fea0a7980fce30e37cb02a7c1217c46d9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
domain_name = os.environ['DOMAIN_NAME']
admin_server_listen_address = os.environ['ADMIN_SERVER_LISTEN_ADDRESS']
admin_server_listen_port = os.environ['ADMIN_SERVER_LISTEN_PORT']
admin_username = os.environ['ADMIN_USERNAME']
admin_password = os.environ['ADMIN_PASSWORD']
#########################... | 32.039216 | 89 | 0.700122 | #!/usr/bin/env python
domain_name = os.environ['DOMAIN_NAME']
admin_server_listen_address = os.environ['ADMIN_SERVER_LISTEN_ADDRESS']
admin_server_listen_port = os.environ['ADMIN_SERVER_LISTEN_PORT']
admin_username = os.environ['ADMIN_USERNAME']
admin_password = os.environ['ADMIN_PASSWORD']
#########################... | 943 | 0 | 23 |
675d9bc20bcb17ec6618dcfe4c7cdd3fbae6a54a | 430 | py | Python | psstguy.py | cshoe/psstguy | 949e41e0618c94af55839cc85ae61c198e0f6f31 | [
"MIT"
] | null | null | null | psstguy.py | cshoe/psstguy | 949e41e0618c94af55839cc85ae61c198e0f6f31 | [
"MIT"
] | null | null | null | psstguy.py | cshoe/psstguy | 949e41e0618c94af55839cc85ae61c198e0f6f31 | [
"MIT"
] | null | null | null | import argparse
PSSTGUY_TEMPLATE = """
┻┳|
┻┳|
┳┻|
┳┻|
┻┳|
┳┻|
┻┳|
┳┻| _
┻┳|•.•) {SECRET_TXT}
┳┻|⊂ノ
┻┳|
"""
if __name__ == '__main__':
cli()
| 13.4375 | 67 | 0.593023 | import argparse
PSSTGUY_TEMPLATE = """
┻┳|
┻┳|
┳┻|
┳┻|
┻┳|
┳┻|
┻┳|
┳┻| _
┻┳|•.•) {SECRET_TXT}
┳┻|⊂ノ
┻┳|
"""
def psstguy(secret_txt):
return PSSTGUY_TEMPLATE.format(SECRET_TXT=secret_txt)
def cli():
parser = argparse.ArgumentParser()
parser.add_argument('secret', type=str, help='Text to wh... | 220 | 0 | 46 |
1cd671c3be5a64d763588f759743f8475e24b225 | 1,325 | py | Python | dags/hooks/launch_hook.py | Baeke/airflow-training-skeleton | 2ba3bf3b4fb6ed2dc46343f28e0c0c94018ea0e6 | [
"Apache-2.0"
] | null | null | null | dags/hooks/launch_hook.py | Baeke/airflow-training-skeleton | 2ba3bf3b4fb6ed2dc46343f28e0c0c94018ea0e6 | [
"Apache-2.0"
] | null | null | null | dags/hooks/launch_hook.py | Baeke/airflow-training-skeleton | 2ba3bf3b4fb6ed2dc46343f28e0c0c94018ea0e6 | [
"Apache-2.0"
] | null | null | null | # hook gets lauches from an api
import os
import pathlib
import subprocess
import re
import time
import posixpath
import requests
import airflow
from airflow.hooks.base_hook import BaseHook
from airflow.exceptions import AirflowException
from airflow.utils import apply_defaults
from airflow.utils.log.logging_mixin im... | 28.804348 | 98 | 0.676981 | # hook gets lauches from an api
import os
import pathlib
import subprocess
import re
import time
import posixpath
import requests
import airflow
from airflow.hooks.base_hook import BaseHook
from airflow.exceptions import AirflowException
from airflow.utils import apply_defaults
from airflow.utils.log.logging_mixin im... | 802 | 0 | 53 |
6c27827373bf9f3e70133f9726ca95c89e845dbd | 10,166 | py | Python | pypet/tests/unittests/link_test.py | dilawar/pypet | 98673767d1e310a36ca1dcd9fe5b0d51e496db37 | [
"BSD-3-Clause"
] | 85 | 2015-01-16T11:50:40.000Z | 2021-12-26T08:15:42.000Z | pypet/tests/unittests/link_test.py | sthagen/pypet | 2769c74eff55c165c9002cc67611b96b1d2377ea | [
"BSD-3-Clause"
] | 51 | 2015-01-10T14:00:12.000Z | 2021-09-11T17:42:35.000Z | pypet/tests/unittests/link_test.py | sthagen/pypet | 2769c74eff55c165c9002cc67611b96b1d2377ea | [
"BSD-3-Clause"
] | 20 | 2015-01-16T11:51:15.000Z | 2021-12-26T08:15:44.000Z | __author__ = 'Robert Meyer'
from pypet import Trajectory, pypetexceptions, PickleResult
from pypet.tests.testutils.data import TrajectoryComparator
from pypet.tests.testutils.ioutils import make_temp_dir, run_suite, parse_args
import pypet.pypetexceptions as pex
if __name__ == '__main__':
opt_args = parse_args()... | 30.346269 | 95 | 0.647354 | __author__ = 'Robert Meyer'
from pypet import Trajectory, pypetexceptions, PickleResult
from pypet.tests.testutils.data import TrajectoryComparator
from pypet.tests.testutils.ioutils import make_temp_dir, run_suite, parse_args
import pypet.pypetexceptions as pex
class LinkTrajectoryTests(TrajectoryComparator):
... | 9,468 | 329 | 23 |
e01f0e2130ccb200cc8849e5c809e32f8c7481c0 | 10,752 | py | Python | main.py | anilgurses/DentalBioFeature | 530b4e9423d7a4a23e228af5e2c79e5e9c1c0ba2 | [
"MIT"
] | 3 | 2020-06-20T22:54:04.000Z | 2020-07-28T01:09:40.000Z | main.py | anilgurses/DentalBioFeature | 530b4e9423d7a4a23e228af5e2c79e5e9c1c0ba2 | [
"MIT"
] | 6 | 2020-11-13T18:55:26.000Z | 2022-02-10T01:44:49.000Z | main.py | anilgurses/DentalBioFeature | 530b4e9423d7a4a23e228af5e2c79e5e9c1c0ba2 | [
"MIT"
] | 2 | 2020-07-28T01:09:42.000Z | 2021-02-24T13:18:08.000Z | import torch
import torch.nn as nn
import torch.nn.init as init
import numpy as np
import pandas as pd
import torchvision
import cv2
from torchvision import transforms, utils, models
from tqdm import tqdm
from torch.utils.data import Dataset, DataLoader, ConcatDataset
import torchvision.models as models
from os import ... | 33.6 | 174 | 0.62128 | import torch
import torch.nn as nn
import torch.nn.init as init
import numpy as np
import pandas as pd
import torchvision
import cv2
from torchvision import transforms, utils, models
from tqdm import tqdm
from torch.utils.data import Dataset, DataLoader, ConcatDataset
import torchvision.models as models
from os import ... | 8,096 | 0 | 138 |
c1037305b47a670583e889aa11054e81cd5c4e4e | 944 | py | Python | Problem Solving Strategy/Bruteforce/recursive/code6.5 picnic.py | homveloper/Algorithm | ae2e063d75a3ecc2537f97ede002450b45da4aa5 | [
"Apache-2.0"
] | null | null | null | Problem Solving Strategy/Bruteforce/recursive/code6.5 picnic.py | homveloper/Algorithm | ae2e063d75a3ecc2537f97ede002450b45da4aa5 | [
"Apache-2.0"
] | null | null | null | Problem Solving Strategy/Bruteforce/recursive/code6.5 picnic.py | homveloper/Algorithm | ae2e063d75a3ecc2537f97ede002450b45da4aa5 | [
"Apache-2.0"
] | null | null | null | import random as r
from pprint import pprint
N = r.randint(2,10)
taken = [False for i in range(N)]
areFriends = setFriends(N)
pprint(setFriends(5))
print(N)
print(countParing(taken)) | 20.977778 | 67 | 0.573093 | import random as r
from pprint import pprint
N = r.randint(2,10)
taken = [False for i in range(N)]
def setFriends(N):
areFriends = [[False for i in range(N)] for i in range(N)]
for i in range(N):
for j in range(N):
if r.randint(0,4) == 4:
areFriends[i][j] = True
... | 713 | 0 | 46 |
4ba7b6e557b558066b308278cf237435af7ba35e | 1,719 | py | Python | batchfile/_functions.py | tassaron2/batchfile.py | b336281edf31f0989ef34ac07921587d82137ca6 | [
"MIT"
] | 1 | 2021-01-14T02:33:23.000Z | 2021-01-14T02:33:23.000Z | batchfile/_functions.py | tassaron2/batchfile.py | b336281edf31f0989ef34ac07921587d82137ca6 | [
"MIT"
] | 1 | 2021-07-27T04:41:34.000Z | 2022-01-30T22:30:47.000Z | batchfile/_functions.py | tassaron2/batchfile.py | b336281edf31f0989ef34ac07921587d82137ca6 | [
"MIT"
] | 1 | 2021-01-14T02:33:09.000Z | 2021-01-14T02:33:09.000Z | import os
import logging
from subprocess import call as system_call
if os.name == "nt":
else:
def find_sensitive_path(insensitive_path, dir=None):
"""
Borrowed from https://stackoverflow.com/a/37708342
Returns a case-sensitive filepath when given a case-insensitive path
"""
if dir is None:
... | 25.279412 | 86 | 0.630599 | import os
import logging
from subprocess import call as system_call
def make_debug_log():
try:
if os.path.exists("debug.log"):
os.remove("debug.log")
fh = logging.FileHandler("debug.log")
except PermissionError:
fh = logging.StreamHandler()
fh.setFormatter(
logg... | 729 | 0 | 123 |
93efafaae5cbedcbeb03d58613437820eb9eb7b2 | 922 | py | Python | tests/test_math.py | Roberto-Rod/tau-intro-to-pytest | 7aa9edffd48bb815556a204820b3084512d8595c | [
"Apache-2.0"
] | null | null | null | tests/test_math.py | Roberto-Rod/tau-intro-to-pytest | 7aa9edffd48bb815556a204820b3084512d8595c | [
"Apache-2.0"
] | null | null | null | tests/test_math.py | Roberto-Rod/tau-intro-to-pytest | 7aa9edffd48bb815556a204820b3084512d8595c | [
"Apache-2.0"
] | null | null | null |
#----------------------------------------------------------
# Imports
#----------------------------------------------------------
import pytest
#----------------------------------------------------------
# Simple test function
#----------------------------------------------------------
#-----------------... | 26.342857 | 60 | 0.286334 |
#----------------------------------------------------------
# Imports
#----------------------------------------------------------
import pytest
#----------------------------------------------------------
# Simple test function
#----------------------------------------------------------
def test_one_plus_... | 210 | 0 | 75 |
ce6d3a7aac811d27e2eca71adc5e2853a59ccd62 | 1,512 | py | Python | tests/utils.py | bigchaindb/bigchaindb-coalaip | d3269c52fe1efa5e09e527619f866ab88eb28b5b | [
"Apache-2.0"
] | 12 | 2016-12-13T09:47:52.000Z | 2018-05-09T16:17:50.000Z | tests/utils.py | bigchaindb/pycoalaip-bigchaindb | d3269c52fe1efa5e09e527619f866ab88eb28b5b | [
"Apache-2.0"
] | 34 | 2016-08-25T20:52:37.000Z | 2018-10-31T10:11:23.000Z | tests/utils.py | COALAIP/pycoalaip-bigchaindb | d3269c52fe1efa5e09e527619f866ab88eb28b5b | [
"Apache-2.0"
] | 8 | 2018-11-15T16:35:27.000Z | 2021-09-06T16:50:43.000Z | from time import sleep
from pytest import fail
def poll_result(fn, result_test_fn, *, max_checks=5, interval=1):
"""Polling utility for cases where we need to wait for BigchainDB
processing. After 'max_checks' attempts, will fail the test with the
last result.
Args:
fn (func): polling func... | 32.170213 | 77 | 0.648148 | from time import sleep
from pytest import fail
def poll_bdb_transaction_valid(driver, tx_id):
return poll_result(
lambda: driver.transactions.status(tx_id),
lambda result: result.get('status') == 'valid')
def poll_bdb_transaction(driver, tx_id):
return poll_result(
lambda: driver.tr... | 403 | 0 | 46 |
1347a91dd6a1979345d31c52a4691c6fb926d746 | 888 | py | Python | outpost24hiabclient/services/scanner_service.py | schubergphilis/outpost24hiabclient | 9c2ce2070e6df1a651e8b1fc5d4cce7a8129cba0 | [
"MIT"
] | null | null | null | outpost24hiabclient/services/scanner_service.py | schubergphilis/outpost24hiabclient | 9c2ce2070e6df1a651e8b1fc5d4cce7a8129cba0 | [
"MIT"
] | null | null | null | outpost24hiabclient/services/scanner_service.py | schubergphilis/outpost24hiabclient | 9c2ce2070e6df1a651e8b1fc5d4cce7a8129cba0 | [
"MIT"
] | null | null | null | from requests import Session
import xml.etree.ElementTree as ET
import json
from ..tools import (xmltools, log)
from outpost24hiabclient.clients.hiabclient import HiabClient
from ..entities.scanner import Scanner
| 26.909091 | 62 | 0.640766 | from requests import Session
import xml.etree.ElementTree as ET
import json
from ..tools import (xmltools, log)
from outpost24hiabclient.clients.hiabclient import HiabClient
from ..entities.scanner import Scanner
class ScannerService:
def __init__(self, hiabclient):
self._logger = log.getLogge... | 522 | 0 | 140 |
33985149ea1d0987285c00a442e1f49b20d1db48 | 1,733 | py | Python | test/test_twitter_controller.py | williamstrong/twitterdatahelper | 4d027d5ca981ec34cea18a1ba227bdf9c209a067 | [
"MIT"
] | null | null | null | test/test_twitter_controller.py | williamstrong/twitterdatahelper | 4d027d5ca981ec34cea18a1ba227bdf9c209a067 | [
"MIT"
] | null | null | null | test/test_twitter_controller.py | williamstrong/twitterdatahelper | 4d027d5ca981ec34cea18a1ba227bdf9c209a067 | [
"MIT"
] | null | null | null | import unittest
from social_networks.twitter_controller.twitter_api import *
@unittest.skip
# @unittest.skip
# @unittest.skip
@unittest.skip
| 25.865672 | 68 | 0.686671 | import unittest
from social_networks.twitter_controller.twitter_api import *
@unittest.skip
class TestTweets(unittest.TestCase):
def setUp(self):
self.db = Database("test")
self.db.create_collection("test")
self.collection_search = "test"
self.tweets = Tweets().api
def test_... | 1,063 | 85 | 436 |
740b40ea3c7841056150821499cc4460e7ef82c2 | 6,406 | py | Python | pyro/infer/reparam/hmm.py | nipunbatra/pyro | d5b0545c4f992d435692080db6969314a2c32f05 | [
"Apache-2.0"
] | 4,959 | 2017-11-03T14:39:17.000Z | 2019-02-04T16:14:30.000Z | pyro/infer/reparam/hmm.py | nipunbatra/pyro | d5b0545c4f992d435692080db6969314a2c32f05 | [
"Apache-2.0"
] | 985 | 2017-11-03T14:27:56.000Z | 2019-02-02T18:52:54.000Z | pyro/infer/reparam/hmm.py | nipunbatra/pyro | d5b0545c4f992d435692080db6969314a2c32f05 | [
"Apache-2.0"
] | 564 | 2017-11-03T15:05:55.000Z | 2019-01-31T14:02:29.000Z | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import pyro.distributions as dist
from .reparam import Reparam
class LinearHMMReparam(Reparam):
"""
Auxiliary variable reparameterizer for
:class:`~pyro.distributions.LinearHMM` random variables.
This defers to comp... | 39.300613 | 86 | 0.581486 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import pyro.distributions as dist
from .reparam import Reparam
class LinearHMMReparam(Reparam):
"""
Auxiliary variable reparameterizer for
:class:`~pyro.distributions.LinearHMM` random variables.
This defers to comp... | 3,969 | 0 | 54 |
6a5389932969a16f5465b3e30ab45e70089777c9 | 5,028 | py | Python | models.py | ericlearning/dynamic-budget-network | 2c3af2d8a30546223c2b2430285dbe02395cdafe | [
"MIT"
] | 1 | 2021-05-18T10:54:06.000Z | 2021-05-18T10:54:06.000Z | models.py | ericlearning/dynamic-budget-network | 2c3af2d8a30546223c2b2430285dbe02395cdafe | [
"MIT"
] | null | null | null | models.py | ericlearning/dynamic-budget-network | 2c3af2d8a30546223c2b2430285dbe02395cdafe | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
| 36.970588 | 111 | 0.559268 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, ic, oc, stride, dilation):
super(BasicBlock, self).__init__()
self.conv1 = nn.Conv2d(ic, oc, 3, stride, dilation, dilation, bias=False)
self.bn1 = nn.BatchNor... | 4,516 | 175 | 264 |
488ef511a7ad4be358f487fba7bd273f5d4e467c | 338 | py | Python | setup.py | jsza/tempus-map-updater | 3a122b5a454caec0fd36e0470c0fb61c4e77151c | [
"MIT"
] | null | null | null | setup.py | jsza/tempus-map-updater | 3a122b5a454caec0fd36e0470c0fb61c4e77151c | [
"MIT"
] | null | null | null | setup.py | jsza/tempus-map-updater | 3a122b5a454caec0fd36e0470c0fb61c4e77151c | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="mapupdater",
packages=find_packages() + ["twisted.plugins"],
install_requires=[
"autobahn == 0.13.0",
"twisted >= 15.0.0",
"treq",
"bs4",
"html5lib",
"service_identity >= 14.0.0"
],
include_pa... | 18.777778 | 51 | 0.56213 | from setuptools import find_packages, setup
setup(
name="mapupdater",
packages=find_packages() + ["twisted.plugins"],
install_requires=[
"autobahn == 0.13.0",
"twisted >= 15.0.0",
"treq",
"bs4",
"html5lib",
"service_identity >= 14.0.0"
],
include_pa... | 0 | 0 | 0 |
46da6b0e41f484404c71eeac80d9a1860465d912 | 4,329 | py | Python | revolutiontech/tests.py | RevolutionTech/revolutiontech.ca | a3f0f1526812554938674c4fc9e7ea90ed4ffe6d | [
"0BSD"
] | null | null | null | revolutiontech/tests.py | RevolutionTech/revolutiontech.ca | a3f0f1526812554938674c4fc9e7ea90ed4ffe6d | [
"0BSD"
] | 171 | 2017-11-02T05:39:37.000Z | 2022-03-07T01:13:53.000Z | revolutiontech/tests.py | RevolutionTech/revolutiontech.ca | a3f0f1526812554938674c4fc9e7ea90ed4ffe6d | [
"0BSD"
] | 1 | 2018-01-13T08:11:26.000Z | 2018-01-13T08:11:26.000Z | """
:Created: 18 September 2016
:Author: Lucas Connors
"""
from django.apps import apps
from django.contrib.auth.models import User
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.test import TransactionTestCase
from django.utils.text import slugify
from pigeon... | 33.3 | 109 | 0.678448 | """
:Created: 18 September 2016
:Author: Lucas Connors
"""
from django.apps import apps
from django.contrib.auth.models import User
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.test import TransactionTestCase
from django.utils.text import slugify
from pigeon... | 2,991 | 380 | 179 |
2975af89f566b9c1600b28d91830a51d9d0eb967 | 710 | py | Python | 37.py | kumaya/dcp | ffcd5f82382a201eaf5a83d39823e0b1da8203f7 | [
"Apache-2.0"
] | null | null | null | 37.py | kumaya/dcp | ffcd5f82382a201eaf5a83d39823e0b1da8203f7 | [
"Apache-2.0"
] | null | null | null | 37.py | kumaya/dcp | ffcd5f82382a201eaf5a83d39823e0b1da8203f7 | [
"Apache-2.0"
] | null | null | null | # The power set of a set is the set of all its subsets.
# Write a function that, given a set, generates its power set.
# For example, given the set {1, 2, 3},
# it should return {{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
import math
if __name__ == "__main__":
inp = [1, 2, 3]
print "Power set:",... | 28.4 | 74 | 0.556338 | # The power set of a set is the set of all its subsets.
# Write a function that, given a set, generates its power set.
# For example, given the set {1, 2, 3},
# it should return {{}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
import math
def power_set(inp, inp_size):
pow_set_size = int(math.pow(2, inp_si... | 341 | 0 | 23 |
81412bd5920489b7b302c99e7696722d6bbe293c | 1,448 | py | Python | setup.py | d0ugal/PyExecJS | a48570034f0e2303c7f01f916b22ca274ab1bb78 | [
"MIT"
] | 1 | 2016-05-25T14:55:10.000Z | 2016-05-25T14:55:10.000Z | setup.py | d0ugal/PyExecJS | a48570034f0e2303c7f01f916b22ca274ab1bb78 | [
"MIT"
] | null | null | null | setup.py | d0ugal/PyExecJS | a48570034f0e2303c7f01f916b22ca274ab1bb78 | [
"MIT"
] | 1 | 2020-04-26T20:40:34.000Z | 2020-04-26T20:40:34.000Z | #!/usr/bin/env python3
# -*- coding: ascii -*-
from __future__ import division, with_statement
from setuptools import setup, find_packages
import sys
import io
version = '1.3.0'
author = "Omoto Kenji"
license = "MIT License"
author_email = 'doloopwhile@gmail.com'
with io.open('README.rst', encoding='ascii') as fp:
... | 29.55102 | 54 | 0.65884 | #!/usr/bin/env python3
# -*- coding: ascii -*-
from __future__ import division, with_statement
from setuptools import setup, find_packages
import sys
import io
version = '1.3.0'
author = "Omoto Kenji"
license = "MIT License"
author_email = 'doloopwhile@gmail.com'
with io.open('README.rst', encoding='ascii') as fp:
... | 0 | 0 | 0 |
cbaef834272d4e86be138549c828d2a510836668 | 392 | py | Python | djangocms_baseplugins/image/tests/test_plugin.py | benzkji/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | 2 | 2019-04-14T01:31:22.000Z | 2020-03-05T13:06:57.000Z | djangocms_baseplugins/image/tests/test_plugin.py | benzkji/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | 32 | 2017-04-04T09:28:06.000Z | 2021-08-18T16:23:02.000Z | djangocms_baseplugins/image/tests/test_plugin.py | bnzk/djangocms-baseplugins | 7f041a030ed93dcdec70e4ca777b841846b8f2f2 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.test import TestCase
from djangocms_baseplugins.baseplugin.tests.base import BasePluginTestCase
from djangocms_baseplugins.image.cms_plugins import ImagePlugin
| 30.153846 | 74 | 0.841837 | from __future__ import unicode_literals
from django.test import TestCase
from djangocms_baseplugins.baseplugin.tests.base import BasePluginTestCase
from djangocms_baseplugins.image.cms_plugins import ImagePlugin
class ImagePluginTests(BasePluginTestCase, TestCase):
plugin_class = ImagePlugin
plugin_settings... | 0 | 154 | 23 |
592b5225e55304e085b4d1b8120049e5622fc81e | 1,744 | py | Python | covid-ie-counties.py | jonathanoneill/covid-19-ie-counties | 96e41ecc21db51605ae0b56de2a8f120a4f3cf51 | [
"MIT"
] | null | null | null | covid-ie-counties.py | jonathanoneill/covid-19-ie-counties | 96e41ecc21db51605ae0b56de2a8f120a4f3cf51 | [
"MIT"
] | null | null | null | covid-ie-counties.py | jonathanoneill/covid-19-ie-counties | 96e41ecc21db51605ae0b56de2a8f120a4f3cf51 | [
"MIT"
] | null | null | null | import argparse
import requests
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
# Get command line arguments
parser = argparse.ArgumentParser()
parser.add_argument("--county", help="county name - default: Cork", default="Cork")
parser.add_argument("--days", help="number of days to... | 38.755556 | 158 | 0.737385 | import argparse
import requests
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
# Get command line arguments
parser = argparse.ArgumentParser()
parser.add_argument("--county", help="county name - default: Cork", default="Cork")
parser.add_argument("--days", help="number of days to... | 0 | 0 | 0 |
6b8010c53ea890d81e8752f02649b787826a7d3c | 513 | py | Python | deepx/initialization/util.py | sharadmv/deepx | 07470e7a579a63427de1d5ff90b9fd00d3f54b61 | [
"MIT"
] | 74 | 2015-11-13T02:26:37.000Z | 2021-07-29T11:00:45.000Z | deepx/initialization/util.py | sharadmv/deepx | 07470e7a579a63427de1d5ff90b9fd00d3f54b61 | [
"MIT"
] | 21 | 2015-12-12T20:33:55.000Z | 2019-04-03T02:49:42.000Z | deepx/initialization/util.py | sharadmv/deepx | 07470e7a579a63427de1d5ff90b9fd00d3f54b61 | [
"MIT"
] | 19 | 2015-11-23T10:07:01.000Z | 2021-08-30T17:06:00.000Z | import numpy as np
def compute_fans(shape):
"""
Taken from Keras compute_fans
"""
if len(shape) == 2:
fan_in = shape[0]
fan_out = shape[1]
elif len(shape) in {3, 4, 5}:
receptive_field_size = np.prod(shape[:-2])
fan_in = shape[-2] * receptive_field_size
fan_o... | 27 | 50 | 0.588694 | import numpy as np
def compute_fans(shape):
"""
Taken from Keras compute_fans
"""
if len(shape) == 2:
fan_in = shape[0]
fan_out = shape[1]
elif len(shape) in {3, 4, 5}:
receptive_field_size = np.prod(shape[:-2])
fan_in = shape[-2] * receptive_field_size
fan_o... | 0 | 0 | 0 |
fcec1691c6e2bb66894ac1c871b88b9a8c33c212 | 6,561 | py | Python | backuppy/plugin.py | bartfeenstra/backuppy | bd9e5f98e5431829054ba18c8c4096d4c548a5cb | [
"MIT"
] | null | null | null | backuppy/plugin.py | bartfeenstra/backuppy | bd9e5f98e5431829054ba18c8c4096d4c548a5cb | [
"MIT"
] | 63 | 2018-03-04T12:04:27.000Z | 2018-07-14T12:08:51.000Z | backuppy/plugin.py | bartfeenstra/backuppy | bd9e5f98e5431829054ba18c8c4096d4c548a5cb | [
"MIT"
] | null | null | null | """Discover plugins."""
from functools import partial
from backuppy.location import PathSource, PathTarget, SshTarget, FirstAvailableTarget
from backuppy.notifier import NotifySendNotifier, CommandNotifier, FileNotifier, StdioNotifier
def _new(available_plugin_types, configuration, plugin_type, plugin_configuration_... | 38.368421 | 117 | 0.729919 | """Discover plugins."""
from functools import partial
from backuppy.location import PathSource, PathTarget, SshTarget, FirstAvailableTarget
from backuppy.notifier import NotifySendNotifier, CommandNotifier, FileNotifier, StdioNotifier
def _new(available_plugin_types, configuration, plugin_type, plugin_configuration_... | 0 | 0 | 0 |
e9e5379debd85027f14aad4d5ec00b0471ba2e19 | 5,412 | py | Python | realms/cards.py | zmitchell/realms | f2c2ec4c68849482c482b4400e6a07d98fe65ca9 | [
"MIT"
] | 3 | 2021-01-17T21:42:19.000Z | 2021-09-02T04:46:54.000Z | realms/cards.py | zmitchell/realms | f2c2ec4c68849482c482b4400e6a07d98fe65ca9 | [
"MIT"
] | 128 | 2017-05-20T17:37:00.000Z | 2018-01-13T13:59:28.000Z | realms/cards.py | zmitchell/realms | f2c2ec4c68849482c482b4400e6a07d98fe65ca9 | [
"MIT"
] | 2 | 2020-12-16T14:19:19.000Z | 2021-01-17T21:43:53.000Z | # -*- coding: utf-8 -*-
"""
.. module:: card
:synopsis: Encapsulate card behavior
.. moduleauthor:: Zach Mitchell <zmitchell@fastmail.com>
"""
from enum import Enum
from functools import total_ordering
from uuid import uuid4
class Card(object):
""" Represents a card in the game
Parameters
----------... | 29.57377 | 90 | 0.637842 | # -*- coding: utf-8 -*-
"""
.. module:: card
:synopsis: Encapsulate card behavior
.. moduleauthor:: Zach Mitchell <zmitchell@fastmail.com>
"""
from enum import Enum
from functools import total_ordering
from uuid import uuid4
class Card(object):
""" Represents a card in the game
Parameters
----------... | 1,267 | 0 | 182 |
7c0cd505979ff77714a4d97b684c6bf114bd5562 | 2,220 | py | Python | bolo/src/bolo/models.py | KrazyKahunaGuy/Bolo-Backend-Basic-Authentication- | a0c893674ecf3c73d6c5267298334167dd400670 | [
"BSD-3-Clause"
] | null | null | null | bolo/src/bolo/models.py | KrazyKahunaGuy/Bolo-Backend-Basic-Authentication- | a0c893674ecf3c73d6c5267298334167dd400670 | [
"BSD-3-Clause"
] | null | null | null | bolo/src/bolo/models.py | KrazyKahunaGuy/Bolo-Backend-Basic-Authentication- | a0c893674ecf3c73d6c5267298334167dd400670 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import SQLAlchemyError
db = SQLAlchemy()
class User(db.Model):
"""User object model."""
id = db.Column(db.Integer, primary_key=True)
userna... | 29.210526 | 73 | 0.682883 | from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import SQLAlchemyError
db = SQLAlchemy()
class User(db.Model):
"""User object model."""
id = db.Column(db.Integer, primary_key=True)
userna... | 939 | 0 | 266 |
2b7ea922b1b50864ba47e5d425f50e2e7cb8cb6f | 876 | py | Python | settings.py | imnobody0396/Nancy-The-Virtual-Assistant | 4016f9bc3741b1f59e298034aa6160e095f56ecf | [
"MIT"
] | null | null | null | settings.py | imnobody0396/Nancy-The-Virtual-Assistant | 4016f9bc3741b1f59e298034aa6160e095f56ecf | [
"MIT"
] | null | null | null | settings.py | imnobody0396/Nancy-The-Virtual-Assistant | 4016f9bc3741b1f59e298034aa6160e095f56ecf | [
"MIT"
] | null | null | null | ### Author - Raghav Maheshwari ###
import notify2
#from wolframalpha import Client
from os import listdir
#app_id = "KHHH6P-HTUJE286QJ"
#client = Client(app_id)
LOGO_PATH = '/home/imnobody0396/Documents/Nancy-The-Virtual-Assistant/logo.png'
#LOGO_PATH = '/home/imnobody0396/Desktop/nancy.png'
HOME_DIR = '/home/im... | 32.444444 | 84 | 0.736301 | ### Author - Raghav Maheshwari ###
import notify2
#from wolframalpha import Client
from os import listdir
def nancy_notify(text): #Desktop Notification
notify2.init('Nancy')
n = notify2.Notification('Nancy', text, icon=LOGO_PATH)
n.show()
#app_id = "KHHH6P-HTUJE286QJ"
#client = Client(app_id)
LOGO_... | 127 | 0 | 23 |
679661a570c502742ca61d7ab4cf33d5b5d080ab | 132 | py | Python | plugins/hash_md5.py | JeffKwasha/hachit | 3e406009f123dcc52565ad1fc6b7d3ef94990cb3 | [
"Apache-2.0"
] | 2 | 2018-06-26T18:08:45.000Z | 2018-07-24T19:58:15.000Z | plugins/hash_md5.py | JeffKwasha/hachit | 3e406009f123dcc52565ad1fc6b7d3ef94990cb3 | [
"Apache-2.0"
] | null | null | null | plugins/hash_md5.py | JeffKwasha/hachit | 3e406009f123dcc52565ad1fc6b7d3ef94990cb3 | [
"Apache-2.0"
] | null | null | null |
doc = {
'name': 'hash_md5',
'inputs' : ['whitelist_csv', 'vt_hash', 'et_hash_dns'],
'id': 'hash',
'cache': None,
}
| 16.5 | 59 | 0.507576 |
doc = {
'name': 'hash_md5',
'inputs' : ['whitelist_csv', 'vt_hash', 'et_hash_dns'],
'id': 'hash',
'cache': None,
}
| 0 | 0 | 0 |
65352633be477e5cd00a949652749d1ce542a8df | 4,840 | py | Python | __init__.py | lex/gg-no-re | 127fe1b39471cd6f48e980138a2089be91b72962 | [
"BSD-3-Clause"
] | null | null | null | __init__.py | lex/gg-no-re | 127fe1b39471cd6f48e980138a2089be91b72962 | [
"BSD-3-Clause"
] | 21 | 2015-03-31T08:36:19.000Z | 2020-07-14T09:08:07.000Z | __init__.py | lex/gg-no-re | 127fe1b39471cd6f48e980138a2089be91b72962 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import (Flask,
request,
render_template,
redirect,
url_for,
jsonify)
import json
from ming import (create_datastore,
Session,
collection,
Field,
Document,
schema)
from bson.objectid import ObjectId
fro... | 23.609756 | 90 | 0.540496 | # -*- coding: utf-8 -*-
from flask import (Flask,
request,
render_template,
redirect,
url_for,
jsonify)
import json
from ming import (create_datastore,
Session,
collection,
Field,
Document,
schema)
from bson.objectid import ObjectId
fro... | 3,001 | 0 | 264 |
22178a7be13446a3b89077bdda26ce8f363a7beb | 5,622 | py | Python | soc_016_conflict_protest_events/contents/src/__init__.py | bapludow/nrt-scripts | 99ed87e73b9428b9b3ee2d57f8d6b236b3892c5f | [
"MIT"
] | null | null | null | soc_016_conflict_protest_events/contents/src/__init__.py | bapludow/nrt-scripts | 99ed87e73b9428b9b3ee2d57f8d6b236b3892c5f | [
"MIT"
] | null | null | null | soc_016_conflict_protest_events/contents/src/__init__.py | bapludow/nrt-scripts | 99ed87e73b9428b9b3ee2d57f8d6b236b3892c5f | [
"MIT"
] | 1 | 2018-09-22T05:27:13.000Z | 2018-09-22T05:27:13.000Z | import os
import logging
import sys
import requests
from collections import OrderedDict
import datetime
import cartosql
# Constants
LATEST_URL = 'https://api.acleddata.com/acled/read?page={page}'
MIN_PAGES = 10
MAX_PAGES = 200
CLEAR_TABLE_FIRST = False
CARTO_TABLE = 'soc_016_conflict_protest_events'
CARTO_SCHEMA = O... | 30.389189 | 88 | 0.559765 | import os
import logging
import sys
import requests
from collections import OrderedDict
import datetime
import cartosql
# Constants
LATEST_URL = 'https://api.acleddata.com/acled/read?page={page}'
MIN_PAGES = 10
MAX_PAGES = 200
CLEAR_TABLE_FIRST = False
CARTO_TABLE = 'soc_016_conflict_protest_events'
CARTO_SCHEMA = O... | 984 | 0 | 23 |
4a1dacaacc72e64dff6c38cd7602e3a9155640fd | 8,000 | py | Python | custom/icds/management/commands/sanitize_phone_numbers.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | custom/icds/management/commands/sanitize_phone_numbers.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | custom/icds/management/commands/sanitize_phone_numbers.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
import csv342 as csv
import six
import sys
import time
from datetime import (
datetime,
date,
timedelta,
)
from io import open
from xml.etree import cElementTree as ElementTree
from django.core.management.base import BaseComma... | 40 | 112 | 0.67425 | from __future__ import absolute_import
from __future__ import unicode_literals
import csv342 as csv
import six
import sys
import time
from datetime import (
datetime,
date,
timedelta,
)
from io import open
from xml.etree import cElementTree as ElementTree
from django.core.management.base import BaseComma... | 5,877 | 738 | 69 |
6b3e6d9ab97884dda29f48787a2b106d9158e326 | 3,752 | py | Python | mesService/modules/RabbitMQ/interface_con.py | mabotech/mes_sv | 7d16e9176b5f58295f0eb8984a7291921c89603d | [
"MIT"
] | 2 | 2020-04-01T01:39:13.000Z | 2020-04-08T01:01:29.000Z | mesService/modules/RabbitMQ/interface_con.py | mabotech/mes_sv | 7d16e9176b5f58295f0eb8984a7291921c89603d | [
"MIT"
] | 1 | 2020-06-03T13:36:46.000Z | 2020-06-03T13:36:46.000Z | mesService/modules/RabbitMQ/interface_con.py | mabotech/mes_sv | 7d16e9176b5f58295f0eb8984a7291921c89603d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @createTime : 2020/3/24 13:56
# @author : 王江桥
# @fileName: mq_rpc_server.py
# @email: jiangqiao.wang@mabotech.com
import json
import os
import sys
import pika
from mesService.modules.RabbitMQ import logger
from mesService.modules.ERPInterface.erp_to_mes.deviartion.receive_deviating import ... | 39.494737 | 103 | 0.703891 | # -*- coding: utf-8 -*-
# @createTime : 2020/3/24 13:56
# @author : 王江桥
# @fileName: mq_rpc_server.py
# @email: jiangqiao.wang@mabotech.com
import json
import os
import sys
import pika
from mesService.modules.RabbitMQ import logger
from mesService.modules.ERPInterface.erp_to_mes.deviartion.receive_deviating import ... | 2,572 | 0 | 67 |
6f6ad3629df0d8e096fd9a7a8529b1c370d95d0c | 802 | py | Python | veracode/utils/report/__init__.py | ctcampbell/veracode-python | 519706785c4ab18c3392cd64fd79d7894adde10e | [
"BSD-3-Clause"
] | 13 | 2019-03-16T03:11:50.000Z | 2021-03-16T13:02:45.000Z | veracode/utils/report/__init__.py | ctcampbell/veracode-python | 519706785c4ab18c3392cd64fd79d7894adde10e | [
"BSD-3-Clause"
] | 6 | 2020-01-14T21:45:55.000Z | 2022-03-03T17:56:43.000Z | veracode/utils/report/__init__.py | ctcampbell/veracode-python | 519706785c4ab18c3392cd64fd79d7894adde10e | [
"BSD-3-Clause"
] | 10 | 2020-01-20T13:34:55.000Z | 2021-09-28T21:21:22.000Z | import json
import datetime
import click
from tabulate import tabulate
| 32.08 | 68 | 0.551122 | import json
import datetime
import click
from tabulate import tabulate
def display(data, headers, format):
if format == 'json':
json_data = []
for datum in list(data):
user_data = {}
for idx, header in enumerate(headers):
header = header.replace(' ', '_').low... | 707 | 0 | 23 |
5f455ec3720963f93456637150632dd3e1384567 | 376 | py | Python | CRL/crl_console.py | mrakitin/bnl-crl | 2e7fd5c3faef900ad96752a786ad53675a71c500 | [
"Apache-2.0"
] | null | null | null | CRL/crl_console.py | mrakitin/bnl-crl | 2e7fd5c3faef900ad96752a786ad53675a71c500 | [
"Apache-2.0"
] | 1 | 2016-06-23T03:53:11.000Z | 2016-06-23T04:11:53.000Z | CRL/crl_console.py | mrakitin/CRL | 2e7fd5c3faef900ad96752a786ad53675a71c500 | [
"Apache-2.0"
] | null | null | null | from CRL import CRL, DEFAULTS_FILE
from console_utils import console
if __name__ == '__main__':
"""
Example of execution:
$ python crl_console.py --cart_ids 2 4 6 7 8 --energy=21500 --p0=6.52
"d","d_ideal","f","p0","p1","p1_ideal"
0.000372455276869,-0.0669574652539,1.04864377922,6.52,1.2496275447... | 26.857143 | 85 | 0.680851 | from CRL import CRL, DEFAULTS_FILE
from console_utils import console
if __name__ == '__main__':
"""
Example of execution:
$ python crl_console.py --cart_ids 2 4 6 7 8 --energy=21500 --p0=6.52
"d","d_ideal","f","p0","p1","p1_ideal"
0.000372455276869,-0.0669574652539,1.04864377922,6.52,1.2496275447... | 0 | 0 | 0 |
d9f2eb70574d44d33177b279b349d26b5f2c74fe | 1,080 | py | Python | dephell/commands/package_search.py | OliverHofkens/dephell | 6303f416018910668f1635b70cd828a2fd2b2d9e | [
"MIT"
] | 1,880 | 2019-03-21T10:08:25.000Z | 2022-03-31T12:41:55.000Z | dephell/commands/package_search.py | rachmadaniHaryono/dephell | 0ef500c8f2d5f05244bac191b1b1383f68464cd2 | [
"MIT"
] | 356 | 2019-03-21T19:08:56.000Z | 2021-01-08T17:45:43.000Z | dephell/commands/package_search.py | rachmadaniHaryono/dephell | 0ef500c8f2d5f05244bac191b1b1383f68464cd2 | [
"MIT"
] | 157 | 2019-04-23T01:13:37.000Z | 2022-03-24T22:41:18.000Z | # built-in
from argparse import REMAINDER, ArgumentParser
# app
from ..actions import make_json
from ..config import builders
from ..repositories import get_repo
from .base import BaseCommand
class PackageSearchCommand(BaseCommand):
"""Search packages on PyPI.org or Anaconda Cloud.
"""
@staticmethod
| 30 | 98 | 0.64537 | # built-in
from argparse import REMAINDER, ArgumentParser
# app
from ..actions import make_json
from ..config import builders
from ..repositories import get_repo
from .base import BaseCommand
class PackageSearchCommand(BaseCommand):
"""Search packages on PyPI.org or Anaconda Cloud.
"""
@staticmethod
... | 711 | 0 | 53 |
5d37edd8588ff31c1bd517b216162c3226989c3f | 783 | py | Python | applications/tensorflow/cnns/inference/tests/test_get_weights.py | Alwaysproblem/examples-1 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | [
"MIT"
] | null | null | null | applications/tensorflow/cnns/inference/tests/test_get_weights.py | Alwaysproblem/examples-1 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | [
"MIT"
] | null | null | null | applications/tensorflow/cnns/inference/tests/test_get_weights.py | Alwaysproblem/examples-1 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Graphcore Ltd. All rights reserved.
import pytest
import sys
import tempfile
from pathlib import Path
sys.path.append(Path(__file__).parent.parent.as_posix())
from get_weights import get_weights # noqa
@pytest.mark.parametrize('model_name', ['VGG16', 'VGG19', 'ResNet101'])
@pytest.mark.para... | 34.043478 | 110 | 0.713921 | # Copyright (c) 2019 Graphcore Ltd. All rights reserved.
import pytest
import sys
import tempfile
from pathlib import Path
sys.path.append(Path(__file__).parent.parent.as_posix())
from get_weights import get_weights # noqa
@pytest.mark.parametrize('model_name', ['VGG16', 'VGG19', 'ResNet101'])
def test_unsupporte... | 229 | 0 | 44 |
4a486cd402d49964353a2cab6691bbd1d7bb7169 | 2,676 | py | Python | alf/examples/qrsac_halfcheetah_conf.py | Ji4chenLi/alf | c42ea1156baed47d78747231e96d6b2e91ef73ad | [
"Apache-2.0"
] | null | null | null | alf/examples/qrsac_halfcheetah_conf.py | Ji4chenLi/alf | c42ea1156baed47d78747231e96d6b2e91ef73ad | [
"Apache-2.0"
] | null | null | null | alf/examples/qrsac_halfcheetah_conf.py | Ji4chenLi/alf | c42ea1156baed47d78747231e96d6b2e91ef73ad | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 Horizon Robotics and ALF Contributors. 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... | 31.857143 | 105 | 0.779522 | # Copyright (c) 2021 Horizon Robotics and ALF Contributors. 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... | 0 | 0 | 0 |
c9234d54134295b07632d883d6d704a05391555c | 12,815 | py | Python | hera_pspec/tests/test_pspecbeam.py | adeliegorce/hera_pspec | 4d2fe17e2015b02b16683b29e2fd5530066dfd7b | [
"BSD-3-Clause"
] | 10 | 2018-01-28T06:59:22.000Z | 2021-02-23T19:23:09.000Z | hera_pspec/tests/test_pspecbeam.py | adeliegorce/hera_pspec | 4d2fe17e2015b02b16683b29e2fd5530066dfd7b | [
"BSD-3-Clause"
] | 314 | 2017-06-30T04:10:58.000Z | 2022-03-18T16:34:37.000Z | hera_pspec/tests/test_pspecbeam.py | adeliegorce/hera_pspec | 4d2fe17e2015b02b16683b29e2fd5530066dfd7b | [
"BSD-3-Clause"
] | 3 | 2017-10-26T00:21:01.000Z | 2022-01-21T20:59:18.000Z | import unittest, os
import pytest
import numpy as np
import pyuvdata as uv
from .. import pspecbeam, conversions
from hera_pspec.data import DATA_PATH
| 43.148148 | 120 | 0.612876 | import unittest, os
import pytest
import numpy as np
import pyuvdata as uv
from .. import pspecbeam, conversions
from hera_pspec.data import DATA_PATH
class Test_DataSet(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def runTest(self):
pass
def test_init... | 7,648 | 4,992 | 23 |
41da4c4cbe2cb06c57446c4f03b94412006622e1 | 7,804 | py | Python | graph_model/model_utils.py | abwilf/Factorized | 64e7d2a54bbfbc8b1c5a2130f2b941c376402fe6 | [
"MIT"
] | 22 | 2021-03-18T22:17:59.000Z | 2022-01-26T22:04:57.000Z | graph_model/model_utils.py | abwilf/Factorized | 64e7d2a54bbfbc8b1c5a2130f2b941c376402fe6 | [
"MIT"
] | 3 | 2021-06-10T15:09:32.000Z | 2022-01-05T07:15:48.000Z | graph_model/model_utils.py | abwilf/Factorized | 64e7d2a54bbfbc8b1c5a2130f2b941c376402fe6 | [
"MIT"
] | 7 | 2021-03-18T22:00:26.000Z | 2022-03-07T01:21:33.000Z | # noinspection PyTypeChecker
import torch
import operator
from functools import reduce
from torch import Tensor
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# NOTE: This is deprecated
# noinspection PyTypeChecker
def build_temporal_clique(node_index_aggr, node_types_aggr, order=1):
"... | 47.877301 | 115 | 0.662096 | # noinspection PyTypeChecker
import torch
import operator
from functools import reduce
from torch import Tensor
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# NOTE: This is deprecated
# noinspection PyTypeChecker
def build_temporal_clique(node_index_aggr, node_types_aggr, order=1):
"... | 770 | 0 | 46 |
4e6e72000b2d87a52287a3d60e9d9252edaceccb | 596 | py | Python | mariadb_kernel/maria_magics/cell_magic.py | robertbindar/mariadb_kernel-1 | 22a58dd0e4d2fbb687f0ed02415bd5278d3ed046 | [
"BSD-3-Clause"
] | null | null | null | mariadb_kernel/maria_magics/cell_magic.py | robertbindar/mariadb_kernel-1 | 22a58dd0e4d2fbb687f0ed02415bd5278d3ed046 | [
"BSD-3-Clause"
] | null | null | null | mariadb_kernel/maria_magics/cell_magic.py | robertbindar/mariadb_kernel-1 | 22a58dd0e4d2fbb687f0ed02415bd5278d3ed046 | [
"BSD-3-Clause"
] | null | null | null | """The type representing a cell magic"""
"""
A cell magic is a shortcut a user can write into a notebook cell.
The cell magic is written under the form '%%magic' and in principle
it operates over the entire code of the cell it is written in, e.g.
------cell
%%magic_python
from matplotlib import pyplot
x = [1,2,3]
pri... | 22.923077 | 67 | 0.723154 | """The type representing a cell magic"""
"""
A cell magic is a shortcut a user can write into a notebook cell.
The cell magic is written under the form '%%magic' and in principle
it operates over the entire code of the cell it is written in, e.g.
------cell
%%magic_python
from matplotlib import pyplot
x = [1,2,3]
pri... | 16 | 7 | 49 |
97f5b54a5ee911478fc724d8d50db832a8bfc3df | 2,693 | py | Python | mergify_engine/debug.py | guits/mergify-engine | 5b97e2697e4743ff9e049b90246f9161359655be | [
"Apache-2.0"
] | null | null | null | mergify_engine/debug.py | guits/mergify-engine | 5b97e2697e4743ff9e049b90246f9161359655be | [
"Apache-2.0"
] | null | null | null | mergify_engine/debug.py | guits/mergify-engine | 5b97e2697e4743ff9e049b90246f9161359655be | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 33.6625 | 75 | 0.65169 | # -*- encoding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 1,873 | 0 | 69 |
4f241b8800d6d477aa178396a5d9dccb53416289 | 3,610 | py | Python | src/plot_positions.py | pgleeson/Smoothed-Particle-Hydrodynamics | 5af5b68af8299a0076e27c2c0c90331d78de5ed2 | [
"MIT"
] | 1 | 2020-11-19T15:34:09.000Z | 2020-11-19T15:34:09.000Z | src/plot_positions.py | pgleeson/Smoothed-Particle-Hydrodynamics | 5af5b68af8299a0076e27c2c0c90331d78de5ed2 | [
"MIT"
] | null | null | null | src/plot_positions.py | pgleeson/Smoothed-Particle-Hydrodynamics | 5af5b68af8299a0076e27c2c0c90331d78de5ed2 | [
"MIT"
] | null | null | null | import sys
'''
Plot the positions from a saved Sibernetic position_buffer.txt file
'''
if __name__ == '__main__':
if len(sys.argv) == 2:
pos_file_name = sys.argv[1]
else:
pos_file_name = '../buffers/position_buffer.txt'
#pos_file_name = '../buffers/position_buffer0.txt'
... | 28.203125 | 125 | 0.531579 | import sys
'''
Plot the positions from a saved Sibernetic position_buffer.txt file
'''
def plot_positions(pos_file_name, rate_to_plot = 1):
postions_file = open(pos_file_name)
index = 0
xmin=-1
xmax=-1
ymin=-1
ymax=-1
zmin=-1
zmax=-1
import matplotlib.pyplot as plt
... | 2,975 | 0 | 22 |
2609d1d677ddabb363ce1962fc161bd5a3876f69 | 29 | py | Python | main/projects/scraper_image/__init__.py | Koubae/Portfolio | cb0add30e1f171a42a715f9a3549fb90eb9a7b1e | [
"MIT"
] | null | null | null | main/projects/scraper_image/__init__.py | Koubae/Portfolio | cb0add30e1f171a42a715f9a3549fb90eb9a7b1e | [
"MIT"
] | null | null | null | main/projects/scraper_image/__init__.py | Koubae/Portfolio | cb0add30e1f171a42a715f9a3549fb90eb9a7b1e | [
"MIT"
] | null | null | null | from .views import scrap_proj | 29 | 29 | 0.862069 | from .views import scrap_proj | 0 | 0 | 0 |
34325c6ced7e5e565e6d5e6d170b7e5214d2a73a | 531 | py | Python | api_framework/module/factory.py | alex-polosky/django-api-framework | 6441fb70294429979653da58787c4d0304ead117 | [
"BSD-2-Clause"
] | null | null | null | api_framework/module/factory.py | alex-polosky/django-api-framework | 6441fb70294429979653da58787c4d0304ead117 | [
"BSD-2-Clause"
] | null | null | null | api_framework/module/factory.py | alex-polosky/django-api-framework | 6441fb70294429979653da58787c4d0304ead117 | [
"BSD-2-Clause"
] | null | null | null | from .base import BaseModule
| 33.1875 | 129 | 0.623352 | from .base import BaseModule
class ModuleFactory(object):
@classmethod
def instance(cls):
if not hasattr(cls, '__SINGLETON'):
setattr(cls, '__SINGLETON', cls())
return getattr(cls, '__SINGLETON')
def __init__(self, **kwargs):
for name, cls in kwargs.items():
... | 401 | 78 | 23 |
4813a4524aa243806581235106f21817e676011b | 2,892 | py | Python | django_backend/operation/migrations/0001_initial.py | CapacitacionDesoft/travels-log | 9b70061ec6a9bde14c14b255498a04a85ecf642c | [
"MIT"
] | 2 | 2021-05-20T18:26:08.000Z | 2021-08-31T02:43:26.000Z | django_backend/operation/migrations/0001_initial.py | CapacitacionDesoft/travels-log | 9b70061ec6a9bde14c14b255498a04a85ecf642c | [
"MIT"
] | null | null | null | django_backend/operation/migrations/0001_initial.py | CapacitacionDesoft/travels-log | 9b70061ec6a9bde14c14b255498a04a85ecf642c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-05-24 03:26
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
| 49.016949 | 201 | 0.603734 | # Generated by Django 3.2.3 on 2021-05-24 03:26
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('fleet', '0001_initial'),
]
operations = [
migrations.Creat... | 0 | 2,716 | 23 |
343a8a8fbf0511dae08552337e415317ecb1a227 | 1,670 | py | Python | portal/apps/dashboard/management/commands/content.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/apps/dashboard/management/commands/content.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/apps/dashboard/management/commands/content.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | # -*- coding: utf-8 -*-
from os.path import join
from unicodecsv import writer
from progress.bar import Bar
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from core.models import Article
| 37.111111 | 108 | 0.678443 | # -*- coding: utf-8 -*-
from os.path import join
from unicodecsv import writer
from progress.bar import Bar
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from core.models import Article
def generate_report(year, progress):
articles = Articl... | 1,020 | 342 | 46 |
f01f60048b1356c05c016e15f4bfd6d2e4fa3925 | 1,221 | py | Python | test/view_helpers/Test_Google_Charts_Js.py | pbx-gs/OSBot_browser | 029d0d872a13b537ee0a99db3ed8b5ce9a50ce65 | [
"Apache-2.0"
] | null | null | null | test/view_helpers/Test_Google_Charts_Js.py | pbx-gs/OSBot_browser | 029d0d872a13b537ee0a99db3ed8b5ce9a50ce65 | [
"Apache-2.0"
] | 4 | 2021-02-17T00:33:39.000Z | 2021-02-26T01:51:08.000Z | test/view_helpers/Test_Google_Charts_Js.py | pbx-gs/OSBot_browser | 029d0d872a13b537ee0a99db3ed8b5ce9a50ce65 | [
"Apache-2.0"
] | 3 | 2021-02-17T01:04:49.000Z | 2021-04-30T06:27:11.000Z | from osbot_aws.helpers.Test_Helper import Test_Helper
from osbot_browser.browser.Browser_Lamdba_Helper import Browser_Lamdba_Helper
from osbot_browser.view_helpers.Google_Charts_Js import Google_Charts_Js
| 33.916667 | 77 | 0.593776 | from osbot_aws.helpers.Test_Helper import Test_Helper
from osbot_browser.browser.Browser_Lamdba_Helper import Browser_Lamdba_Helper
from osbot_browser.view_helpers.Google_Charts_Js import Google_Charts_Js
class Test_Google_Charts_Js(Test_Helper):
def setUp(self):
super().setUp()
self.headless =... | 864 | 20 | 131 |
1b88aab585798cf1d4b025cb86ca7128e492b2ae | 2,560 | py | Python | cowbird/services/service_factory.py | Ouranosinc/cowbird | 108195ca6abbd58fd75b180f6fa7d40eab0f8ea5 | [
"MIT"
] | 1 | 2021-02-04T18:56:36.000Z | 2021-02-04T18:56:36.000Z | cowbird/services/service_factory.py | Ouranosinc/cowbird | 108195ca6abbd58fd75b180f6fa7d40eab0f8ea5 | [
"MIT"
] | 12 | 2021-02-05T22:01:10.000Z | 2022-03-09T14:23:10.000Z | cowbird/services/service_factory.py | Ouranosinc/cowbird | 108195ca6abbd58fd75b180f6fa7d40eab0f8ea5 | [
"MIT"
] | null | null | null | import importlib
from typing import TYPE_CHECKING
from cowbird.config import get_all_configs
from cowbird.utils import SingletonMeta, get_config_path, get_logger, get_settings
if TYPE_CHECKING:
from typing import List
from cowbird.services.service import Service
LOGGER = get_logger(__name__)
VALID_SERVICES... | 38.208955 | 120 | 0.597656 | import importlib
from typing import TYPE_CHECKING
from cowbird.config import get_all_configs
from cowbird.utils import SingletonMeta, get_config_path, get_logger, get_settings
if TYPE_CHECKING:
from typing import List
from cowbird.services.service import Service
LOGGER = get_logger(__name__)
VALID_SERVICES... | 874 | 0 | 27 |
8e1272b327a1e5891533cfb82cc23fbfe3fd61da | 3,739 | py | Python | ven2/lib/python2.7/site-packages/zope/i18n/gettextmessagecatalog.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | 1 | 2021-09-15T20:22:39.000Z | 2021-09-15T20:22:39.000Z | ven2/lib/python2.7/site-packages/zope/i18n/gettextmessagecatalog.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | 43 | 2015-01-28T21:04:24.000Z | 2021-12-09T07:33:35.000Z | ven2/lib/python2.7/site-packages/zope/i18n/gettextmessagecatalog.py | manliu1225/Facebook_crawler | 0f75a1c4382dd4effc3178d84b99b0cad97337cd | [
"Apache-2.0"
] | 7 | 2015-04-03T09:00:54.000Z | 2020-05-14T14:16:25.000Z | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | 33.383929 | 78 | 0.632522 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | 350 | 120 | 49 |
8d0df3b9f9fb0c2e9a054a797ceb02f0c01dd3a7 | 6,968 | py | Python | demo/inference_demo_pod.py | JarvisUSTC/DARDet | debbf476e9750030db67f030a40cf8d4f03e46ee | [
"Apache-2.0"
] | null | null | null | demo/inference_demo_pod.py | JarvisUSTC/DARDet | debbf476e9750030db67f030a40cf8d4f03e46ee | [
"Apache-2.0"
] | null | null | null | demo/inference_demo_pod.py | JarvisUSTC/DARDet | debbf476e9750030db67f030a40cf8d4f03e46ee | [
"Apache-2.0"
] | null | null | null | from mmdet.apis import init_detector, inference_detector, show_result_pyplot
import mmcv
import argparse
import cv2
import numpy as np
import os
import time
import threading
import tqdm
def read_image(file_name, format=None, package="PIL"):
"""
Read an image into the given format.
Will apply rotation and f... | 35.55102 | 150 | 0.568886 | from mmdet.apis import init_detector, inference_detector, show_result_pyplot
import mmcv
import argparse
import cv2
import numpy as np
import os
import time
import threading
import tqdm
def get_parser():
parser = argparse.ArgumentParser(description="MMDetection demo for builtin models")
parser.add_argument(
... | 1,348 | 0 | 46 |
45b3f4d2f01baf34114eb55c6515bb1045fbc517 | 58 | py | Python | tests/io/__init__.py | libxd/libxd | aa0564bd8f0d81ba0f6f98af51e978b374cb8e9a | [
"MIT"
] | null | null | null | tests/io/__init__.py | libxd/libxd | aa0564bd8f0d81ba0f6f98af51e978b374cb8e9a | [
"MIT"
] | null | null | null | tests/io/__init__.py | libxd/libxd | aa0564bd8f0d81ba0f6f98af51e978b374cb8e9a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Created by libxd on 17-2-5.
#
| 11.6 | 29 | 0.517241 | # -*- coding: utf-8 -*-
#
# Created by libxd on 17-2-5.
#
| 0 | 0 | 0 |
0da49d5703a776e44119823aed60c1a085356f62 | 902 | py | Python | cvat/apps/stats/views.py | prismai/cvat | 72e7b35bf3238077b8f48bc0de8a67df3672486a | [
"MIT"
] | null | null | null | cvat/apps/stats/views.py | prismai/cvat | 72e7b35bf3238077b8f48bc0de8a67df3672486a | [
"MIT"
] | 18 | 2018-11-08T14:02:04.000Z | 2019-10-24T07:22:13.000Z | cvat/apps/stats/views.py | prismai/cvat | 72e7b35bf3238077b8f48bc0de8a67df3672486a | [
"MIT"
] | 1 | 2019-06-19T15:58:19.000Z | 2019-06-19T15:58:19.000Z | from django.http import JsonResponse, HttpResponse
from django.shortcuts import render
from django.contrib.auth import get_user_model
from cvat.apps.authentication.decorators import login_required
from cvat.apps.stats.services import collect_annotators_stats, save_job_stats
User = get_user_model()
@login_required
... | 25.055556 | 77 | 0.749446 | from django.http import JsonResponse, HttpResponse
from django.shortcuts import render
from django.contrib.auth import get_user_model
from cvat.apps.authentication.decorators import login_required
from cvat.apps.stats.services import collect_annotators_stats, save_job_stats
User = get_user_model()
@login_required
... | 480 | 0 | 66 |
d293a2b70a3abdba139320bda897658514f9dc5d | 67,542 | py | Python | qmla/model_for_learning.py | flynnbr11/QMD | ac8cfe1603658ee9b916452f29b99460ee5e3d44 | [
"MIT"
] | 9 | 2021-01-08T12:49:01.000Z | 2021-12-29T06:59:32.000Z | qmla/model_for_learning.py | flynnbr11/QMD | ac8cfe1603658ee9b916452f29b99460ee5e3d44 | [
"MIT"
] | 2 | 2021-02-22T20:42:25.000Z | 2021-02-22T22:22:59.000Z | qmla/model_for_learning.py | flynnbr11/QMD | ac8cfe1603658ee9b916452f29b99460ee5e3d44 | [
"MIT"
] | 9 | 2021-02-15T14:18:48.000Z | 2021-12-17T04:02:07.000Z | import numpy as np
import os
import sys
import time
import copy
import scipy
import random
import logging
import pandas as pd
import qinfer as qi
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import seaborn as sns
import redis
import pickle
try:
from lfig import LatexF... | 39.567663 | 122 | 0.567573 | import numpy as np
import os
import sys
import time
import copy
import scipy
import random
import logging
import pandas as pd
import qinfer as qi
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import seaborn as sns
import redis
import pickle
try:
from lfig import LatexF... | 3,802 | 0 | 116 |
a955cad44f733d05a08adefbb524ef5877bf5e8f | 1,052 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/ARB/blend_func_extended.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/ARB/blend_func_extended.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/ARB/blend_func_extended.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import... | 42.08 | 121 | 0.807985 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import... | 189 | 0 | 69 |
0ef9235a1f32dcb8ee6c05aaa20c8c69efd9fed4 | 2,520 | py | Python | nnet/libs/metric.py | spacekcraft/conv-tasnet | 0c2e65a977b0f5e8c6f5b07b343bf3d5474de684 | [
"MIT"
] | null | null | null | nnet/libs/metric.py | spacekcraft/conv-tasnet | 0c2e65a977b0f5e8c6f5b07b343bf3d5474de684 | [
"MIT"
] | null | null | null | nnet/libs/metric.py | spacekcraft/conv-tasnet | 0c2e65a977b0f5e8c6f5b07b343bf3d5474de684 | [
"MIT"
] | null | null | null | # wujian@2018
"""
SI-SNR(scale-invariant SNR/SDR) measure of speech separation
"""
import numpy as np
from itertools import permutations
import pdb
def si_snr(x, s, remove_dc=True):
"""
Compute SI-SNR
Arguments:
x: vector, enhanced/separated signal
s: vector, reference signal(ground trut... | 28.965517 | 81 | 0.598016 | # wujian@2018
"""
SI-SNR(scale-invariant SNR/SDR) measure of speech separation
"""
import numpy as np
from itertools import permutations
import pdb
def si_snr(x, s, remove_dc=True):
"""
Compute SI-SNR
Arguments:
x: vector, enhanced/separated signal
s: vector, reference signal(ground trut... | 205 | 0 | 81 |
1f3b2ef4e75a6aa2fa8414236acaba7f5022b6a2 | 793 | py | Python | resources/docker_hub.py | danigfavero/ada | 3c3842023c22510eedf207b23c418f22389622aa | [
"MIT"
] | null | null | null | resources/docker_hub.py | danigfavero/ada | 3c3842023c22510eedf207b23c418f22389622aa | [
"MIT"
] | null | null | null | resources/docker_hub.py | danigfavero/ada | 3c3842023c22510eedf207b23c418f22389622aa | [
"MIT"
] | null | null | null |
from .base import BaseResource
import requests | 28.321429 | 71 | 0.61034 |
from .base import BaseResource
import requests
class DockerHub(BaseResource):
def __init__(self, logger, telegram_broadcaster):
super().__init__(logger, telegram_broadcaster)
def on_post(self, req, res):
body = req.context.body
repo_name = body['repository']['repo_name']
tag ... | 634 | 9 | 104 |
dbef2f786e6e0f785cc9e3585126f9ad3cbd71d1 | 1,229 | py | Python | polynomials/least_squares.py | Zettergren-Courses/EP501_python | dabaa584e5158eb35197a43f38920a9ed7cc02b8 | [
"MIT"
] | null | null | null | polynomials/least_squares.py | Zettergren-Courses/EP501_python | dabaa584e5158eb35197a43f38920a9ed7cc02b8 | [
"MIT"
] | 1 | 2020-10-06T13:29:01.000Z | 2020-10-06T13:29:01.000Z | polynomials/least_squares.py | Zettergren-Courses/EP501_python | dabaa584e5158eb35197a43f38920a9ed7cc02b8 | [
"MIT"
] | 6 | 2020-09-01T10:35:59.000Z | 2020-09-18T10:12:59.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 07:53:36 2020
Illustrates linear least squares fitting of data
@author: zettergm
"""
# Imports
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../linear_algebra")
from elimtools import Gauss_elim,backsub
# Grid a... | 24.58 | 81 | 0.716843 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 07:53:36 2020
Illustrates linear least squares fitting of data
@author: zettergm
"""
# Imports
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../linear_algebra")
from elimtools import Gauss_elim,backsub
# Grid a... | 0 | 0 | 0 |