hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3901ca5ab816802d479374ebb2045f07d00596 | 2,584 | py | Python | whyis_classifier/test_whyis_classifier.py | roryschadler/whyis_classifier | e0c41fb2b01311c40979764265b79fd7bd771794 | [
"MIT"
] | null | null | null | whyis_classifier/test_whyis_classifier.py | roryschadler/whyis_classifier | e0c41fb2b01311c40979764265b79fd7bd771794 | [
"MIT"
] | null | null | null | whyis_classifier/test_whyis_classifier.py | roryschadler/whyis_classifier | e0c41fb2b01311c40979764265b79fd7bd771794 | [
"MIT"
] | null | null | null | """ Provides a testing framework for the Classifier Agent."""
from rdflib import *
from rdflib.namespace import RDF
from whyis_classifier import classifier_agent as ca
from whyis_classifier import testclassifier
from whyis_classifier import whyisclassifier
from whyis import nanopub
from whyis.test.agent_unit_test_ca... | 39.151515 | 114 | 0.664861 |
from rdflib import *
from rdflib.namespace import RDF
from whyis_classifier import classifier_agent as ca
from whyis_classifier import testclassifier
from whyis_classifier import whyisclassifier
from whyis import nanopub
from whyis.test.agent_unit_test_case import AgentUnitTestCase
from whyis.namespace import sio
... | true | true |
1c3902c997e7058ff982752470db9ce9e18556b9 | 21,647 | py | Python | cirq/sim/simulator.py | davemc84/Cirq | 713e016d32be99efb0fd4d3e6dbe6d9ca8421271 | [
"Apache-2.0"
] | 2 | 2019-04-02T09:16:28.000Z | 2019-05-25T18:35:19.000Z | cirq/sim/simulator.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | null | null | null | cirq/sim/simulator.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.613508 | 80 | 0.633714 |
from typing import (
Any, Dict, Hashable, Iterator, List, Tuple, Union, Optional)
import abc
import collections
import numpy as np
from cirq import circuits, ops, protocols, schedules, study, value
from cirq.sim import sampler
class SimulatesSamples(sampler.Sampler, metaclass=abc.ABCMeta):
def run_sweep... | true | true |
1c3903d9c614c2f662c464f37994e6c31336906e | 167 | py | Python | python/8kyu/opposites_attracks.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | 3 | 2021-06-08T01:57:13.000Z | 2021-06-26T10:52:47.000Z | python/8kyu/opposites_attracks.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | null | null | null | python/8kyu/opposites_attracks.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | 2 | 2021-06-10T21:20:13.000Z | 2021-06-30T10:13:26.000Z | """Kata url: https://www.codewars.com/kata/555086d53eac039a2a000083."""
def lovefunc(flower1: int, flower2: int) -> bool:
return bool(flower1 % 2 - flower2 % 2)
| 27.833333 | 71 | 0.688623 |
def lovefunc(flower1: int, flower2: int) -> bool:
return bool(flower1 % 2 - flower2 % 2)
| true | true |
1c3903ef11cf30ab618c0f857e68e2d515607a88 | 11,794 | py | Python | matched_markets_fixed/utils.py | ntellakula/fixed_matched_markets | 187827e614f398d414019a68ec093a39ca8fadfd | [
"MIT"
] | null | null | null | matched_markets_fixed/utils.py | ntellakula/fixed_matched_markets | 187827e614f398d414019a68ec093a39ca8fadfd | [
"MIT"
] | null | null | null | matched_markets_fixed/utils.py | ntellakula/fixed_matched_markets | 187827e614f398d414019a68ec093a39ca8fadfd | [
"MIT"
] | null | null | null | # Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 38.292208 | 80 | 0.664151 |
import random
import re
from typing import List
import altair as alt
from matched_markets_fixed.methodology import common_classes
import numpy as np
import pandas as pd
from pandas.api.types import is_numeric_dtype
TimeWindow = common_classes.TimeWindow
def kwarg_subdict(prefix, **kwargs):
rgx = re.compile(r'... | true | true |
1c3905c8a414bd1df7bcaf0c0e38c79c313ebff3 | 18,262 | py | Python | tests/test_main.py | dstathis/charmcraft | d892b3f301dfeef8a9ba597be30d521a1f29a30e | [
"Apache-2.0"
] | null | null | null | tests/test_main.py | dstathis/charmcraft | d892b3f301dfeef8a9ba597be30d521a1f29a30e | [
"Apache-2.0"
] | null | null | null | tests/test_main.py | dstathis/charmcraft | d892b3f301dfeef8a9ba597be30d521a1f29a30e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 33.324818 | 97 | 0.664604 |
import argparse
import io
import os
import pathlib
import subprocess
import sys
from unittest.mock import patch
from charmcraft import __version__, logsetup
from charmcraft.main import Dispatcher, main, COMMAND_GROUPS
from charmcraft.cmdbase import BaseCommand, CommandError
from tests.factory import create_command
i... | true | true |
1c3905ddf3a4668d405567ec585b908595c453dc | 1,824 | py | Python | gym_minigrid/envs/distshift.py | HelgeS/gym-minigrid | af7f0e9473d9ef1365779e27af3143c40dda07e0 | [
"BSD-3-Clause"
] | 2 | 2021-12-06T20:45:55.000Z | 2022-03-15T21:09:15.000Z | gym_minigrid/envs/distshift.py | HelgeS/gym-minigrid | af7f0e9473d9ef1365779e27af3143c40dda07e0 | [
"BSD-3-Clause"
] | null | null | null | gym_minigrid/envs/distshift.py | HelgeS/gym-minigrid | af7f0e9473d9ef1365779e27af3143c40dda07e0 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T21:04:37.000Z | 2022-01-11T21:04:37.000Z | from gym_minigrid.minigrid import *
from gym_minigrid.register import register
class DistShiftEnv(MiniGridEnv):
"""
Distributional shift environment.
"""
def __init__(
self,
width=9,
height=7,
agent_start_pos=(1,1),
agent_start_dir=0,
strip2_row=2
):... | 25.690141 | 56 | 0.611294 | from gym_minigrid.minigrid import *
from gym_minigrid.register import register
class DistShiftEnv(MiniGridEnv):
def __init__(
self,
width=9,
height=7,
agent_start_pos=(1,1),
agent_start_dir=0,
strip2_row=2
):
self.agent_start_pos = agent_start_pos
... | true | true |
1c3906b61a2bdcb4997a349270dd185d2a2fab40 | 5,883 | py | Python | catkin_ws/src/ros_pa3/scripts/markers_example.py | SwellMai/Terminator-800 | df7b31780aa950e407d4f50fbbfb150959ec4192 | [
"MIT"
] | null | null | null | catkin_ws/src/ros_pa3/scripts/markers_example.py | SwellMai/Terminator-800 | df7b31780aa950e407d4f50fbbfb150959ec4192 | [
"MIT"
] | null | null | null | catkin_ws/src/ros_pa3/scripts/markers_example.py | SwellMai/Terminator-800 | df7b31780aa950e407d4f50fbbfb150959ec4192 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Ref 1: http://wiki.ros.org/rviz/DisplayTypes/Marker
# Ref 2: https://answers.ros.org/question/203782/rviz-marker-line_strip-is-not-displayed/
import rospy
from visualization_msgs.msg import Marker
from geometry_msgs.msg import Point
rospy.loginfo('Rviz example')
def display_line_list(points... | 33.050562 | 95 | 0.654088 |
import rospy
from visualization_msgs.msg import Marker
from geometry_msgs.msg import Point
rospy.loginfo('Rviz example')
def display_line_list(points, publisher):
marker = Marker()
marker.header.frame_id = "/map"
marker.type = marker.LINE_LIST
marker.action = marker.ADD
... | true | true |
1c39089dece05e9048b900f460e1e2cfed1a3266 | 3,404 | py | Python | pcg_libraries/src/pcg_gazebo/task_manager/simulation_timer.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 42 | 2019-06-26T09:46:03.000Z | 2022-03-18T17:56:26.000Z | pcg_libraries/src/pcg_gazebo/task_manager/simulation_timer.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2019-07-18T10:36:05.000Z | 2020-10-02T15:26:32.000Z | pcg_libraries/src/pcg_gazebo/task_manager/simulation_timer.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-11-01T03:20:11.000Z | 2020-10-15T23:23:44.000Z | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | 40.52381 | 117 | 0.65658 |
from time import time, sleep
from threading import Thread
from rosgraph_msgs.msg import Clock
import rospy
from ..log import create_logger
class SimulationTimer(Thread):
def __init__(self, simulation_timeout=0, start_gazebo_timeout=60, ros_config=None,
output_log_dir=None, callback=None):
... | true | true |
1c390924433878cc4300f06e61fa07ebe7d9ea64 | 5,040 | py | Python | d3mdm/__main__.py | HDI-Project/d3m-dataset-manager | fdba854cd88a5731dae5213b6c32874a50610e7b | [
"MIT"
] | 3 | 2021-09-27T00:53:54.000Z | 2022-02-26T09:06:48.000Z | d3mdm/__main__.py | HDI-Project/d3m-dataset-manager | fdba854cd88a5731dae5213b6c32874a50610e7b | [
"MIT"
] | null | null | null | d3mdm/__main__.py | HDI-Project/d3m-dataset-manager | fdba854cd88a5731dae5213b6c32874a50610e7b | [
"MIT"
] | 2 | 2019-12-07T17:59:35.000Z | 2021-09-27T00:53:55.000Z | # -*- coding: utf-8 -*-
import gc
import logging
import os
from getpass import getpass
from d3mdm import d3m, local, s3
from d3mdm.splitter import add_dataset_splits
LOGGER = logging.getLogger(__name__)
def logging_setup(verbosity=1):
logger = logging.getLogger()
log_level = (3 - verbosity) * 10
fmt = ... | 31.698113 | 97 | 0.624405 |
import gc
import logging
import os
from getpass import getpass
from d3mdm import d3m, local, s3
from d3mdm.splitter import add_dataset_splits
LOGGER = logging.getLogger(__name__)
def logging_setup(verbosity=1):
logger = logging.getLogger()
log_level = (3 - verbosity) * 10
fmt = '%(levelname)s - %(messa... | true | true |
1c39094515abba4603acfc585af47cc40b45b3eb | 3,265 | py | Python | 2_structures_lineaires/liste.py | efloti/cours-nsi-terminale | 091df5518c25b50ef523a803ac747c63be76f670 | [
"CC0-1.0"
] | null | null | null | 2_structures_lineaires/liste.py | efloti/cours-nsi-terminale | 091df5518c25b50ef523a803ac747c63be76f670 | [
"CC0-1.0"
] | null | null | null | 2_structures_lineaires/liste.py | efloti/cours-nsi-terminale | 091df5518c25b50ef523a803ac747c63be76f670 | [
"CC0-1.0"
] | null | null | null | class Cellule:
"""Fondation du type ListeSimple"""
def __init__(self, valeur, suivante=None):
self.valeur = valeur
self._suivante = suivante # éviter de jouer avec ce pointeur...
@property
def suivante(self):
return self._suivante
def __str__(self):
if self._suivan... | 28.391304 | 108 | 0.583155 | class Cellule:
def __init__(self, valeur, suivante=None):
self.valeur = valeur
self._suivante = suivante
@property
def suivante(self):
return self._suivante
def __str__(self):
if self._suivante is None:
return f"{self.valeur}"
return f"{self.valeur}... | true | true |
1c3909bc4bd933e38f38b04f0fc61f7b50cb080d | 227 | py | Python | helper.py | mohammadjafri1992/simple_py_cli | a77b5fc27813b4b1572613d6ffb5f8b2d7647a55 | [
"MIT"
] | null | null | null | helper.py | mohammadjafri1992/simple_py_cli | a77b5fc27813b4b1572613d6ffb5f8b2d7647a55 | [
"MIT"
] | 1 | 2020-08-07T03:13:08.000Z | 2020-08-07T03:13:08.000Z | helper.py | mohammadjafri1992/simple_py_cli | a77b5fc27813b4b1572613d6ffb5f8b2d7647a55 | [
"MIT"
] | null | null | null | def _greet_user(user):
print("Hello, ", user)
def get_user():
user = input("What is your name?")
return user
def interface_with_user(user):
_greet_user(user)
# Test# 11: This is another test for GitKraken. Not merging.
| 17.461538 | 60 | 0.713656 | def _greet_user(user):
print("Hello, ", user)
def get_user():
user = input("What is your name?")
return user
def interface_with_user(user):
_greet_user(user)
| true | true |
1c390a4922c1bec8289b04732867bd2ca4a2da77 | 3,674 | py | Python | UNIOA/optimizer_running.py | Huilin-Li/UNIOA | 0f2527eac955a7193406775e5b71fab35f064422 | [
"MIT"
] | null | null | null | UNIOA/optimizer_running.py | Huilin-Li/UNIOA | 0f2527eac955a7193406775e5b71fab35f064422 | [
"MIT"
] | null | null | null | UNIOA/optimizer_running.py | Huilin-Li/UNIOA | 0f2527eac955a7193406775e5b71fab35f064422 | [
"MIT"
] | null | null | null | import time
import ioh
from datetime import datetime
from .algs import *
import sys, os
from pydoc import locate
# def optimizer_running(problems, instances, dimensions, num_runs, paras_set, optimizer_name, output_name):
# Which_alg = output_name.split("_")[1]
# folder_name = Which_alg + '_folder'
# data_n... | 44.26506 | 120 | 0.555253 | import time
import ioh
from datetime import datetime
from .algs import *
import sys, os
from pydoc import locate
def optimizer_running(problems, instances, dimensions, num_runs, paras_set, optimizer_name):
t = 0
optimizer_name_temp = optimizer_name
UNIOA_algs = ['BA_UNIOA', 'CSA_UNIOA', 'MFO_UNIOA', 'PSO... | true | true |
1c390c681c2d3660293795ee39f4549157cbf995 | 3,947 | py | Python | tests/unit/viz/test_legend.py | manmorjim/cartoframes | 4172e3dcdaedf207c10772a6dffe4f43b1993230 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/viz/test_legend.py | manmorjim/cartoframes | 4172e3dcdaedf207c10772a6dffe4f43b1993230 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/viz/test_legend.py | manmorjim/cartoframes | 4172e3dcdaedf207c10772a6dffe4f43b1993230 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from cartoframes.viz import Legend
class TestLegend(object):
def test_is_legend_defined(self):
"""Legend"""
assert Legend is not None
def test_legend_init_dict(self):
"""Legend should be properly initialized when passing a dict"""
legend = Legend({
'... | 36.546296 | 109 | 0.53965 | import pytest
from cartoframes.viz import Legend
class TestLegend(object):
def test_is_legend_defined(self):
assert Legend is not None
def test_legend_init_dict(self):
legend = Legend({
'type': 'color-category',
'prop': 'strokeColor',
'title': '[TITLE]',
... | true | true |
1c390d3b6b3f17050b35232ecaab5093ede0711c | 336 | py | Python | helpline/qpanel/rq_worker.py | mbai93/myhelpline-1 | 8c6130ad7ce9637565e83988a45c0b2ff9c5d698 | [
"BSD-3-Clause"
] | 1 | 2018-07-15T13:13:43.000Z | 2018-07-15T13:13:43.000Z | helpline/qpanel/rq_worker.py | mbai93/myhelpline-1 | 8c6130ad7ce9637565e83988a45c0b2ff9c5d698 | [
"BSD-3-Clause"
] | 14 | 2018-07-10T12:48:46.000Z | 2022-03-11T23:24:51.000Z | helpline/qpanel/rq_worker.py | mbai93/myhelpline-1 | 8c6130ad7ce9637565e83988a45c0b2ff9c5d698 | [
"BSD-3-Clause"
] | 5 | 2018-07-04T07:59:14.000Z | 2020-01-28T07:50:18.000Z | from panel.qpanel.job import start_process
from multiprocessing import Process
from rq_scheduler.scripts.rqscheduler import main
def start_jobs():
p = Process(target=start_process)
p.start()
start_scheduler()
def start_scheduler():
p = Process(target=main)
p.start()
if __name__ == '__main__':
... | 18.666667 | 49 | 0.72619 | from panel.qpanel.job import start_process
from multiprocessing import Process
from rq_scheduler.scripts.rqscheduler import main
def start_jobs():
p = Process(target=start_process)
p.start()
start_scheduler()
def start_scheduler():
p = Process(target=main)
p.start()
if __name__ == '__main__':
... | true | true |
1c390e23f28cb806d6b057d3dc02d45614c84697 | 996 | py | Python | account/urls.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | 1 | 2020-11-17T13:08:07.000Z | 2020-11-17T13:08:07.000Z | account/urls.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | null | null | null | account/urls.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from utils.site_settings import force_closed
from . import views
app_name = "account"
urlpatterns = [
url(r'^settings/profile/$', views.UpdateProfileView.as_view(), name='profile', kwargs=force_closed()),
url(r'^settings/security/$', views.my_password_change, name='security',... | 49.8 | 116 | 0.710843 | from django.conf.urls import url
from utils.site_settings import force_closed
from . import views
app_name = "account"
urlpatterns = [
url(r'^settings/profile/$', views.UpdateProfileView.as_view(), name='profile', kwargs=force_closed()),
url(r'^settings/security/$', views.my_password_change, name='security',... | true | true |
1c390f513174f38db1d3c2c1982522569666ed0f | 4,592 | py | Python | abusehelper/core/handlers.py | AbuseSA/abusehelper | 3e953632d20317c6bfe7eeb987ea9104d8f2a957 | [
"MIT"
] | 117 | 2015-11-30T09:52:52.000Z | 2021-11-24T23:58:13.000Z | abusehelper/core/handlers.py | AbuseSA/abusehelper | 3e953632d20317c6bfe7eeb987ea9104d8f2a957 | [
"MIT"
] | 57 | 2015-12-08T10:06:57.000Z | 2018-03-28T11:13:11.000Z | abusehelper/core/handlers.py | AbuseSA/abusehelper | 3e953632d20317c6bfe7eeb987ea9104d8f2a957 | [
"MIT"
] | 29 | 2016-02-08T08:24:30.000Z | 2022-03-31T13:53:15.000Z | import json
import collections
from . import bot, utils
class HandlerParam(bot.Param):
def parse(self, value):
try:
return json.loads(value)
except ValueError:
return value
def load_handler(handler_spec):
"""
>>> import logging
>>> log = logging.getLogger("du... | 28.521739 | 100 | 0.633493 | import json
import collections
from . import bot, utils
class HandlerParam(bot.Param):
def parse(self, value):
try:
return json.loads(value)
except ValueError:
return value
def load_handler(handler_spec):
if isinstance(handler_spec, collections.Mapping):
han... | true | true |
1c39104a082000a3ca295c53bab812baf8df9962 | 1,656 | py | Python | app/tool_results/microbe_directory/tests/factory.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/microbe_directory/tests/factory.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/microbe_directory/tests/factory.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | """Factory for generating Kraken result models for testing."""
from random import random
from app.tool_results.microbe_directory import MicrobeDirectoryToolResult
def create_values():
"""Create microbe directory values."""
return {
'gram_stain': {
'gram_positive': random(),
'... | 26.285714 | 73 | 0.490942 |
from random import random
from app.tool_results.microbe_directory import MicrobeDirectoryToolResult
def create_values():
return {
'gram_stain': {
'gram_positive': random(),
'gram_negative': random(),
'unknown': random(),
},
'microbiome_location': {
... | true | true |
1c391078e21a3e42bb1c73182f9827a91c3d06ee | 16,562 | py | Python | bird/_bird.py | wavelets/bird | ae0fe470a6517e34bfe8713fe389f0a2dd223afe | [
"BSD-3-Clause"
] | 1 | 2017-05-05T20:15:44.000Z | 2017-05-05T20:15:44.000Z | bird/_bird.py | wavelets/bird | ae0fe470a6517e34bfe8713fe389f0a2dd223afe | [
"BSD-3-Clause"
] | null | null | null | bird/_bird.py | wavelets/bird | ae0fe470a6517e34bfe8713fe389f0a2dd223afe | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manuel Moussallam <manuel.moussallam@gmail.com>
#
# Algorithm presented here are described in:
# Blind Denoising with Random Greedy Pursuits.
# Moussallam, M., Gramfort, A., Daudet, L., & Richard, G. (2014).
# IEE... | 37.134529 | 79 | 0.586282 |
from math import sqrt
import multiprocessing
from functools import partial
import numpy as np
from scipy.special import erfinv
from scipy import linalg
from joblib import Parallel, delayed, Memory
from mdct_tools import mdct_waveform, mdct, MDCT
def check_random_state(seed):
if seed is None or seed is np.rando... | true | true |
1c3910cf551f794e5779d21ed10f3b3bae511add | 7,975 | py | Python | lib/galaxy/workflow/resources/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | lib/galaxy/workflow/resources/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 52 | 2015-03-16T14:02:14.000Z | 2021-12-24T09:50:23.000Z | lib/galaxy/workflow/resources/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2016-03-21T12:54:06.000Z | 2016-03-21T12:54:06.000Z | """This package is something a placeholder for workflow resource parameters.
This file defines the baked in resource mapper types, and this package contains an
example of a more open, pluggable approach with greater control.
"""
import functools
import logging
import os
import sys
from copy import deepcopy
import yam... | 45.3125 | 138 | 0.61442 | import functools
import logging
import os
import sys
from copy import deepcopy
import yaml
import galaxy.util
log = logging.getLogger(__name__)
def get_resource_mapper_function(app):
config = app.config
mapper = getattr(config, "workflow_resource_params_mapper", None)
if mapper is None:
return... | true | true |
1c391150740bb4b197ee22feca4f17cc88087007 | 579 | py | Python | hellowebapp/settings_production.py | cesmus/hellowebapp | 83a1a0018d4ba3fffb6e4fc78d5502bffcd3ec50 | [
"MIT"
] | 49 | 2015-03-16T16:17:33.000Z | 2017-08-18T16:24:51.000Z | hellowebapp/settings_production.py | cesmus/hellowebapp | 83a1a0018d4ba3fffb6e4fc78d5502bffcd3ec50 | [
"MIT"
] | 1 | 2015-07-23T16:41:07.000Z | 2015-07-25T15:14:34.000Z | hellowebapp/settings_production.py | cesmus/hellowebapp | 83a1a0018d4ba3fffb6e4fc78d5502bffcd3ec50 | [
"MIT"
] | 16 | 2017-10-20T19:51:26.000Z | 2021-05-13T05:12:33.000Z | # Inherit from standard settings file for defaults
from hellowebapp.settings import *
# Everything below will override our standard settings:
# Parse database configuration from $DATABASE_URL
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Honor the 'X-Forwarded-Proto' header for request.is_... | 28.95 | 72 | 0.7962 | from hellowebapp.settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['*']
DEBUG = False
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
| true | true |
1c39140645f257e2db64c393e1af682f66d7985f | 60,018 | py | Python | test/onnx/test_utility_funs.py | wayi1/pytorch | e832ff58bf93fb1bcb2292219f6c98ab3c842484 | [
"Intel"
] | 2 | 2020-03-13T06:57:49.000Z | 2020-05-17T04:18:14.000Z | test/onnx/test_utility_funs.py | wayi1/pytorch | e832ff58bf93fb1bcb2292219f6c98ab3c842484 | [
"Intel"
] | null | null | null | test/onnx/test_utility_funs.py | wayi1/pytorch | e832ff58bf93fb1bcb2292219f6c98ab3c842484 | [
"Intel"
] | null | null | null | # Owner(s): ["module: onnx"]
import copy
import io
import unittest
import onnx
import torchvision
from autograd_helper import CustomFunction as CustomFunction2
from test_pytorch_common import (
TestCase,
run_tests,
skipIfNoCuda,
skipIfUnsupportedMaxOpsetVersion,
skipIfUnsupportedMinOpsetVersion,
)... | 36.133654 | 124 | 0.561915 |
import copy
import io
import unittest
import onnx
import torchvision
from autograd_helper import CustomFunction as CustomFunction2
from test_pytorch_common import (
TestCase,
run_tests,
skipIfNoCuda,
skipIfUnsupportedMaxOpsetVersion,
skipIfUnsupportedMinOpsetVersion,
)
from verify import verify
i... | true | true |
1c3914fede50b34f4b2f062825b934eb1dadb5ab | 1,545 | py | Python | setup.py | akalex/aiohttp_prometheus_exporter | d6e80e86a63bf568d175929e7a7d9ee039af5a68 | [
"MIT"
] | null | null | null | setup.py | akalex/aiohttp_prometheus_exporter | d6e80e86a63bf568d175929e7a7d9ee039af5a68 | [
"MIT"
] | null | null | null | setup.py | akalex/aiohttp_prometheus_exporter | d6e80e86a63bf568d175929e7a7d9ee039af5a68 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['aiohttp>=3', 'prometheus_client>=0.6', ]
setup_requirements... | 31.530612 | 101 | 0.680906 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['aiohttp>=3', 'prometheus_client>=0.6', ]
setup_requirements = ['pytest-runner', ]
test_requirements = ['... | true | true |
1c391551e0a5354e37d07670d112ae687c8b0879 | 4,663 | py | Python | python/zephyr/constants.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | 18 | 2021-05-27T04:40:38.000Z | 2022-02-08T19:46:31.000Z | python/zephyr/constants.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | null | null | null | python/zephyr/constants.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | 2 | 2021-11-07T12:42:00.000Z | 2022-03-01T12:51:54.000Z | FEATURE_MEAN = [491.3183898925781, 445.4370422363281, 104.46714782714844, -9.33281421661377, -0.3871251940727234, 15.277295112609863, 96.35192108154297, -21.257665634155273, 244.6168975830078, 454.5150146484375, 452.712890625, 93.33969116210938, 96.92170715332031, 0.4305391013622284, 0.39397644996643066, 0.101892776787... | 43.175926 | 798 | 0.668239 | FEATURE_MEAN = [491.3183898925781, 445.4370422363281, 104.46714782714844, -9.33281421661377, -0.3871251940727234, 15.277295112609863, 96.35192108154297, -21.257665634155273, 244.6168975830078, 454.5150146484375, 452.712890625, 93.33969116210938, 96.92170715332031, 0.4305391013622284, 0.39397644996643066, 0.101892776787... | true | true |
1c3915f44fe7d8202f20a3318d5e5194a160286a | 2,067 | py | Python | UiMainWindowLoginByFaceID.py | kyvipro113/FaceID_Realtime_Detect | b4942091ade34b38b761808386991b919d29c1d3 | [
"MIT"
] | 1 | 2021-07-01T10:25:14.000Z | 2021-07-01T10:25:14.000Z | Ui_MainWindowLoginByFaceID.py | kyvipro113/FaceID_Realtime_Detect | b4942091ade34b38b761808386991b919d29c1d3 | [
"MIT"
] | null | null | null | Ui_MainWindowLoginByFaceID.py | kyvipro113/FaceID_Realtime_Detect | b4942091ade34b38b761808386991b919d29c1d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_MainWindowLoginByFaceID.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 ... | 41.34 | 117 | 0.742622 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindowLoginByFaceID(object):
def setupUi(self, MainWindowLoginByFaceID):
MainWindowLoginByFaceID.setObjectName("MainWindowLoginByFaceID")
MainWindowLoginByFaceID.resize(640, 497)
self.centralwidget = QtWidgets.QWidget(MainWindowLog... | true | true |
1c3916a50958fbd9772e08319d3a2903ea41a9cc | 4,057 | py | Python | hublib/rappture/test/test_number.py | hzclarksm/hublib | e8f2168d80464b6343b980e30fdd552d1b0c2479 | [
"MIT"
] | 6 | 2017-05-23T19:17:29.000Z | 2022-02-24T00:36:46.000Z | hublib/rappture/test/test_number.py | hzclarksm/hublib | e8f2168d80464b6343b980e30fdd552d1b0c2479 | [
"MIT"
] | 1 | 2019-02-13T13:35:57.000Z | 2019-02-13T13:35:57.000Z | hublib/rappture/test/test_number.py | hzclarksm/hublib | e8f2168d80464b6343b980e30fdd552d1b0c2479 | [
"MIT"
] | 6 | 2017-09-12T19:51:12.000Z | 2021-01-13T23:43:57.000Z | from __future__ import print_function
import pytest
import os, sys
import numpy as np
sys.path.insert(0, os.path.abspath('../../..'))
import hublib.rappture as rappture
from hublib import ureg, Q_
class TestNumber:
@classmethod
def setup_class(cls):
print("cls", cls)
cls.io = rappture.RapXML... | 33.808333 | 72 | 0.624846 | from __future__ import print_function
import pytest
import os, sys
import numpy as np
sys.path.insert(0, os.path.abspath('../../..'))
import hublib.rappture as rappture
from hublib import ureg, Q_
class TestNumber:
@classmethod
def setup_class(cls):
print("cls", cls)
cls.io = rappture.RapXML... | true | true |
1c3916bec016c984790c755d9995f06946dcc489 | 2,686 | py | Python | Banking-Inference/code.py | Shubham-0212/ga-learner-dsmp-repo | ed2ebf13fb959746be3b97a6ece0a1784ebb0166 | [
"MIT"
] | null | null | null | Banking-Inference/code.py | Shubham-0212/ga-learner-dsmp-repo | ed2ebf13fb959746be3b97a6ece0a1784ebb0166 | [
"MIT"
] | null | null | null | Banking-Inference/code.py | Shubham-0212/ga-learner-dsmp-repo | ed2ebf13fb959746be3b97a6ece0a1784ebb0166 | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
data... | 26.333333 | 133 | 0.686895 | import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
sample_size=2000
z_critical = stats.norm.ppf(q = 0.95)
data=pd.read_csv(path)
data_sample=data.sample(n=sample_size,random_state=0)
sample_mean=data_sample.installment.mea... | true | true |
1c3917526a4c1ededdf3dc3e73ebc732d89b14e3 | 232 | py | Python | source/py/cmd/osclient.py | shakfu/pymax | 67dca5990581d91ffcedf800e585e87646ab94d4 | [
"CC0-1.0"
] | 25 | 2020-08-06T12:38:07.000Z | 2022-03-23T17:35:09.000Z | source/py/cmd/osclient.py | shakfu/pymax | 67dca5990581d91ffcedf800e585e87646ab94d4 | [
"CC0-1.0"
] | 7 | 2021-04-02T02:58:56.000Z | 2022-03-31T22:58:19.000Z | source/py/cmd/osclient.py | shakfu/pymax | 67dca5990581d91ffcedf800e585e87646ab94d4 | [
"CC0-1.0"
] | 3 | 2021-04-04T05:47:07.000Z | 2021-06-26T03:30:02.000Z | #!/usr/bin/env python3
from pythonosc import udp_client
client = udp_client.SimpleUDPClient('127.0.0.1', 7000)
while True:
data = input(">>> ")
#client.send_message("/py", data)
client.send_message("/eval", data)
| 15.466667 | 54 | 0.663793 |
from pythonosc import udp_client
client = udp_client.SimpleUDPClient('127.0.0.1', 7000)
while True:
data = input(">>> ")
client.send_message("/eval", data)
| true | true |
1c391a12cc5d4d5f2963496063d83640b2a90b80 | 2,250 | py | Python | qa/rpc-tests/forknotify.py | jwflame/nyancoin-client-1 | 6bc7686edf8bc4b058d504ce0ab40b7cd2a0597b | [
"MIT"
] | 21 | 2021-11-13T17:36:02.000Z | 2022-03-02T15:11:57.000Z | qa/rpc-tests/forknotify.py | jwflame/nyancoin-client-1 | 6bc7686edf8bc4b058d504ce0ab40b7cd2a0597b | [
"MIT"
] | 3 | 2021-07-07T13:55:07.000Z | 2021-11-29T21:05:11.000Z | qa/rpc-tests/forknotify.py | BillionaerCoin/BillionaerCoin | 0e11b0b1fec56191b4ca93496d1881648498cb84 | [
"MIT"
] | 3 | 2021-11-19T23:50:41.000Z | 2021-12-06T23:20:26.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -alertnotify
#
from test_framework.test_framework import BitcoinTestFramework
from test_framew... | 33.58209 | 108 | 0.628 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ForkNotifyTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = False
alert_filename = None
def setup_network(self):
... | true | true |
1c391b33607695b408094e1bb3752379aca6ea4e | 9,199 | py | Python | asposecellscloud/models/name.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | 3 | 2018-05-23T03:16:26.000Z | 2020-11-07T11:42:41.000Z | asposecellscloud/models/name.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | null | null | null | asposecellscloud/models/name.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | 4 | 2018-08-29T18:45:05.000Z | 2021-03-25T07:59:56.000Z | # coding: utf-8
"""
Copyright (c) 2021 Aspose.Cells Cloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | 26.819242 | 160 | 0.576584 |
from pprint import pformat
from six import iteritems
import re
class Name(object):
swagger_types = {
'link': 'Link',
'comment': 'str',
'text': 'str',
'worksheet_index': 'int',
'r1_c1_refers_to': 'str',
'refers_to': 'str',
'is_referred': 'bool',
... | true | true |
1c391b51a86d75659c38a1a5c1fac94f650f2f1e | 463 | py | Python | accounts/migrations/0033_auto_20210130_1852.py | noelsj007/ecommerceweb | e00edfe9110d2cc54deebd97043e0aa152c8afd4 | [
"Unlicense"
] | null | null | null | accounts/migrations/0033_auto_20210130_1852.py | noelsj007/ecommerceweb | e00edfe9110d2cc54deebd97043e0aa152c8afd4 | [
"Unlicense"
] | null | null | null | accounts/migrations/0033_auto_20210130_1852.py | noelsj007/ecommerceweb | e00edfe9110d2cc54deebd97043e0aa152c8afd4 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-30 13:22
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0032_auto_20210130_1852'),
]
operations = [
migrations.AlterField(
model_name='order',
n... | 23.15 | 99 | 0.62851 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0032_auto_20210130_1852'),
]
operations = [
migrations.AlterField(
model_name='order',
name='order_ordered_date',
field=mode... | true | true |
1c391b838cbaebe0ca5300f1f7adc660e5fbd8a6 | 5,058 | py | Python | earth/weather/observations.py | justquick/python-earth | ced0d1fff7c2de77df5b51ea490137b0d84d1d96 | [
"MIT"
] | 2 | 2017-12-18T13:12:48.000Z | 2020-01-21T04:18:03.000Z | earth/weather/observations.py | justquick/python-earth | ced0d1fff7c2de77df5b51ea490137b0d84d1d96 | [
"MIT"
] | null | null | null | earth/weather/observations.py | justquick/python-earth | ced0d1fff7c2de77df5b51ea490137b0d84d1d96 | [
"MIT"
] | null | null | null | import os,sys
import zipfile
from xml.parsers.expat import ParserCreate
from datetime import datetime
from urllib import urlretrieve
from earth.core.config import conf
from earth.geo import Location
URL = 'http://www.weather.gov/data/current_obs/all_xml.zip'
URI = os.path.join(conf.data_root, 'observation... | 32.216561 | 87 | 0.536576 | import os,sys
import zipfile
from xml.parsers.expat import ParserCreate
from datetime import datetime
from urllib import urlretrieve
from earth.core.config import conf
from earth.geo import Location
URL = 'http://www.weather.gov/data/current_obs/all_xml.zip'
URI = os.path.join(conf.data_root, 'observation... | true | true |
1c391bf60123cd731b897495b6cd872ba6fb0af6 | 36,120 | py | Python | mrcnn/utils.py | HuchieWuchie/Mask_RCNN | 93f74c5fae72852563b1d3e0e22428d6abf86dc2 | [
"MIT"
] | null | null | null | mrcnn/utils.py | HuchieWuchie/Mask_RCNN | 93f74c5fae72852563b1d3e0e22428d6abf86dc2 | [
"MIT"
] | null | null | null | mrcnn/utils.py | HuchieWuchie/Mask_RCNN | 93f74c5fae72852563b1d3e0e22428d6abf86dc2 | [
"MIT"
] | null | null | null | """
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import sys
import os
import logging
import math
import random
import numpy as np
import tensorflow as tf
import scipy
import skimage.color
imp... | 38.101266 | 117 | 0.612846 |
import sys
import os
import logging
import math
import random
import numpy as np
import tensorflow as tf
import scipy
import skimage.color
import skimage.io
import skimage.transform
import urllib.request
import shutil
import warnings
from distutils.version import LooseVersion
COCO_MODEL_URL = "https://github.com/matt... | true | true |
1c391d1d141f20c8bb8ed6f008fe68893348f80f | 3,342 | py | Python | alipay/aop/api/domain/ExtendParams.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 32 | 2018-05-24T08:40:15.000Z | 2019-04-04T20:54:55.000Z | alipay/aop/api/domain/ExtendParams.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 7 | 2018-05-24T08:42:59.000Z | 2020-09-06T23:18:46.000Z | alipay/aop/api/domain/ExtendParams.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 13 | 2018-04-25T11:27:58.000Z | 2021-03-15T12:22:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class ExtendParams(object):
def __init__(self):
self._card_type = None
self._hb_fq_num = None
self._hb_fq_seller_percent = None
self._industry_reflux_info = None
... | 33.089109 | 97 | 0.642729 | import json
from alipay.aop.api.constant.ParamConstants import *
class ExtendParams(object):
def __init__(self):
self._card_type = None
self._hb_fq_num = None
self._hb_fq_seller_percent = None
self._industry_reflux_info = None
self._sys_service_provider_id = None
@pr... | true | true |
1c391d5749ac5da2b4e8d01b62d28ba30433503f | 2,530 | py | Python | attacks/single_key/z3_solver.py | Marius-Sheppard/RsaCtfTool | c6b8e00d54d56e9bcbf0a324e90ecd9446aef839 | [
"Beerware"
] | null | null | null | attacks/single_key/z3_solver.py | Marius-Sheppard/RsaCtfTool | c6b8e00d54d56e9bcbf0a324e90ecd9446aef839 | [
"Beerware"
] | null | null | null | attacks/single_key/z3_solver.py | Marius-Sheppard/RsaCtfTool | c6b8e00d54d56e9bcbf0a324e90ecd9446aef839 | [
"Beerware"
] | 1 | 2021-12-13T15:58:47.000Z | 2021-12-13T15:58:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from z3 import Solver, Int ,set_param
from attacks.abstract_attack import AbstractAttack
from gmpy2 import isqrt
from lib.utils import timeout, TimeoutError
from lib.keys_wrapper import PrivateKey
set_param('parallel.enable', True)
class Attack(AbstractAttack):
def _... | 32.857143 | 112 | 0.514625 |
from z3 import Solver, Int ,set_param
from attacks.abstract_attack import AbstractAttack
from gmpy2 import isqrt
from lib.utils import timeout, TimeoutError
from lib.keys_wrapper import PrivateKey
set_param('parallel.enable', True)
class Attack(AbstractAttack):
def __init__(self, timeout=60):
super().__in... | true | true |
1c391d5ed05feb1b0e23072fa66197a57a837bf5 | 2,565 | py | Python | quartical/apps/backup.py | JSKenyon/QuartiCal | 2113855b080cfecc4a1c77cc9dad346ef3619716 | [
"MIT"
] | null | null | null | quartical/apps/backup.py | JSKenyon/QuartiCal | 2113855b080cfecc4a1c77cc9dad346ef3619716 | [
"MIT"
] | null | null | null | quartical/apps/backup.py | JSKenyon/QuartiCal | 2113855b080cfecc4a1c77cc9dad346ef3619716 | [
"MIT"
] | 1 | 2022-03-18T14:30:04.000Z | 2022-03-18T14:30:04.000Z | import argparse
from daskms import xds_from_ms, xds_to_table
from daskms.experimental.zarr import xds_to_zarr, xds_from_zarr
from pathlib import Path
import time
import dask
def backup():
parser = argparse.ArgumentParser(
description='Backup any Measurement Set column to zarr. Backups will '
... | 27 | 78 | 0.607797 | import argparse
from daskms import xds_from_ms, xds_to_table
from daskms.experimental.zarr import xds_to_zarr, xds_from_zarr
from pathlib import Path
import time
import dask
def backup():
parser = argparse.ArgumentParser(
description='Backup any Measurement Set column to zarr. Backups will '
... | true | true |
1c391df30f14ef0733bb52c2cdf6a72596913d64 | 3,649 | py | Python | esm/pretrained.py | konstin/esm | a39894c079ce314e1c0aaa607e8ae498111910a0 | [
"MIT"
] | null | null | null | esm/pretrained.py | konstin/esm | a39894c079ce314e1c0aaa607e8ae498111910a0 | [
"MIT"
] | null | null | null | esm/pretrained.py | konstin/esm | a39894c079ce314e1c0aaa607e8ae498111910a0 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import esm
import torch
from argparse import Namespace
from .constants import proteinseq_toks
def load_model_and_alphabet(model_name):
if... | 36.128713 | 110 | 0.725678 |
import esm
import torch
from argparse import Namespace
from .constants import proteinseq_toks
def load_model_and_alphabet(model_name):
if model_name.endswith(".pt"): return load_model_and_alphabet_local(model_name)
else:
return load_model_and_alphabet_hub(model_name)
def load_model_and_alpha... | true | true |
1c391e377f29162aac3ee75ece710cd23fd7e65e | 799 | py | Python | ds2bim2-Adrian/usuariodao.py | adrianpastore/trabds2bim2 | 72232dfb27cdaf3d8ff99fccabf8612a803d4903 | [
"MIT"
] | null | null | null | ds2bim2-Adrian/usuariodao.py | adrianpastore/trabds2bim2 | 72232dfb27cdaf3d8ff99fccabf8612a803d4903 | [
"MIT"
] | null | null | null | ds2bim2-Adrian/usuariodao.py | adrianpastore/trabds2bim2 | 72232dfb27cdaf3d8ff99fccabf8612a803d4903 | [
"MIT"
] | null | null | null | from usuario import Usuario
from psycopg2 import connect
from dao import DAO
class UsuarioDao(DAO):
def __init__(self):
super().__init__()
def buscar(self, usuario):
with connect(self._dados_con) as conn:
cur = conn.cursor()
cur.execute('SELECT * from "usuario" WHER... | 31.96 | 117 | 0.56821 | from usuario import Usuario
from psycopg2 import connect
from dao import DAO
class UsuarioDao(DAO):
def __init__(self):
super().__init__()
def buscar(self, usuario):
with connect(self._dados_con) as conn:
cur = conn.cursor()
cur.execute('SELECT * from "usuario" WHER... | true | true |
1c391e3c0170ee0db296746981821f8c2c9b4e91 | 4,200 | py | Python | pypureclient/flashblade/FB_2_3/models/session_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flashblade/FB_2_3/models/session_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flashblade/FB_2_3/models/session_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashBlade REST API
A lightweight client for FlashBlade REST API 2.3, developed by Pure Storage, Inc. (http://www.purestorage.com/).
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typ... | 33.870968 | 530 | 0.585952 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flashblade.FB_2_3 import models
class SessionGetResponse(object):
swagger_types = {
'continuation_token': 'str',
'total_item_count': 'int',
'items': 'list... | true | true |
1c391e5facf5849bcd0968b6857debfbf9b22501 | 9,328 | py | Python | bincrafters/build_shared.py | rockdreamer/bincrafters-package-tools | 75781ef72e756888dd6f1dc48ae8bb3c97afb5ea | [
"MIT"
] | null | null | null | bincrafters/build_shared.py | rockdreamer/bincrafters-package-tools | 75781ef72e756888dd6f1dc48ae8bb3c97afb5ea | [
"MIT"
] | null | null | null | bincrafters/build_shared.py | rockdreamer/bincrafters-package-tools | 75781ef72e756888dd6f1dc48ae8bb3c97afb5ea | [
"MIT"
] | null | null | null | import os
import re
import platform
from conans.client import conan_api
from cpt.packager import ConanMultiPackager
from cpt.tools import split_colon_env
from cpt.remotes import RemotesManager
# from cpt.ci_manager import *
from cpt.printer import Printer
from bincrafters.build_paths import BINCRAFTERS_REPO_URL, BINCRA... | 34.168498 | 129 | 0.690609 | import os
import re
import platform
from conans.client import conan_api
from cpt.packager import ConanMultiPackager
from cpt.tools import split_colon_env
from cpt.remotes import RemotesManager
from cpt.printer import Printer
from bincrafters.build_paths import BINCRAFTERS_REPO_URL, BINCRAFTERS_LOGIN_USERNAME, BINCRAFTE... | true | true |
1c391f6ada311b0f09e8e8fff75fe6bb1938ca33 | 12,918 | py | Python | chap11/cuppa4_interp/cuppa4_fe.py | lutzhamel/plipy-code | b4f8c465cddbc0b51d6d6487535d3171ce4f13ee | [
"BSD-2-Clause"
] | 1 | 2021-09-17T15:27:53.000Z | 2021-09-17T15:27:53.000Z | chap11/cuppa4/cuppa4_fe.py | lutzhamel/plipy-code | b4f8c465cddbc0b51d6d6487535d3171ce4f13ee | [
"BSD-2-Clause"
] | null | null | null | chap11/cuppa4/cuppa4_fe.py | lutzhamel/plipy-code | b4f8c465cddbc0b51d6d6487535d3171ce4f13ee | [
"BSD-2-Clause"
] | 4 | 2021-09-17T15:27:58.000Z | 2021-11-17T01:18:37.000Z | '''
Frontend for our Cuppa4 language - builds an AST where each
node is of the shape,
(TYPE, [arg1, arg2, arg3,...])
here TYPE is a string describing the node type.
'''
# helper function to compute the type of a function
def formalargs_type(args):
output_list = list()
for a in args[1]:
(FORMALARG... | 35.00813 | 105 | 0.549466 | def formalargs_type(args):
output_list = list()
for a in args[1]:
(FORMALARG, type, id) = a
output_list.append(type)
return ('LIST', output_list)
stmt_lookahead = [
'VOID_TYPE',
'INTEGER_TYPE',
'FLOAT_TYPE',
'STRING_TYPE',
'ID',
'GET',
'PUT',
'RETURN',
'... | true | true |
1c39203f14a1c227593183bf54901f5572687633 | 7,062 | py | Python | packages/python/plotly/plotly/tests/test_io/test_to_from_json.py | astafan8/plotly.py | c67f80067210d66e61c2f8f5e3b746a9a6c739a0 | [
"MIT"
] | 1 | 2022-01-22T04:10:29.000Z | 2022-01-22T04:10:29.000Z | packages/python/plotly/plotly/tests/test_io/test_to_from_json.py | astafan8/plotly.py | c67f80067210d66e61c2f8f5e3b746a9a6c739a0 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/tests/test_io/test_to_from_json.py | astafan8/plotly.py | c67f80067210d66e61c2f8f5e3b746a9a6c739a0 | [
"MIT"
] | 1 | 2022-02-07T14:42:35.000Z | 2022-02-07T14:42:35.000Z | import plotly.graph_objs as go
import plotly.io as pio
import pytest
import plotly
import json
import os
import tempfile
from unittest.mock import MagicMock
from pathlib import Path
# fixtures
# --------
@pytest.fixture
def fig1(request):
return go.Figure(
data=[
{"type": "scattergl", "marker"... | 26.851711 | 85 | 0.65817 | import plotly.graph_objs as go
import plotly.io as pio
import pytest
import plotly
import json
import os
import tempfile
from unittest.mock import MagicMock
from pathlib import Path
@pytest.fixture
def fig1(request):
return go.Figure(
data=[
{"type": "scattergl", "marker": {"color": "green"}},... | true | true |
1c39218de99cf3055114621cc77d6dfaa98a58d0 | 3,699 | py | Python | flask_apispec/apidoc.py | henryfjordan/flask-apispec | a643f15586f4fdc16372e939805d00a0b23eafe3 | [
"MIT"
] | null | null | null | flask_apispec/apidoc.py | henryfjordan/flask-apispec | a643f15586f4fdc16372e939805d00a0b23eafe3 | [
"MIT"
] | null | null | null | flask_apispec/apidoc.py | henryfjordan/flask-apispec | a643f15586f4fdc16372e939805d00a0b23eafe3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import six
from pkg_resources import parse_version
import apispec
from apispec.core import VALID_METHODS
from apispec.ext.marshmallow import swagger
from marshmallow import Schema
from marshmallow.utils import is_instance_or_subclass
from flask_apispec.paths import rule_to_path,... | 34.570093 | 86 | 0.641254 |
import copy
import six
from pkg_resources import parse_version
import apispec
from apispec.core import VALID_METHODS
from apispec.ext.marshmallow import swagger
from marshmallow import Schema
from marshmallow.utils import is_instance_or_subclass
from flask_apispec.paths import rule_to_path, rule_to_params
from fla... | true | true |
1c3926366b55551ae92b5873afdccbfc3221ebce | 4,769 | py | Python | src/main/python/main.py | sterzy/rc-snitch | 0e6889e1797c3eae2e5f502f7f01cfee7e1bfa20 | [
"MIT"
] | null | null | null | src/main/python/main.py | sterzy/rc-snitch | 0e6889e1797c3eae2e5f502f7f01cfee7e1bfa20 | [
"MIT"
] | null | null | null | src/main/python/main.py | sterzy/rc-snitch | 0e6889e1797c3eae2e5f502f7f01cfee7e1bfa20 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from commands import block, send, sniff, profile
from pathlib import Path
from util import check_binary, check_tri_state, check_tri_state_pair
import argparse
def main():
parser = argparse.ArgumentParser(description='''A utility to sniff and \
transmit with a 433MH... | 37.551181 | 82 | 0.477039 |
from commands import block, send, sniff, profile
from pathlib import Path
from util import check_binary, check_tri_state, check_tri_state_pair
import argparse
def main():
parser = argparse.ArgumentParser(description='''A utility to sniff and \
transmit with a 433MHz transceiver using an Arduino.''')
subparse... | true | true |
1c39284718027a242c5b3d74f179ac8b43a95aed | 9,481 | py | Python | tests/test_miso_helper.py | ferrumnet/MISO | d1698e1819d7cacbddb7fb979dc0c9a613d55cc9 | [
"Apache-2.0"
] | 80 | 2020-11-30T00:25:51.000Z | 2022-03-15T12:02:37.000Z | brownie/tests/test_miso_helper.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 8 | 2021-09-01T17:33:57.000Z | 2022-02-25T20:11:27.000Z | brownie/tests/test_miso_helper.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 30 | 2020-11-30T00:25:57.000Z | 2022-01-09T06:01:27.000Z | from brownie import accounts, web3, Wei, reverts, chain
from brownie.network.transaction import TransactionReceipt
from brownie.convert import to_address
import pytest
from brownie import Contract
from settings import *
from test_token_factory import _create_token
# reset the chain after every test case
@pytest.fixt... | 32.693103 | 136 | 0.702141 | from brownie import accounts, web3, Wei, reverts, chain
from brownie.network.transaction import TransactionReceipt
from brownie.convert import to_address
import pytest
from brownie import Contract
from settings import *
from test_token_factory import _create_token
@pytest.fixture(autouse=True)
def isolation(fn_isola... | true | true |
1c392b3f62972fca6f39a129839f79d030fd890e | 6,362 | py | Python | test/functional/feature_dersig.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/feature_dersig.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/feature_dersig.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Knotcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP66 (DER SIG).
Test that the DERSIG soft-fork activates at (regtest) height 1251.
"""
from te... | 41.311688 | 105 | 0.668029 |
from test_framework.test_framework import KnotcoinTestFramework
from test_framework.util import *
from test_framework.mininode import *
from test_framework.blocktools import create_coinbase, create_block
from test_framework.script import CScript
from io import BytesIO
DERSIG_HEIGHT = 1251
REJECT_INVALID = 16
REJECT_... | true | true |
1c392d05cd539b3dbedd2273b39a258c3a351840 | 513 | py | Python | setup.py | robert-pathy/graphite-cleaner | fc6e59cf25307cad532c4323fb8d62372e7bffbd | [
"MIT"
] | null | null | null | setup.py | robert-pathy/graphite-cleaner | fc6e59cf25307cad532c4323fb8d62372e7bffbd | [
"MIT"
] | null | null | null | setup.py | robert-pathy/graphite-cleaner | fc6e59cf25307cad532c4323fb8d62372e7bffbd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='graphite-cleaner',
version='0.1.3',
description='Graphite Whisper stale database files remover',
author='Services Wroclaw Team',
author_email='svc-code@opera.com',
url='https://github.com/operasoftware/graphite-clea... | 25.65 | 64 | 0.674464 |
from setuptools import setup, find_packages
setup(
name='graphite-cleaner',
version='0.1.3',
description='Graphite Whisper stale database files remover',
author='Services Wroclaw Team',
author_email='svc-code@opera.com',
url='https://github.com/operasoftware/graphite-cleaner',
packages=fin... | true | true |
1c3930693a5c124be3065fafbd3e7b798d91134e | 2,211 | py | Python | tools/utils.py | mpfeppat/mpfeppat | 85ecf09a3d8c33177967ea404b2274b0d4f2d2df | [
"Apache-2.0"
] | 1 | 2016-02-10T10:41:27.000Z | 2016-02-10T10:41:27.000Z | tools/utils.py | mpfeppat/mpfeppat | 85ecf09a3d8c33177967ea404b2274b0d4f2d2df | [
"Apache-2.0"
] | null | null | null | tools/utils.py | mpfeppat/mpfeppat | 85ecf09a3d8c33177967ea404b2274b0d4f2d2df | [
"Apache-2.0"
] | null | null | null | """Some format conversion tools.
"""
from base64 import b64encode
from gmpy import mpz
from re import sub
# from gmpy2 import mpz, bit_length, f_divmod_2exp
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
b64toOct = {}
i = 0
for key in "ABCDEFGH":
b64toOct[key] = "0" + str(i)
i... | 22.793814 | 78 | 0.561284 |
from base64 import b64encode
from gmpy import mpz
from re import sub
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
b64toOct = {}
i = 0
for key in "ABCDEFGH":
b64toOct[key] = "0" + str(i)
i += 1
for key in "IJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=":
b64toO... | true | true |
1c393135d2924153274c5bf9832e7a13fb57ac31 | 751 | py | Python | app/core/tests/test_utils.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 13 | 2018-07-31T15:37:47.000Z | 2021-12-20T04:48:13.000Z | app/core/tests/test_utils.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 25 | 2019-12-10T20:03:48.000Z | 2022-03-11T23:26:11.000Z | app/core/tests/test_utils.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 4 | 2020-03-24T20:13:50.000Z | 2022-02-05T20:40:48.000Z | from django.contrib.auth import get_user_model
from django.test import TestCase
from core.models import MyProfile
from core.utils import content_file_name
class ContentFileTests(TestCase):
def setUp(self):
self.user = get_user_model().objects.create_user(
email="test@gmail.com",
... | 27.814815 | 89 | 0.679095 | from django.contrib.auth import get_user_model
from django.test import TestCase
from core.models import MyProfile
from core.utils import content_file_name
class ContentFileTests(TestCase):
def setUp(self):
self.user = get_user_model().objects.create_user(
email="test@gmail.com",
... | true | true |
1c393157c4d04005e6e3d429b955d205cafcbc5c | 2,939 | py | Python | code/utils/bbox_helper.py | cruiseresearchgroup/DroTrack | d2adb8d8ee6d142f89c16cd906c848903ba1617b | [
"MIT"
] | 13 | 2020-08-19T14:33:04.000Z | 2021-11-29T05:43:45.000Z | code/utils/bbox_helper.py | cruiseresearchgroup/DroTrack | d2adb8d8ee6d142f89c16cd906c848903ba1617b | [
"MIT"
] | 1 | 2021-06-12T04:51:17.000Z | 2022-02-22T09:43:17.000Z | code/utils/bbox_helper.py | cruiseresearchgroup/DroTrack | d2adb8d8ee6d142f89c16cd906c848903ba1617b | [
"MIT"
] | 1 | 2021-06-23T07:06:07.000Z | 2021-06-23T07:06:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 13:37:39 2020
@author: Ali Hamdi; ali.ali@rmit.edu.au
"""
from collections import OrderedDict
import cv2
import numpy as np
from scipy.spatial import distance
def intersection_over_union(boxA, boxB):
# determine the (x, y)-coordinates of the intersection rectangl... | 31.945652 | 89 | 0.595781 |
from collections import OrderedDict
import cv2
import numpy as np
from scipy.spatial import distance
def intersection_over_union(boxA, boxB):
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
interArea = max(0, xB - xA + 1) * m... | true | true |
1c393288d85c3a10aa4301a9be8d466f103489b4 | 9,643 | py | Python | tests/api/test_datafeed.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 81 | 2015-01-13T15:16:43.000Z | 2021-11-12T20:51:56.000Z | tests/api/test_datafeed.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 1 | 2015-07-30T06:17:55.000Z | 2015-07-30T08:09:14.000Z | tests/api/test_datafeed.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 30 | 2015-03-26T11:55:46.000Z | 2021-07-22T22:16:39.000Z | '''
Tests for intuition.api.datafeed
'''
import unittest
from nose.tools import raises, ok_, eq_, nottest
import random
import pytz
import datetime as dt
import pandas as pd
import intuition.api.datafeed as datafeed
from intuition.data.universe import Market
from intuition.errors import InvalidDatafeed
import dna.test... | 33.023973 | 79 | 0.606139 |
import unittest
from nose.tools import raises, ok_, eq_, nottest
import random
import pytz
import datetime as dt
import pandas as pd
import intuition.api.datafeed as datafeed
from intuition.data.universe import Market
from intuition.errors import InvalidDatafeed
import dna.test_utils
class FakeBacktestDatasource(obj... | true | true |
1c3933380f57420b969ba2aa01d1a27d4b57408a | 7,501 | py | Python | synapse/rest/client/v1/directory.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | 2 | 2021-05-14T19:05:03.000Z | 2021-05-26T23:00:43.000Z | synapse/rest/client/v1/directory.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | synapse/rest/client/v1/directory.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 33.337778 | 83 | 0.639781 |
from twisted.internet import defer
from synapse.api.errors import AuthError, SynapseError, Codes
from synapse.types import RoomAlias
from synapse.http.servlet import parse_json_object_from_request
from .base import ClientV1RestServlet, client_path_patterns
import logging
logger = logging.getLogger(__name__)
de... | true | true |
1c39336bd345b134235dc43a104eb61b2d17024f | 2,809 | py | Python | keystone/contrib/endpoint_filter/backends/catalog_sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/contrib/endpoint_filter/backends/catalog_sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/contrib/endpoint_filter/backends/catalog_sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
#
# 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... | 36.012821 | 75 | 0.632253 |
from oslo_config import cfg
from keystone.catalog.backends import sql
from keystone.common import dependency
from keystone.common import utils
CONF = cfg.CONF
@dependency.requires('catalog_api')
class EndpointFilterCatalog(sql.Catalog):
def get_v3_catalog(self, user_id, project_id):
substitutions = di... | true | true |
1c3933738fb207211f83be29cc0b87ab51a2cb7f | 133 | py | Python | 001-simple-tr/reahl/simple-tr/etc/web.config.py | craig-reahl/python-web-framework-comparison | 30c9d08f5c87b5b12bda7158108398092d6cad31 | [
"Apache-2.0"
] | null | null | null | 001-simple-tr/reahl/simple-tr/etc/web.config.py | craig-reahl/python-web-framework-comparison | 30c9d08f5c87b5b12bda7158108398092d6cad31 | [
"Apache-2.0"
] | null | null | null | 001-simple-tr/reahl/simple-tr/etc/web.config.py | craig-reahl/python-web-framework-comparison | 30c9d08f5c87b5b12bda7158108398092d6cad31 | [
"Apache-2.0"
] | 1 | 2018-10-23T07:46:51.000Z | 2018-10-23T07:46:51.000Z |
from __future__ import print_function, unicode_literals, absolute_import, division
from simple_tr import MyUI
web.site_root = MyUI
| 22.166667 | 82 | 0.842105 |
from __future__ import print_function, unicode_literals, absolute_import, division
from simple_tr import MyUI
web.site_root = MyUI
| true | true |
1c39356ff5ad1145eb7a03dbf131079e7de162ec | 907 | py | Python | taotao-cloud-python/taotao-cloud-oldboy/day59-student-manager-system-form/day59 - 1/day59/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 47 | 2021-04-13T10:32:13.000Z | 2022-03-31T10:30:30.000Z | taotao-cloud-python/taotao-cloud-oldboy/day59-student-manager-system-form/day59 - 1/day59/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:41:04.000Z | 2021-11-01T07:41:10.000Z | taotao-cloud-python/taotao-cloud-oldboy/day59-student-manager-system-form/day59 - 1/day59/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 21 | 2021-04-13T10:32:17.000Z | 2022-03-26T07:43:22.000Z | """day59 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | 36.28 | 79 | 0.692393 | from django.conf.urls import url
from django.contrib import admin
from app01 import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^users/', views.users),
url(r'^add_user/', views.add_user),
url(r'^edit_user-(\d+)/', views.edit_user),
]
| true | true |
1c3935bd382124999fb78f579dec7c4c42f6c9cd | 685 | py | Python | pysparktest/test_data_frame.py | Joe-Heffer-Shef/pyspark-bessemer | ab78a96fd7fc607824a95a0b502d4ffa1bcc1899 | [
"MIT"
] | null | null | null | pysparktest/test_data_frame.py | Joe-Heffer-Shef/pyspark-bessemer | ab78a96fd7fc607824a95a0b502d4ffa1bcc1899 | [
"MIT"
] | 4 | 2021-04-08T09:38:59.000Z | 2021-04-08T10:03:27.000Z | pysparktest/test_data_frame.py | Joe-Heffer-Shef/pyspark-bessemer | ab78a96fd7fc607824a95a0b502d4ffa1bcc1899 | [
"MIT"
] | null | null | null | """
PySpark "Hello World" example
Based on the quick-start guide in the docs
https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html
"""
import datetime
import random
import uuid
from pyspark.sql import SparkSession
def test_data_frame(session: SparkSession):
# Create data frame
df ... | 26.346154 | 79 | 0.681752 |
import datetime
import random
import uuid
from pyspark.sql import SparkSession
def test_data_frame(session: SparkSession):
df = session.createDataFrame([
(i, random.random(), uuid.uuid4().hex,
datetime.date(1970, 1, 1) + datetime.timedelta(days=i),
datetime.datetime(1970, 1... | true | true |
1c3939db7a445b27d04bce0f50544a42aa0b8875 | 1,881 | py | Python | stanford_postagger/java.py | banyh/PyStanfordSegmenter | 2165a218df87f00f84c461a41ca77a86eb85687b | [
"MIT"
] | 16 | 2017-03-25T07:42:51.000Z | 2022-03-12T09:33:50.000Z | stanford_postagger/java.py | banyh/PyStanfordSegmenter | 2165a218df87f00f84c461a41ca77a86eb85687b | [
"MIT"
] | 1 | 2017-09-06T02:46:29.000Z | 2017-09-21T01:56:11.000Z | stanford_postagger/java.py | banyh/PyStanfordSegmenter | 2165a218df87f00f84c461a41ca77a86eb85687b | [
"MIT"
] | 5 | 2017-04-13T04:32:53.000Z | 2018-03-17T06:09:27.000Z | from jpype import startJVM, getDefaultJVMPath, shutdownJVM, java, JPackage, isJVMStarted
from os.path import join, dirname
from platform import system
class Postagger(object):
def __init__(self, lang='zh'):
if system() == 'Linux':
sep = ':'
else:
sep = ';' # Windows
... | 44.785714 | 105 | 0.577352 | from jpype import startJVM, getDefaultJVMPath, shutdownJVM, java, JPackage, isJVMStarted
from os.path import join, dirname
from platform import system
class Postagger(object):
def __init__(self, lang='zh'):
if system() == 'Linux':
sep = ':'
else:
sep = ';' pwd = di... | true | true |
1c393ad1a362a095cadd38c4c328787fc28e2873 | 5,994 | py | Python | stuff7/utils/parsers/tests.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | stuff7/utils/parsers/tests.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | stuff7/utils/parsers/tests.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | from datetime import datetime as dt
from datetime import timezone as tz
from datetime import timedelta as td
from calendar import isleap
from unittest import TestCase
from pytz import timezone
from . import TimeDeltaParser, TimezoneParser
class TimeDeltaParserTestCase(TestCase):
def setUp(self):
self.delta = ... | 43.434783 | 110 | 0.66016 | from datetime import datetime as dt
from datetime import timezone as tz
from datetime import timedelta as td
from calendar import isleap
from unittest import TestCase
from pytz import timezone
from . import TimeDeltaParser, TimezoneParser
class TimeDeltaParserTestCase(TestCase):
def setUp(self):
self.delta = ... | true | true |
1c393cccf5d22a80a4b220c3f9f9f8cbfaeb97cf | 15,241 | py | Python | api/authority/digicert.py | ziegeer/autocert | 285df181508573918e280948e51cdd7c65743281 | [
"MIT"
] | null | null | null | api/authority/digicert.py | ziegeer/autocert | 285df181508573918e280948e51cdd7c65743281 | [
"MIT"
] | null | null | null | api/authority/digicert.py | ziegeer/autocert | 285df181508573918e280948e51cdd7c65743281 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import zipfile
from attrdict import AttrDict
from pprint import pprint, pformat
from fnmatch import fnmatch
from datetime import timedelta #FIXME: do we import this here?
from whois import whois
from tld import get_tld
from authority.base import AuthorityBase
f... | 44.826471 | 159 | 0.660127 |
import io
import zipfile
from attrdict import AttrDict
from pprint import pprint, pformat
from fnmatch import fnmatch
from datetime import timedelta from whois import whois
from tld import get_tld
from authority.base import AuthorityBase
from utils.dictionary import merge, body
from utils.format import fmt, pfmt
from... | true | true |
1c393d14ea8f30150efe552dc96b3b2564573ec3 | 1,489 | py | Python | one_one.py | hduliufan/work | 951a69aad5de3387c26fabe417a939349def3df6 | [
"Apache-2.0"
] | null | null | null | one_one.py | hduliufan/work | 951a69aad5de3387c26fabe417a939349def3df6 | [
"Apache-2.0"
] | null | null | null | one_one.py | hduliufan/work | 951a69aad5de3387c26fabe417a939349def3df6 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from getlen_bit import getlen
from begain import getbegain
from x1x2 import x1_x2
from exchange_normal import variation
from fitvalue import fitvalue
#计算精度(人为设定)0.001
s=0.0001
a1=-3
a2=4.1
b1=12.1
b2=5.8
#种群规模
N=20
#-3<=x1<=12.1 4.1<=x2<=5.8
#二进制长度t1,t2
t1=getlen(a1,... | 21.271429 | 50 | 0.58227 | import numpy as np
import matplotlib.pyplot as plt
from getlen_bit import getlen
from begain import getbegain
from x1x2 import x1_x2
from exchange_normal import variation
from fitvalue import fitvalue
s=0.0001
a1=-3
a2=4.1
b1=12.1
b2=5.8
N=20
t1=getlen(a1,b1,s)
t2=getlen(a2,b2,s)
t=t1+t2
pop=getbegain(N,t)
x1,x2=x1_x2(... | true | true |
1c393e0e4e5cdb3c7b762f7c9e41dfc5893cdb33 | 4,396 | py | Python | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/log_utils.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/log_utils.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | NLPCC_2018_TASK2_GEC/CS2S+BPE+Emb/software/nbest-reranker/log_utils.py | DCMMC/chineseocr | 0b8772615239ea7f212b1ab5bc75183e7e9f16b0 | [
"MIT"
] | null | null | null | import logging
import sys
#-----------------------------------------------------------------------------------------------------------#
import re
class BColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033... | 34.34375 | 109 | 0.541401 | import logging
import sys
import re
class BColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
WHITE = '\033[37m'
YELLOW = '\033[33m'
GREEN = '\033[32m'
BLUE ... | true | true |
1c393e1d3e1f2aa16049a35c535565eaac8e73ec | 1,170 | py | Python | checkov/cloudformation/checks/resource/aws/IAMPolicyAttachedToGroupOrRoles.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/cloudformation/checks/resource/aws/IAMPolicyAttachedToGroupOrRoles.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | checkov/cloudformation/checks/resource/aws/IAMPolicyAttachedToGroupOrRoles.py | peaudecastor/checkov | a4804b61c1b1390b7abd44ab53285fcbc3e7e80b | [
"Apache-2.0"
] | null | null | null | from typing import List, Any
from checkov.cloudformation.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck
from checkov.common.models.consts import ANY_VALUE
from checkov.common.models.enums import CheckCategories
class IAMPolicyAttachedToGroupOrRoles(BaseResourceNegativeValueC... | 40.344828 | 119 | 0.749573 | from typing import List, Any
from checkov.cloudformation.checks.resource.base_resource_negative_value_check import BaseResourceNegativeValueCheck
from checkov.common.models.consts import ANY_VALUE
from checkov.common.models.enums import CheckCategories
class IAMPolicyAttachedToGroupOrRoles(BaseResourceNegativeValueC... | true | true |
1c393e95a6ee0086c9f4971d40918cf5dc494fc7 | 8,021 | py | Python | opendatatools/stock/stock_interface.py | buf1024/OpenData | 6268a5f7bee88cc943b3a05858b8ab6f371e8e3b | [
"Apache-2.0"
] | null | null | null | opendatatools/stock/stock_interface.py | buf1024/OpenData | 6268a5f7bee88cc943b3a05858b8ab6f371e8e3b | [
"Apache-2.0"
] | null | null | null | opendatatools/stock/stock_interface.py | buf1024/OpenData | 6268a5f7bee88cc943b3a05858b8ab6f371e8e3b | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import datetime
from .stock_agent import SHExAgent, SZExAgent, CSIAgent, XueqiuAgent, SinaAgent, CNInfoAgent, EastMoneyAgent
from opendatatools.common import get_current_day
shex_agent = SHExAgent()
szex_agent = SZExAgent()
csi_agent = CSIAgent()
xq_agent = XueqiuAgent()
sina_agent = S... | 29.488971 | 127 | 0.642688 |
import datetime
from .stock_agent import SHExAgent, SZExAgent, CSIAgent, XueqiuAgent, SinaAgent, CNInfoAgent, EastMoneyAgent
from opendatatools.common import get_current_day
shex_agent = SHExAgent()
szex_agent = SZExAgent()
csi_agent = CSIAgent()
xq_agent = XueqiuAgent()
sina_agent = SinaAgent()
cninfo_... | true | true |
1c393f3ee967e72fff88acc2c2b88e798cda569b | 62,343 | py | Python | pypsg/psg.py | AWehrhahn/PyPSG | adaa1e50998b3366541e16143034d6acdc379bb3 | [
"MIT"
] | null | null | null | pypsg/psg.py | AWehrhahn/PyPSG | adaa1e50998b3366541e16143034d6acdc379bb3 | [
"MIT"
] | null | null | null | pypsg/psg.py | AWehrhahn/PyPSG | adaa1e50998b3366541e16143034d6acdc379bb3 | [
"MIT"
] | null | null | null | # ---------------------------------------------------
# Planet Spectrum Generator Interface
# PSG multiple-scattering model: https://psg.gsfc.nasa.gov/helpmodel.php
# PSG databases: https://psg.gsfc.nasa.gov/helpatm.php
# PSG API driver: https://psg.gsfc.nasa.gov/helpapi.php
# ------------------------------------------... | 50.480162 | 332 | 0.643055 | from io import StringIO
from os.path import dirname, join
import subprocess
from datetime import datetime
import re
import hashlib
from tempfile import NamedTemporaryFile
import numpy as np
from astropy.utils.data import (
import_file_to_cache,
download_file,
clear_download_cache,
is_url_in_cache,
)
f... | true | true |
1c39411b639150078841ad88a31b978e89f9da7c | 13,757 | py | Python | src/models/test.py | nybupt/athena | 2808f5060831382e603e5dc5ec6a9e9d8901a3b2 | [
"MIT"
] | null | null | null | src/models/test.py | nybupt/athena | 2808f5060831382e603e5dc5ec6a9e9d8901a3b2 | [
"MIT"
] | 8 | 2020-09-25T22:32:00.000Z | 2022-02-10T01:17:17.000Z | src/models/test.py | nybupt/athena | 2808f5060831382e603e5dc5ec6a9e9d8901a3b2 | [
"MIT"
] | 1 | 2021-08-12T12:48:51.000Z | 2021-08-12T12:48:51.000Z | import os
import sys
import time
import numpy as np
from utils.config import *
from utils.util import *
def usage():
print(
"====================================================================================================================")
print(
"python <this script> samplesDir experime... | 36.490716 | 127 | 0.63902 | import os
import sys
import time
import numpy as np
from utils.config import *
from utils.util import *
def usage():
print(
"====================================================================================================================")
print(
"python <this script> samplesDir experime... | true | true |
1c39415d2831c402bbcfd6fc9987ca728401fb5c | 333,094 | py | Python | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 337 | 2016-02-11T07:36:35.000Z | 2018-12-10T07:17:35.000Z | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 127 | 2016-07-06T15:43:14.000Z | 2018-12-11T18:46:27.000Z | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 29 | 2016-10-05T14:15:28.000Z | 2018-11-29T10:17:00.000Z | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import io
import difflib
import base64
from typing import Iterable
import os
import math
import time
import itertools
import functools
import collections
import sys
import platform
import warnings
import re
from functools import reduce
import threa... | 45.887037 | 307 | 0.595706 | from __future__ import division, print_function
import io
import difflib
import base64
from typing import Iterable
import os
import math
import time
import itertools
import functools
import collections
import sys
import platform
import warnings
import re
from functools import reduce
import threading
import six
import v... | true | true |
1c39437443bb429a67763236a1f6ec0fef6ababf | 2,494 | py | Python | tests/riscv/address_solving/RVC_misaligned_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/address_solving/RVC_misaligned_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/address_solving/RVC_misaligned_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 34.164384 | 97 | 0.60826 |
from riscv.EnvRISCV import EnvRISCV
from riscv.GenThreadRISCV import GenThreadRISCV
from base.Sequence import Sequence
RVC_load_store_instructions = {
"C.FLD##RISCV": 10,
"C.LD##RISCV": 10,
"C.LW##RISCV": 10,
"C.FLDSP##RISCV": 10,
"C.LDSP##RISCV": 10,
"C.LWSP##RISCV": 10,
"C.FSD##RISCV": ... | true | true |
1c394495ee78dcc6978a8c9ea7280ee260d6dedc | 296 | py | Python | ex085c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | ex085c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | ex085c.py | lucaspereirag/pythonProject | 15a88762ca94322918474537bbed13e0ed2b60a6 | [
"MIT"
] | null | null | null | lista = [[], []]
for cont in range(0, 4):
numero = int(input(f'Número {cont + 1}: '))
if numero % 2 == 0:
lista[0].append(numero)
else:
lista[1].append(numero)
lista[0].sort()
lista[1].sort()
print(f'Números pares: {lista[0]}')
print(f'Números ímpares: {lista[1]}') | 21.142857 | 47 | 0.564189 | lista = [[], []]
for cont in range(0, 4):
numero = int(input(f'Número {cont + 1}: '))
if numero % 2 == 0:
lista[0].append(numero)
else:
lista[1].append(numero)
lista[0].sort()
lista[1].sort()
print(f'Números pares: {lista[0]}')
print(f'Números ímpares: {lista[1]}') | true | true |
1c39457a03a863ae96ea4251a04280ff26a408c8 | 7,773 | py | Python | meditemp.py | phseiff/MediTemp | cdbcf5b42894f250caa39145fb4c2318247c6761 | [
"MIT"
] | null | null | null | meditemp.py | phseiff/MediTemp | cdbcf5b42894f250caa39145fb4c2318247c6761 | [
"MIT"
] | null | null | null | meditemp.py | phseiff/MediTemp | cdbcf5b42894f250caa39145fb4c2318247c6761 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
You gotta run this with sudo!!
optional arguments:
* supply with --no-notifs if you don't want to use telegram-sent to get notifications.
* supply with --no-logfile to disable printing.
* supply with --no-gnuplot to disable gnuplot.
For a full documentation on how to use this and how to set it... | 33.076596 | 117 | 0.586646 |
import sys
import os
import time
from datetime import datetime
import subprocess
import re
import urllib.parse
import shutil
import pwd
import getpass
import traceback
import warnings
import textwrap
import temper
if "--no-notifs" not in sys.argv:
import telegram_send
ALREADY_DETECTED_INFUNCTIONAL_GNUPLOT = F... | true | true |
1c39458530ceec542f15fe8ab7a396f63b750c45 | 1,210 | py | Python | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import setti... | 30.25 | 79 | 0.673554 | from __future__ import unicode_literals
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import settings, views
from wiki.plu... | true | true |
1c3945eae691de7baaef4774b2e28e69f9ac26a3 | 2,763 | py | Python | src/valiant/repositories/factory.py | pomes/valiant | 786d417a7903d40e54136f645fdbe51575612902 | [
"MIT"
] | 2 | 2020-11-11T00:13:32.000Z | 2021-04-26T08:31:28.000Z | src/valiant/repositories/factory.py | pomes/valiant | 786d417a7903d40e54136f645fdbe51575612902 | [
"MIT"
] | 10 | 2020-03-15T00:09:23.000Z | 2021-06-10T22:43:53.000Z | src/valiant/repositories/factory.py | pomes/valiant | 786d417a7903d40e54136f645fdbe51575612902 | [
"MIT"
] | null | null | null | """Works out which repo wrangler ya need.
Copyright (c) 2020 The Valiant Authors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
us... | 37.849315 | 95 | 0.706478 | from .config import RepositoryConfiguration
from .repository import BaseRepository
class RepositoryFactory:
def __init__(self):
from typing import Dict
self._cache: Dict[str, BaseRepository] = {}
def _instantiate_handler(self, conf: RepositoryConfiguration) -> BaseRepository:
from .... | true | true |
1c39460ba37951a4967580d366596462867ba20e | 8,653 | py | Python | plugins/modules/oci_mysql_analytics_cluster_memory_estimate_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_mysql_analytics_cluster_memory_estimate_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_mysql_analytics_cluster_memory_estimate_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 37.297414 | 156 | 0.585924 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_mysql_analytics_cluster_memory_estimate_facts
short_description: Fetches detail... | true | true |
1c39477d259e9ad716d99cbf82e58e6f3b87381e | 2,399 | py | Python | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.788732 | 74 | 0.689037 |
from absl.testing import absltest
from absl.testing import parameterized
from clif.testing.python import sequence_methods
try:
from clif.testing.python import sequence_methods_pybind11
except ImportError:
sequence_methods_pybind11 = None
@parameterized.named_parameters([
np for np in zip(('c_api', 'pybind11... | true | true |
1c3948496ed8396ce882619ab8bb6c566ec5d7ec | 685 | py | Python | hardware/tests/firmware_integration/test_echo.py | y3rsh/opentrons | b446567910db218030fef40396ab2255cc074bba | [
"Apache-2.0"
] | 235 | 2017-10-27T20:37:27.000Z | 2022-03-30T14:09:49.000Z | hardware/tests/firmware_integration/test_echo.py | y3rsh/opentrons | b446567910db218030fef40396ab2255cc074bba | [
"Apache-2.0"
] | 8,425 | 2017-10-26T15:25:43.000Z | 2022-03-31T23:54:26.000Z | hardware/tests/firmware_integration/test_echo.py | y3rsh/opentrons | b446567910db218030fef40396ab2255cc074bba | [
"Apache-2.0"
] | 130 | 2017-11-09T21:02:37.000Z | 2022-03-15T18:01:24.000Z | """Test Echo firmware."""
import pytest
import asyncio
from typing import AsyncGenerator
from opentrons_hardware.drivers.can_bus import CanDriver, ArbitrationId, CanMessage
@pytest.fixture
async def driver(loop: asyncio.BaseEventLoop) -> AsyncGenerator[CanDriver, None]:
"""Create CanDriver connected to OT-3 Emula... | 29.782609 | 83 | 0.737226 | import pytest
import asyncio
from typing import AsyncGenerator
from opentrons_hardware.drivers.can_bus import CanDriver, ArbitrationId, CanMessage
@pytest.fixture
async def driver(loop: asyncio.BaseEventLoop) -> AsyncGenerator[CanDriver, None]:
driver = await CanDriver.from_env()
yield driver
driver.shutd... | true | true |
1c3948fdeaf5c6d61eddbba04d30e311127ec3f6 | 7,300 | py | Python | graphql/validation/validation.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 8 | 2020-03-23T21:34:02.000Z | 2021-11-12T11:27:45.000Z | graphql/validation/validation.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-14T22:22:29.000Z | 2022-03-16T19:26:37.000Z | graphql/validation/validation.py | ThanksBoomerang/graphql-core-legacy | 6e2fbccdec655ce9122b84d3808c14242c4e6b96 | [
"MIT"
] | 17 | 2020-03-23T12:06:23.000Z | 2022-02-13T05:33:32.000Z | from ..language.ast import FragmentDefinition, FragmentSpread, OperationDefinition
from ..language.visitor import ParallelVisitor, TypeInfoVisitor, Visitor, visit
from ..type import GraphQLSchema
from ..utils.type_info import TypeInfo
from .rules import specified_rules
# Necessary for static type checking
if False: #... | 36.138614 | 83 | 0.636849 | from ..language.ast import FragmentDefinition, FragmentSpread, OperationDefinition
from ..language.visitor import ParallelVisitor, TypeInfoVisitor, Visitor, visit
from ..type import GraphQLSchema
from ..utils.type_info import TypeInfo
from .rules import specified_rules
if False: from typing import List, Union, Op... | true | true |
1c3949beb5e0e8c7ba3be86949a81306113cad5c | 876 | py | Python | releasetools/releasetools.py | scto/android_device_samsung_sm8250-common | 912e07a86f4157f788833f7e65747e0a7e6d9882 | [
"Apache-2.0"
] | null | null | null | releasetools/releasetools.py | scto/android_device_samsung_sm8250-common | 912e07a86f4157f788833f7e65747e0a7e6d9882 | [
"Apache-2.0"
] | null | null | null | releasetools/releasetools.py | scto/android_device_samsung_sm8250-common | 912e07a86f4157f788833f7e65747e0a7e6d9882 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020 The LineageOS Project
import common
import re
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def AddImage(info, basename, dest):
path = "IMAGES/" + basename
if path not ... | 25.764706 | 81 | 0.734018 |
import common
import re
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def AddImage(info, basename, dest):
path = "IMAGES/" + basename
if path not in info.input_zip.namelist():
return
data = info.input_zip.read(path)
co... | true | true |
1c394c7520609260e85412e55eb6764cf76dc1ad | 81,813 | py | Python | dojo/product/views.py | SPoint42/django-DefectDojo | ce386a5c9ae7405366109bf8faea8dce1ca2d8e6 | [
"BSD-3-Clause"
] | null | null | null | dojo/product/views.py | SPoint42/django-DefectDojo | ce386a5c9ae7405366109bf8faea8dce1ca2d8e6 | [
"BSD-3-Clause"
] | 275 | 2021-02-19T15:16:15.000Z | 2022-03-31T21:09:29.000Z | dojo/product/views.py | SPoint42/django-DefectDojo | ce386a5c9ae7405366109bf8faea8dce1ca2d8e6 | [
"BSD-3-Clause"
] | null | null | null | # # product
import calendar as tcalendar
import logging
import base64
from collections import OrderedDict
from datetime import datetime, date, timedelta
from math import ceil
from dateutil.relativedelta import relativedelta
from django.contrib import messages
from django.core.exceptions import PermissionDenied, Valida... | 46.803776 | 154 | 0.597741 | import calendar as tcalendar
import logging
import base64
from collections import OrderedDict
from datetime import datetime, date, timedelta
from math import ceil
from dateutil.relativedelta import relativedelta
from django.contrib import messages
from django.core.exceptions import PermissionDenied, ValidationError
fro... | true | true |
1c394cd42f5508ae906a8a9b784fa9c02b3ade1e | 33 | py | Python | web_app/shap4mmf/__init__.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | web_app/shap4mmf/__init__.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | web_app/shap4mmf/__init__.py | yongkangzzz/mmfgroup | 098a78c83e1c2973dc895d1dc7fd30d7d3668143 | [
"MIT"
] | null | null | null | from ._explainer import Explainer | 33 | 33 | 0.878788 | from ._explainer import Explainer | true | true |
1c394dd6465c72408da41055c65ade522768351a | 1,198 | py | Python | finrl_meta/env_future_trading/wt4elegantrl/wtpy/wrapper/ContractLoader.py | eitin-infant/FinRL-Meta | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | [
"MIT"
] | 214 | 2021-11-08T17:06:11.000Z | 2022-03-31T18:29:48.000Z | finrl_meta/env_future_trading/wt4elegantrl/wtpy/wrapper/ContractLoader.py | eitin-infant/FinRL-Meta | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | [
"MIT"
] | 51 | 2021-11-14T19:11:02.000Z | 2022-03-30T20:23:08.000Z | finrl_meta/env_future_trading/wt4elegantrl/wtpy/wrapper/ContractLoader.py | eitin-infant/FinRL-Meta | 4c94011e58425796e7e2e5c1bf848afd65c828d6 | [
"MIT"
] | 110 | 2021-11-03T07:41:40.000Z | 2022-03-31T03:23:38.000Z | '''
Descripttion: Automatically generated file comment
version:
Author: Wesley
Date: 2021-05-24 15:05:01
LastEditors: Wesley
LastEditTime: 2021-08-13 15:35:59
'''
from .PlatformHelper import PlatformHelper as ph
import os
from ctypes import cdll,c_char_p
from enum import Enum
class LoaderType(Enum):
'''
引擎类型
... | 24.958333 | 61 | 0.658598 | from .PlatformHelper import PlatformHelper as ph
import os
from ctypes import cdll,c_char_p
from enum import Enum
class LoaderType(Enum):
LT_CTP = 1
LT_CTPMini = 2
LT_CTPOpt = 3
def getModuleName(lType:LoaderType)->str:
if lType == LoaderType.LT_CTP:
filename = "CTPLoader"
elif lTy... | true | true |
1c394f272ec8618035bfe7e93a7a40d94808dc99 | 401 | py | Python | studydiscord/wsgi.py | cwhittaker123/django-blog | a89408a86434b0aeb3b179e5885de28740222880 | [
"MIT"
] | null | null | null | studydiscord/wsgi.py | cwhittaker123/django-blog | a89408a86434b0aeb3b179e5885de28740222880 | [
"MIT"
] | null | null | null | studydiscord/wsgi.py | cwhittaker123/django-blog | a89408a86434b0aeb3b179e5885de28740222880 | [
"MIT"
] | null | null | null | """
WSGI config for studydiscord project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studydiscord.settings')
application = get_wsgi_application()
| true | true |
1c395176e9e2ab1dac36b34689a73bf733882451 | 2,564 | py | Python | src/oci/cloud_guard/models/change_security_recipe_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/cloud_guard/models/change_security_recipe_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/cloud_guard/models/change_security_recipe_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 33.298701 | 245 | 0.691108 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class ChangeSecurityRecipeCompartmentDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'com... | true | true |
1c3951895d68db584912d0df9d55f2d91408dd34 | 24,475 | py | Python | scale/data/models.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 121 | 2015-11-18T18:15:33.000Z | 2022-03-10T01:55:00.000Z | scale/data/models.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 1,415 | 2015-12-23T23:36:04.000Z | 2022-01-07T14:10:09.000Z | scale/data/models.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 66 | 2015-12-03T20:38:56.000Z | 2020-07-27T15:28:11.000Z | """Defines the database models for datasets"""
from __future__ import absolute_import, unicode_literals
import copy
import logging
from collections import namedtuple
import django.contrib.postgres.fields
from django.db import models, transaction
from django.db.models import Q, Count
from data.data import data_util
f... | 41.134454 | 160 | 0.671175 | from __future__ import absolute_import, unicode_literals
import copy
import logging
from collections import namedtuple
import django.contrib.postgres.fields
from django.db import models, transaction
from django.db.models import Q, Count
from data.data import data_util
from data.data.json.data_v6 import convert_data_... | true | true |
1c395295389303bc1d6b9b1cf2f5f624ba63beff | 1,850 | py | Python | setup.py | maksyuki/TaichiGAME | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 37 | 2021-12-30T02:03:11.000Z | 2022-03-21T11:37:52.000Z | setup.py | maksyuki/TaichiGame | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 2 | 2022-01-09T13:04:04.000Z | 2022-01-11T06:47:43.000Z | setup.py | maksyuki/TaichiGame | 647d08d3d31b209314ec0dfec5270c565b2f6a61 | [
"MIT"
] | 2 | 2022-01-03T06:52:23.000Z | 2022-01-11T06:31:30.000Z | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="TaichiGAME",
version="0.0.3",
author="maksyuki",
author_email="maksyuki@126.com",
description="GPU Accelerated Motion Engine based on Taichi Lang",
long_description=l... | 40.217391 | 78 | 0.636216 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="TaichiGAME",
version="0.0.3",
author="maksyuki",
author_email="maksyuki@126.com",
description="GPU Accelerated Motion Engine based on Taichi Lang",
long_description=l... | true | true |
1c39529af27c755a11f591ced76bc5b85c5600df | 5,601 | py | Python | tests/mock_objects.py | jmuilwijk/DiscordBot | 63cbb3e96d473b24ecc2928fd5e65ab0e4fec4a8 | [
"MIT"
] | 3 | 2018-11-29T23:31:22.000Z | 2019-05-15T12:13:05.000Z | tests/mock_objects.py | jmuilwijk/DiscordBot | 63cbb3e96d473b24ecc2928fd5e65ab0e4fec4a8 | [
"MIT"
] | 1 | 2018-12-13T21:07:13.000Z | 2018-12-13T21:07:13.000Z | tests/mock_objects.py | jmuilwijk/DiscordBot | 63cbb3e96d473b24ecc2928fd5e65ab0e4fec4a8 | [
"MIT"
] | 2 | 2019-05-26T15:49:24.000Z | 2019-07-31T21:13:49.000Z | """
Module containing mocked objects of discord.py
"""
# Builtin
import collections
import itertools
import unittest.mock
from asyncio import AbstractEventLoop
from aiohttp import ClientSession
# pip
import discord
from discord.ext.commands import Context
# Locals
from KonekoBot import Koneko
class CustomMock:
... | 29.951872 | 99 | 0.636851 |
import collections
import itertools
import unittest.mock
from asyncio import AbstractEventLoop
from aiohttp import ClientSession
import discord
from discord.ext.commands import Context
from KonekoBot import Koneko
class CustomMock:
spec_set = None
discord_id = itertools.count(0)
def __init__(self, **... | true | true |
1c3953de6c5b5802e6221ab2d6af6d68757d930e | 498 | py | Python | yardstick/service/__init__.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 28 | 2017-02-07T07:46:42.000Z | 2021-06-30T08:11:06.000Z | yardstick/service/__init__.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 6 | 2018-01-18T08:00:54.000Z | 2019-04-11T04:51:41.000Z | yardstick/service/__init__.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 46 | 2016-12-13T10:05:47.000Z | 2021-02-18T07:33:06.000Z | ##############################################################################
# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 38.307692 | 78 | 0.522088 |
class Service(object):
pass
| true | true |
1c3955cfd469102938ead8fe91221387a47491ec | 1,087 | py | Python | tests/test_fluid_lists.py | portyanikhin/PyFluids | c570c6708f88d24fb3100d90b81271c3171cd87b | [
"MIT"
] | null | null | null | tests/test_fluid_lists.py | portyanikhin/PyFluids | c570c6708f88d24fb3100d90b81271c3171cd87b | [
"MIT"
] | null | null | null | tests/test_fluid_lists.py | portyanikhin/PyFluids | c570c6708f88d24fb3100d90b81271c3171cd87b | [
"MIT"
] | 1 | 2021-08-08T01:36:59.000Z | 2021-08-08T01:36:59.000Z | # PyFluids
# Copyright (c) 2021 Vladimir Portyanikhin
import pytest
from pyfluids import *
fluid_list = (
list(PureFluids)
+ list(IncompPureFluids)
+ list(IncompMixturesMF)
+ list(IncompMixturesVF)
)
class TestFluidLists:
@pytest.mark.parametrize("name", fluid_list)
def test_coolprop_name... | 27.871795 | 58 | 0.605336 |
import pytest
from pyfluids import *
fluid_list = (
list(PureFluids)
+ list(IncompPureFluids)
+ list(IncompMixturesMF)
+ list(IncompMixturesVF)
)
class TestFluidLists:
@pytest.mark.parametrize("name", fluid_list)
def test_coolprop_name(self, name):
try:
assert name.coolp... | true | true |
1c39573626ef3ac70fdc9ac65ce63eb25e33fcf4 | 23,681 | py | Python | qcodes/data/hdf5_format.py | edumur/Qcodes | ac262035c299a872995cecd210f0e84b0b85d751 | [
"MIT"
] | null | null | null | qcodes/data/hdf5_format.py | edumur/Qcodes | ac262035c299a872995cecd210f0e84b0b85d751 | [
"MIT"
] | 62 | 2021-12-23T04:32:54.000Z | 2022-03-31T04:28:12.000Z | qcodes/data/hdf5_format.py | emartinez/Qcodes | 478af6e746f918a9e1dded7ec626484987f894d2 | [
"MIT"
] | null | null | null | import json
import logging
import os
from typing import TYPE_CHECKING
import h5py
import numpy as np
import qcodes as qc
from .data_array import DataArray
from .format import Formatter
if TYPE_CHECKING:
from .data_set import DataSet
class HDF5Format(Formatter):
"""
HDF5 formatter for saving qcodes data... | 41.839223 | 118 | 0.57164 | import json
import logging
import os
from typing import TYPE_CHECKING
import h5py
import numpy as np
import qcodes as qc
from .data_array import DataArray
from .format import Formatter
if TYPE_CHECKING:
from .data_set import DataSet
class HDF5Format(Formatter):
_format_tag = 'hdf5'
def close_file(sel... | true | true |
1c3957e91fba49529695f8315f9933a48df10e2d | 1,547 | py | Python | Kuka_examples/plot_monitor.py | zhigenzhao/stable-baselines3 | a69a4f0497849d9c20f6b77870ca77ae92f5c7bb | [
"MIT"
] | null | null | null | Kuka_examples/plot_monitor.py | zhigenzhao/stable-baselines3 | a69a4f0497849d9c20f6b77870ca77ae92f5c7bb | [
"MIT"
] | null | null | null | Kuka_examples/plot_monitor.py | zhigenzhao/stable-baselines3 | a69a4f0497849d9c20f6b77870ca77ae92f5c7bb | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
import numpy as np
import csv
def main():
filename = "/home/zhigen/code/stable-baselines3/Kuka_examples/saved_models/monitor (copy).csv"
with open(filename) as csvfile:
training_monitor = csv.reader(csvfile)
reward = []
for (i, row) in enum... | 29.75 | 110 | 0.548158 | from matplotlib import pyplot as plt
import numpy as np
import csv
def main():
filename = "/home/zhigen/code/stable-baselines3/Kuka_examples/saved_models/monitor (copy).csv"
with open(filename) as csvfile:
training_monitor = csv.reader(csvfile)
reward = []
for (i, row) in enum... | true | true |
1c395835516cc3cdac94a16be11eafdeeb9614e5 | 12,088 | py | Python | tscribe/__init__.py | craigmayhew/aws_transcribe_to_docx | 1aded9a7c0f14b8242991e564aec3275fc9f83f9 | [
"MIT"
] | null | null | null | tscribe/__init__.py | craigmayhew/aws_transcribe_to_docx | 1aded9a7c0f14b8242991e564aec3275fc9f83f9 | [
"MIT"
] | null | null | null | tscribe/__init__.py | craigmayhew/aws_transcribe_to_docx | 1aded9a7c0f14b8242991e564aec3275fc9f83f9 | [
"MIT"
] | null | null | null | """ Produce Word Document transcriptions using the automatic speech recognition from AWS Transcribe. """
from docx import Document
from docx.shared import Cm, Mm, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
import json, datetime
import matplotlib.pyplot as plt
import statistics
def convert_time_st... | 47.968254 | 184 | 0.558653 |
from docx import Document
from docx.shared import Cm, Mm, Inches, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
import json, datetime
import matplotlib.pyplot as plt
import statistics
def convert_time_stamp(n):
ts = datetime.timedelta(seconds=float(n))
ts = ts - datetime.timedelta(microseconds=ts.mi... | true | true |
1c39586ec92ace93580f38c62c9dc9d24e87e440 | 3,249 | py | Python | third-party/dool-1.0.0/plugins/dool_top_io_adv.py | rreye/bdev | 8ad775f8c14b9aa51e6813529c7022fbc2b297d7 | [
"MIT"
] | 34 | 2021-01-18T14:25:24.000Z | 2021-06-05T03:21:10.000Z | docker/dstat/plugins/dstat_top_io_adv.py | dbiir/WooKongDB | 2afe19ce291d786249f97d37094a26078ceb571c | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | docker/dstat/plugins/dstat_top_io_adv.py | dbiir/WooKongDB | 2afe19ce291d786249f97d37094a26078ceb571c | [
"PostgreSQL",
"Apache-2.0"
] | 2 | 2021-04-20T20:11:08.000Z | 2021-06-02T02:56:16.000Z | ### Dstat all I/O process plugin
### Displays all processes' I/O read/write stats and CPU usage
###
### Authority: Guillermo Cantu Luna
class dstat_plugin(dstat):
def __init__(self):
self.name = 'most expensive i/o process'
self.vars = ('process pid read write cpu',)
... | 42.75 | 311 | 0.495537 | ###
### Authority: Guillermo Cantu Luna
class dstat_plugin(dstat):
def __init__(self):
self.name = 'most expensive i/o process'
self.vars = ('process pid read write cpu',)
self.type = 's'
self.width = 40
self.scale = 0
self.pidset1 = {}
... | true | true |
1c3959f5ce2f0e894ca1fdf9c1723ed860f7f4df | 3,267 | py | Python | Examples/EventProfiler/tutorial.py | romanbsd/QuantSoftwareToolkit | 6b7e15fa3c0ba483a30674ff5acf30c77b91b877 | [
"BSD-3-Clause"
] | 3 | 2018-03-03T02:03:18.000Z | 2020-07-31T23:10:03.000Z | Examples/EventProfiler/tutorial.py | romanbsd/QuantSoftwareToolkit | 6b7e15fa3c0ba483a30674ff5acf30c77b91b877 | [
"BSD-3-Clause"
] | null | null | null | Examples/EventProfiler/tutorial.py | romanbsd/QuantSoftwareToolkit | 6b7e15fa3c0ba483a30674ff5acf30c77b91b877 | [
"BSD-3-Clause"
] | 6 | 2018-03-04T15:39:01.000Z | 2021-12-30T13:26:22.000Z | '''
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
Created on January, 23, 2013
@author: Sourabh Bajaj
@contact: sourabhbajaj@gatech.edu
@summary: Event Profiler Tutori... | 33.680412 | 87 | 0.666361 |
import pandas as pd
import numpy as np
import math
import copy
import QSTK.qstkutil.qsdateutil as du
import datetime as dt
import QSTK.qstkutil.DataAccess as da
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkstudy.EventProfiler as ep
def find_events(ls_symbols, d_data):
df_close = d_data['close']
ts_ma... | true | true |
1c395a2bb49bfe09ed8c4a70a44d073ecd425a73 | 2,000 | py | Python | asgn09.py | qadeerassan/python-data-structures-I-a9 | 714bff87e22a2f7ef2b546a449e2bf90482d650a | [
"MIT"
] | null | null | null | asgn09.py | qadeerassan/python-data-structures-I-a9 | 714bff87e22a2f7ef2b546a449e2bf90482d650a | [
"MIT"
] | null | null | null | asgn09.py | qadeerassan/python-data-structures-I-a9 | 714bff87e22a2f7ef2b546a449e2bf90482d650a | [
"MIT"
] | null | null | null | """
----------------------------------------------------
asgn09.py
Holds functions for assignment 9.
----------------------------------------------------
Author: Qadeer Assan
ID: 160257370
Email: assa7370@mylaurier.ca
_updated_="2018-03-22"
----------------------------------------------------
"""
from word i... | 35.714286 | 81 | 0.466 | from word import Word
def insert_words(file_variable, hash_set):
for line in file_variable:
line = line.strip().split()
for word in line:
if word.isalpha():
obj = Word(word.lower())
hash_set.insert(obj)
def comparison_total(hash_set):
tota... | true | true |
1c395c05fd3ea21bc967978556d244ddb33ac6a5 | 12,086 | py | Python | aries_cloudagent/core/tests/test_conductor.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 2 | 2019-10-10T16:33:01.000Z | 2019-10-10T19:22:17.000Z | aries_cloudagent/core/tests/test_conductor.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 5 | 2019-10-13T01:28:48.000Z | 2019-10-21T20:10:47.000Z | aries_cloudagent/core/tests/test_conductor.py | euroledger/aries-cloudagent-python | caf457276b19df374c16c2890e1c7e4914f46254 | [
"Apache-2.0"
] | 4 | 2019-07-09T20:41:03.000Z | 2021-06-06T10:45:23.000Z | import asyncio
from io import StringIO
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from .. import conductor as test_module
from ...admin.base_server import BaseAdminServer
from ...config.base_context import ContextBuilder
from ...config.injection_context import InjectionCon... | 38.006289 | 87 | 0.684015 | import asyncio
from io import StringIO
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from .. import conductor as test_module
from ...admin.base_server import BaseAdminServer
from ...config.base_context import ContextBuilder
from ...config.injection_context import InjectionCon... | true | true |
1c395d7edb3f718bfdf9111d3fd63749240be388 | 811 | py | Python | python/523_Continuous_Subarray_Sum.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 17 | 2016-03-01T22:40:53.000Z | 2021-04-19T02:15:03.000Z | python/523_Continuous_Subarray_Sum.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | null | null | null | python/523_Continuous_Subarray_Sum.py | liaison/LeetCode | 8b10a1f6bbeb3ebfda99248994f7c325140ee2fd | [
"MIT"
] | 3 | 2019-03-07T03:48:43.000Z | 2020-04-05T01:11:36.000Z | class Solution:
def checkSubarraySum(self, nums: List[int], k: int) -> bool:
# the earliest index with the same module remaider of k
prefix_sum_indices = {}
# a virtual prefix sum index.
# for the test case of [0, 0] k = 0
prefix_sum = 0
prefix_sum_indi... | 30.037037 | 64 | 0.509248 | class Solution:
def checkSubarraySum(self, nums: List[int], k: int) -> bool:
prefix_sum_indices = {}
prefix_sum = 0
prefix_sum_indices[0] = -1
for index, num in enumerate(nums):
prefix_sum += num
... | true | true |
1c395dbab07719fc7ed142448f04c349ad8f54ca | 1,951 | py | Python | espnet/nets/tts_interface.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | 3 | 2019-10-11T11:41:27.000Z | 2020-05-21T09:08:44.000Z | espnet/nets/tts_interface.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | null | null | null | espnet/nets/tts_interface.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | 1 | 2021-04-07T09:47:44.000Z | 2021-04-07T09:47:44.000Z | import chainer
class Reporter(chainer.Chain):
def report(self, dicts):
for d in dicts:
chainer.reporter.report(d, self)
class TTSInterface(object):
"""TTS Interface for ESPnet model implementation"""
@staticmethod
def add_arguments(parser):
return parser
def __init_... | 30.968254 | 109 | 0.652486 | import chainer
class Reporter(chainer.Chain):
def report(self, dicts):
for d in dicts:
chainer.reporter.report(d, self)
class TTSInterface(object):
@staticmethod
def add_arguments(parser):
return parser
def __init__(self):
self.reporter = Reporter()
def for... | true | true |
1c395e81d0785fcb41d2e2daa5b42f97a6d910e7 | 1,672 | py | Python | neutron/tests/unit/linuxbridge/test_defaults.py | SnabbCo/neutron | a657c06d10f2171149c6b1863df36522bdc11cd7 | [
"Apache-2.0"
] | 3 | 2015-02-02T02:51:39.000Z | 2015-02-23T10:20:23.000Z | neutron/tests/unit/linuxbridge/test_defaults.py | SnabbCo/neutron | a657c06d10f2171149c6b1863df36522bdc11cd7 | [
"Apache-2.0"
] | 4 | 2015-02-23T10:21:11.000Z | 2015-03-04T09:28:20.000Z | neutron/tests/unit/linuxbridge/test_defaults.py | SnabbCo/neutron | a657c06d10f2171149c6b1863df36522bdc11cd7 | [
"Apache-2.0"
] | 4 | 2015-04-14T10:06:51.000Z | 2019-10-02T01:28:34.000Z | # Copyright (c) 2012 OpenStack Foundation.
#
# 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... | 38.883721 | 69 | 0.660287 |
from oslo.config import cfg
from neutron.plugins.linuxbridge.common import config from neutron.tests import base
class ConfigurationTest(base.BaseTestCase):
def test_defaults(self):
self.assertEqual(2,
cfg.CONF.AGENT.polling_interval)
self.assertEqual(False,
... | true | true |
1c395eb8b89c86ddd4fe3e5cf7c5322c461ea836 | 2,204 | py | Python | hypixelaPY/objects/quake.py | QuartzWarrior/hypixelaPY | cb6a96ce8b15ebd3f6fa0666df46bc6135f0afb0 | [
"MIT"
] | 3 | 2021-01-04T14:29:03.000Z | 2021-02-24T11:06:41.000Z | hypixelaPY/objects/quake.py | QuartzWarrior/hypixelaPY | cb6a96ce8b15ebd3f6fa0666df46bc6135f0afb0 | [
"MIT"
] | 2 | 2021-09-21T18:31:46.000Z | 2021-09-22T13:50:28.000Z | hypixelaPY/objects/quake.py | myerrr/hypixelaPY | 336ff2723a336142254b9e01b969adda98fa5f96 | [
"MIT"
] | 1 | 2021-05-01T02:16:36.000Z | 2021-05-01T02:16:36.000Z | """
MIT License
Copyright (c) 2020 Myer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... | 44.979592 | 132 | 0.670145 |
from .stats import KillsDeaths
class Quake:
def __init__(self, data):
self.name = "Quake"
self.coins = data.get("player", {}).get("stats", {}).get("Quake", {}).get("coins", 0)
self.kills = KillsDeaths(
data.get("player", {}).get("stats", {}).get("Quake", {}).get("kills", 0),
... | true | true |
1c395f2ce46aa11c29c30e7c60549fb45d8d9850 | 3,284 | py | Python | benchmark/startCirq3278.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3278.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3278.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=43
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 36.898876 | 77 | 0.678745 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0])) c.append(cirq.H.on(input_qubit[1])) c.append(c... | true | true |
1c39613a5d2cda13b72a9b04ba4f1fd6dbc8681a | 513 | py | Python | tests/conftest.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | tests/conftest.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | tests/conftest.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# pytest configuration
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC mod... | 28.5 | 72 | 0.442495 |
from noc.tests.fixtures.database import database
def pytest_terminal_summary(terminalreporter, exitstatus):
global _stats
_stats = terminalreporter.stats
_stats = None
| true | true |
1c396179fdc1baf926d524a0f740d38daaa3bc17 | 20,506 | py | Python | main.py | FloWuenne/semi-auto-image-annotation-tool | f48f521c480a436bafb148b4ecaf9f2c4a898211 | [
"Apache-2.0"
] | null | null | null | main.py | FloWuenne/semi-auto-image-annotation-tool | f48f521c480a436bafb148b4ecaf9f2c4a898211 | [
"Apache-2.0"
] | null | null | null | main.py | FloWuenne/semi-auto-image-annotation-tool | f48f521c480a436bafb148b4ecaf9f2c4a898211 | [
"Apache-2.0"
] | null | null | null | """
Copyright {2018} {Viraj Mavani}
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
"""
from tkinter import *
from tkinter import filedia... | 43.629787 | 120 | 0.578611 |
from tkinter import *
from tkinter import filedialog
from PIL import Image, ImageTk
import keras
from keras_retinanet import models
from keras_retinanet.utils.image import preprocess_image
import os
import numpy as np
import tensorflow as tf
import config
import math
def get_session():
config = tf.compat.v1.C... | true | true |
1c3961b70cb71bf46342e39b85de8960e6ba64c2 | 1,016 | py | Python | pajbot/web/routes/admin/moderators.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | null | null | null | pajbot/web/routes/admin/moderators.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | null | null | null | pajbot/web/routes/admin/moderators.py | MrBean355/pajbot | 3f27aabccfb242f5e3e8eedd20c97633b0d39950 | [
"MIT"
] | null | null | null | import collections
from flask import render_template
from pajbot.managers.db import DBManager
from pajbot.models.user import User
from pajbot.web.utils import requires_level
def init(page):
@page.route("/moderators/")
@requires_level(500)
def moderators(**options):
with DBManager.create_session_... | 46.181818 | 113 | 0.698819 | import collections
from flask import render_template
from pajbot.managers.db import DBManager
from pajbot.models.user import User
from pajbot.web.utils import requires_level
def init(page):
@page.route("/moderators/")
@requires_level(500)
def moderators(**options):
with DBManager.create_session_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.