hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f88380005fdf72aec41b2332e31913dae1f756f6 | 7,742 | py | Python | src/operations/classification/svm.py | vmariiechko/python-image-processing | 5613440dc04140845600b8c37a2b28786d504815 | [
"MIT"
] | null | null | null | src/operations/classification/svm.py | vmariiechko/python-image-processing | 5613440dc04140845600b8c37a2b28786d504815 | [
"MIT"
] | null | null | null | src/operations/classification/svm.py | vmariiechko/python-image-processing | 5613440dc04140845600b8c37a2b28786d504815 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from cv2 import (ml, imread, threshold, findContours, moments, contourArea, arcLength,
boundingRect, drawContours, cvtColor,
IMREAD_GRAYSCALE, TERM_CRITERIA_MAX_ITER, COLOR_GRAY2RGB)
from numpy import (array, matrix, ones, empty, delete, sqrt, pi,
... | 40.322917 | 111 | 0.652803 | import matplotlib.pyplot as plt
from cv2 import (ml, imread, threshold, findContours, moments, contourArea, arcLength,
boundingRect, drawContours, cvtColor,
IMREAD_GRAYSCALE, TERM_CRITERIA_MAX_ITER, COLOR_GRAY2RGB)
from numpy import (array, matrix, ones, empty, delete, sqrt, pi,
... | 0 | 0 | 0 |
f3f3e74dbdb66c3eeb72f5d95fff49cb5739f5aa | 3,505 | py | Python | ksb_homology/utils/utils.py | Edoldin/KSB_homology | fcdd848526bbb9ce39d0c38ffabe0d23d93f691b | [
"MIT"
] | null | null | null | ksb_homology/utils/utils.py | Edoldin/KSB_homology | fcdd848526bbb9ce39d0c38ffabe0d23d93f691b | [
"MIT"
] | null | null | null | ksb_homology/utils/utils.py | Edoldin/KSB_homology | fcdd848526bbb9ce39d0c38ffabe0d23d93f691b | [
"MIT"
] | null | null | null | from collections import deque
| 30.745614 | 123 | 0.532097 | from collections import deque
class Utils():
@staticmethod
def calculate_index( aiC_U_ajC, top, Udot ):
"""
Calculate Index
PARAMETERS
----------
aiC_U_ajC : :class:' set'
top : :class:' set'
Udot : :class:' set'
... | 968 | 2,486 | 22 |
104572a8ccb0d0755cba08b5cf533bc06da49b4a | 12,012 | py | Python | python/configPoster.py | crotwell/dragrace | 2fdb009e9ca7e868e1435d3a38ac81a0b3698433 | [
"MIT"
] | 12 | 2018-11-27T16:18:16.000Z | 2020-01-10T03:17:26.000Z | python/configPoster.py | crotwell/dragrace | 2fdb009e9ca7e868e1435d3a38ac81a0b3698433 | [
"MIT"
] | null | null | null | python/configPoster.py | crotwell/dragrace | 2fdb009e9ca7e868e1435d3a38ac81a0b3698433 | [
"MIT"
] | 1 | 2019-04-12T18:34:22.000Z | 2019-04-12T18:34:22.000Z | import argparse
import asyncio
import json
import math
import random
import signal
import time
from datetime import datetime, timedelta
#from netifaces import interfaces, ifaddresses, AF_INET
import socket
import traceback
import configChecker
import filecmp
import shutil
import sys
import simpleDali
# #For Testing
#... | 42 | 128 | 0.542791 | import argparse
import asyncio
import json
import math
import random
import signal
import time
from datetime import datetime, timedelta
#from netifaces import interfaces, ifaddresses, AF_INET
import socket
import traceback
import configChecker
import filecmp
import shutil
import sys
import simpleDali
# #For Testing
#... | 10,349 | -4 | 234 |
bb1f0421abd7c4f41cf11d86404f6403f7af7587 | 832 | py | Python | pie/util.py | andrearommal/PIe | 1502423b5377c1162fbe4fa953af9abea7f8e56b | [
"Apache-2.0"
] | null | null | null | pie/util.py | andrearommal/PIe | 1502423b5377c1162fbe4fa953af9abea7f8e56b | [
"Apache-2.0"
] | null | null | null | pie/util.py | andrearommal/PIe | 1502423b5377c1162fbe4fa953af9abea7f8e56b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
util.py
Created by Ronak Shah on April 12, 2018.
Copyright (c) 2018 Northwell Health. All rights reserved.
"""
import json
import logging
import os
import sys
RESOURCE_FILE = os.getenv('PIE_RESOURCE_CONFIG', "pie_resources.json")
JSON_CONFIG = json.load(open(RESOURCE_FILE))... | 26.83871 | 70 | 0.772837 | #!/usr/bin/env python
# encoding: utf-8
"""
util.py
Created by Ronak Shah on April 12, 2018.
Copyright (c) 2018 Northwell Health. All rights reserved.
"""
import json
import logging
import os
import sys
RESOURCE_FILE = os.getenv('PIE_RESOURCE_CONFIG', "pie_resources.json")
JSON_CONFIG = json.load(open(RESOURCE_FILE))... | 0 | 0 | 0 |
2672c05fc5faec2576b9d7fe6a08752dbcc31a12 | 5,115 | py | Python | src/ventcat/app.py | rohe/verify_entcat | df6dc2be0abc4115273d0b20c14dc90f03cab98d | [
"Apache-2.0"
] | null | null | null | src/ventcat/app.py | rohe/verify_entcat | df6dc2be0abc4115273d0b20c14dc90f03cab98d | [
"Apache-2.0"
] | null | null | null | src/ventcat/app.py | rohe/verify_entcat | df6dc2be0abc4115273d0b20c14dc90f03cab98d | [
"Apache-2.0"
] | null | null | null | import json
import cherrypy
import logging
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_HTTP_REDIRECT
from ventcat import conv_response, as_unicode
from ventcat import UnSupported
from ventcat.acs import ACS
from ventcat.response import Response, make_cookie
from ventcat.sso import SSO
logger = log... | 35.520833 | 82 | 0.516129 | import json
import cherrypy
import logging
from saml2 import BINDING_HTTP_POST
from saml2 import BINDING_HTTP_REDIRECT
from ventcat import conv_response, as_unicode
from ventcat import UnSupported
from ventcat.acs import ACS
from ventcat.response import Response, make_cookie
from ventcat.sso import SSO
logger = log... | 4,376 | 292 | 23 |
53b07645beb6a37bb39e8fb6d9e458b88789c6b6 | 770 | py | Python | gamemacros.py | GameTL/GameMacros | b573c0fbabc332873f2030728a5f9d52f64e0856 | [
"MIT"
] | null | null | null | gamemacros.py | GameTL/GameMacros | b573c0fbabc332873f2030728a5f9d52f64e0856 | [
"MIT"
] | null | null | null | gamemacros.py | GameTL/GameMacros | b573c0fbabc332873f2030728a5f9d52f64e0856 | [
"MIT"
] | null | null | null | # Version 3.0 - 2021 September 10
# work for both Mac, Windows, Linux
# use clear() for clearing terminal
# Method 1
# from clearterminal import * -----> clear()
# Method 2
# import clearterminal -----> clearterminal.clear()
import os
import platform
platform = platform.system()
if platform == 'Darwin': # for Unix (Ma... | 23.333333 | 59 | 0.68961 | # Version 3.0 - 2021 September 10
# work for both Mac, Windows, Linux
# use clear() for clearing terminal
# Method 1
# from clearterminal import * -----> clear()
# Method 2
# import clearterminal -----> clearterminal.clear()
import os
import platform
platform = platform.system()
if platform == 'Darwin': # for Unix (Ma... | 11 | 0 | 23 |
73c231f843e281f5793ac6d65c263fc1d0984a82 | 2,629 | py | Python | tovp/users/views.py | nrsimha/tovp | 311bc957c95c294811d737f5df30b0a218d35610 | [
"MIT"
] | null | null | null | tovp/users/views.py | nrsimha/tovp | 311bc957c95c294811d737f5df30b0a218d35610 | [
"MIT"
] | null | null | null | tovp/users/views.py | nrsimha/tovp | 311bc957c95c294811d737f5df30b0a218d35610 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Import the reverse lookup function
from django.core.urlresolvers import reverse
# view imports
from django.views.generic import DetailView
from django.views.generic import RedirectView
from django.views.generic import UpdateView
from django.views.generic import ListView
# Will be used for lo... | 31.674699 | 83 | 0.732218 | # -*- coding: utf-8 -*-
# Import the reverse lookup function
from django.core.urlresolvers import reverse
# view imports
from django.views.generic import DetailView
from django.views.generic import RedirectView
from django.views.generic import UpdateView
from django.views.generic import ListView
# Will be used for lo... | 942 | 760 | 138 |
e1a7bac7b331fd02cd759384caa0119eac149b9d | 696 | py | Python | should_be/tests/test_mixin_utils.py | jayvdb/should_be | afcc71a19fcd9aaf6e8f93f740fa71f6d7e74ce1 | [
"0BSD"
] | 4 | 2017-10-24T11:20:19.000Z | 2021-01-13T02:41:29.000Z | should_be/tests/test_mixin_utils.py | jayvdb/should_be | afcc71a19fcd9aaf6e8f93f740fa71f6d7e74ce1 | [
"0BSD"
] | 9 | 2019-03-01T06:14:39.000Z | 2021-01-18T23:48:42.000Z | should_be/tests/test_mixin_utils.py | jayvdb/should_be | afcc71a19fcd9aaf6e8f93f740fa71f6d7e74ce1 | [
"0BSD"
] | 3 | 2020-05-18T07:08:43.000Z | 2020-07-19T14:18:29.000Z | from should_be import core as sc
import unittest
| 26.769231 | 77 | 0.635057 | from should_be import core as sc
import unittest
class TestMixin(sc.BaseMixin):
target_class = object
def should_cheese(self):
self.should_follow(True)
class TestMixinUtils(unittest.TestCase):
def test_default_mix(self):
TestMixin.mix()
(object()).should_cheese()
def test_s... | 438 | 81 | 126 |
5189a017d03f3a9e16de5ab89f9496ace97a2cf5 | 12,191 | py | Python | edge_scripts/robot_support.py | OSU-AIMS/tic-tac-toe | b213e2e16b95671f78a79fd9b8d6046c30cd0a54 | [
"Apache-2.0"
] | 2 | 2021-08-12T18:45:27.000Z | 2021-12-27T04:28:37.000Z | edge_scripts/robot_support.py | OSU-AIMS/tic-tac-toe | b213e2e16b95671f78a79fd9b8d6046c30cd0a54 | [
"Apache-2.0"
] | 11 | 2021-07-09T14:49:30.000Z | 2022-03-04T16:59:54.000Z | edge_scripts/robot_support.py | OSU-AIMS/tic-tac-toe | b213e2e16b95671f78a79fd9b8d6046c30cd0a54 | [
"Apache-2.0"
] | 1 | 2021-12-27T04:28:41.000Z | 2021-12-27T04:28:41.000Z | #!/usr/bin/env python
### IMPORTS
#
# `moveit_commander` namespace allows Python MoveIt interfaces.
# Includes a `MoveGroupCommander`_, `PlanningSceneInterface`_, and `RobotCommander`_ class
#
# Additional imports allow used for support, ROS messages, and etc.
import sys
import copy
import rospy
import moveit_comman... | 36.71988 | 120 | 0.703634 | #!/usr/bin/env python
### IMPORTS
#
# `moveit_commander` namespace allows Python MoveIt interfaces.
# Includes a `MoveGroupCommander`_, `PlanningSceneInterface`_, and `RobotCommander`_ class
#
# Additional imports allow used for support, ROS messages, and etc.
import sys
import copy
import rospy
import moveit_comman... | 10,228 | 0 | 396 |
b4d0c4319db41b600e68c367ddf3793d8cf65162 | 1,222 | py | Python | client/test/test_packet.py | estcube/telemetry-forwarding-client | be659c8dd8e4bd26d1d1974d63f90acffd150e34 | [
"MIT"
] | 3 | 2020-06-11T12:34:25.000Z | 2020-09-16T12:06:32.000Z | client/test/test_packet.py | estcube/telemetry-forwarding-client | be659c8dd8e4bd26d1d1974d63f90acffd150e34 | [
"MIT"
] | 57 | 2020-09-16T09:11:04.000Z | 2022-02-28T01:32:13.000Z | client/test/test_packet.py | estcube/Telemetry-Forwarding-Client | be659c8dd8e4bd26d1d1974d63f90acffd150e34 | [
"MIT"
] | null | null | null | from random import random
from hk_common import *
from hk_sp import *
from test_code_common import *
from test_code_eps import *
from test_code_aocs import *
from test_code_obc import *
from test_code_st import *
from test_code_sp import *
from test_code_pcom import *
from test_code_scom import *
from client.kaitai.... | 21.438596 | 55 | 0.711948 | from random import random
from hk_common import *
from hk_sp import *
from test_code_common import *
from test_code_eps import *
from test_code_aocs import *
from test_code_obc import *
from test_code_st import *
from test_code_sp import *
from test_code_pcom import *
from test_code_scom import *
from client.kaitai.... | 556 | 0 | 46 |
f5f32bf9fc9897c7d19c064ce63795ce31ac13eb | 415 | py | Python | daysxtractor/daysselector.py | sebMathieu/daysxtractor | 744b535fbdd1e9186edc0f7562ce3bd920855c05 | [
"MIT"
] | 1 | 2020-09-15T07:29:18.000Z | 2020-09-15T07:29:18.000Z | daysxtractor/daysselector.py | sebMathieu/daysxtractor | 744b535fbdd1e9186edc0f7562ce3bd920855c05 | [
"MIT"
] | null | null | null | daysxtractor/daysselector.py | sebMathieu/daysxtractor | 744b535fbdd1e9186edc0f7562ce3bd920855c05 | [
"MIT"
] | null | null | null | ##@package daysselector
# @author Sebastien MATHIEU
from abc import ABCMeta, abstractmethod
## Abstract class of a day selector.
| 24.411765 | 64 | 0.722892 | ##@package daysselector
# @author Sebastien MATHIEU
from abc import ABCMeta, abstractmethod
## Abstract class of a day selector.
class DaysSelector:
__metaclass__ = ABCMeta
## Select representative days from time series.
# @param data Data with the time series.
# @return Dictionary with the select d... | 26 | 235 | 22 |
0a3ebda6000b9985a6e8a6936744f41e409200aa | 1,516 | py | Python | scripts/automation/regression/stateless_tests/profiles/syn.py | timgates42/trex-core | efe94752fcb2d0734c83d4877afe92a3dbf8eccd | [
"Apache-2.0"
] | 956 | 2015-06-24T15:04:55.000Z | 2022-03-30T06:25:04.000Z | scripts/automation/regression/stateless_tests/profiles/syn.py | angelyouyou/trex-core | fddf78584cae285d9298ef23f9f5c8725e16911e | [
"Apache-2.0"
] | 782 | 2015-09-20T15:19:00.000Z | 2022-03-31T23:52:05.000Z | scripts/automation/regression/stateless_tests/profiles/syn.py | angelyouyou/trex-core | fddf78584cae285d9298ef23f9f5c8725e16911e | [
"Apache-2.0"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | from trex.stl.api import *
| 35.255814 | 102 | 0.396438 | from trex.stl.api import *
class Prof():
def get_streams(self, direction = 0, pkt_size = 64, **kwargs):
size = pkt_size - 4; # HW will add 4 bytes ethernet FCS
# TCP SYN
base_pkt = Ether()/IP(dst="48.0.0.1")/TCP(dport=80,flags="S")
pad = max(0, size - len(base_pkt)) * 'x'
... | 1,423 | -8 | 73 |
39c95dbf7cfd4d5c5459f3becb477b2b40029973 | 5,465 | py | Python | helpers/results_page_helper.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | 1 | 2019-05-21T08:10:41.000Z | 2019-05-21T08:10:41.000Z | helpers/results_page_helper.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | null | null | null | helpers/results_page_helper.py | guineawheek/ftcdata | f6515da93c7a788b00b3e88d4c507c2140d7e385 | [
"MIT"
] | null | null | null | import logging
from models import Event, Ranking, Award, Match, MatchScore
from bs4 import BeautifulSoup
from db.orm import orm
class ResultsPageHelper:
"""Helper methods to parse the output from FTC Live Scoring Software pages"""
res_map = {"R": "red", "B": "blue", "T": "tie"}
@classmethod
@classmet... | 41.401515 | 188 | 0.543458 | import logging
from models import Event, Ranking, Award, Match, MatchScore
from bs4 import BeautifulSoup
from db.orm import orm
class ResultsPageHelper:
"""Helper methods to parse the output from FTC Live Scoring Software pages"""
res_map = {"R": "red", "B": "blue", "T": "tie"}
@classmethod
def parse_... | 3,654 | 0 | 130 |
6a73b83c877297fb609627c070518c8f93ebfd7a | 38,276 | py | Python | deepinterpolation/generator_collection.py | sakuroki/deepinterpolation | 0b08cfbbdb02eec6d2bc2badfd007070fc020bc7 | [
"Unlicense"
] | null | null | null | deepinterpolation/generator_collection.py | sakuroki/deepinterpolation | 0b08cfbbdb02eec6d2bc2badfd007070fc020bc7 | [
"Unlicense"
] | null | null | null | deepinterpolation/generator_collection.py | sakuroki/deepinterpolation | 0b08cfbbdb02eec6d2bc2badfd007070fc020bc7 | [
"Unlicense"
] | null | null | null | # Class to generate data for training
import numpy as np
import json
import h5py
import os
import tensorflow.keras as keras
from deepinterpolation.generic import JsonLoader
import tifffile
import nibabel as nib
from scipy.io import wavfile
import s3fs
class DeepGenerator(keras.utils.Sequence):
"""
This class ... | 36.143532 | 131 | 0.604844 | # Class to generate data for training
import numpy as np
import json
import h5py
import os
import tensorflow.keras as keras
from deepinterpolation.generic import JsonLoader
import tifffile
import nibabel as nib
from scipy.io import wavfile
import s3fs
class MaxRetryException(Exception):
# This is helper class for ... | 13,167 | 4,331 | 505 |
31d15073f4299bffb88f36168fb8ffcab78c52c8 | 1,228 | py | Python | migrations/versions/b652b688d0ed_.py | firmitfeng/SurveysFlask | d25cdd68261088cfdf9596b291f70a1b0c32fd25 | [
"MIT"
] | null | null | null | migrations/versions/b652b688d0ed_.py | firmitfeng/SurveysFlask | d25cdd68261088cfdf9596b291f70a1b0c32fd25 | [
"MIT"
] | null | null | null | migrations/versions/b652b688d0ed_.py | firmitfeng/SurveysFlask | d25cdd68261088cfdf9596b291f70a1b0c32fd25 | [
"MIT"
] | null | null | null | """empty message
Revision ID: b652b688d0ed
Revises: c6170594b21e
Create Date: 2017-06-22 12:43:46.146126
"""
# revision identifiers, used by Alembic.
revision = 'b652b688d0ed'
down_revision = 'c6170594b21e'
from alembic import op
import sqlalchemy as sa
| 30.7 | 80 | 0.673453 | """empty message
Revision ID: b652b688d0ed
Revises: c6170594b21e
Create Date: 2017-06-22 12:43:46.146126
"""
# revision identifiers, used by Alembic.
revision = 'b652b688d0ed'
down_revision = 'c6170594b21e'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 922 | 0 | 46 |
29f40798e34ed8bade7a6e4e67fca54f24b3f2fb | 403 | py | Python | find_num.py | sanchagrins/Python | aad28edb8fd338a8da30f515e8239b403c6902b0 | [
"MIT"
] | null | null | null | find_num.py | sanchagrins/Python | aad28edb8fd338a8da30f515e8239b403c6902b0 | [
"MIT"
] | null | null | null | find_num.py | sanchagrins/Python | aad28edb8fd338a8da30f515e8239b403c6902b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Purpose: Exercise for Coursera Class Using Python to Access Web Data.
# Reads through a file, extracts numbers using regex and sums them.
import re
fh = open("regex_sum_320787.txt", 'r')
numlist = list()
for line in fh:
line = line.rstrip()
x = re.findall('[0-9]+', line)
... | 25.1875 | 76 | 0.632754 | #!/usr/bin/env python
# Purpose: Exercise for Coursera Class Using Python to Access Web Data.
# Reads through a file, extracts numbers using regex and sums them.
import re
fh = open("regex_sum_320787.txt", 'r')
numlist = list()
for line in fh:
line = line.rstrip()
x = re.findall('[0-9]+', line)
... | 0 | 0 | 0 |
a2725f355ef2b28067c0cff16fc47dcc673d222c | 7,418 | py | Python | Level3.py | MAXIORBOY/ReflexGame | 69d3c12f2a227cd948009f863fb5c16ce1c70256 | [
"MIT"
] | null | null | null | Level3.py | MAXIORBOY/ReflexGame | 69d3c12f2a227cd948009f863fb5c16ce1c70256 | [
"MIT"
] | null | null | null | Level3.py | MAXIORBOY/ReflexGame | 69d3c12f2a227cd948009f863fb5c16ce1c70256 | [
"MIT"
] | null | null | null | import random
from Items import *
pygame.init()
| 42.878613 | 263 | 0.630089 | import random
from Items import *
pygame.init()
class TerroristsAndCivilians:
def __init__(self, window_width, window_height):
self.targets = Sprites()
self.grid = Grid(window_width, window_height, self.targets.sprite_dimension)
self.terrorist, self.civilian = self.pick_fruit()
se... | 6,931 | -9 | 444 |
4f1567896d929471cf6007f360c8ea31880d6fe7 | 4,432 | py | Python | Chinese_NER/evaluate.py | fengyh3/Chinese_Resume_NER | 24d532d0d15d56860ef7857e3bbcca104f2eb938 | [
"MIT"
] | 11 | 2020-04-01T11:41:43.000Z | 2021-09-22T07:02:22.000Z | Chinese_NER/evaluate.py | fengyh3/Chinese_Resume_NER | 24d532d0d15d56860ef7857e3bbcca104f2eb938 | [
"MIT"
] | null | null | null | Chinese_NER/evaluate.py | fengyh3/Chinese_Resume_NER | 24d532d0d15d56860ef7857e3bbcca104f2eb938 | [
"MIT"
] | 1 | 2020-05-09T01:43:47.000Z | 2020-05-09T01:43:47.000Z | from collections import Counter
from utils import flatten_lists
| 39.571429 | 106 | 0.548962 | from collections import Counter
from utils import flatten_lists
class Metrics(object):
def __init__(self, golden_tags, predict_tags, remove_O = True):
self.golden_tags = flatten_lists(golden_tags)
self.predict_tags = flatten_lists(predict_tags)
if remove_O:
self._remov... | 2,641 | 1,742 | 24 |
128e8e0bed81ee72905b7e8a2add5bee9df2df35 | 3,866 | py | Python | PyParadise/header.py | brandherd/PyParadise | 1c65bf634e17931f165fd88b9938f604b9371e2e | [
"MIT"
] | 1 | 2021-06-01T13:07:54.000Z | 2021-06-01T13:07:54.000Z | PyParadise/header.py | brandherd/PyParadise | 1c65bf634e17931f165fd88b9938f604b9371e2e | [
"MIT"
] | 3 | 2021-11-03T02:07:38.000Z | 2022-03-14T20:35:04.000Z | PyParadise/header.py | brandherd/PyParadise | 1c65bf634e17931f165fd88b9938f604b9371e2e | [
"MIT"
] | null | null | null | import astropy.io.fits as pyfits
| 33.327586 | 89 | 0.498189 | import astropy.io.fits as pyfits
class Header(object):
def __init__(self, header=None, origin=None):
"""
Creates an Header object
Parameters
--------------
header : pyfits.header object, optional
Fits header as header
... | 573 | 3,236 | 23 |
504fe8b4813d6970424712a3f23a2e0df3a783b4 | 1,012 | py | Python | model/game_model_proxy.py | PetrSpacek/angrylikegame-python-pyqt5 | 2ddc73fb5b4398117c3a83593632408b4b44e246 | [
"MIT"
] | 2 | 2020-01-17T10:43:13.000Z | 2021-11-21T14:56:53.000Z | model/game_model_proxy.py | PetrSpacek/angrylikegame-python-pyqt5 | 2ddc73fb5b4398117c3a83593632408b4b44e246 | [
"MIT"
] | null | null | null | model/game_model_proxy.py | PetrSpacek/angrylikegame-python-pyqt5 | 2ddc73fb5b4398117c3a83593632408b4b44e246 | [
"MIT"
] | null | null | null | from model.command import AbsCommand
from model.game_model import AbsGameModel
from model.game_object import GameObject
| 25.3 | 52 | 0.713439 | from model.command import AbsCommand
from model.game_model import AbsGameModel
from model.game_object import GameObject
class GameModelProxy(AbsGameModel):
def __init__(self, subject: AbsGameModel):
self.subject = subject
def move_cannon_up(self):
self.subject.move_cannon_up()
def move_c... | 557 | 14 | 319 |
d745485ddfded67faabda3bdea895d1e8ceaa236 | 4,304 | py | Python | test_data/VoigtFit_example.py | jkrogager/VoigtFit | ca84ff4b9e6827e2ca64cd03c9437ab5d4097f1a | [
"MIT"
] | 21 | 2018-03-06T02:06:03.000Z | 2022-01-18T05:24:35.000Z | test_data/VoigtFit_example.py | jkrogager/VoigtFit | ca84ff4b9e6827e2ca64cd03c9437ab5d4097f1a | [
"MIT"
] | 21 | 2018-03-03T11:53:09.000Z | 2022-03-02T20:43:34.000Z | test_data/VoigtFit_example.py | jkrogager/VoigtFit | ca84ff4b9e6827e2ca64cd03c9437ab5d4097f1a | [
"MIT"
] | 9 | 2018-05-16T03:34:19.000Z | 2021-11-30T02:38:17.000Z | import numpy as np
import VoigtFit
### Fit DLA towards quasar Q1313+1441
### Observed in X-shooter P089.A-0068
z_DLA = 1.7941
logNHI = 21.3, 0.1 # value, uncertainty
# If log(NHI) is not known use:
#logNHI = None
#### Load UVB and VIS data:
UVB_fname = 'data/test_UVB_1d.spec'
res_UVB = 8000
VIS_fname = 'data/test_... | 36.168067 | 113 | 0.745818 | import numpy as np
import VoigtFit
### Fit DLA towards quasar Q1313+1441
### Observed in X-shooter P089.A-0068
z_DLA = 1.7941
logNHI = 21.3, 0.1 # value, uncertainty
# If log(NHI) is not known use:
#logNHI = None
#### Load UVB and VIS data:
UVB_fname = 'data/test_UVB_1d.spec'
res_UVB = 8000
VIS_fname = 'data/test_... | 0 | 0 | 0 |
f6f7df60b9e4598c503b7ba14cfaa26f0c4b5828 | 1,098 | py | Python | add_person.py | tomasrasymas/face-recognition-python | 52da6697fb775cfcd0a7e1511b356f6fd9908678 | [
"MIT"
] | null | null | null | add_person.py | tomasrasymas/face-recognition-python | 52da6697fb775cfcd0a7e1511b356f6fd9908678 | [
"MIT"
] | null | null | null | add_person.py | tomasrasymas/face-recognition-python | 52da6697fb775cfcd0a7e1511b356f6fd9908678 | [
"MIT"
] | null | null | null | import os
import cv2
import face_detector
import config
if __name__ == '__main__':
camera = cv2.VideoCapture(0)
cv2.namedWindow("preview")
person_name = input('Person name: ').lower()
person_folder = os.path.join(config.original_images_path, person_name)
if not os.path.exists(person_folder):
... | 24.954545 | 87 | 0.571949 | import os
import cv2
import face_detector
import config
if __name__ == '__main__':
camera = cv2.VideoCapture(0)
cv2.namedWindow("preview")
person_name = input('Person name: ').lower()
person_folder = os.path.join(config.original_images_path, person_name)
if not os.path.exists(person_folder):
... | 0 | 0 | 0 |
3e246085f72d7330f51f46130b2cc931e524e49e | 3,261 | py | Python | nlptoolkit/nlp.py | jeroyang/nlptoolkit | d788fa9011133dca86823b590d23070883e59918 | [
"MIT"
] | null | null | null | nlptoolkit/nlp.py | jeroyang/nlptoolkit | d788fa9011133dca86823b590d23070883e59918 | [
"MIT"
] | null | null | null | nlptoolkit/nlp.py | jeroyang/nlptoolkit | d788fa9011133dca86823b590d23070883e59918 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import re
from itertools import chain, combinations
def clause_tokenize(sentence):
"""Split on comma or parenthesis, if there are more then three words for each clause"""
clause_re = re.compile(r'((?:\S+\s){2,}\S+,|(?:\S+\s){3,}(?=\((?:\S+\s){2,... | 45.929577 | 134 | 0.59399 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import re
from itertools import chain, combinations
def sent_tokenize(context):
paired_symbols = [("(", ")"),
("[", "]"),
("{", "}")]
paired_patterns = ["%s.*?%s" % (re.escape(lt), re.escape(rt)) for lt, rt in... | 974 | 0 | 46 |
ab1daa3d066e1ffb657c4f2921c471c9002bf834 | 234 | py | Python | poc/classes/AuxSTExtension.py | bookofproofs/fpl | 527b43b0f8bb3d459ee906e5ed8524a676ce3a2c | [
"MIT"
] | 4 | 2021-11-08T10:09:46.000Z | 2021-11-13T22:25:46.000Z | poc/classes/AuxSTExtension.py | bookofproofs/fpl | 527b43b0f8bb3d459ee906e5ed8524a676ce3a2c | [
"MIT"
] | 1 | 2020-09-04T13:02:09.000Z | 2021-06-16T07:07:44.000Z | poc/classes/AuxSTExtension.py | bookofproofs/fpl | 527b43b0f8bb3d459ee906e5ed8524a676ce3a2c | [
"MIT"
] | 1 | 2021-11-08T10:10:12.000Z | 2021-11-08T10:10:12.000Z | from poc.classes.AuxST import AuxST
from poc.classes.AuxSymbolTable import AuxSymbolTable
| 21.272727 | 55 | 0.726496 | from poc.classes.AuxST import AuxST
from poc.classes.AuxSymbolTable import AuxSymbolTable
class AuxSTExtension(AuxST):
def __init__(self, i):
super().__init__(AuxSymbolTable.block_axiom, i)
self.extension = ""
| 85 | 7 | 50 |
2bc64e80bf72ed0f849deeb18ccd8a8117379138 | 1,517 | py | Python | sols/111.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/111.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | sols/111.py | Paul11100/LeetCode | 9896c579dff1812c0c76964db8d60603ee715e35 | [
"MIT"
] | null | null | null | from collections import deque
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# BFS (Accepted), O(n) time, O(n) space
# # BFS (Top Voted), O(n) time, O(n) space
... | 32.276596 | 63 | 0.507581 | from collections import deque
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
# BFS (Accepted), O(n) time, O(n) space
def minDepth(self, root: TreeNo... | 462 | -6 | 49 |
8405fff54c92d57f94de1396e91c12fad7fcdf98 | 3,035 | py | Python | automated_logging/tests/models.py | rewardz/django-automated-logging | 3f7c578b42de1e5ddc72cac79014715fc7dffa46 | [
"MIT"
] | 31 | 2018-02-19T08:06:00.000Z | 2021-08-11T14:42:51.000Z | automated_logging/tests/models.py | rewardz/django-automated-logging | 3f7c578b42de1e5ddc72cac79014715fc7dffa46 | [
"MIT"
] | 11 | 2018-09-08T21:11:52.000Z | 2021-09-24T15:49:36.000Z | automated_logging/tests/models.py | rewardz/django-automated-logging | 3f7c578b42de1e5ddc72cac79014715fc7dffa46 | [
"MIT"
] | 11 | 2018-02-18T14:56:04.000Z | 2021-06-23T09:16:17.000Z | import uuid
from django.db.models import (
Model,
UUIDField,
DateTimeField,
ManyToManyField,
CASCADE,
ForeignKey,
OneToOneField,
CharField,
)
from automated_logging.decorators import exclude_model, include_model
class TestBase(Model):
""" Base for all the test models """
id =... | 22.819549 | 76 | 0.689951 | import uuid
from django.db.models import (
Model,
UUIDField,
DateTimeField,
ManyToManyField,
CASCADE,
ForeignKey,
OneToOneField,
CharField,
)
from automated_logging.decorators import exclude_model, include_model
class TestBase(Model):
""" Base for all the test models """
id =... | 0 | 513 | 405 |
c064039faf659c2d777c4940242feee054cd300d | 24 | py | Python | src/utils/__version__.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 8 | 2021-12-08T05:33:58.000Z | 2022-03-07T00:40:48.000Z | src/utils/__version__.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 34 | 2021-08-11T03:59:33.000Z | 2022-03-10T05:39:26.000Z | src/utils/__version__.py | kevin3/cwl-ica | cf706ea42993d563f364c0847ee4b882f8fe067c | [
"MIT"
] | 1 | 2022-01-08T07:34:55.000Z | 2022-01-08T07:34:55.000Z | version = "__VERSION__"
| 12 | 23 | 0.75 | version = "__VERSION__"
| 0 | 0 | 0 |
6e2107cf51e389f1a13fc9e21fc4ac6ecc14ba63 | 2,105 | py | Python | sherlock_scripts/pythonhops/sherlock_jacf.py | apoletayev/anomalous_ion_conduction | badb91e971e4a5263a433cfa9fcbf914d53ed2a1 | [
"MIT"
] | 2 | 2021-05-20T03:49:51.000Z | 2021-06-21T08:41:10.000Z | sherlock_scripts/pythonhops/sherlock_jacf.py | apoletayev/anomalous_ion_conduction | badb91e971e4a5263a433cfa9fcbf914d53ed2a1 | [
"MIT"
] | null | null | null | sherlock_scripts/pythonhops/sherlock_jacf.py | apoletayev/anomalous_ion_conduction | badb91e971e4a5263a433cfa9fcbf914d53ed2a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 10:55:08 2020
@author: andreypoletaev
Assumptions made:
time is in picoseconds, timestep is 1 fs
"""
# =============================================================================
# %% Imports & constants
# ==========================... | 32.384615 | 122 | 0.55772 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 10:55:08 2020
@author: andreypoletaev
Assumptions made:
time is in picoseconds, timestep is 1 fs
"""
# =============================================================================
# %% Imports & constants
# ==========================... | 0 | 0 | 0 |
b13e94b4438f73055adcddf25912666ad6090be7 | 456 | py | Python | symptoms/admin.py | sjsafranek/symptom_tracker | 2e7d9ff3ed946ebbf18b366bbe79deb3b3c94a5c | [
"MIT"
] | null | null | null | symptoms/admin.py | sjsafranek/symptom_tracker | 2e7d9ff3ed946ebbf18b366bbe79deb3b3c94a5c | [
"MIT"
] | null | null | null | symptoms/admin.py | sjsafranek/symptom_tracker | 2e7d9ff3ed946ebbf18b366bbe79deb3b3c94a5c | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
admin.site.register(models.Agency)
admin.site.register(models.Therapist)
admin.site.register(models.Client)
admin.site.register(models.ClientSymptom)
admin.site.register(models.Session)
admin.site.register(models.SymptomScore)
# from guardian.admin import Guard... | 24 | 61 | 0.811404 | from django.contrib import admin
from . import models
admin.site.register(models.Agency)
admin.site.register(models.Therapist)
admin.site.register(models.Client)
admin.site.register(models.ClientSymptom)
admin.site.register(models.Session)
admin.site.register(models.SymptomScore)
# from guardian.admin import Guard... | 0 | 0 | 0 |
40cd83ad44db70333ce38a5c61c142021c8a2fe6 | 6,037 | py | Python | models/algorithms/libfm_fastfm.py | ucds-sg/h2oai | 7042860767dc25d1a7d7122103bbd5016d02df53 | [
"Apache-2.0"
] | 194 | 2019-04-23T10:25:13.000Z | 2022-03-29T04:19:28.000Z | models/algorithms/libfm_fastfm.py | ucds-sg/h2oai | 7042860767dc25d1a7d7122103bbd5016d02df53 | [
"Apache-2.0"
] | 50 | 2019-06-24T20:17:51.000Z | 2022-03-16T20:05:37.000Z | models/algorithms/libfm_fastfm.py | ucds-sg/h2oai | 7042860767dc25d1a7d7122103bbd5016d02df53 | [
"Apache-2.0"
] | 85 | 2019-03-27T12:26:43.000Z | 2022-01-27T13:15:37.000Z | """LibFM implementation of fastFM """
import datatable as dt
import numpy as np
from sklearn.preprocessing import LabelEncoder
from h2oaicore.models import CustomModel
from sklearn.model_selection import StratifiedKFold
from sklearn.calibration import CalibratedClassifierCV
from sklearn.base import BaseEstimator, Class... | 39.980132 | 109 | 0.563525 | """LibFM implementation of fastFM """
import datatable as dt
import numpy as np
from sklearn.preprocessing import LabelEncoder
from h2oaicore.models import CustomModel
from sklearn.model_selection import StratifiedKFold
from sklearn.calibration import CalibratedClassifierCV
from sklearn.base import BaseEstimator, Class... | 5,106 | 447 | 23 |
da62656679c6f24aafd02686ce50bd44338b6f04 | 25,831 | py | Python | lib/kb_Amplicon/Utils/MDSUtils.py | muddymicrobes/MDS | ab85959d85ffb0dd1dbf2537ae4d756f8cbed7e5 | [
"MIT"
] | null | null | null | lib/kb_Amplicon/Utils/MDSUtils.py | muddymicrobes/MDS | ab85959d85ffb0dd1dbf2537ae4d756f8cbed7e5 | [
"MIT"
] | null | null | null | lib/kb_Amplicon/Utils/MDSUtils.py | muddymicrobes/MDS | ab85959d85ffb0dd1dbf2537ae4d756f8cbed7e5 | [
"MIT"
] | null | null | null |
import errno
import json
import logging
import os
import shutil
import uuid
import zipfile
import re
import subprocess
import pandas as pd
from kb_Amplicon.Utils.DataUtil import DataUtil
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseReport
| 43.268007 | 121 | 0.597964 |
import errno
import json
import logging
import os
import shutil
import uuid
import zipfile
import re
import subprocess
import pandas as pd
from kb_Amplicon.Utils.DataUtil import DataUtil
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseReport
class ... | 5,705 | 19,790 | 23 |
87da8a733dcef29dd32be297bf9fda26b92a975c | 1,525 | py | Python | CursoIntensivoPython/alien_invasion/exercicio/star.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | CursoIntensivoPython/alien_invasion/exercicio/star.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | CursoIntensivoPython/alien_invasion/exercicio/star.py | SweydAbdul/estudos-python | b052708d0566a0afb9a1c04d035467d45f820879 | [
"MIT"
] | null | null | null | import pygame
from pygame.sprite import Sprite
import sys
class Estrela(Sprite):
"""Uma classe que representa uma unica estrela"""
def __init__(self, tela, janela):
"""Inicializa a estrela e define sua posicao inicial."""
super(Estrela, self).__init__()
self.janela = janela
sel... | 26.754386 | 67 | 0.602623 | import pygame
from pygame.sprite import Sprite
import sys
class Estrela(Sprite):
"""Uma classe que representa uma unica estrela"""
def __init__(self, tela, janela):
"""Inicializa a estrela e define sua posicao inicial."""
super(Estrela, self).__init__()
self.janela = janela
sel... | 431 | 0 | 23 |
023de8aa7308628a653ef21d3dd78f164e3e9392 | 9,144 | py | Python | tools/tests/helperInclude.py | spockthegray/mantaflow | df72cf235e14ef4f3f8fac9141b5e0a8707406b3 | [
"Apache-2.0"
] | 158 | 2018-06-24T17:42:13.000Z | 2022-03-12T13:29:43.000Z | tools/tests/helperInclude.py | spockthegray/mantaflow | df72cf235e14ef4f3f8fac9141b5e0a8707406b3 | [
"Apache-2.0"
] | 5 | 2018-09-05T07:30:48.000Z | 2020-07-01T08:56:28.000Z | tools/tests/helperInclude.py | spockthegray/mantaflow | df72cf235e14ef4f3f8fac9141b5e0a8707406b3 | [
"Apache-2.0"
] | 35 | 2018-06-13T04:05:42.000Z | 2022-03-29T16:55:24.000Z | #
# Helper functions for test runs in mantaflow
#
from manta import *
import os
import shutil
import re
from helperGeneric import *
# ------------------------------------------------------------------------------------------
# test result checking
# global var to print manta version once per test
printVersion =... | 36.722892 | 141 | 0.675962 | #
# Helper functions for test runs in mantaflow
#
from manta import *
import os
import shutil
import re
from helperGeneric import *
# ------------------------------------------------------------------------------------------
# test result checking
def checkResult( name, result, resultRel , thresh, threshStrict, i... | 7,720 | 0 | 133 |
0a20c06ff463c05d267ec94c8d6e0ff76393e309 | 152 | py | Python | gym_marl_reconnaissance/__init__.py | JacopoPan/gym-marl-reconnaissance | 85a4373f3ebee66b12c88a0bdd5e4e96f9606e5a | [
"MIT"
] | 4 | 2021-08-29T20:13:38.000Z | 2022-02-28T02:39:17.000Z | gym_marl_reconnaissance/__init__.py | JacopoPan/gym-marl-reconnaissance | 85a4373f3ebee66b12c88a0bdd5e4e96f9606e5a | [
"MIT"
] | 1 | 2022-02-28T02:26:04.000Z | 2022-03-22T15:30:58.000Z | gym_marl_reconnaissance/__init__.py | JacopoPan/gym-marl-reconnaissance | 85a4373f3ebee66b12c88a0bdd5e4e96f9606e5a | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='recon-arena-v0',
entry_point='gym_marl_reconnaissance.envs.recon_arena:ReconArena',
)
| 21.714286 | 70 | 0.776316 | from gym.envs.registration import register
register(
id='recon-arena-v0',
entry_point='gym_marl_reconnaissance.envs.recon_arena:ReconArena',
)
| 0 | 0 | 0 |
9c220a151084c5a15cafe9c0fb7e9461558a125f | 165 | py | Python | aliyun/dns/__init__.py | getlantern/python-aliyun | 524ccdc991f952433b2636a94266d31b00823f66 | [
"Apache-2.0"
] | 38 | 2015-05-21T05:59:14.000Z | 2018-11-28T09:14:07.000Z | aliyun/dns/__init__.py | getlantern/python-aliyun | 524ccdc991f952433b2636a94266d31b00823f66 | [
"Apache-2.0"
] | 16 | 2015-03-20T17:55:41.000Z | 2018-05-15T15:09:15.000Z | aliyun/dns/__init__.py | getlantern/python-aliyun | 524ccdc991f952433b2636a94266d31b00823f66 | [
"Apache-2.0"
] | 27 | 2015-03-16T18:32:16.000Z | 2020-11-30T05:28:06.000Z | """
Aliyun ECS
==========
The following DNS API actions are nearly fully supported:
* AddDomainRecord
* DeleteDomainRecord
* DescribeDomainRecords
"""
| 15 | 57 | 0.672727 | """
Aliyun ECS
==========
The following DNS API actions are nearly fully supported:
* AddDomainRecord
* DeleteDomainRecord
* DescribeDomainRecords
"""
| 0 | 0 | 0 |
7ceb822675136513e97564061b6f57e8cccf5494 | 1,037 | py | Python | sentry_sdk/debug.py | Siecje/sentry-python | d8405491c60c5b7c3d2ec3ed97ab4bea104f4e51 | [
"BSD-2-Clause"
] | 1 | 2020-11-02T11:31:01.000Z | 2020-11-02T11:31:01.000Z | sentry_sdk/debug.py | Siecje/sentry-python | d8405491c60c5b7c3d2ec3ed97ab4bea104f4e51 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/debug.py | Siecje/sentry-python | d8405491c60c5b7c3d2ec3ed97ab4bea104f4e51 | [
"BSD-2-Clause"
] | null | null | null | import sys
import logging
from sentry_sdk import utils
from sentry_sdk.hub import Hub
from sentry_sdk.utils import logger
from sentry_sdk.client import _client_init_debug
from logging import LogRecord
| 25.292683 | 84 | 0.711668 | import sys
import logging
from sentry_sdk import utils
from sentry_sdk.hub import Hub
from sentry_sdk.utils import logger
from sentry_sdk.client import _client_init_debug
from logging import LogRecord
class _HubBasedClientFilter(logging.Filter):
def filter(self, record):
# type: (LogRecord) -> bool
... | 690 | 23 | 118 |
600e214504ee1a81a112be83452958bb2542ebd5 | 2,117 | py | Python | intake/cli/bootstrap.py | gramhagen/intake | de4cbb5df78881dc166b1f02743d22067f2bbd78 | [
"BSD-2-Clause"
] | 578 | 2019-02-22T11:45:28.000Z | 2022-03-31T08:32:22.000Z | intake/cli/bootstrap.py | gramhagen/intake | de4cbb5df78881dc166b1f02743d22067f2bbd78 | [
"BSD-2-Clause"
] | 336 | 2019-02-21T16:24:33.000Z | 2022-03-30T09:23:53.000Z | intake/cli/bootstrap.py | gramhagen/intake | de4cbb5df78881dc166b1f02743d22067f2bbd78 | [
"BSD-2-Clause"
] | 99 | 2019-02-22T18:31:09.000Z | 2022-03-22T03:27:54.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
#------------------------------------------------------------------------... | 30.242857 | 98 | 0.512518 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
#------------------------------------------------------------------------... | 0 | 0 | 0 |
4af96fc1ae5139effbf1471a3d5a99c044bf84e9 | 1,828 | py | Python | solutions/0242-valid-anagram/valid-anagram.py | iFun/Project-G | d33b3b3c7bcee64f93dc2539fd9955a27f321d96 | [
"MIT"
] | null | null | null | solutions/0242-valid-anagram/valid-anagram.py | iFun/Project-G | d33b3b3c7bcee64f93dc2539fd9955a27f321d96 | [
"MIT"
] | null | null | null | solutions/0242-valid-anagram/valid-anagram.py | iFun/Project-G | d33b3b3c7bcee64f93dc2539fd9955a27f321d96 | [
"MIT"
] | null | null | null | # Given two strings s and t , write a function to determine if t is an anagram of s.
#
# Example 1:
#
#
# Input: s = "anagram", t = "nagaram"
# Output: true
#
#
# Example 2:
#
#
# Input: s = "rat", t = "car"
# Output: false
#
#
# Note:
# You may assume the string contains only lowercase alphabets.
#
# Follow u... | 19.869565 | 97 | 0.571116 | # Given two strings s and t , write a function to determine if t is an anagram of s.
#
# Example 1:
#
#
# Input: s = "anagram", t = "nagaram"
# Output: true
#
#
# Example 2:
#
#
# Input: s = "rat", t = "car"
# Output: false
#
#
# Note:
# You may assume the string contains only lowercase alphabets.
#
# Follow u... | 651 | -6 | 49 |
5b3660b9d00705aa230281fe180336f75f2007d3 | 3,568 | py | Python | interpreter/theRealLiner.py | Crain-32/Liner | 4656d086425877fbd50f23f383222cf85220012f | [
"Apache-2.0"
] | 1 | 2021-08-04T00:59:43.000Z | 2021-08-04T00:59:43.000Z | interpreter/theRealLiner.py | Crain-32/Liner | 4656d086425877fbd50f23f383222cf85220012f | [
"Apache-2.0"
] | null | null | null | interpreter/theRealLiner.py | Crain-32/Liner | 4656d086425877fbd50f23f383222cf85220012f | [
"Apache-2.0"
] | null | null | null | """
*`prin` Prints the results of all the following function, and the numeric value
of any namespace.
*`let` converts an integer into its Unicode character.
*`if` returns the highest number of two different namespaces/function
*`set` override the numeric value of a namespace, and replaces the original in duplicate cas... | 33.037037 | 95 | 0.60454 | """
*`prin` Prints the results of all the following function, and the numeric value
of any namespace.
*`let` converts an integer into its Unicode character.
*`if` returns the highest number of two different namespaces/function
*`set` override the numeric value of a namespace, and replaces the original in duplicate cas... | 2,713 | -9 | 346 |
8be2210037ef9e111391e66eb0f8edd82c0e78a5 | 1,095 | py | Python | recognition/recongitions.py | HermasTV/uol_face_detection_recognition | 7622fb23c31651cb25fc995bcdaabffd8f24a1a1 | [
"MIT"
] | null | null | null | recognition/recongitions.py | HermasTV/uol_face_detection_recognition | 7622fb23c31651cb25fc995bcdaabffd8f24a1a1 | [
"MIT"
] | null | null | null | recognition/recongitions.py | HermasTV/uol_face_detection_recognition | 7622fb23c31651cb25fc995bcdaabffd8f24a1a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""detectors.py: contains face detectors modules."""
__author__ = "Ahmed Hermas"
__copyright__ = "Copyright 2022, © UOL "
__license__ = "MIT"
__version__ = "0.0.1"
__email__ = "a7medhermas@gmail.com"
import os
import torch
from cv2 import cv2
import utils
import numpy as np
from Siamese_resnet1... | 28.076923 | 82 | 0.673059 | #!/usr/bin/env python3
"""detectors.py: contains face detectors modules."""
__author__ = "Ahmed Hermas"
__copyright__ = "Copyright 2022, © UOL "
__license__ = "MIT"
__version__ = "0.0.1"
__email__ = "a7medhermas@gmail.com"
import os
import torch
from cv2 import cv2
import utils
import numpy as np
from Siamese_resnet1... | 645 | -4 | 115 |
ae0166d5856fe574d19d0263006e54665d49d87a | 2,825 | py | Python | examples/ciq_identity.py | saegel/python-stix | a777aafa2573d5e66233e29b1909ce178f643891 | [
"BSD-3-Clause"
] | 194 | 2015-02-20T17:52:06.000Z | 2022-03-06T07:29:08.000Z | examples/ciq_identity.py | saegel/python-stix | a777aafa2573d5e66233e29b1909ce178f643891 | [
"BSD-3-Clause"
] | 136 | 2015-01-12T05:33:35.000Z | 2022-03-12T07:41:42.000Z | examples/ciq_identity.py | saegel/python-stix | a777aafa2573d5e66233e29b1909ce178f643891 | [
"BSD-3-Clause"
] | 82 | 2015-01-05T14:46:16.000Z | 2022-03-30T06:00:45.000Z | #!/usr/bin/env python
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
"""
Description: An example of how to add CIQ Identity information to a STIX
Indicator.
"""
# stdlib
from pprint import pprint
# python-cybox
from cybox.objects.file_object import File
# pyth... | 31.043956 | 78 | 0.722478 | #!/usr/bin/env python
# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
"""
Description: An example of how to add CIQ Identity information to a STIX
Indicator.
"""
# stdlib
from pprint import pprint
# python-cybox
from cybox.objects.file_object import File
# pyth... | 2,263 | 0 | 23 |
e3b7626d09367b525a8b131aacf60f75a7a8d063 | 793 | py | Python | bomb.py | eric2007/Python-game-of-bomb-finder | 2b5c80363d2d829c199fac480345e0176021882d | [
"MIT"
] | null | null | null | bomb.py | eric2007/Python-game-of-bomb-finder | 2b5c80363d2d829c199fac480345e0176021882d | [
"MIT"
] | null | null | null | bomb.py | eric2007/Python-game-of-bomb-finder | 2b5c80363d2d829c199fac480345e0176021882d | [
"MIT"
] | null | null | null | import pygame
| 30.5 | 65 | 0.554855 | import pygame
class Bomb(pygame.sprite.Sprite):
def __init__(self,color, x, y):
pygame.sprite.Sprite.__init__(self)
self.isHidden = True
self.color = color
self.image = pygame.image.load(r'empty.gif')
self.rect = self.image.get_rect()
self.rect.topleft = [x,y]
def... | 605 | 12 | 152 |
27682f03712aaa784ac0638f01a7479a671b0930 | 1,465 | py | Python | src/s3_transfer.py | rkaahean/weather-scrape | b85a22151e19429e83e71531943bc6766b20304e | [
"Apache-2.0"
] | null | null | null | src/s3_transfer.py | rkaahean/weather-scrape | b85a22151e19429e83e71531943bc6766b20304e | [
"Apache-2.0"
] | 4 | 2020-05-07T09:31:24.000Z | 2020-05-08T06:46:13.000Z | src/s3_transfer.py | rkaahean/weather-scrape | b85a22151e19429e83e71531943bc6766b20304e | [
"Apache-2.0"
] | null | null | null | import boto3
import configparser
import logging
from datetime import datetime
from botocore.exceptions import NoCredentialsError
import os
import sys
from pathlib import Path
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from src.constants import FILE_NAME
"""
Setting up s3 destination structure.
... | 22.19697 | 94 | 0.711263 | import boto3
import configparser
import logging
from datetime import datetime
from botocore.exceptions import NoCredentialsError
import os
import sys
from pathlib import Path
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from src.constants import FILE_NAME
"""
Setting up s3 destination structure.
... | 0 | 0 | 0 |
6b3a348a4ea5ce822a4219b204beebee38d50090 | 363 | py | Python | src/pandas_profiling/report/presentation/core/html.py | abhicantdraw/pandas-profiling | a12ebb7a94b9371df94bf611237a389d99f8bc00 | [
"MIT"
] | 8,107 | 2018-01-07T23:27:39.000Z | 2022-02-22T12:57:11.000Z | src/pandas_profiling/report/presentation/core/html.py | abhicantdraw/pandas-profiling | a12ebb7a94b9371df94bf611237a389d99f8bc00 | [
"MIT"
] | 771 | 2018-01-06T11:33:08.000Z | 2022-02-21T11:16:02.000Z | src/pandas_profiling/report/presentation/core/html.py | abhicantdraw/pandas-profiling | a12ebb7a94b9371df94bf611237a389d99f8bc00 | [
"MIT"
] | 1,308 | 2018-01-08T21:22:08.000Z | 2022-02-21T04:10:21.000Z | from typing import Any
from pandas_profiling.report.presentation.core.item_renderer import ItemRenderer
| 24.2 | 80 | 0.677686 | from typing import Any
from pandas_profiling.report.presentation.core.item_renderer import ItemRenderer
class HTML(ItemRenderer):
def __init__(self, content: str, **kwargs):
super().__init__("html", {"html": content}, **kwargs)
def __repr__(self) -> str:
return "HTML"
def render(self) -... | 150 | 4 | 103 |
ad8010831a49578bee5bd4cb162c4edd05b5f6a3 | 3,679 | py | Python | pyflowgraph/visual.py | stspbu/code-change-miner | a9aceb92a3484f0c3c8140bbb986bfec1e2d7562 | [
"Apache-2.0"
] | 1 | 2020-09-06T16:32:17.000Z | 2020-09-06T16:32:17.000Z | pyflowgraph/visual.py | neomatrix369/code-change-miner | 4fe24d03c8512202bc80a77bf1ebee456d8400d7 | [
"Apache-2.0"
] | null | null | null | pyflowgraph/visual.py | neomatrix369/code-change-miner | 4fe24d03c8512202bc80a77bf1ebee456d8400d7 | [
"Apache-2.0"
] | null | null | null | import graphviz as gv
import os
from pyflowgraph.models import ExtControlFlowGraph, DataNode, OperationNode, ControlNode, ControlEdge, DataEdge, EntryNode
| 41.337079 | 122 | 0.643653 | import graphviz as gv
import os
from pyflowgraph.models import ExtControlFlowGraph, DataNode, OperationNode, ControlNode, ControlEdge, DataEdge, EntryNode
def _get_label_and_attrs(node, show_op_kind=True, show_data_keys=False):
label = f'{node.label}'
attrs = {}
if isinstance(node, DataNode):
at... | 3,451 | 0 | 69 |
b484bf03eff33ef8a88973fb7e0988e315bc3613 | 591 | py | Python | learning/01-pattern/00-recursion-backtracking/07-fibonacci.py | tienduy-nguyen/ds-algorithms | 5c211393f19a97215beb061ed826362fadf83326 | [
"MIT"
] | null | null | null | learning/01-pattern/00-recursion-backtracking/07-fibonacci.py | tienduy-nguyen/ds-algorithms | 5c211393f19a97215beb061ed826362fadf83326 | [
"MIT"
] | null | null | null | learning/01-pattern/00-recursion-backtracking/07-fibonacci.py | tienduy-nguyen/ds-algorithms | 5c211393f19a97215beb061ed826362fadf83326 | [
"MIT"
] | null | null | null |
# not good
# Dynamic programing
| 17.382353 | 66 | 0.529611 | def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
# not good
def fibonacci_recursion(n):
if n < 2:
return n
return fibonacci_recursion(n - 1) + fibonacci_recursion(n - 2)
def fibonacci(n):
if n <= 1:
return n
fib = [0, 1]
for i in ran... | 465 | 0 | 89 |
7ac1fd31606dbc3b5b90d1efc4ed050693153622 | 1,803 | py | Python | tests/test_model.py | daifoundation/ethtx_ce | 5aa0de0e33f6af569e840554b024116c9a21d54b | [
"Apache-2.0"
] | 1 | 2021-07-26T11:05:24.000Z | 2021-07-26T11:05:24.000Z | tests/test_model.py | daifoundation/ethtx_ce | 5aa0de0e33f6af569e840554b024116c9a21d54b | [
"Apache-2.0"
] | null | null | null | tests/test_model.py | daifoundation/ethtx_ce | 5aa0de0e33f6af569e840554b024116c9a21d54b | [
"Apache-2.0"
] | 1 | 2021-07-26T11:05:32.000Z | 2021-07-26T11:05:32.000Z | from datetime import datetime
from ethtx_ce.config import EthConfig
from ethtx_ce.backend.models.objects_model import Block, Event, Transaction
from mocks.mocks import MockWeb3Provider
| 37.5625 | 86 | 0.716583 | from datetime import datetime
from ethtx_ce.config import EthConfig
from ethtx_ce.backend.models.objects_model import Block, Event, Transaction
from mocks.mocks import MockWeb3Provider
class TestModel:
def test_create_transaction(self):
tx_hash = "0xd7701a0fc05593aee3a16f20cab605db7183f752ae942cc75fd0975... | 1,464 | -5 | 157 |
e7f77c402f926f2c0f88139332f635d977b294bd | 65,367 | py | Python | run_simulation_woggm.py | Wang518hongyu/PyGEMwangtest | f6ff507681b45599d0ecce5be2e5292e94fd09f7 | [
"MIT"
] | null | null | null | run_simulation_woggm.py | Wang518hongyu/PyGEMwangtest | f6ff507681b45599d0ecce5be2e5292e94fd09f7 | [
"MIT"
] | null | null | null | run_simulation_woggm.py | Wang518hongyu/PyGEMwangtest | f6ff507681b45599d0ecce5be2e5292e94fd09f7 | [
"MIT"
] | null | null | null | """Run a model simulation."""
# Default climate data is ERA-Interim; specify CMIP5 by specifying a filename to the argument:
# (Command line) python run_simulation_list_multiprocess.py -gcm_list_fn=C:\...\gcm_rcpXX_filenames.txt
# - Default is running ERA-Interim in parallel with five processors.
# (Spyd... | 57.59207 | 122 | 0.599354 | """Run a model simulation."""
# Default climate data is ERA-Interim; specify CMIP5 by specifying a filename to the argument:
# (Command line) python run_simulation_list_multiprocess.py -gcm_list_fn=C:\...\gcm_rcpXX_filenames.txt
# - Default is running ERA-Interim in parallel with five processors.
# (Spyd... | 0 | 0 | 0 |
90b763967161ada45c58e7d2a7c5158c9e848ee0 | 6,276 | py | Python | sopel_modules/SpiceBot/Translate.py | deathbybandaid/Sopel-SpiceBotSERV | 816dddc88943b9194f3f0aa6558759eedd585343 | [
"EFL-2.0"
] | 2 | 2018-07-24T14:04:36.000Z | 2019-01-11T21:41:50.000Z | sopel_modules/SpiceBot/Translate.py | deathbybandaid/Sopel-SpiceBotSERV | 816dddc88943b9194f3f0aa6558759eedd585343 | [
"EFL-2.0"
] | 947 | 2018-07-24T01:50:29.000Z | 2019-04-14T22:40:57.000Z | sopel_modules/SpiceBot/Translate.py | deathbybandaid/Sopel-SpiceBotSERV | 816dddc88943b9194f3f0aa6558759eedd585343 | [
"EFL-2.0"
] | 6 | 2019-04-12T17:09:07.000Z | 2019-09-30T05:56:15.000Z | # coding=utf8
from __future__ import unicode_literals, absolute_import, division, print_function
from sopel_modules.spicemanip import spicemanip
import re
from num2words import num2words
translate = Translate()
| 32.020408 | 155 | 0.497291 | # coding=utf8
from __future__ import unicode_literals, absolute_import, division, print_function
from sopel_modules.spicemanip import spicemanip
import re
from num2words import num2words
class Translate():
def __init__(self):
self.dict = {}
def bot_translate_process(self, totranslate, translationt... | 5,716 | -3 | 347 |
f12e3008a4319a15eacceb3b37eb991f2dfc9a15 | 1,108 | py | Python | models/type.py | DevgurusSupport/commercetools-python-sdk | 849c4cc182b68850fedc1f67a594449c28a4f751 | [
"MIT"
] | null | null | null | models/type.py | DevgurusSupport/commercetools-python-sdk | 849c4cc182b68850fedc1f67a594449c28a4f751 | [
"MIT"
] | null | null | null | models/type.py | DevgurusSupport/commercetools-python-sdk | 849c4cc182b68850fedc1f67a594449c28a4f751 | [
"MIT"
] | null | null | null | from .basemodel import BaseModel
from .types.field_definition import FieldDefinition
from typing import List, Dict
| 36.933333 | 178 | 0.643502 | from .basemodel import BaseModel
from .types.field_definition import FieldDefinition
from typing import List, Dict
class Type(BaseModel):
key: str
name: Dict
description: Dict
resourceTypeIds: List[str]
fieldDefinitions: List[FieldDefinition]
def __init__(self, key: str = None, name: Dict = N... | 816 | 153 | 23 |
7e168a33fd90d6bac2118972d179f010ae072f3f | 1,688 | py | Python | scripts/strelka-2.9.2.centos6_x86_64/share/scoringModelTraining/somatic/lib/evs/features/__init__.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 7 | 2021-09-03T09:11:00.000Z | 2022-02-14T15:02:12.000Z | scripts/strelka-2.9.2.centos6_x86_64/share/scoringModelTraining/somatic/lib/evs/features/__init__.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | null | null | null | scripts/strelka-2.9.2.centos6_x86_64/share/scoringModelTraining/somatic/lib/evs/features/__init__.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 2 | 2022-01-10T13:07:29.000Z | 2022-01-11T22:14:11.000Z | #
# Strelka - Small Variant Caller
# Copyright (c) 2009-2018 Illumina, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# at your option) any later vers... | 27.225806 | 88 | 0.673578 | #
# Strelka - Small Variant Caller
# Copyright (c) 2009-2018 Illumina, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# at your option) any later vers... | 282 | 0 | 79 |
c98f6322ac2340652aaaf45eb747da841ba74e6d | 2,815 | py | Python | simulation/utils/geometry/test/test_frame.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | 13 | 2020-06-30T17:18:28.000Z | 2021-07-20T16:55:35.000Z | simulation/utils/geometry/test/test_frame.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | 1 | 2020-11-10T20:15:42.000Z | 2020-12-25T18:27:56.000Z | simulation/utils/geometry/test/test_frame.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | 3 | 2020-07-20T09:09:08.000Z | 2021-07-20T17:00:37.000Z | import math
import unittest
from simulation.utils.geometry.frame import Frame, validate_and_maintain_frames
from simulation.utils.geometry.transform import Transform
from simulation.utils.geometry.vector import Vector
if __name__ == "__main__":
unittest.main()
| 31.988636 | 83 | 0.630906 | import math
import unittest
from simulation.utils.geometry.frame import Frame, validate_and_maintain_frames
from simulation.utils.geometry.transform import Transform
from simulation.utils.geometry.vector import Vector
class ModuleTest(unittest.TestCase):
def test_connecting_frames(self):
"""Test if frame... | 87 | 2,436 | 23 |
bdeac31fc404c7ca4aa58750eff8f810ef925d2f | 990 | py | Python | tests/window/WINDOW_SET_ICON.py | theblacklion/pyglet | 5fd5c7d581e376946b7a94fac9582c09ad65bcd2 | [
"BSD-3-Clause"
] | 1 | 2016-07-19T16:56:46.000Z | 2016-07-19T16:56:46.000Z | tests/window/WINDOW_SET_ICON.py | theblacklion/pyglet | 5fd5c7d581e376946b7a94fac9582c09ad65bcd2 | [
"BSD-3-Clause"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | tests/window/WINDOW_SET_ICON.py | theblacklion/pyglet | 5fd5c7d581e376946b7a94fac9582c09ad65bcd2 | [
"BSD-3-Clause"
] | 1 | 2019-09-06T03:05:35.000Z | 2019-09-06T03:05:35.000Z | #!/usr/bin/env python
'''Test that window icon can be set.
Expected behaviour:
One window will be opened. It will have an icon depicting a yellow
"A".
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:... | 25.384615 | 87 | 0.674747 | #!/usr/bin/env python
'''Test that window icon can be set.
Expected behaviour:
One window will be opened. It will have an icon depicting a yellow
"A".
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:... | 323 | 20 | 49 |
10a5a338a92a7f9288831f9283b572e927bc7fcb | 867 | py | Python | blender/arm/logicnode/object/LN_raycast_object.py | proteanblank/armory | edec5c2c3626cfc16065ccc5cf24e02f03187465 | [
"Zlib"
] | 2 | 2020-04-16T20:32:15.000Z | 2021-12-15T10:50:05.000Z | blender/arm/logicnode/object/LN_raycast_object.py | proteanblank/armory | edec5c2c3626cfc16065ccc5cf24e02f03187465 | [
"Zlib"
] | 1 | 2020-09-13T09:34:57.000Z | 2020-09-13T09:34:57.000Z | blender/arm/logicnode/object/LN_raycast_object.py | proteanblank/armory | edec5c2c3626cfc16065ccc5cf24e02f03187465 | [
"Zlib"
] | 1 | 2019-09-24T14:25:35.000Z | 2019-09-24T14:25:35.000Z | from arm.logicnode.arm_nodes import *
class RaycastObjectNode(ArmLogicTreeNode):
"""it takes an object and returns true or false if the object is touched at screen (x, y) and the (x,y, z) position of that touch if returned"""
bl_idname = 'LNRaycastObjectNode'
bl_label = 'Raycast Object'
arm_section = '... | 39.409091 | 148 | 0.675894 | from arm.logicnode.arm_nodes import *
class RaycastObjectNode(ArmLogicTreeNode):
"""it takes an object and returns true or false if the object is touched at screen (x, y) and the (x,y, z) position of that touch if returned"""
bl_idname = 'LNRaycastObjectNode'
bl_label = 'Raycast Object'
arm_section = '... | 492 | 0 | 27 |
d299f91d21993de099da6d5c3ffc6a6c7b0fdbe5 | 3,824 | py | Python | upnpc/client.py | hamsteruser/upnpc_py | c2409ad262ea1fa48c847837d8141bd1851af193 | [
"MIT"
] | null | null | null | upnpc/client.py | hamsteruser/upnpc_py | c2409ad262ea1fa48c847837d8141bd1851af193 | [
"MIT"
] | null | null | null | upnpc/client.py | hamsteruser/upnpc_py | c2409ad262ea1fa48c847837d8141bd1851af193 | [
"MIT"
] | null | null | null | import miniupnpc
import random
import itertools
import ipaddress
if __name__ == "__main__":
pm = port_manager()
print(pm.discover())
(result, port) = pm.mapport()
print(result, port)
print(pm.used_ports())
print(pm.unmapport(int(port)))
print(pm.used_ports())
print(pm.unmap_ports(close... | 35.082569 | 119 | 0.558316 | import miniupnpc
import random
import itertools
import ipaddress
class port_manager():
def __init__(self):
''' initialize a uPnP '''
try:
self.upnp = miniupnpc.UPnP()
self.discover()
except Exception as err:
print(err)
raise ValueError("uPnP ... | 432 | 3,038 | 23 |
6ec87ca6e40ae1af7ac430c629c1de5301101e79 | 315 | py | Python | mysite/article/views.py | ismailtimo29/e-olymp-clone | 900b8eb596d893642b493c12c09e248d86d72a85 | [
"Unlicense"
] | 1 | 2021-03-03T22:25:23.000Z | 2021-03-03T22:25:23.000Z | mysite/article/views.py | akhadov11/e-olymp-clone | 900b8eb596d893642b493c12c09e248d86d72a85 | [
"Unlicense"
] | null | null | null | mysite/article/views.py | akhadov11/e-olymp-clone | 900b8eb596d893642b493c12c09e248d86d72a85 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render
from rest_framework import viewsets
from .models import Item
from .serializers import ItemSerializer
| 26.25 | 57 | 0.8 | from django.shortcuts import render
from rest_framework import viewsets
from .models import Item
from .serializers import ItemSerializer
class ItemViewSet(viewsets.ModelViewSet, ItemSerializer):
permission_classes = []
serializer_class = ItemSerializer
queryset = Item.objects.order_by('-post_time')
| 0 | 153 | 23 |
22d8500af8da68aaa57954193c1fa5124901be5b | 408 | py | Python | plugins/dbnd-tensorflow/src/dbnd_tensorflow/marshalling/tensorflow_values.py | busunkim96/dbnd | 0191fdcd4c4fbd35006f1026d1a55b2abab9097b | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | plugins/dbnd-tensorflow/src/dbnd_tensorflow/marshalling/tensorflow_values.py | busunkim96/dbnd | 0191fdcd4c4fbd35006f1026d1a55b2abab9097b | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | plugins/dbnd-tensorflow/src/dbnd_tensorflow/marshalling/tensorflow_values.py | busunkim96/dbnd | 0191fdcd4c4fbd35006f1026d1a55b2abab9097b | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | from tensorflow.keras import models
from tensorflow.keras.callbacks import History
from targets.values.builtins_values import DataValueType
| 24 | 56 | 0.781863 | from tensorflow.keras import models
from tensorflow.keras.callbacks import History
from targets.values.builtins_values import DataValueType
class TensorflowModelValueType(DataValueType):
type = models.Model
type_str = "Model"
config_name = "tensorflow_model"
class TensorflowHistoryValueType(DataValueTy... | 0 | 219 | 46 |
86b06fba764b1a4406ad0f6948dbaa2789f40664 | 8,989 | py | Python | python/stepspy-current/demo/demo_powerflow.py | changgang/steps | 9b8ea474581885129d1c1a1c3ad40bc8058a7e0a | [
"MIT"
] | 29 | 2019-10-30T07:04:10.000Z | 2022-02-22T06:34:32.000Z | python/stepspy-current/demo/demo_powerflow.py | cuihantao/steps | 60327bf42299cb7117ed5907a931583d7cdf590d | [
"MIT"
] | 1 | 2021-09-25T15:29:59.000Z | 2022-01-05T14:04:18.000Z | python/stepspy-current/demo/demo_powerflow.py | changgang/steps | 9b8ea474581885129d1c1a1c3ad40bc8058a7e0a | [
"MIT"
] | 8 | 2019-12-20T16:13:46.000Z | 2022-03-20T14:58:23.000Z | #coding = utf-8
'''
Here is a demo of showing how to slove powerflow with stepspy.
Changgang Li, 2019/08/25
'''
from stepspy import STEPS # import the class 'STEPS'
simulator = STEPS(is_default=True) # create a STEPS simulator instance
simulator.info()
powerflow_data_file = 'IEEE9.raw' # file name of powerflow data... | 45.39899 | 180 | 0.766047 | #coding = utf-8
'''
Here is a demo of showing how to slove powerflow with stepspy.
Changgang Li, 2019/08/25
'''
from stepspy import STEPS # import the class 'STEPS'
simulator = STEPS(is_default=True) # create a STEPS simulator instance
simulator.info()
powerflow_data_file = 'IEEE9.raw' # file name of powerflow data... | 0 | 0 | 0 |
c62690b142f347c026178eead428488587719c22 | 9,918 | py | Python | scripts/ckpt_processor/read_fti_ckpts.py | Knoxort/fti | c784a535aae17ec4df28d025b1d589bd6a71948d | [
"BSD-3-Clause"
] | 34 | 2015-03-16T03:04:37.000Z | 2022-02-28T19:59:57.000Z | scripts/ckpt_processor/read_fti_ckpts.py | Knoxort/fti | c784a535aae17ec4df28d025b1d589bd6a71948d | [
"BSD-3-Clause"
] | 155 | 2015-12-07T23:12:16.000Z | 2022-01-15T19:14:34.000Z | scripts/ckpt_processor/read_fti_ckpts.py | Knoxort/fti | c784a535aae17ec4df28d025b1d589bd6a71948d | [
"BSD-3-Clause"
] | 29 | 2015-03-20T02:16:35.000Z | 2021-11-11T16:10:17.000Z | # This module initiates the checkpoint
# processing of FTI files.
import os
import glob
import os.path
import time
from fnmatch import fnmatch
import configparser
import posix_read_ckpts
import subprocess
import sys
# variables used for input validation
fti_levels = (1, 2, 3, 4)
output_formats = ('CSV', 'HDF5', 'dat... | 31.993548 | 109 | 0.619681 | # This module initiates the checkpoint
# processing of FTI files.
import os
import glob
import os.path
import time
from fnmatch import fnmatch
import configparser
import posix_read_ckpts
import subprocess
import sys
# variables used for input validation
fti_levels = (1, 2, 3, 4)
output_formats = ('CSV', 'HDF5', 'dat... | 8,326 | 0 | 176 |
b15a0e4cd2f7f657e116c512dee66346dc5c3c3d | 10,882 | py | Python | tests/test_projectcounts/test_weekly_aggregation.py | wikimedia/analytics-aggregator | e07c0dc2d3102a591e5e968a7e4c49499770fe39 | [
"Apache-2.0"
] | 1 | 2018-01-09T07:49:21.000Z | 2018-01-09T07:49:21.000Z | tests/test_projectcounts/test_weekly_aggregation.py | wikimedia/analytics-aggregator | e07c0dc2d3102a591e5e968a7e4c49499770fe39 | [
"Apache-2.0"
] | null | null | null | tests/test_projectcounts/test_weekly_aggregation.py | wikimedia/analytics-aggregator | e07c0dc2d3102a591e5e968a7e4c49499770fe39 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... | 36.516779 | 76 | 0.529314 | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... | 9,697 | 0 | 215 |
4dfca50f1b3f1df35c4e5dbc925eb02663bd476e | 608 | py | Python | python/2542 - Iu-Di-Oh!.py | kaiosatiro/URIjudge_beecrowd | e646c771384e77e6b6e38d88f58aa8c61f0a3cb7 | [
"MIT"
] | null | null | null | python/2542 - Iu-Di-Oh!.py | kaiosatiro/URIjudge_beecrowd | e646c771384e77e6b6e38d88f58aa8c61f0a3cb7 | [
"MIT"
] | null | null | null | python/2542 - Iu-Di-Oh!.py | kaiosatiro/URIjudge_beecrowd | e646c771384e77e6b6e38d88f58aa8c61f0a3cb7 | [
"MIT"
] | null | null | null | while True:
try:
n = int(input())
m,l = map(int, input().split(' '))
m_dic = {}
l_dic = {}
for i in range(1, m+1):
m_dic[i] = list(map(int, input().split(' ')))
for i in range(1, l+1):
l_dic[i] = list(map(int, input().split(' ')))
cm... | 23.384615 | 57 | 0.404605 | while True:
try:
n = int(input())
m,l = map(int, input().split(' '))
m_dic = {}
l_dic = {}
for i in range(1, m+1):
m_dic[i] = list(map(int, input().split(' ')))
for i in range(1, l+1):
l_dic[i] = list(map(int, input().split(' ')))
cm... | 0 | 0 | 0 |
7ddbe2a2af26ca48666b40b82ce35ef3a04ace79 | 437 | py | Python | data_structures/linked-list/conftest.py | zarkle/data-structures-and-algorithms | 0485b95f5aabc0ee255cd7e50b48a6ccec851e00 | [
"MIT"
] | 1 | 2021-01-28T07:32:17.000Z | 2021-01-28T07:32:17.000Z | data_structures/linked-list/conftest.py | zarkle/data-structures-and-algorithms | 0485b95f5aabc0ee255cd7e50b48a6ccec851e00 | [
"MIT"
] | null | null | null | data_structures/linked-list/conftest.py | zarkle/data-structures-and-algorithms | 0485b95f5aabc0ee255cd7e50b48a6ccec851e00 | [
"MIT"
] | 1 | 2020-04-10T08:01:50.000Z | 2020-04-10T08:01:50.000Z | import pytest
from linked_list import LinkedList as LL
@pytest.fixture
def empty_ll():
"""fixture for empty array"""
return LL()
@pytest.fixture
def small_ll():
"""fixture for short array"""
return LL([1, 2, 3, 4])
@pytest.fixture
def short_ll():
"""fixture for short array"""
return LL([5,... | 16.185185 | 40 | 0.624714 | import pytest
from linked_list import LinkedList as LL
@pytest.fixture
def empty_ll():
"""fixture for empty array"""
return LL()
@pytest.fixture
def small_ll():
"""fixture for short array"""
return LL([1, 2, 3, 4])
@pytest.fixture
def short_ll():
"""fixture for short array"""
return LL([5,... | 0 | 0 | 0 |
4eb9be9e5bdd2a42932ae0913e83fcaa9ef5590a | 2,403 | py | Python | graph_sampler/reject_to_uniform.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | graph_sampler/reject_to_uniform.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | graph_sampler/reject_to_uniform.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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... | 32.917808 | 76 | 0.718685 | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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... | 1,107 | 0 | 23 |
131cadd4426c23dcd44f31279f6c1992ea0649c5 | 47,673 | py | Python | reana_client/cli/workflow.py | VMois/reana-client | 206a7fb5762ac28a97095ad774e88054af53b2f7 | [
"MIT"
] | null | null | null | reana_client/cli/workflow.py | VMois/reana-client | 206a7fb5762ac28a97095ad774e88054af53b2f7 | [
"MIT"
] | null | null | null | reana_client/cli/workflow.py | VMois/reana-client | 206a7fb5762ac28a97095ad774e88054af53b2f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA client workflow related commands."""
import json
import logging
import os
impor... | 34.772429 | 193 | 0.592683 | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA client workflow related commands."""
import json
import logging
import os
impor... | 3,012 | 0 | 108 |
f55121917310571bd99506aae23fcb3e38f91bbb | 12,863 | py | Python | buildtest/config.py | shahzebsiddiqui/buildtest-1 | 6c47424b82ec1e92ce0930f99be4ba10da62515c | [
"MIT"
] | null | null | null | buildtest/config.py | shahzebsiddiqui/buildtest-1 | 6c47424b82ec1e92ce0930f99be4ba10da62515c | [
"MIT"
] | 42 | 2021-04-20T11:11:06.000Z | 2022-03-30T16:54:24.000Z | buildtest/config.py | shahzebsiddiqui/buildtest-1 | 6c47424b82ec1e92ce0930f99be4ba10da62515c | [
"MIT"
] | null | null | null | import json
import logging
import re
from buildtest.defaults import (
DEFAULT_SETTINGS_FILE,
DEFAULT_SETTINGS_SCHEMA,
USER_SETTINGS_FILE,
)
from buildtest.exceptions import ConfigurationError
from buildtest.schemas.defaults import custom_validator
from buildtest.schemas.utils import load_recipe, load_schem... | 38.169139 | 189 | 0.566042 | import json
import logging
import re
from buildtest.defaults import (
DEFAULT_SETTINGS_FILE,
DEFAULT_SETTINGS_SCHEMA,
USER_SETTINGS_FILE,
)
from buildtest.exceptions import ConfigurationError
from buildtest.schemas.defaults import custom_validator
from buildtest.schemas.utils import load_recipe, load_schem... | 751 | 0 | 106 |
756d20aa02f85429376fdfee0f98ca46c91f170f | 11,781 | py | Python | libraries/graphite2-1.3.12/tests/graphite.py | myzhang1029/zmymingw | 4c6b6088fb8a03248a1e6d9d6126dfaf225ffa56 | [
"CC0-1.0"
] | null | null | null | libraries/graphite2-1.3.12/tests/graphite.py | myzhang1029/zmymingw | 4c6b6088fb8a03248a1e6d9d6126dfaf225ffa56 | [
"CC0-1.0"
] | null | null | null | libraries/graphite2-1.3.12/tests/graphite.py | myzhang1029/zmymingw | 4c6b6088fb8a03248a1e6d9d6126dfaf225ffa56 | [
"CC0-1.0"
] | null | null | null | # Copyright 2012, SIL International
# All rights reserved.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of License, or
# (at your option) any lat... | 32.454545 | 163 | 0.678975 | # Copyright 2012, SIL International
# All rights reserved.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of License, or
# (at your option) any lat... | 4,853 | 1,444 | 677 |
9de4506c0dcebe59faf722b9fbf0a45256f07f38 | 3,765 | py | Python | pvtpy/eos/peng_robinson.py | scuervo91/pvtpy | 6fe42caee6a193e7a406b3461a397dada3c32445 | [
"MIT"
] | null | null | null | pvtpy/eos/peng_robinson.py | scuervo91/pvtpy | 6fe42caee6a193e7a406b3461a397dada3c32445 | [
"MIT"
] | null | null | null | pvtpy/eos/peng_robinson.py | scuervo91/pvtpy | 6fe42caee6a193e7a406b3461a397dada3c32445 | [
"MIT"
] | null | null | null | from pydantic import BaseModel, Field
import numpy as np
from ..units import Pressure, Temperature, CriticalProperties
| 35.518868 | 128 | 0.588845 | from pydantic import BaseModel, Field
import numpy as np
from ..units import Pressure, Temperature, CriticalProperties
class PengRobinson(BaseModel):
a: float = Field(None)
b: float = Field(None)
alpha: float = Field(None)
a_alpha: float = Field(None)
def coef_ab(self,critical_properties:Crit... | 3,282 | 341 | 23 |
58dd7ca0dc1e5f7d4f6f08f327033b0d25f35645 | 2,139 | py | Python | tests/test_mpdtoxml.py | wreszelewski/python-mpegdash | a0f83810e479711f2f40dd8c44b5a903438a0dcc | [
"MIT"
] | 39 | 2019-10-12T13:41:01.000Z | 2022-03-30T19:58:45.000Z | tests/test_mpdtoxml.py | fox0618/python-mpegdash | 9cdcafd3395d99ad211ea1010eac7aef516ecae4 | [
"MIT"
] | 24 | 2019-09-22T08:56:27.000Z | 2022-03-05T01:21:19.000Z | tests/test_mpdtoxml.py | fox0618/python-mpegdash | 9cdcafd3395d99ad211ea1010eac7aef516ecae4 | [
"MIT"
] | 22 | 2019-10-14T12:24:21.000Z | 2022-03-03T18:50:30.000Z | try:
import unittest
except ImportError:
import unittest2 as unittest
from sys import version_info
from mpegdash.parser import MPEGDASHParser
| 36.254237 | 85 | 0.619916 | try:
import unittest
except ImportError:
import unittest2 as unittest
from sys import version_info
from mpegdash.parser import MPEGDASHParser
class MPD2XMLTestCase(unittest.TestCase):
def test_mpd2xml(self):
mpd = MPEGDASHParser.parse('./tests/mpd-samples/sample-001.mpd')
MPEGDASHParser.w... | 1,864 | 20 | 103 |
0bc05b0077b727e62fea7fe23cb0e20ab099fdea | 9,796 | py | Python | samples/Python/common_samples/common.py | holgafx/gehtsoft | 7bb1dfc23d3b5b45793a85e162bbed2ca963d3ed | [
"Apache-2.0"
] | null | null | null | samples/Python/common_samples/common.py | holgafx/gehtsoft | 7bb1dfc23d3b5b45793a85e162bbed2ca963d3ed | [
"Apache-2.0"
] | null | null | null | samples/Python/common_samples/common.py | holgafx/gehtsoft | 7bb1dfc23d3b5b45793a85e162bbed2ca963d3ed | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Gehtsoft USA LLC
# Licensed under the license derived from 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://fxcodebase.com/licenses/open-source/license.html
# Unless required by ap... | 44.527273 | 113 | 0.5441 | # Copyright 2018 Gehtsoft USA LLC
# Licensed under the license derived from 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://fxcodebase.com/licenses/open-source/license.html
# Unless required by ap... | 8,377 | 0 | 321 |
05ff2eee1834701da388e3350f5937c4d3038e22 | 1,635 | py | Python | extensions/matrix/management/commands/matrix_room_join.py | nirgal/ngw | 0a28e8f12cb342a20ca3456e2a2ab91dd9c898be | [
"BSD-2-Clause"
] | null | null | null | extensions/matrix/management/commands/matrix_room_join.py | nirgal/ngw | 0a28e8f12cb342a20ca3456e2a2ab91dd9c898be | [
"BSD-2-Clause"
] | null | null | null | extensions/matrix/management/commands/matrix_room_join.py | nirgal/ngw | 0a28e8f12cb342a20ca3456e2a2ab91dd9c898be | [
"BSD-2-Clause"
] | null | null | null | import logging
from django.core.management.base import BaseCommand, CommandError
from ngw.extensions.matrix import matrix
| 34.787234 | 79 | 0.593272 | import logging
from django.core.management.base import BaseCommand, CommandError
from ngw.extensions.matrix import matrix
class Command(BaseCommand):
help = 'update matrix user information'
def add_arguments(self, parser):
parser.add_argument(
'user',
)
parser.add_ar... | 1,383 | 104 | 23 |
0f586d06f7f6008b5af6b8a12581096e18f21c4a | 416 | py | Python | ps4you/ps4you/urls.py | bogomaz1987/ps4you | 7222425fb469dd966ba33de11405b9aa5e37ba67 | [
"Apache-2.0"
] | null | null | null | ps4you/ps4you/urls.py | bogomaz1987/ps4you | 7222425fb469dd966ba33de11405b9aa5e37ba67 | [
"Apache-2.0"
] | 2 | 2020-06-05T17:41:58.000Z | 2021-06-01T22:00:29.000Z | ps4you/ps4you/urls.py | bogomaz1987/ps4you | 7222425fb469dd966ba33de11405b9aa5e37ba67 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import include
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
# path('searchableselect/', include('searchableselect.urls')),
path('', include('page.urls')),
path('game/', include('game.urls')),
path('client/', i... | 26 | 68 | 0.670673 | from django.conf.urls import include
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
# path('searchableselect/', include('searchableselect.urls')),
path('', include('page.urls')),
path('game/', include('game.urls')),
path('client/', i... | 0 | 0 | 0 |
c376f410b1597c029143f8b2507b3a11656225d2 | 44,416 | py | Python | syft/core/frameworks/torch/tensor.py | codevedas/PySyft | 8017b7f04434e797d0721e34488f637bf4865385 | [
"Apache-2.0"
] | null | null | null | syft/core/frameworks/torch/tensor.py | codevedas/PySyft | 8017b7f04434e797d0721e34488f637bf4865385 | [
"Apache-2.0"
] | null | null | null | syft/core/frameworks/torch/tensor.py | codevedas/PySyft | 8017b7f04434e797d0721e34488f637bf4865385 | [
"Apache-2.0"
] | null | null | null | import json
import re
import torch
import random
import syft as sy
from ... import utils
from . import utils as torch_utils
import logging
import numpy as np
class _SyftTensor(object):
"""
Super class for all Syft tensors, that contains all the specific syft functions
"""
def set_id(self, new_id):
... | 40.014414 | 134 | 0.579431 | import json
import re
import torch
import random
import syft as sy
from ... import utils
from . import utils as torch_utils
import logging
import numpy as np
class _SyftTensor(object):
"""
Super class for all Syft tensors, that contains all the specific syft functions
"""
def __init__(self, child=Non... | 15,325 | 16,499 | 524 |
cc9dd8cf46ccc1eb841121a757ce978bd638c1e7 | 2,209 | py | Python | backend/src/jobs/flaskGetSpecJobHistory.py | frost917/customer-manager | d7d4c16f99e1548989bff85c20c307a844711eda | [
"Apache-2.0"
] | null | null | null | backend/src/jobs/flaskGetSpecJobHistory.py | frost917/customer-manager | d7d4c16f99e1548989bff85c20c307a844711eda | [
"Apache-2.0"
] | 1 | 2021-09-18T05:56:45.000Z | 2021-09-18T05:56:45.000Z | backend/src/jobs/flaskGetSpecJobHistory.py | frost917/customer-manager | d7d4c16f99e1548989bff85c20c307a844711eda | [
"Apache-2.0"
] | null | null | null | from dataCheck import customerDataCheck
import json
from auth.flaskAuthVerify import tokenVerify
from flask import Blueprint, Response, g
from postgres.databaseConnection import PostgresControll
manager = Blueprint('getSpecJobHistory', __name__, url_prefix='/jobs')
# 특정 고객의 모든 시술 기록을 불러옴
@manager.route('/customer/<... | 35.063492 | 124 | 0.67904 | from dataCheck import customerDataCheck
import json
from auth.flaskAuthVerify import tokenVerify
from flask import Blueprint, Response, g
from postgres.databaseConnection import PostgresControll
manager = Blueprint('getSpecJobHistory', __name__, url_prefix='/jobs')
# 특정 고객의 모든 시술 기록을 불러옴
@manager.route('/customer/<... | 1,851 | 0 | 22 |
29300bf9bee9f68f012ef9344b1eeab4fad8bcc6 | 1,759 | py | Python | pytensor/network/tensor.py | xinjli/pyml | 03cc30c75014f97655410e6b481b429523dfd045 | [
"MIT"
] | 13 | 2018-04-20T09:52:24.000Z | 2021-02-16T22:46:25.000Z | pytensor/network/tensor.py | xinjli/pyml | 03cc30c75014f97655410e6b481b429523dfd045 | [
"MIT"
] | null | null | null | pytensor/network/tensor.py | xinjli/pyml | 03cc30c75014f97655410e6b481b429523dfd045 | [
"MIT"
] | 5 | 2019-02-18T12:51:29.000Z | 2022-03-06T15:08:53.000Z | import numpy as np
class LongTensor:
"""
LongTensor is a type of Tensor to keep integers
"""
def __init__(self, value, name='LongTensor', trainable=False):
"""
:param value: long value
:param name:
:param trainable:
"""
self.value = np.array(value, dty... | 25.128571 | 112 | 0.590677 | import numpy as np
class LongTensor:
"""
LongTensor is a type of Tensor to keep integers
"""
def __init__(self, value, name='LongTensor', trainable=False):
"""
:param value: long value
:param name:
:param trainable:
"""
self.value = np.array(value, dty... | 271 | 0 | 162 |
ecbd1a9534534abe593e2f4947ba9fa64382adf4 | 12,996 | py | Python | SVM/svm.py | Younes-SadatNejad/SIP_Temp | d38f4255283a2fb6f2bdc2c7d8a27e9462bd9727 | [
"MIT"
] | null | null | null | SVM/svm.py | Younes-SadatNejad/SIP_Temp | d38f4255283a2fb6f2bdc2c7d8a27e9462bd9727 | [
"MIT"
] | null | null | null | SVM/svm.py | Younes-SadatNejad/SIP_Temp | d38f4255283a2fb6f2bdc2c7d8a27e9462bd9727 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 18:45:05 2021.
@author: mahdi
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
from sklearn.datasets import make_blobs
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import NearestCentroid
i... | 29.336343 | 80 | 0.623115 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 18:45:05 2021.
@author: mahdi
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
from sklearn.datasets import make_blobs
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import NearestCentroid
i... | 0 | 0 | 0 |
86d698c9a546a498b829518be815313ee7a80870 | 8,941 | py | Python | Week 11/Lab_5.py | aash7871/PHYS-3210 | 7820e85259b5fbc2845feaa1068ef12afc13db77 | [
"MIT"
] | null | null | null | Week 11/Lab_5.py | aash7871/PHYS-3210 | 7820e85259b5fbc2845feaa1068ef12afc13db77 | [
"MIT"
] | null | null | null | Week 11/Lab_5.py | aash7871/PHYS-3210 | 7820e85259b5fbc2845feaa1068ef12afc13db77 | [
"MIT"
] | 1 | 2020-01-17T01:58:14.000Z | 2020-01-17T01:58:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 29 19:02:02 2019
@author: amandaash
"""
import numpy as np
import matplotlib.pyplot as plt
"""
dt = 0.0001
mass = 1
p_value = 2
k_constant = 100
v_initial = 0
x_initial = 1
t_initial = 0
t_final = 10
static_coeff = 0.45
kinetic_coeff = 0.35
viscous... | 29.411184 | 162 | 0.621071 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 29 19:02:02 2019
@author: amandaash
"""
import numpy as np
import matplotlib.pyplot as plt
def harmonic_oscillator_friction_beta(p,k,v0,x0,m,time_step,t0,tf, mu_s, mu_k, b):
g = 9.81
v = v0
x = x0
x_val = []
v_val = []
time... | 3,353 | 0 | 92 |
4cbf5d37297872ed7437ada33f59af00dbf496c6 | 201 | py | Python | Labs/5/FormatStrings/LocalShortRead/Exploit.py | Opty-MISCE/SS | 2010a7f93fdcaa50f835d827e531dc636abfe299 | [
"MIT"
] | null | null | null | Labs/5/FormatStrings/LocalShortRead/Exploit.py | Opty-MISCE/SS | 2010a7f93fdcaa50f835d827e531dc636abfe299 | [
"MIT"
] | null | null | null | Labs/5/FormatStrings/LocalShortRead/Exploit.py | Opty-MISCE/SS | 2010a7f93fdcaa50f835d827e531dc636abfe299 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from pwn import *
SERVER = "mustard.stt.rnl.tecnico.ulisboa.pt"
PORT = 10091
POS = 7
s = remote(SERVER, PORT)
s.sendline("%{}$s".format(POS))
print(s.recvuntil("}"))
s.close()
| 15.461538 | 45 | 0.661692 | #!/usr/bin/env python
from pwn import *
SERVER = "mustard.stt.rnl.tecnico.ulisboa.pt"
PORT = 10091
POS = 7
s = remote(SERVER, PORT)
s.sendline("%{}$s".format(POS))
print(s.recvuntil("}"))
s.close()
| 0 | 0 | 0 |
530d719ea9df225dbaff8e8de68097186795f2d1 | 33,600 | py | Python | plugin/OscamStatus.py | rdamas/oscam-skyde-status | 68a34b7c55aa7ffa405cd0fe3c74473ea9f70c67 | [
"MIT"
] | null | null | null | plugin/OscamStatus.py | rdamas/oscam-skyde-status | 68a34b7c55aa7ffa405cd0fe3c74473ea9f70c67 | [
"MIT"
] | 1 | 2016-10-09T15:57:10.000Z | 2016-10-09T15:58:16.000Z | plugin/OscamStatus.py | rdamas/oscam-skyde-status | 68a34b7c55aa7ffa405cd0fe3c74473ea9f70c67 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import ConfigParser
import fileinput
import json
import os
import re
import requests
from enigma import eTimer, getDesktop, iServiceInformation
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Sources.List import List
from Screens.Messa... | 37.837838 | 205 | 0.521577 | # -*- coding: utf-8 -*-
import base64
import ConfigParser
import fileinput
import json
import os
import re
import requests
from enigma import eTimer, getDesktop, iServiceInformation
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Sources.List import List
from Screens.Messa... | 22,163 | 6,627 | 673 |
0a5b73243a48019d002b8f2fb808eb1f41ab86fc | 2,486 | py | Python | app/__init__.py | cletuzz00/insuranceclaimfraud | 9723781ec6368f19cacc2d537ce5ebc3652ce812 | [
"MIT"
] | 23 | 2019-11-29T19:53:50.000Z | 2022-03-11T16:47:21.000Z | app/__init__.py | cletuzz00/insuranceclaimfraud | 9723781ec6368f19cacc2d537ce5ebc3652ce812 | [
"MIT"
] | 15 | 2020-03-21T20:43:05.000Z | 2020-11-09T22:15:37.000Z | app/__init__.py | cletuzz00/insuranceclaimfraud | 9723781ec6368f19cacc2d537ce5ebc3652ce812 | [
"MIT"
] | 11 | 2019-12-05T12:25:53.000Z | 2020-10-20T15:25:19.000Z | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from flask import Flask, url_for
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from importlib import import_module
from logging import basicConfig, DEBUG, getLogger, StreamHandler
from os import path
... | 29.247059 | 82 | 0.672566 | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from flask import Flask, url_for
from flask_login import LoginManager
from flask_sqlalchemy import SQLAlchemy
from importlib import import_module
from logging import basicConfig, DEBUG, getLogger, StreamHandler
from os import path
... | 1,425 | 0 | 168 |
a1c4e4caa2cf815e38d5be1495a90e5c6321be82 | 8,968 | py | Python | bcs-ui/backend/templatesets/legacy_apps/configuration/yaml_mode/views.py | kayinli/bk-bcs | 93a0856175f7b066ef835921572c1cac590dbd8e | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/templatesets/legacy_apps/configuration/yaml_mode/views.py | kayinli/bk-bcs | 93a0856175f7b066ef835921572c1cac590dbd8e | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/templatesets/legacy_apps/configuration/yaml_mode/views.py | kayinli/bk-bcs | 93a0856175f7b066ef835921572c1cac590dbd8e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.857778 | 125 | 0.674286 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 2,428 | 4,706 | 69 |
cea3ca7316f3a8d6ec3256b07e5e310104ec5ec4 | 2,581 | py | Python | analyses/TestAnalyzer.py | ThinkNaive/Matrix-Vector-Multiplication | 9a00ba9e4d0d298ce4ff3bfae092f49571a56605 | [
"MIT"
] | null | null | null | analyses/TestAnalyzer.py | ThinkNaive/Matrix-Vector-Multiplication | 9a00ba9e4d0d298ce4ff3bfae092f49571a56605 | [
"MIT"
] | null | null | null | analyses/TestAnalyzer.py | ThinkNaive/Matrix-Vector-Multiplication | 9a00ba9e4d0d298ce4ff3bfae092f49571a56605 | [
"MIT"
] | null | null | null | # coding=utf-8
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
# 由master生成的测试参数
row = 10000
col = 10000
iteration = 10
param = {'id': '3', 'strategy': 'lt', 'p': 10, 'c': 0.03, 'delta': 0.5, 'alpha': 2.0}
params = [{'key': 'client-a'},
{'key': 'client-... | 40.968254 | 119 | 0.515304 | # coding=utf-8
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
# 由master生成的测试参数
row = 10000
col = 10000
iteration = 10
param = {'id': '3', 'strategy': 'lt', 'p': 10, 'c': 0.03, 'delta': 0.5, 'alpha': 2.0}
params = [{'key': 'client-a'},
{'key': 'client-... | 0 | 0 | 0 |
b25c3ee2eacc5ec3f4d8e4d31557ea457f8037a6 | 8,096 | py | Python | code/feature_extraction/audio_utils.py | jonepatr/lets_face_it | fefba5e82d236f89703449bd517cfa5867fda09f | [
"MIT"
] | 11 | 2020-10-21T09:58:53.000Z | 2022-01-22T08:31:57.000Z | code/feature_extraction/audio_utils.py | jonepatr/lets_face_it | fefba5e82d236f89703449bd517cfa5867fda09f | [
"MIT"
] | 3 | 2021-05-05T07:15:45.000Z | 2021-12-14T14:43:42.000Z | code/feature_extraction/audio_utils.py | jonepatr/lets_face_it | fefba5e82d236f89703449bd517cfa5867fda09f | [
"MIT"
] | 4 | 2020-10-21T09:46:22.000Z | 2021-12-16T11:41:03.000Z | import shutil
import tempfile
from pathlib import Path
import librosa
import numpy as np
import parselmouth as pm
import scipy.io.wavfile as wav
import scipy.signal as sig
import soundfile
from misc.shared import DATA_DIR, DATASET_DIR
from pydub import AudioSegment
from python_speech_features import mfcc
from scipy.si... | 29.985185 | 88 | 0.644392 | import shutil
import tempfile
from pathlib import Path
import librosa
import numpy as np
import parselmouth as pm
import scipy.io.wavfile as wav
import scipy.signal as sig
import soundfile
from misc.shared import DATA_DIR, DATASET_DIR
from pydub import AudioSegment
from python_speech_features import mfcc
from scipy.si... | 4,779 | 0 | 138 |
deeb4aa4c9389421b410b823b599dee2b492e6f4 | 916 | py | Python | MyWork/OldFiles/Beginner/FunctionsWithOutput.py/FunctionsWithOutputs.py | minefarmer/100-Days-Python | b80b28d299342b490082ac301a0d8b176419f8f9 | [
"Unlicense"
] | null | null | null | MyWork/OldFiles/Beginner/FunctionsWithOutput.py/FunctionsWithOutputs.py | minefarmer/100-Days-Python | b80b28d299342b490082ac301a0d8b176419f8f9 | [
"Unlicense"
] | null | null | null | MyWork/OldFiles/Beginner/FunctionsWithOutput.py/FunctionsWithOutputs.py | minefarmer/100-Days-Python | b80b28d299342b490082ac301a0d8b176419f8f9 | [
"Unlicense"
] | null | null | null | ''' Functions with output
def my_function(something):
#Do this with something
#Then do this
#finally do this
def my_function():
return 3 * 2 # result
'''
# def format_name(f_name, l_name):
# print(f_name.title())
# print(l_name.title())
# format_name("rich", "MATSON") # Rich
... | 21.302326 | 69 | 0.651747 | ''' Functions with output
def my_function(something):
#Do this with something
#Then do this
#finally do this
def my_function():
return 3 * 2 # result
'''
# def format_name(f_name, l_name):
# print(f_name.title())
# print(l_name.title())
# format_name("rich", "MATSON") # Rich
... | 136 | 0 | 23 |
b701bc49a8f78c1f99f8cb01373047a279aef075 | 887 | py | Python | clonehero_scoreboard_app/csv_handler.py | apesch85/clonehero_scoreboard | 2b8550a9db93e46d1104ec5e1ed92a7282bc567c | [
"MIT"
] | null | null | null | clonehero_scoreboard_app/csv_handler.py | apesch85/clonehero_scoreboard | 2b8550a9db93e46d1104ec5e1ed92a7282bc567c | [
"MIT"
] | null | null | null | clonehero_scoreboard_app/csv_handler.py | apesch85/clonehero_scoreboard | 2b8550a9db93e46d1104ec5e1ed92a7282bc567c | [
"MIT"
] | null | null | null | import csv
import os
from score_comparer import ScoreComparer
| 34.115385 | 77 | 0.685457 | import csv
import os
from score_comparer import ScoreComparer
def HandleCsv(csv_path, final_score_dict):
csv_exists = os.path.isfile(csv_path)
if csv_exists:
with open(csv_path, 'r') as read_scores:
csv_reader = csv.reader(read_scores)
existing_scores = list(csv_reader)
compared_scores = ScoreC... | 802 | 0 | 23 |
1d5caf304ff7c630a8244058d57493b0771b5dfa | 1,987 | py | Python | annotation_process/onset.py | marl/GuitarSet | 462f414a3a5fed6477ee1c589acd776ef3262b41 | [
"MIT"
] | 81 | 2018-05-04T19:53:45.000Z | 2022-01-27T15:17:42.000Z | annotation_process/onset.py | funkfuzz/GuitarSet | 462f414a3a5fed6477ee1c589acd776ef3262b41 | [
"MIT"
] | 4 | 2019-03-12T19:50:44.000Z | 2020-05-15T13:38:56.000Z | annotation_process/onset.py | funkfuzz/GuitarSet | 462f414a3a5fed6477ee1c589acd776ef3262b41 | [
"MIT"
] | 12 | 2018-05-04T19:54:08.000Z | 2022-01-19T17:37:52.000Z | import vamp
import librosa
import numpy as np
import pretty_midi
import jams
import os
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='analyze whole stems.')
parser.add_argument(
'inpath', type=str, help='path to the stem of interest')
parser.add_a... | 30.569231 | 97 | 0.621037 | import vamp
import librosa
import numpy as np
import pretty_midi
import jams
import os
import argparse
def rough_midi(args):
# gets a rough midi trasncription using pYin Note from inpath.wav to outpath.mid
if os.path.exists(args.outpath):
print('file already exist')
return 0
#check if o... | 1,501 | 0 | 46 |
2247560231332cd3b4dc8cbf8ea9235b791cb557 | 403 | py | Python | uopbmoh_hub/urls.py | westerncapelabs/uopboh-hub | 10c36026e5588d1490dfa3396745db5b9a94e875 | [
"BSD-3-Clause"
] | null | null | null | uopbmoh_hub/urls.py | westerncapelabs/uopboh-hub | 10c36026e5588d1490dfa3396745db5b9a94e875 | [
"BSD-3-Clause"
] | 2 | 2016-01-18T16:23:53.000Z | 2016-02-22T08:50:56.000Z | uopbmoh_hub/urls.py | westerncapelabs/uopboh-hub | 10c36026e5588d1490dfa3396745db5b9a94e875 | [
"BSD-3-Clause"
] | null | null | null | import os
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
admin.site.site_header = os.environ.get('UOPBMOH_HUB_TITLE', 'UoPBMoH Admin')
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls... | 26.866667 | 77 | 0.744417 | import os
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
admin.site.site_header = os.environ.get('UOPBMOH_HUB_TITLE', 'UoPBMoH Admin')
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls... | 0 | 0 | 0 |
90623213d36080058235d77137f677569c026eb7 | 1,397 | py | Python | rummikub/predict.py | ronikobrosly/rummikub_AI | 4cce795d8cd6c54270d12ae14a7b2b6afa53ca2f | [
"MIT"
] | null | null | null | rummikub/predict.py | ronikobrosly/rummikub_AI | 4cce795d8cd6c54270d12ae14a7b2b6afa53ca2f | [
"MIT"
] | null | null | null | rummikub/predict.py | ronikobrosly/rummikub_AI | 4cce795d8cd6c54270d12ae14a7b2b6afa53ca2f | [
"MIT"
] | null | null | null |
from os.path import expanduser
import cv2
from keras.models import load_model
from matplotlib import pyplot as plt
import numpy as np
# Create kernel for cv2 dilation method
KERNEL = np.ones((5,5),np.uint8)
# Import the model
model = load_model('big_model')
# Read input image
img = cv2.imread(expanduser('~/Desk... | 29.723404 | 125 | 0.759485 |
from os.path import expanduser
import cv2
from keras.models import load_model
from matplotlib import pyplot as plt
import numpy as np
# Create kernel for cv2 dilation method
KERNEL = np.ones((5,5),np.uint8)
# Import the model
model = load_model('big_model')
# Read input image
img = cv2.imread(expanduser('~/Desk... | 0 | 0 | 0 |
a5c8abe1c65669f643bb9cbb0eb349888db744a9 | 1,311 | py | Python | src/lib/config.py | RonaldHiemstra/BronartsmeiH | 1ad3838b43abfe9a1f3416334439c8056aa50dde | [
"MIT"
] | null | null | null | src/lib/config.py | RonaldHiemstra/BronartsmeiH | 1ad3838b43abfe9a1f3416334439c8056aa50dde | [
"MIT"
] | 3 | 2021-03-17T16:05:01.000Z | 2021-05-01T18:47:43.000Z | src/lib/config.py | RonaldHiemstra/BronartsmeiH | 1ad3838b43abfe9a1f3416334439c8056aa50dde | [
"MIT"
] | null | null | null | """Support file to handle configuration files."""
import json
import os
class Config():
"""Class for serializing configuration items."""
def get(self, key=None, default=None):
"""Get a config item."""
if key is None:
# return all public config items (filter out the hidden items)
... | 31.214286 | 97 | 0.540809 | """Support file to handle configuration files."""
import json
import os
class Config():
"""Class for serializing configuration items."""
def __init__(self, filename):
self.filename = filename
try:
with open(self.filename) as file:
self.__config = json.load(file)
... | 434 | 0 | 27 |
f2992e31d0f58be982aab9d0bf92129cdc5b1c9e | 1,038 | py | Python | python-jwt.py | HTTP101/sturdy-octo-barnacle | 843df5bf3f65ab0617a2794b28ecaffef271d2ec | [
"MIT"
] | null | null | null | python-jwt.py | HTTP101/sturdy-octo-barnacle | 843df5bf3f65ab0617a2794b28ecaffef271d2ec | [
"MIT"
] | null | null | null | python-jwt.py | HTTP101/sturdy-octo-barnacle | 843df5bf3f65ab0617a2794b28ecaffef271d2ec | [
"MIT"
] | null | null | null | from flask_jwt_extended import create_access_token,JWTManager
from flask import jsonify
from application import app
from application.models.UserMaster import UserMaster
from application.config.config import Config
conf = Config()
app.config['JWT_SECRET_KEY'] = conf.JWT_SECRET_KEY
app.config['PROPAGATE_EXCEPTIONS'] = T... | 23.066667 | 68 | 0.701349 | from flask_jwt_extended import create_access_token,JWTManager
from flask import jsonify
from application import app
from application.models.UserMaster import UserMaster
from application.config.config import Config
conf = Config()
app.config['JWT_SECRET_KEY'] = conf.JWT_SECRET_KEY
app.config['PROPAGATE_EXCEPTIONS'] = T... | 534 | 0 | 66 |
31a685b4046ff71a9304718c2fbced073961b530 | 6,496 | py | Python | test/test_user_otp.py | HailLab/girder | 974d869e6f53ec87a5e64730fee27eb6314fc006 | [
"Apache-2.0"
] | 395 | 2015-01-12T19:20:13.000Z | 2022-03-30T05:40:40.000Z | test/test_user_otp.py | HailLab/girder | 974d869e6f53ec87a5e64730fee27eb6314fc006 | [
"Apache-2.0"
] | 2,388 | 2015-01-01T20:09:19.000Z | 2022-03-29T16:49:14.000Z | test/test_user_otp.py | HailLab/girder | 974d869e6f53ec87a5e64730fee27eb6314fc006 | [
"Apache-2.0"
] | 177 | 2015-01-04T14:47:00.000Z | 2022-03-25T09:01:51.000Z | # -*- coding: utf-8 -*-
import pytest
from girder.exceptions import AccessException
from girder.models.setting import Setting
from girder.models.user import User
from girder.settings import SettingKey
from pytest_girder.assertions import assertStatus, assertStatusOk
| 33.484536 | 99 | 0.68319 | # -*- coding: utf-8 -*-
import pytest
from girder.exceptions import AccessException
from girder.models.setting import Setting
from girder.models.user import User
from girder.settings import SettingKey
from pytest_girder.assertions import assertStatus, assertStatusOk
def testInitializeOtp(user):
# The logic for t... | 6,060 | 0 | 161 |
cf1fe7a14625d2db9b7aa3fc34ffda13a4a03d1f | 6,549 | py | Python | rl_safety_algorithms/algs/pdo/pdo.py | liuzuxin/RL-Safety-Algorithms | 2575225b1ea8ce12e1e13f7a81f8dda7b4189708 | [
"MIT"
] | 4 | 2021-09-05T17:49:02.000Z | 2021-12-22T03:13:39.000Z | rl_safety_algorithms/algs/pdo/pdo.py | liuzuxin/RL-Safety-Algorithms | 2575225b1ea8ce12e1e13f7a81f8dda7b4189708 | [
"MIT"
] | null | null | null | rl_safety_algorithms/algs/pdo/pdo.py | liuzuxin/RL-Safety-Algorithms | 2575225b1ea8ce12e1e13f7a81f8dda7b4189708 | [
"MIT"
] | 2 | 2021-09-05T17:49:07.000Z | 2021-11-30T17:36:30.000Z | """ PyTorch implementation of the Primal Dual Optimization (PDO) algorithm.
Author: Sven Gronauer (sven.gronauer@tum.de)
Created: 28.10.2020
Updated: --
inspired by:
Joshua Achiam, David Held, Aviv Tamar, Peter Abbeel
Constrained Policy Optimization
ICML 2017
also see:
Yinlam Chow, Mohammad... | 38.523529 | 85 | 0.626661 | """ PyTorch implementation of the Primal Dual Optimization (PDO) algorithm.
Author: Sven Gronauer (sven.gronauer@tum.de)
Created: 28.10.2020
Updated: --
inspired by:
Joshua Achiam, David Held, Aviv Tamar, Peter Abbeel
Constrained Policy Optimization
ICML 2017
also see:
Yinlam Chow, Mohammad... | 5,312 | 105 | 176 |
00a9e5f58342a9bccd8e67ac41aec89b1b16e559 | 1,048 | py | Python | AmazonProductReviewScraping/reviews/spiders/productReviews.py | pranav0904/Amazon-Product-Review | 76a39c667642c98f2c4f240fda5fcf92a7fa5cf8 | [
"MIT"
] | 1 | 2021-12-14T08:39:16.000Z | 2021-12-14T08:39:16.000Z | AmazonProductReviewScraping/reviews/spiders/productReviews.py | pranav0904/Amazon-Product-Review | 76a39c667642c98f2c4f240fda5fcf92a7fa5cf8 | [
"MIT"
] | null | null | null | AmazonProductReviewScraping/reviews/spiders/productReviews.py | pranav0904/Amazon-Product-Review | 76a39c667642c98f2c4f240fda5fcf92a7fa5cf8 | [
"MIT"
] | 1 | 2021-12-02T16:51:34.000Z | 2021-12-02T16:51:34.000Z | import scrapy
from scrapy import Request
import scraper_helper as sh
from scrapy.selector import Selector
review_url = 'https://www.amazon.com/product-reviews/{}'
asin_list = ['B08CVSL4K5'] #Roborock
| 33.806452 | 116 | 0.59542 | import scrapy
from scrapy import Request
import scraper_helper as sh
from scrapy.selector import Selector
review_url = 'https://www.amazon.com/product-reviews/{}'
asin_list = ['B08CVSL4K5'] #Roborock
class ProductreviewsSpider(scrapy.Spider):
name = 'productReviews'
def start_requests(self):
fo... | 715 | 107 | 23 |
a193ad0ca2236f916cfc3ad918e5d50bc9873323 | 3,485 | py | Python | mayan/apps/metadata/links.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 2 | 2021-09-12T19:41:19.000Z | 2021-09-12T19:41:20.000Z | mayan/apps/metadata/links.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 37 | 2021-09-13T01:00:12.000Z | 2021-10-02T03:54:30.000Z | mayan/apps/metadata/links.py | CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons | 0e4e919fd2e1ded6711354a0330135283e87f8c7 | [
"Apache-2.0"
] | 1 | 2021-09-22T13:17:30.000Z | 2021-09-22T13:17:30.000Z | from django.utils.translation import ugettext_lazy as _
from mayan.apps.documents.permissions import permission_document_type_edit
from mayan.apps.navigation.classes import Link
from .icons import (
icon_document_metadata_add, icon_document_metadata_edit,
icon_document_metadata_remove, icon_document_me... | 41.488095 | 88 | 0.781636 | from django.utils.translation import ugettext_lazy as _
from mayan.apps.documents.permissions import permission_document_type_edit
from mayan.apps.navigation.classes import Link
from .icons import (
icon_document_metadata_add, icon_document_metadata_edit,
icon_document_metadata_remove, icon_document_me... | 0 | 0 | 0 |
4e5a5ed27eea5e994d2324b6c0408176e8371053 | 15,744 | py | Python | citrees/scorers.py | m0hashi/citrees | e7d4866109ce357d5d67cffa450604567f7b469e | [
"MIT"
] | null | null | null | citrees/scorers.py | m0hashi/citrees | e7d4866109ce357d5d67cffa450604567f7b469e | [
"MIT"
] | null | null | null | citrees/scorers.py | m0hashi/citrees | e7d4866109ce357d5d67cffa450604567f7b469e | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import ctypes
from numba import njit
import numpy as np
from os.path import dirname, join
import pandas as pd
from scipy.stats import rankdata as rank
from sklearn.feature_selection import mutual_info_classif
# from externals.six.moves import range
###... | 23.085044 | 83 | 0.523565 | from __future__ import absolute_import, division, print_function
import ctypes
from numba import njit
import numpy as np
from os.path import dirname, join
import pandas as pd
from scipy.stats import rankdata as rank
from sklearn.feature_selection import mutual_info_classif
# from externals.six.moves import range
###... | 0 | 0 | 0 |
1c67f80426cccc03d5222dfecfea87a636eddca5 | 1,044 | py | Python | models.py | ServerChef/serverchef-system-helpers | fee45b06902d0887767fb430ade31af8052f4ff3 | [
"MIT"
] | null | null | null | models.py | ServerChef/serverchef-system-helpers | fee45b06902d0887767fb430ade31af8052f4ff3 | [
"MIT"
] | null | null | null | models.py | ServerChef/serverchef-system-helpers | fee45b06902d0887767fb430ade31af8052f4ff3 | [
"MIT"
] | null | null | null | import json
import psutil
__all__ = ['SystemdUnitStatus', 'Use']
| 22.695652 | 70 | 0.599617 | import json
import psutil
__all__ = ['SystemdUnitStatus', 'Use']
class BaseModel(object):
def to_dict(self):
return {name: getattr(self, name) for name in self.get_keys()}
def get_keys(self):
return [name for name in dir(self) if
not name.startswith('__')
and not call... | 586 | 214 | 176 |
ab587aac8ba41bf3e5ff1adc3b5bef4b37c4a250 | 3,911 | py | Python | sdks/python/apache_beam/utils/processes.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 3 | 2020-08-28T17:47:26.000Z | 2021-08-17T06:38:58.000Z | sdks/python/apache_beam/utils/processes.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 80 | 2020-01-16T09:55:09.000Z | 2020-10-03T13:43:07.000Z | sdks/python/apache_beam/utils/processes.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 1 | 2020-03-24T08:34:38.000Z | 2020-03-24T08:34:38.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 35.554545 | 77 | 0.676042 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 2,275 | 0 | 100 |
fb2e165b9cab12205cb49a14697d29f1f446e88a | 636 | py | Python | bship/events.py | UTDS16/battleship | 0244dd350fd628baf0928762ea49352ab418660c | [
"MIT"
] | null | null | null | bship/events.py | UTDS16/battleship | 0244dd350fd628baf0928762ea49352ab418660c | [
"MIT"
] | 6 | 2016-12-08T17:33:32.000Z | 2016-12-15T02:24:42.000Z | bship/events.py | UTDS16/battleship | 0244dd350fd628baf0928762ea49352ab418660c | [
"MIT"
] | null | null | null | import pygame
# It seems that up to USEREVENT + 3 are already taken.
# Anyway, an event for server announces.
# It's about time for the server to advertise its presence.
E_ANNOUNCE = pygame.USEREVENT + 4
# A state change has occurred.
E_STATE = pygame.USEREVENT + 5
# Player in the lobby.
S_LOBBY = 0
# Player creatin... | 23.555556 | 59 | 0.738994 | import pygame
# It seems that up to USEREVENT + 3 are already taken.
# Anyway, an event for server announces.
# It's about time for the server to advertise its presence.
E_ANNOUNCE = pygame.USEREVENT + 4
# A state change has occurred.
E_STATE = pygame.USEREVENT + 5
# Player in the lobby.
S_LOBBY = 0
# Player creatin... | 0 | 0 | 0 |
0918669d246dee92735957bcb29fa3a26b3a47f8 | 4,036 | py | Python | LSTM/code/model.py | ayush1997/DLG | 99b030eb68a2f5e7f30b0213249eb03d11bcceef | [
"Apache-2.0"
] | null | null | null | LSTM/code/model.py | ayush1997/DLG | 99b030eb68a2f5e7f30b0213249eb03d11bcceef | [
"Apache-2.0"
] | null | null | null | LSTM/code/model.py | ayush1997/DLG | 99b030eb68a2f5e7f30b0213249eb03d11bcceef | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Dropout
from keras.layers.recurrent import LSTM
from keras.utils.data_utils import get_file
import numpy as np
import random
import sys
import os
if __name__ == "__main__":
all_folders = ".... | 33.081967 | 131 | 0.601338 | from __future__ import print_function
from keras.models import Sequential
from keras.layers.core import Dense, Activation, Dropout
from keras.layers.recurrent import LSTM
from keras.utils.data_utils import get_file
import numpy as np
import random
import sys
import os
if __name__ == "__main__":
all_folders = ".... | 215 | 0 | 27 |
281b2bb040823d5ed05354eed9b4ed54853060af | 691 | py | Python | abcli/__init__.py | john5f35/abcli | fa696cf6bcc2f26fbd754e01952553ce09e5e006 | [
"MIT"
] | 3 | 2019-10-19T15:07:34.000Z | 2022-01-07T01:49:24.000Z | abcli/__init__.py | john5f35/abcli | fa696cf6bcc2f26fbd754e01952553ce09e5e006 | [
"MIT"
] | null | null | null | abcli/__init__.py | john5f35/abcli | fa696cf6bcc2f26fbd754e01952553ce09e5e006 | [
"MIT"
] | 1 | 2022-03-12T03:22:29.000Z | 2022-03-12T03:22:29.000Z | # CLI
#
# Commands:
# - transactions import <json>
# - transaction show (?)
# - account show [name] [date-from] [date-to] [aggregation:week|fortnight|*month*|quarter|year]
# Shows balance, average in aggregation method, between two dates
# - account graph [name] [date-from] [date-to] [aggregation:...]
# ... | 36.368421 | 97 | 0.681621 | # CLI
#
# Commands:
# - transactions import <json>
# - transaction show (?)
# - account show [name] [date-from] [date-to] [aggregation:week|fortnight|*month*|quarter|year]
# Shows balance, average in aggregation method, between two dates
# - account graph [name] [date-from] [date-to] [aggregation:...]
# ... | 0 | 0 | 0 |
07ea35374229480bf2eea63ea423ff927d92c861 | 5,564 | py | Python | application.py | naimaier/kindle-notes | 47efaf8c314211e57754db836c1c17243543cfc0 | [
"MIT"
] | null | null | null | application.py | naimaier/kindle-notes | 47efaf8c314211e57754db836c1c17243543cfc0 | [
"MIT"
] | null | null | null | application.py | naimaier/kindle-notes | 47efaf8c314211e57754db836c1c17243543cfc0 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
from functools import partial
# Generate main window
root = Tk()
gui = Application(root)
# Necessary for winfo_width and winfo_heigh to work properly
root.update()
""" Centering the window on the screen """
# https://yagisanatode.com/2018/02/24/how-to-center-the-main-... | 30.571429 | 107 | 0.614845 | from tkinter import *
from tkinter import ttk
from functools import partial
class MyClippings():
clippings = []
def append(self, element):
self.clippings.append(element)
def getBookNames(self):
distinctBookNames = set()
for clipping in self.clippings:
distinctBookNam... | 2,853 | 1,774 | 46 |