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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9e33bf3fd84da7b31eae42da73e2d690216b5a18 | 256 | py | Python | lib/oeqa/runtime/cases/rubygems_rubygems_rubyzip.py | tuxable-ltd/meta-rubygems | e80630e79b64e1be8339e1add0ab07644ec99425 | [
"BSD-2-Clause"
] | null | null | null | lib/oeqa/runtime/cases/rubygems_rubygems_rubyzip.py | tuxable-ltd/meta-rubygems | e80630e79b64e1be8339e1add0ab07644ec99425 | [
"BSD-2-Clause"
] | 141 | 2021-02-04T16:22:13.000Z | 2022-03-27T08:29:40.000Z | lib/oeqa/runtime/cases/rubygems_rubygems_rubyzip.py | tuxable-ltd/meta-rubygems | e80630e79b64e1be8339e1add0ab07644ec99425 | [
"BSD-2-Clause"
] | 3 | 2021-02-04T14:02:01.000Z | 2022-02-02T16:46:52.000Z | from rubygems_utils import RubyGemsTestUtils
| 23.272727 | 54 | 0.769531 | from rubygems_utils import RubyGemsTestUtils
class RubyGemsTestrubygems_rubyzip(RubyGemsTestUtils):
def test_gem_list_rubygems_rubyzip(self):
self.gem_is_installed("rubyzip")
def test_load_zip(self):
self.gem_is_loadable("zip")
| 100 | 33 | 77 |
432c47d00efb11b0207ac4b4b615068235077cdb | 404 | py | Python | fsociety/information_gathering/cli.py | mihaid-b/fsociety | 1852a00546757a9b288f5d487c4da97e6d69b3ff | [
"MIT"
] | null | null | null | fsociety/information_gathering/cli.py | mihaid-b/fsociety | 1852a00546757a9b288f5d487c4da97e6d69b3ff | [
"MIT"
] | null | null | null | fsociety/information_gathering/cli.py | mihaid-b/fsociety | 1852a00546757a9b288f5d487c4da97e6d69b3ff | [
"MIT"
] | null | null | null | # Core
from fsociety.core.menu import tools_cli
from .gitgraber import gitgraber
from .hydrarecon import hydrarecon
from .s3scanner import s3scanner
from .sherlock import sherlock
from .sqlmap import sqlmap
from .striker import striker
from .sublist3r import sublist3r
__tools__ = [sqlmap, striker, sublist3r, sherlock... | 23.764706 | 84 | 0.80198 | # Core
from fsociety.core.menu import tools_cli
from .gitgraber import gitgraber
from .hydrarecon import hydrarecon
from .s3scanner import s3scanner
from .sherlock import sherlock
from .sqlmap import sqlmap
from .striker import striker
from .sublist3r import sublist3r
__tools__ = [sqlmap, striker, sublist3r, sherlock... | 24 | 0 | 23 |
99037f163e47bcec7a5c770b2fc88090f79abaeb | 15,424 | py | Python | tensorflow/python/kernel_tests/logging_ops_test.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/logging_ops_test.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | tensorflow/python/kernel_tests/logging_ops_test.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.619512 | 80 | 0.649118 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 12,291 | 1,435 | 94 |
35ba8ec9c40b993ed940b2ef8d6ce9e4e14764a3 | 2,513 | py | Python | pyart/graph/tests/test_gridmapdisplay.py | kmuehlbauer/pyart | 4accda3fc02490d135373ad5b054899c6781e762 | [
"OLDAP-2.6",
"Python-2.0"
] | null | null | null | pyart/graph/tests/test_gridmapdisplay.py | kmuehlbauer/pyart | 4accda3fc02490d135373ad5b054899c6781e762 | [
"OLDAP-2.6",
"Python-2.0"
] | null | null | null | pyart/graph/tests/test_gridmapdisplay.py | kmuehlbauer/pyart | 4accda3fc02490d135373ad5b054899c6781e762 | [
"OLDAP-2.6",
"Python-2.0"
] | null | null | null | """ Unit Tests for Py-ART's graph/gridmapdisplay.py module. """
# execute this script to create figure_gridmapdisplay_*.png files.
# TODO use matplotlib's @image_comparison decorator to compare to file
# in baseline_images directory. Current this test only determines if files can
# be created, not that they are correc... | 32.217949 | 78 | 0.735376 | """ Unit Tests for Py-ART's graph/gridmapdisplay.py module. """
# execute this script to create figure_gridmapdisplay_*.png files.
# TODO use matplotlib's @image_comparison decorator to compare to file
# in baseline_images directory. Current this test only determines if files can
# be created, not that they are correc... | 1,619 | 0 | 66 |
e49137635e0b677d3411d4f5d40c243f0d0ff560 | 2,008 | py | Python | 01_Language/05_Python/tests/email_/test_smtp.py | cliff363825/TwentyFour | 09df59bd5d275e66463e343647f46027397d1233 | [
"MIT"
] | 3 | 2020-06-28T07:42:51.000Z | 2021-01-15T10:32:11.000Z | 01_Language/05_Python/tests/email_/test_smtp.py | cliff363825/TwentyFour | 09df59bd5d275e66463e343647f46027397d1233 | [
"MIT"
] | 9 | 2021-03-10T22:45:40.000Z | 2022-02-27T06:53:20.000Z | 01_Language/05_Python/tests/email_/test_smtp.py | cliff363825/TwentyFour | 09df59bd5d275e66463e343647f46027397d1233 | [
"MIT"
] | 1 | 2021-01-15T10:51:24.000Z | 2021-01-15T10:51:24.000Z | # coding: utf-8
from email import encoders
from email.header import Header
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.utils import parseaddr, formataddr
import smtplib
# from_addr = input('From: ')
from_addr = '176462329@qq.co... | 29.529412 | 77 | 0.653386 | # coding: utf-8
from email import encoders
from email.header import Header
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.utils import parseaddr, formataddr
import smtplib
def _format_addr(s):
name, addr = parseaddr(s)
retu... | 91 | 0 | 23 |
38cac067f9cf4cba75a74649a2a8461fc9fb9958 | 9,689 | py | Python | modoboa/admin/management/commands/subcommands/_mx.py | vietbm-hcm/modoboa | ceeec1bf0a63cf1b3ef7b4087c06e2a1eb35598d | [
"ISC"
] | null | null | null | modoboa/admin/management/commands/subcommands/_mx.py | vietbm-hcm/modoboa | ceeec1bf0a63cf1b3ef7b4087c06e2a1eb35598d | [
"ISC"
] | null | null | null | modoboa/admin/management/commands/subcommands/_mx.py | vietbm-hcm/modoboa | ceeec1bf0a63cf1b3ef7b4087c06e2a1eb35598d | [
"ISC"
] | null | null | null | """Management command to check defined domains."""
from datetime import datetime
from datetime import timedelta
import ipaddress
import dns.resolver
import gevent
from gevent import socket
from django.conf import settings
from django.core.management.base import BaseCommand
from django.template.loader import render_... | 36.562264 | 79 | 0.551966 | """Management command to check defined domains."""
from datetime import datetime
from datetime import timedelta
import ipaddress
import dns.resolver
import gevent
from gevent import socket
from django.conf import settings
from django.core.management.base import BaseCommand
from django.template.loader import render_... | 0 | 0 | 0 |
0fd5d0acbb9602a1dfc99ee1f81e82d50a1c3f42 | 231 | py | Python | django_productline/feature.py | henzk/django-productline | 24ff156924c1a8c07b99cbb8a1de0a42b8d81f60 | [
"MIT"
] | 5 | 2015-06-16T17:36:33.000Z | 2017-10-17T19:22:59.000Z | django_productline/feature.py | henzk/django-productline | 24ff156924c1a8c07b99cbb8a1de0a42b8d81f60 | [
"MIT"
] | 8 | 2016-03-14T09:02:13.000Z | 2017-11-16T16:00:31.000Z | django_productline/feature.py | henzk/django-productline | 24ff156924c1a8c07b99cbb8a1de0a42b8d81f60 | [
"MIT"
] | 17 | 2015-08-04T18:45:18.000Z | 2017-11-16T14:52:46.000Z | from __future__ import unicode_literals
def select(composer):
"""
binds the django_productline base feature
"""
# no introductions or refinements necessary -
# django_productline acts as base feature
pass
| 21 | 49 | 0.718615 | from __future__ import unicode_literals
def select(composer):
"""
binds the django_productline base feature
"""
# no introductions or refinements necessary -
# django_productline acts as base feature
pass
| 0 | 0 | 0 |
0edeb6c73ba3ced691a6e11c99b80309796c761e | 3,264 | py | Python | src/spaceone/statistics/service/history_service.py | whdalsrnt/statistics | 7401ad6753e3b6ee3942b5036d1e5214d8930cb3 | [
"Apache-2.0"
] | 7 | 2020-06-04T23:01:03.000Z | 2021-06-22T07:06:28.000Z | src/spaceone/statistics/service/history_service.py | jean1042/statistics | 747a93b130e341a8863383a7740800285dd0b897 | [
"Apache-2.0"
] | 3 | 2020-08-20T01:49:08.000Z | 2022-03-23T09:02:18.000Z | src/spaceone/statistics/service/history_service.py | jean1042/statistics | 747a93b130e341a8863383a7740800285dd0b897 | [
"Apache-2.0"
] | 6 | 2020-06-10T02:00:24.000Z | 2021-12-03T06:02:36.000Z | import logging
from spaceone.core.service import *
from spaceone.statistics.error import *
from spaceone.statistics.manager.resource_manager import ResourceManager
from spaceone.statistics.manager.schedule_manager import ScheduleManager
from spaceone.statistics.manager.history_manager import HistoryManager
_LOGGER = ... | 31.384615 | 93 | 0.61152 | import logging
from spaceone.core.service import *
from spaceone.statistics.error import *
from spaceone.statistics.manager.resource_manager import ResourceManager
from spaceone.statistics.manager.schedule_manager import ScheduleManager
from spaceone.statistics.manager.history_manager import HistoryManager
_LOGGER = ... | 232 | 2,580 | 22 |
1220574045c6f2473c4d5b04889630819f67ad47 | 2,009 | py | Python | observation/tests/obs_virtual/ObsVirtualUtilTest.py | CUrW-SL/cfcwm-cms | 3888e724800395c478f1b63dab9f77d0afa3b2c4 | [
"Apache-2.0"
] | null | null | null | observation/tests/obs_virtual/ObsVirtualUtilTest.py | CUrW-SL/cfcwm-cms | 3888e724800395c478f1b63dab9f77d0afa3b2c4 | [
"Apache-2.0"
] | null | null | null | observation/tests/obs_virtual/ObsVirtualUtilTest.py | CUrW-SL/cfcwm-cms | 3888e724800395c478f1b63dab9f77d0afa3b2c4 | [
"Apache-2.0"
] | null | null | null | import datetime
import json
import logging
import logging.config
import os
import traceback
from os.path import join as pjoin
import unittest2 as unittest
from observation.obs_virtual.ObsVirtualUtils import is_unique_points
| 30.439394 | 109 | 0.582877 | import datetime
import json
import logging
import logging.config
import os
import traceback
from os.path import join as pjoin
import unittest2 as unittest
from observation.obs_virtual.ObsVirtualUtils import is_unique_points
class ObsVirtualTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
t... | 1,572 | 187 | 23 |
f4659a787887c8c90e6b4cb5687ed1e272cfd859 | 926 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/split-array-with-equal-sum.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/split-array-with-equal-sum.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/split-array-with-equal-sum.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n^2)
# Space: O(n)
| 33.071429 | 110 | 0.516199 | # Time: O(n^2)
# Space: O(n)
class Solution(object):
def splitArray(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
if len(nums) < 7:
return False
accumulated_sum = [0] * len(nums)
accumulated_sum[0] = nums[0]
for i in xrange(1, ... | 0 | 872 | 23 |
269d077afeae122c4cd12e9bbb27e8ca41ceaaee | 3,403 | py | Python | Paper_13/Functions/Interactions_type.py | ADGiuliano/DevAndCompForRecSys2016 | f8c4d5a1f184d5e773f841dce9f855ba0d792b65 | [
"MIT"
] | null | null | null | Paper_13/Functions/Interactions_type.py | ADGiuliano/DevAndCompForRecSys2016 | f8c4d5a1f184d5e773f841dce9f855ba0d792b65 | [
"MIT"
] | null | null | null | Paper_13/Functions/Interactions_type.py | ADGiuliano/DevAndCompForRecSys2016 | f8c4d5a1f184d5e773f841dce9f855ba0d792b65 | [
"MIT"
] | null | null | null | """
@author: Andrea Domenico Giuliano
@contact: andreadomenico.giuliano@studenti.unipd.it
@organization: University of Padua
"""
import Time_Calcolation as t_c
#File contenente le funzioni riguardanti la creazione di una lista degli item utili per un determinato user
# e per l'attribuizione degli score relai... | 37.395604 | 108 | 0.649721 | """
@author: Andrea Domenico Giuliano
@contact: andreadomenico.giuliano@studenti.unipd.it
@organization: University of Padua
"""
import Time_Calcolation as t_c
#File contenente le funzioni riguardanti la creazione di una lista degli item utili per un determinato user
# e per l'attribuizione degli score relai... | 2,773 | 0 | 274 |
d306dc3a9a56997d7aad880845dc4e1a3303af7f | 362 | py | Python | SQLite - Pratice/codemy/sqlite1.py | shubhamnag14/Python-Documents | d3fee0ad90232b413f6ac1b562588fb255b79e42 | [
"Apache-2.0"
] | 2 | 2020-11-27T13:21:05.000Z | 2021-04-19T21:14:21.000Z | SQLite - Pratice/codemy/sqlite1.py | shubhamnag14/Python-Documents | d3fee0ad90232b413f6ac1b562588fb255b79e42 | [
"Apache-2.0"
] | null | null | null | SQLite - Pratice/codemy/sqlite1.py | shubhamnag14/Python-Documents | d3fee0ad90232b413f6ac1b562588fb255b79e42 | [
"Apache-2.0"
] | 1 | 2021-06-27T20:31:42.000Z | 2021-06-27T20:31:42.000Z | import sqlite3
# connect to database
conn = sqlite3.connect('customer.db')
# Create a cursor
c = conn.cursor()
c = conn.execute("""CREATE TABLE customers (
first TEXT,
last TEXT,
email text)""")
print("Sucessfully Did what I had to!!")
# Commit our command
conn.commi... | 16.454545 | 44 | 0.61326 | import sqlite3
# connect to database
conn = sqlite3.connect('customer.db')
# Create a cursor
c = conn.cursor()
c = conn.execute("""CREATE TABLE customers (
first TEXT,
last TEXT,
email text)""")
print("Sucessfully Did what I had to!!")
# Commit our command
conn.commi... | 0 | 0 | 0 |
ba8368d930a3fd7ca4cced853944b735a45f9585 | 142 | py | Python | donate/urls.py | yazdanv/backend | 49da8d46e108bc2000fdabc1b991836f2cc50687 | [
"MIT"
] | 232 | 2021-05-05T06:29:32.000Z | 2022-03-04T18:38:34.000Z | donate/urls.py | lmn3x/backend | 5ef2dca266aaf6f2000e0765894045642e48ef98 | [
"MIT"
] | 30 | 2021-05-05T11:55:32.000Z | 2021-11-10T15:15:06.000Z | donate/urls.py | lmn3x/backend | 5ef2dca266aaf6f2000e0765894045642e48ef98 | [
"MIT"
] | 69 | 2021-05-05T07:12:18.000Z | 2022-03-06T13:37:31.000Z | from django.urls import path
from donate import views
urlpatterns = [
# Donate
path('donate/', views.DonateCreateView.as_view()),
]
| 15.777778 | 54 | 0.704225 | from django.urls import path
from donate import views
urlpatterns = [
# Donate
path('donate/', views.DonateCreateView.as_view()),
]
| 0 | 0 | 0 |
1152280365489a13126c29bd2747caf1ac246814 | 7,076 | py | Python | youtube_search.py | hatahetahmad/youtube-search | cc48e526355ae8c550fd1e3c47f79f3121652c2c | [
"MIT"
] | null | null | null | youtube_search.py | hatahetahmad/youtube-search | cc48e526355ae8c550fd1e3c47f79f3121652c2c | [
"MIT"
] | null | null | null | youtube_search.py | hatahetahmad/youtube-search | cc48e526355ae8c550fd1e3c47f79f3121652c2c | [
"MIT"
] | null | null | null | import csv
import os
import json
from googleapiclient.discovery import build
# * IMPORTANT
query = r'python tutorial'
# read secret api key
with open('./SECRETS.json', 'r') as f:
secrets = json.load(f)
api_token = secrets['api_token']
# Functions
# creating data directory to save data
if not os.path.exists('./... | 36.102041 | 143 | 0.544799 | import csv
import os
import json
from googleapiclient.discovery import build
# * IMPORTANT
query = r'python tutorial'
# read secret api key
with open('./SECRETS.json', 'r') as f:
secrets = json.load(f)
api_token = secrets['api_token']
# Functions
def save_response_to_JSON(file_name, response) -> None:
with ... | 141 | 0 | 22 |
913d538ba9c9761fcd50792df0ea09593659bcc0 | 6,078 | py | Python | lbrynet/stream/assembler.py | TBitcoin/lbry | d931c765d22d6b034ef5754560f38e7d5f035461 | [
"MIT"
] | null | null | null | lbrynet/stream/assembler.py | TBitcoin/lbry | d931c765d22d6b034ef5754560f38e7d5f035461 | [
"MIT"
] | null | null | null | lbrynet/stream/assembler.py | TBitcoin/lbry | d931c765d22d6b034ef5754560f38e7d5f035461 | [
"MIT"
] | null | null | null | import os
import binascii
import logging
import typing
import asyncio
from lbrynet.blob import MAX_BLOB_SIZE
from lbrynet.stream.descriptor import StreamDescriptor
if typing.TYPE_CHECKING:
from lbrynet.blob.blob_manager import BlobFileManager
from lbrynet.blob.blob_info import BlobInfo
from lbrynet.blob.blo... | 46.396947 | 118 | 0.601185 | import os
import binascii
import logging
import typing
import asyncio
from lbrynet.blob import MAX_BLOB_SIZE
from lbrynet.stream.descriptor import StreamDescriptor
if typing.TYPE_CHECKING:
from lbrynet.blob.blob_manager import BlobFileManager
from lbrynet.blob.blob_info import BlobInfo
from lbrynet.blob.blo... | 5,438 | 1 | 257 |
772e165adbc161a8fe591475bccb76f37dd10d6a | 1,403 | py | Python | viyaRestPy/Reports/get_report_content.py | xavierBizoux/viyaRestPy | 2db2c982a369252f0b97861a74ec35ade969af9a | [
"Apache-2.0"
] | null | null | null | viyaRestPy/Reports/get_report_content.py | xavierBizoux/viyaRestPy | 2db2c982a369252f0b97861a74ec35ade969af9a | [
"Apache-2.0"
] | null | null | null | viyaRestPy/Reports/get_report_content.py | xavierBizoux/viyaRestPy | 2db2c982a369252f0b97861a74ec35ade969af9a | [
"Apache-2.0"
] | null | null | null | from .get_report import get_report
from ..call_rest import call_rest
| 37.918919 | 78 | 0.455453 | from .get_report import get_report
from ..call_rest import call_rest
def get_report_content(name="", path="", report_uri="", auth={}):
# Define the endpoint based on passed report information
if report_uri == "" and path == "" and name == "":
raise ValueError(
"You should provide a path an... | 1,310 | 0 | 23 |
60d31c9129b3bd68af775a31a7ef931f5627ec34 | 2,775 | py | Python | sagemaker-pyspark-sdk/src/sagemaker_pyspark/NamePolicy.py | hyandell/sagemaker-spark | 0149cf0f52562008a1a163e455207bb6d00d3e4a | [
"Apache-2.0"
] | null | null | null | sagemaker-pyspark-sdk/src/sagemaker_pyspark/NamePolicy.py | hyandell/sagemaker-spark | 0149cf0f52562008a1a163e455207bb6d00d3e4a | [
"Apache-2.0"
] | null | null | null | sagemaker-pyspark-sdk/src/sagemaker_pyspark/NamePolicy.py | hyandell/sagemaker-spark | 0149cf0f52562008a1a163e455207bb6d00d3e4a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accom... | 31.896552 | 99 | 0.70991 | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accom... | 680 | 0 | 216 |
3a7493287160bb8c85ebf44fce40ad60fd7b3258 | 11,036 | py | Python | src/hackrf/SDR_Testing/oldstuff/wifi_rx_rftap_nogrc.py | pieterbork/SUPERFREQ | c5aff0a28a299e1146612f60b02d8cefd5fe74a5 | [
"MIT"
] | 3 | 2018-09-14T15:13:33.000Z | 2019-07-16T04:27:45.000Z | src/hackrf/SDR_Testing/oldstuff/wifi_rx_rftap_nogrc.py | pieterbork/SUPERFREQ | c5aff0a28a299e1146612f60b02d8cefd5fe74a5 | [
"MIT"
] | null | null | null | src/hackrf/SDR_Testing/oldstuff/wifi_rx_rftap_nogrc.py | pieterbork/SUPERFREQ | c5aff0a28a299e1146612f60b02d8cefd5fe74a5 | [
"MIT"
] | 2 | 2018-01-22T03:11:51.000Z | 2018-02-24T01:28:27.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Wifi Rx Rftap
# Generated: Sun Feb 18 16:11:24 2018
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform... | 55.737374 | 1,066 | 0.640631 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Wifi Rx Rftap
# Generated: Sun Feb 18 16:11:24 2018
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform... | 9,711 | 24 | 347 |
8ff130d76169acca0a10d774d6dfab41f7052929 | 2,739 | py | Python | handling_conditions.py | mrabdsaif/DS-training | aa2b2cb6e25d5f00baafcd699fb6ed64817f4ac3 | [
"MIT"
] | null | null | null | handling_conditions.py | mrabdsaif/DS-training | aa2b2cb6e25d5f00baafcd699fb6ed64817f4ac3 | [
"MIT"
] | null | null | null | handling_conditions.py | mrabdsaif/DS-training | aa2b2cb6e25d5f00baafcd699fb6ed64817f4ac3 | [
"MIT"
] | null | null | null | #price = float(input('Enter The Price: ')) # int() to convert the inputs into float so we can compare it with tax
#if price >= 2.0:
#tax = 0.07
#else:
# tax = 0.00
#print(f'The Tax for this price is: ', {tax}, '\n \n') # note that the print statements without indentations so it will wait the if and else ... | 33.402439 | 172 | 0.632713 | #price = float(input('Enter The Price: ')) # int() to convert the inputs into float so we can compare it with tax
#if price >= 2.0:
#tax = 0.07
#else:
# tax = 0.00
#print(f'The Tax for this price is: ', {tax}, '\n \n') # note that the print statements without indentations so it will wait the if and else ... | 0 | 0 | 0 |
ad6b67f9b8c96cd19e386ce1dbb7c3472c252e56 | 4,536 | py | Python | L1Trigger/L1TTwinMux/test/runUnpEmuTwinMux.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | L1Trigger/L1TTwinMux/test/runUnpEmuTwinMux.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | L1Trigger/L1TTwinMux/test/runUnpEmuTwinMux.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | ##Unpackers and Emulator of BMTF-TwinMux
import FWCore.ParameterSet.Config as cms
process = cms.Process("TwinMuxRawToDigi")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")... | 34.625954 | 105 | 0.702822 | ##Unpackers and Emulator of BMTF-TwinMux
import FWCore.ParameterSet.Config as cms
process = cms.Process("TwinMuxRawToDigi")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 1000
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")... | 0 | 0 | 0 |
a4c3a971f691351c9a26c77a1dcf3ec0c9a00baf | 117 | py | Python | librespot/player/metrics/PlaybackMetrics.py | JeffmeisterJ/librespot-python | 0e0e1db65aa40262bd13479b97f81ae8c29ae049 | [
"Apache-2.0"
] | 1 | 2021-12-15T22:44:46.000Z | 2021-12-15T22:44:46.000Z | librespot/player/metrics/PlaybackMetrics.py | JeffmeisterJ/librespot-python | 0e0e1db65aa40262bd13479b97f81ae8c29ae049 | [
"Apache-2.0"
] | 12 | 2021-10-06T02:18:44.000Z | 2022-02-07T02:16:47.000Z | librespot/player/metrics/PlaybackMetrics.py | JeffmeisterJ/librespot-python | 0e0e1db65aa40262bd13479b97f81ae8c29ae049 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import logging
| 16.714286 | 41 | 0.811966 | from __future__ import annotations
import logging
class PlaybackMetrics:
_LOGGER = logging.getLogger(__name__)
| 0 | 43 | 23 |
fe240726e14f38b5b773ea045f596f31dd8e5997 | 5,688 | py | Python | pymilvus/orm/exceptions.py | sarvex/pymilvus | 8cd5ef54eb8d3f1598d36288008b9dc5a6ae34e2 | [
"Apache-2.0"
] | 417 | 2019-06-21T02:25:25.000Z | 2022-03-25T04:27:28.000Z | pymilvus/orm/exceptions.py | sarvex/pymilvus | 8cd5ef54eb8d3f1598d36288008b9dc5a6ae34e2 | [
"Apache-2.0"
] | 681 | 2019-06-18T11:03:53.000Z | 2022-03-31T14:29:17.000Z | pymilvus/orm/exceptions.py | sarvex/pymilvus | 8cd5ef54eb8d3f1598d36288008b9dc5a6ae34e2 | [
"Apache-2.0"
] | 193 | 2019-06-14T07:46:55.000Z | 2022-03-14T16:02:22.000Z | # Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 26.704225 | 115 | 0.728376 | # Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 257 | 3,545 | 552 |
6f051b0083183e72dd5da9669ff28eca7917ae99 | 1,133 | py | Python | hw/hw05/tests/q3d.py | surajrampure/data-94-sp21 | 074543103579c28d796c681f78f3c38449825328 | [
"BSD-3-Clause"
] | 1 | 2020-11-21T09:42:52.000Z | 2020-11-21T09:42:52.000Z | hw/hw05/tests/q3d.py | surajrampure/data-94-sp21 | 074543103579c28d796c681f78f3c38449825328 | [
"BSD-3-Clause"
] | null | null | null | hw/hw05/tests/q3d.py | surajrampure/data-94-sp21 | 074543103579c28d796c681f78f3c38449825328 | [
"BSD-3-Clause"
] | null | null | null | test = { 'name': 'q3d',
'points': 2,
'suites': [ { 'cases': [ { 'code': ">>> np.all(sorted(top_5_acc) == sorted(np.array(['ROSELAND COLLEGIATE PREP', 'GRANGE SCHOOL THE', 'FELICITAS GONZALO MENDEZ HS', 'ALLIANCE M&E STERN "
"MATH SCI SCH', 'SOUTH HIGH SCH... | 66.647059 | 198 | 0.363636 | test = { 'name': 'q3d',
'points': 2,
'suites': [ { 'cases': [ { 'code': ">>> np.all(sorted(top_5_acc) == sorted(np.array(['ROSELAND COLLEGIATE PREP', 'GRANGE SCHOOL THE', 'FELICITAS GONZALO MENDEZ HS', 'ALLIANCE M&E STERN "
"MATH SCI SCH', 'SOUTH HIGH SCH... | 0 | 0 | 0 |
d89de1ea8b3cb7bfc739adb65ef029260b61f449 | 921 | py | Python | graff/category.py | apontzen/graff | edbc7dcb292bba5a723d5acd9478af75a601038c | [
"BSD-3-Clause"
] | 3 | 2020-08-28T18:52:16.000Z | 2020-09-05T01:51:40.000Z | graff/category.py | apontzen/graff | edbc7dcb292bba5a723d5acd9478af75a601038c | [
"BSD-3-Clause"
] | null | null | null | graff/category.py | apontzen/graff | edbc7dcb292bba5a723d5acd9478af75a601038c | [
"BSD-3-Clause"
] | null | null | null | from .orm import Category
| 27.088235 | 79 | 0.62215 | from .orm import Category
class RaiseException:
pass
class CategoryCache(object):
def __init__(self, sqlalchemy_session):
self._name_ids = None
self._session = sqlalchemy_session
def get_id(self, name, default=RaiseException):
if self._name_ids is None:
id_and_name =... | 753 | 16 | 126 |
6a83fc53020dbc31bd85e4245c624104b7ac7b86 | 3,695 | py | Python | trdg/string_generator.py | Cospel/TextRecognitionDataGenerator | 2339383f61a926945c06206ba5bb6358c0cb3568 | [
"MIT"
] | null | null | null | trdg/string_generator.py | Cospel/TextRecognitionDataGenerator | 2339383f61a926945c06206ba5bb6358c0cb3568 | [
"MIT"
] | null | null | null | trdg/string_generator.py | Cospel/TextRecognitionDataGenerator | 2339383f61a926945c06206ba5bb6358c0cb3568 | [
"MIT"
] | null | null | null | import random as rnd
import re
import string
import requests
from xeger import Xeger
from bs4 import BeautifulSoup
def create_strings_from_file(filename, count):
"""
Create all strings by reading lines in specified files
"""
strings = []
with open(filename, "r", encoding="utf8") as f:
... | 28.867188 | 96 | 0.573748 | import random as rnd
import re
import string
import requests
from xeger import Xeger
from bs4 import BeautifulSoup
def create_strings_from_file(filename, count):
"""
Create all strings by reading lines in specified files
"""
strings = []
with open(filename, "r", encoding="utf8") as f:
... | 267 | 0 | 23 |
c2aeb3c2bd829668c37fe6c5b010c0278128318d | 15,659 | py | Python | tridentstream/bases/metadata/mixins.py | tridentstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | 6 | 2020-01-03T14:50:09.000Z | 2021-09-13T01:44:31.000Z | tridentstream/bases/metadata/mixins.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | tridentstream/bases/metadata/mixins.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | import logging
from collections import defaultdict
from django.core.exceptions import FieldDoesNotExist
from django.db.models import Count, Field, Q
from unplugged import JSONAPIObject, command
from .models import BaseMetadataResolutionLink, BaseUpdatable
logger = logging.getLogger(__name__)
class ListingItemRelin... | 37.283333 | 162 | 0.603678 | import logging
from collections import defaultdict
from django.core.exceptions import FieldDoesNotExist
from django.db.models import Count, Field, Q
from unplugged import JSONAPIObject, command
from .models import BaseMetadataResolutionLink, BaseUpdatable
logger = logging.getLogger(__name__)
class ListingItemRelin... | 13,486 | 1,345 | 320 |
bdcd4e8075ba0b50ad9f12ad4c62ded2b2a73210 | 2,144 | py | Python | model.py | HashemSami/image_classifier_aipnd | 6c5e0a3ef5d4e8a0a4031fa149cd171975651cac | [
"MIT"
] | null | null | null | model.py | HashemSami/image_classifier_aipnd | 6c5e0a3ef5d4e8a0a4031fa149cd171975651cac | [
"MIT"
] | null | null | null | model.py | HashemSami/image_classifier_aipnd | 6c5e0a3ef5d4e8a0a4031fa149cd171975651cac | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch import optim
from collections import OrderedDict
from PIL import Image
import torchvision.transforms as transforms
import torchvision.models as models
densenet121 = models.densenet121(pretrained=True)
vgg16 = models.vgg16(pretrained=True)
models = {
"densenet": {
... | 26.146341 | 81 | 0.591418 | import torch
from torch import nn
from torch import optim
from collections import OrderedDict
from PIL import Image
import torchvision.transforms as transforms
import torchvision.models as models
densenet121 = models.densenet121(pretrained=True)
vgg16 = models.vgg16(pretrained=True)
models = {
"densenet": {
... | 1,654 | 0 | 46 |
9d485ab355ff1ef0db848c1f2358528cbcb55e0f | 1,936 | py | Python | string_encode_decode.py | priyankparmar3/Python--Code | 142fbaffa83ace38d28ba753b6f4dff9f92dc3a7 | [
"MIT"
] | null | null | null | string_encode_decode.py | priyankparmar3/Python--Code | 142fbaffa83ace38d28ba753b6f4dff9f92dc3a7 | [
"MIT"
] | null | null | null | string_encode_decode.py | priyankparmar3/Python--Code | 142fbaffa83ace38d28ba753b6f4dff9f92dc3a7 | [
"MIT"
] | null | null | null | '''
__author__ : Priyank Parmar
__tested_on__ : 4th June, 2017
__description__ : To test different encoding and decoding methods
'''
## Taking the Input from user
str = raw_input('Enter String :')
print "=================================================="
## Encoded String
print "Encoded Strings"
# UTF-8 Encoding
enco... | 32.266667 | 104 | 0.673037 | '''
__author__ : Priyank Parmar
__tested_on__ : 4th June, 2017
__description__ : To test different encoding and decoding methods
'''
## Taking the Input from user
str = raw_input('Enter String :')
print "=================================================="
## Encoded String
print "Encoded Strings"
# UTF-8 Encoding
enco... | 0 | 0 | 0 |
cf31d4fdf8e8b1bbb9dd1062afda7ee4a7b5b4cd | 3,868 | py | Python | pyswmm/lib/__init__.py | kmmacro/pyswmm | 028fc9a2c731bed4129ee100e295900d989867fd | [
"BSD-2-Clause"
] | 3 | 2018-03-08T23:21:42.000Z | 2019-04-01T18:39:37.000Z | pyswmm/lib/__init__.py | kmmacro/pyswmm | 028fc9a2c731bed4129ee100e295900d989867fd | [
"BSD-2-Clause"
] | null | null | null | pyswmm/lib/__init__.py | kmmacro/pyswmm | 028fc9a2c731bed4129ee100e295900d989867fd | [
"BSD-2-Clause"
] | 2 | 2020-03-12T17:07:56.000Z | 2020-04-01T18:13:56.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014 Bryant E. McDonnell
#
# Licensed under the terms of the BSD2 License
# See LICENSE.txt for details
# -----------------------------------------------------------------------------
"""SWMM5 compile... | 28.441176 | 79 | 0.533092 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014 Bryant E. McDonnell
#
# Licensed under the terms of the BSD2 License
# See LICENSE.txt for details
# -----------------------------------------------------------------------------
"""SWMM5 compile... | 31 | 0 | 27 |
aac451287db2634caaab88693d358d73ff97fbe2 | 1,003 | py | Python | desertbot/response.py | DesertBot/DesertBot | 33b4fe03dae5ead23003e18b511179e0b03b061d | [
"MIT",
"BSD-3-Clause"
] | 7 | 2018-03-20T17:10:10.000Z | 2021-11-17T18:58:04.000Z | desertbot/response.py | DesertBot/DesertBot | 33b4fe03dae5ead23003e18b511179e0b03b061d | [
"MIT",
"BSD-3-Clause"
] | 109 | 2015-08-20T13:16:35.000Z | 2022-01-21T19:40:35.000Z | desertbot/response.py | DesertBot/DesertBot | 33b4fe03dae5ead23003e18b511179e0b03b061d | [
"MIT",
"BSD-3-Clause"
] | 7 | 2018-03-29T05:55:01.000Z | 2021-02-05T19:19:39.000Z | from enum import Enum
from typing import Dict, Union
| 27.861111 | 98 | 0.575274 | from enum import Enum
from typing import Dict, Union
class ResponseType(Enum):
Say = 1
Do = 2
Notice = 3
Raw = 4
class IRCResponse(object):
type = ResponseType.Say
response = ''
target = ''
def __init__(self, response: Union[str, bytes], target: Union[str, bytes],
m... | 754 | 148 | 46 |
4b5039847ff57f6148ef092f859d68353b6e4bc7 | 1,434 | py | Python | main_website/migrations/versions/7ef3c4f2ba0c_.py | realtimclemans/DataAboutDotMe | 0b666689c972f1880d2ef3d0240102ab685585a7 | [
"MIT"
] | null | null | null | main_website/migrations/versions/7ef3c4f2ba0c_.py | realtimclemans/DataAboutDotMe | 0b666689c972f1880d2ef3d0240102ab685585a7 | [
"MIT"
] | null | null | null | main_website/migrations/versions/7ef3c4f2ba0c_.py | realtimclemans/DataAboutDotMe | 0b666689c972f1880d2ef3d0240102ab685585a7 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 7ef3c4f2ba0c
Revises:
Create Date: 2020-12-28 10:48:53.012083
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '7ef3c4f2ba0c'
down_revision = None
branch_labels = None
depends_on = None
| 33.348837 | 91 | 0.702929 | """empty message
Revision ID: 7ef3c4f2ba0c
Revises:
Create Date: 2020-12-28 10:48:53.012083
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '7ef3c4f2ba0c'
down_revision = None
branch_labels = None
depends_on = None
d... | 1,069 | 0 | 46 |
10cf75a7db71980ccaab10af140ba67986fef858 | 4,585 | py | Python | main/ffmpeg/template.py | chimera-linux/cports | 37888f8ded3e6afc1a42227a4019bc25e2456afc | [
"BSD-2-Clause"
] | 46 | 2021-06-10T02:27:32.000Z | 2022-03-27T11:33:24.000Z | main/ffmpeg/template.py | chimera-linux/cports | 37888f8ded3e6afc1a42227a4019bc25e2456afc | [
"BSD-2-Clause"
] | 58 | 2021-07-03T13:58:20.000Z | 2022-03-13T16:45:35.000Z | main/ffmpeg/template.py | chimera-linux/cports | 37888f8ded3e6afc1a42227a4019bc25e2456afc | [
"BSD-2-Clause"
] | 6 | 2021-07-04T10:46:40.000Z | 2022-01-09T00:03:59.000Z | pkgname = "ffmpeg"
pkgver = "4.4.1"
pkgrel = 0
build_style = "configure"
configure_args = [
"--prefix=/usr",
"--enable-shared",
"--enable-static",
"--enable-gpl",
"--enable-version3",
"--enable-runtime-cpudetect",
"--enable-lto",
"--enable-openssl",
"--enable-librtmp",
"--enable-... | 30.566667 | 76 | 0.596292 | pkgname = "ffmpeg"
pkgver = "4.4.1"
pkgrel = 0
build_style = "configure"
configure_args = [
"--prefix=/usr",
"--enable-shared",
"--enable-static",
"--enable-gpl",
"--enable-version3",
"--enable-runtime-cpudetect",
"--enable-lto",
"--enable-openssl",
"--enable-librtmp",
"--enable-... | 977 | 0 | 90 |
d6e3139f264aba1f3892e5f27eed21274e10b618 | 605 | py | Python | third_party/deep_leaning_from_scratch/common/gradient.py | KentWangYQ/py3-poc | 52b993716192acaf13094dc77f3f6347ee580996 | [
"MIT"
] | null | null | null | third_party/deep_leaning_from_scratch/common/gradient.py | KentWangYQ/py3-poc | 52b993716192acaf13094dc77f3f6347ee580996 | [
"MIT"
] | null | null | null | third_party/deep_leaning_from_scratch/common/gradient.py | KentWangYQ/py3-poc | 52b993716192acaf13094dc77f3f6347ee580996 | [
"MIT"
] | null | null | null | import numpy as np
| 18.90625 | 58 | 0.538843 | import numpy as np
def _numerical_gradient_no_batch(f, x):
h = 1e-4
grad = np.zeros_like(x)
for idx in range(x.size):
tmp_val = x[idx]
x[idx] = tmp_val + h
fxh1 = f(x)
x[idx] = tmp_val - h
fxh2 = f(x)
grad[idx] = (fxh1 - fxh2) / (2 * h)
x[idx] = t... | 538 | 0 | 46 |
b0fd67321ba06086eac123cffefe4cfb6e25eba3 | 1,717 | py | Python | the-eventbridge-etl/typescript/container/s3DataExtractionTask/main.py | mttfarmer/serverless | e7b28421708cd4643ce61d28940357c3664ed2a8 | [
"MIT"
] | 1,627 | 2020-01-12T10:35:06.000Z | 2022-03-31T13:12:51.000Z | the-eventbridge-etl/typescript/container/s3DataExtractionTask/main.py | mttfarmer/serverless | e7b28421708cd4643ce61d28940357c3664ed2a8 | [
"MIT"
] | 58 | 2020-02-09T06:57:35.000Z | 2022-02-26T23:25:10.000Z | the-eventbridge-etl/typescript/container/s3DataExtractionTask/main.py | mttfarmer/serverless | e7b28421708cd4643ce61d28940357c3664ed2a8 | [
"MIT"
] | 240 | 2020-01-19T09:09:44.000Z | 2022-03-30T19:12:17.000Z | import boto3
import time
import os
import csv
from datetime import datetime
import json
if __name__ == '__main__':
main()
| 30.122807 | 102 | 0.559697 | import boto3
import time
import os
import csv
from datetime import datetime
import json
def main():
event_bridge = boto3.client('events')
# https://stackoverflow.com/questions/4906977/how-to-access-environment-variable-values
data_s3_bucket_name = os.environ.get('S3_BUCKET_NAME')
data_s3_object_key =... | 1,567 | 0 | 23 |
316cb32636c7f5d4d7cb7999e43806c46063a905 | 1,215 | py | Python | pyinstrument/util.py | DEKHTIARJonathan/pyinstrument | cc4f3f6fc1b493d7cd058ecf41ad012e0030a512 | [
"BSD-3-Clause"
] | null | null | null | pyinstrument/util.py | DEKHTIARJonathan/pyinstrument | cc4f3f6fc1b493d7cd058ecf41ad012e0030a512 | [
"BSD-3-Clause"
] | null | null | null | pyinstrument/util.py | DEKHTIARJonathan/pyinstrument | cc4f3f6fc1b493d7cd058ecf41ad012e0030a512 | [
"BSD-3-Clause"
] | null | null | null | import importlib, warnings
from pyinstrument.vendor.decorator import decorator
@decorator
def deprecated(func, *args, **kwargs):
''' Marks a function as deprecated. '''
warnings.warn(
'{} is deprecated and should no longer be used.'.format(func),
DeprecationWarning,
stacklevel=3
)
... | 31.153846 | 90 | 0.633745 | import importlib, warnings
from pyinstrument.vendor.decorator import decorator
def object_with_import_path(import_path):
if '.' not in import_path:
raise ValueError("Can't import '%s', it is not a valid import path" % import_path)
module_path, object_name = import_path.rsplit('.', 1)
module = impo... | 670 | 0 | 72 |
9439a1400ea3d720ed936e880d899ea559d9617b | 804 | py | Python | newApp/migrations/0002_personmodel.py | herokudev/Django-models | 80a67311ed6702789396d77eecbbf582281266f1 | [
"MIT"
] | null | null | null | newApp/migrations/0002_personmodel.py | herokudev/Django-models | 80a67311ed6702789396d77eecbbf582281266f1 | [
"MIT"
] | null | null | null | newApp/migrations/0002_personmodel.py | herokudev/Django-models | 80a67311ed6702789396d77eecbbf582281266f1 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-22 17:05
from django.db import migrations, models
| 32.16 | 116 | 0.557214 | # Generated by Django 4.0.2 on 2022-02-22 17:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('newApp', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PersonModel',
fields=[
('id... | 0 | 690 | 23 |
8e106bd84cda12c9b345aada8addbc62c6b8d35e | 22,351 | py | Python | upb_audio_tagging_2019/data.py | fgnt/upb_audio_tagging_2019 | 8c0640688403cef678be7ebe1a658dc3844ba95d | [
"MIT"
] | 2 | 2019-10-25T20:37:32.000Z | 2021-05-16T13:13:35.000Z | upb_audio_tagging_2019/data.py | fgnt/upb_audio_tagging_2019 | 8c0640688403cef678be7ebe1a658dc3844ba95d | [
"MIT"
] | null | null | null | upb_audio_tagging_2019/data.py | fgnt/upb_audio_tagging_2019 | 8c0640688403cef678be7ebe1a658dc3844ba95d | [
"MIT"
] | 2 | 2019-09-18T09:05:07.000Z | 2021-04-12T08:01:36.000Z |
import json
import numbers
from pathlib import Path
import numpy as np
import samplerate
import soundfile
from cached_property import cached_property
from lazy_dataset import Dataset, FilterException
from lazy_dataset.core import DynamicTimeSeriesBucket
from scipy.interpolate import make_interp_spline
from scipy.sign... | 34.019787 | 131 | 0.571786 |
import json
import numbers
from pathlib import Path
import numpy as np
import samplerate
import soundfile
from cached_property import cached_property
from lazy_dataset import Dataset, FilterException
from lazy_dataset.core import DynamicTimeSeriesBucket
from scipy.interpolate import make_interp_spline
from scipy.sign... | 11,529 | 6,981 | 287 |
5066330648f21b72214a940161a3e1803e798d80 | 2,045 | py | Python | tools/build_docs.py | rishiraj/decision-forests | c3977d9404ff7c8163f1201f2d142a4b44a2ad8e | [
"Apache-2.0"
] | 1 | 2021-07-14T15:05:05.000Z | 2021-07-14T15:05:05.000Z | tools/build_docs.py | machinelearning147/decision-forests | e2e2c3f8f1c270a23ac97a6833f84a28ec99c51e | [
"Apache-2.0"
] | null | null | null | tools/build_docs.py | machinelearning147/decision-forests | e2e2c3f8f1c270a23ac97a6833f84a28ec99c51e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 34.083333 | 79 | 0.729584 | # Copyright 2021 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 536 | 0 | 23 |
18282d350926bafe37d7608171ded402b2e6597e | 1,348 | py | Python | share/prun_jobs.py | micaelverissimo/kepler | 5db55aa39d7e65f460f533dfd91ca6e5fdb3076a | [
"MIT"
] | 1 | 2021-11-20T22:45:13.000Z | 2021-11-20T22:45:13.000Z | share/prun_jobs.py | micaelverissimo/kepler | 5db55aa39d7e65f460f533dfd91ca6e5fdb3076a | [
"MIT"
] | null | null | null | share/prun_jobs.py | micaelverissimo/kepler | 5db55aa39d7e65f460f533dfd91ca6e5fdb3076a | [
"MIT"
] | 2 | 2021-10-05T22:35:11.000Z | 2021-11-20T22:45:18.000Z | #!/usr/bin/env python3
import argparse
from Gaugi import Pool
from Gaugi import Logger
mainLogger = Logger.getModuleLogger("prun.job")
parser = argparse.ArgumentParser(description = '', add_help = False)
parser = argparse.ArgumentParser()
parser.add_argument('-o','--outputFile', action='store',
dest='outputFile... | 28.083333 | 89 | 0.675816 | #!/usr/bin/env python3
import argparse
from Gaugi import Pool
from Gaugi import Logger
mainLogger = Logger.getModuleLogger("prun.job")
parser = argparse.ArgumentParser(description = '', add_help = False)
parser = argparse.ArgumentParser()
parser.add_argument('-o','--outputFile', action='store',
dest='outputFile... | 66 | 0 | 23 |
5d8f572e644d76cf033f47714622010c229a0731 | 7,167 | py | Python | pedal/assertions/functions.py | acbart/python-analysis | 3cd2cc22d50a414ae6b62c74d2643be4742238d4 | [
"MIT"
] | 14 | 2019-08-22T03:40:23.000Z | 2022-03-13T00:30:53.000Z | pedal/assertions/functions.py | pedal-edu/pedal | 3cd2cc22d50a414ae6b62c74d2643be4742238d4 | [
"MIT"
] | 74 | 2019-09-12T04:35:56.000Z | 2022-01-26T19:21:32.000Z | pedal/assertions/functions.py | acbart/python-analysis | 3cd2cc22d50a414ae6b62c74d2643be4742238d4 | [
"MIT"
] | 2 | 2018-09-16T22:39:15.000Z | 2018-09-17T12:53:28.000Z | from pedal.assertions.feedbacks import AssertionFeedback
from pedal.core.report import MAIN_REPORT
class missing_function(AssertionFeedback):
""" Unconditionally asserts that the function is missing. """
title = "Missing Function"
message_template = "No function named {name_message} was found."
class du... | 41.189655 | 82 | 0.630529 | from pedal.assertions.feedbacks import AssertionFeedback
from pedal.core.report import MAIN_REPORT
class missing_function(AssertionFeedback):
""" Unconditionally asserts that the function is missing. """
title = "Missing Function"
message_template = "No function named {name_message} was found."
def _... | 3,979 | 0 | 270 |
b3fd09f9fb17248746d53dd5958a859085c4ce8e | 1,727 | py | Python | rapid7_insightvm_cloud/icon_rapid7_insightvm_cloud/actions/start_scan/schema.py | GreyNoise-Intelligence/insightconnect-plugins | 2ba3121d42fd96e1267bb095bc76b962678c1f56 | [
"MIT"
] | null | null | null | rapid7_insightvm_cloud/icon_rapid7_insightvm_cloud/actions/start_scan/schema.py | GreyNoise-Intelligence/insightconnect-plugins | 2ba3121d42fd96e1267bb095bc76b962678c1f56 | [
"MIT"
] | null | null | null | rapid7_insightvm_cloud/icon_rapid7_insightvm_cloud/actions/start_scan/schema.py | GreyNoise-Intelligence/insightconnect-plugins | 2ba3121d42fd96e1267bb095bc76b962678c1f56 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
| 19.404494 | 73 | 0.53619 | # GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Start an InsightVM scan of previously scanned devices"
class Input:
ASSET_IDS = "asset_ids"
HOSTNAMES = "hostnames"
IPS = "ips"
NAME = "name"
class Output:
ID = "id"... | 112 | 1,398 | 115 |
02819a0ba527b27cf75ea1d7e538e272055c1bcf | 6,394 | py | Python | geonode/geonode/proxy/tests.py | ttungbmt/BecaGIS_GeoPortal | 6c05f9fc020ec4ccf600ba2503a06c2231443920 | [
"MIT"
] | null | null | null | geonode/geonode/proxy/tests.py | ttungbmt/BecaGIS_GeoPortal | 6c05f9fc020ec4ccf600ba2503a06c2231443920 | [
"MIT"
] | null | null | null | geonode/geonode/proxy/tests.py | ttungbmt/BecaGIS_GeoPortal | 6c05f9fc020ec4ccf600ba2503a06c2231443920 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | 38.518072 | 106 | 0.66234 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | 1,568 | 3,079 | 123 |
70897d92921f34bca39590bd4b49fb1137f3852b | 221 | py | Python | convertmusic/db/__init__.py | groboclown/music-uploader | d73ad811324027f2d1d4292eaa599709f3600b56 | [
"MIT"
] | null | null | null | convertmusic/db/__init__.py | groboclown/music-uploader | d73ad811324027f2d1d4292eaa599709f3600b56 | [
"MIT"
] | null | null | null | convertmusic/db/__init__.py | groboclown/music-uploader | d73ad811324027f2d1d4292eaa599709f3600b56 | [
"MIT"
] | null | null | null |
from .api import MediaFileHistory
| 20.090909 | 37 | 0.719457 |
from .api import MediaFileHistory
def get_history(db_filename):
from .schema import SCHEMA
from .meta import Db
from .impl import Impl
db = Db(db_filename, SCHEMA)
return MediaFileHistory(Impl(db))
| 162 | 0 | 23 |
ff105396015d7a57d3f83412832488f0295cdca9 | 482 | py | Python | lib/dnsServer/utils.py | bankonmecoin/nmcontrol | 49a879b98bb2885e3ba7c9fdf6dfe7e122e0edad | [
"FTL"
] | 161 | 2015-01-08T19:45:20.000Z | 2022-01-15T18:25:21.000Z | lib/dnsServer/utils.py | bankonmecoin/nmcontrol | 49a879b98bb2885e3ba7c9fdf6dfe7e122e0edad | [
"FTL"
] | 77 | 2015-01-02T02:20:59.000Z | 2020-05-25T08:33:56.000Z | lib/dnsServer/utils.py | namecoin/nmcontrol | 49a879b98bb2885e3ba7c9fdf6dfe7e122e0edad | [
"FTL"
] | 36 | 2015-02-26T01:51:53.000Z | 2022-01-15T18:25:45.000Z | #This was not written by sonicrules1234, look in namecoindnsserver.py at the top for the actual author
import struct
| 20.083333 | 102 | 0.582988 | #This was not written by sonicrules1234, look in namecoindnsserver.py at the top for the actual author
import struct
def label2str(label):
s = struct.pack("!B", len(label))
s += label
return s
def labels2str(labels):
s = ''
for label in labels:
s += label2str(label)
s += struct.pack("!... | 295 | 0 | 69 |
efdb4a3ae8a8d4ff1cb0d994eada23af140462d4 | 434 | py | Python | setup.py | SimonIT/pylrc | d9d2f8f7aa01891f2f37702b000f7c3f0a346876 | [
"MIT"
] | 22 | 2017-07-02T05:15:16.000Z | 2021-10-20T03:05:18.000Z | setup.py | SimonIT/pylrc | d9d2f8f7aa01891f2f37702b000f7c3f0a346876 | [
"MIT"
] | 9 | 2017-11-14T04:06:19.000Z | 2021-06-10T16:17:41.000Z | setup.py | SimonIT/pylrc | d9d2f8f7aa01891f2f37702b000f7c3f0a346876 | [
"MIT"
] | 12 | 2017-07-02T05:15:19.000Z | 2021-05-31T18:27:56.000Z | from setuptools import setup
setup(
name='pylrc',
packages=['pylrc'],
version='0.1.0',
description='A library for parsing .lrc files',
long_description=open('README.rst').read(),
author='doakey3, SimonIT',
author_email='pylrc.dmodo@spamgourmet.com',
url='https://github.com/doakey3/pylrc... | 28.933333 | 89 | 0.677419 | from setuptools import setup
setup(
name='pylrc',
packages=['pylrc'],
version='0.1.0',
description='A library for parsing .lrc files',
long_description=open('README.rst').read(),
author='doakey3, SimonIT',
author_email='pylrc.dmodo@spamgourmet.com',
url='https://github.com/doakey3/pylrc... | 0 | 0 | 0 |
754d2258cd8985ae42460292a352d2eed4a8bd8d | 2,973 | py | Python | modules_lib/bleextop/libraries/permissionbi.py | hephaestus9/Ironworks | 37be48e37f63530dd7bf82618948ef82522699a0 | [
"MIT"
] | 1 | 2021-05-17T08:31:07.000Z | 2021-05-17T08:31:07.000Z | modules_lib/bleextop/libraries/permissionbi.py | hephaestus9/Ironworks | 37be48e37f63530dd7bf82618948ef82522699a0 | [
"MIT"
] | null | null | null | modules_lib/bleextop/libraries/permissionbi.py | hephaestus9/Ironworks | 37be48e37f63530dd7bf82618948ef82522699a0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from modules_lib.bleextop.models import roledao, permissiondao
import datetime
import re
#/**
#* Return the application permissions for the given user
#* @params data An array containing the user model and the application_id
#* @return Array containing the permissions and succe... | 35.819277 | 98 | 0.578877 | # -*- coding: utf-8 -*-
from modules_lib.bleextop.models import roledao, permissiondao
import datetime
import re
class PermissionBI:
def __init__(self):
self.permission = permissiondao.PermissionDAO()
self.role = roledao.RoleDAO()
def getAllPermissions(self):
return self.permission.g... | 2,270 | -2 | 158 |
082e0176c2c8151e1a97641a83bb9545de3cb17d | 3,365 | py | Python | rep0st/web/site.py | tomoshizuki/rep0st | 567f625762d7581be434e46fae08515ee5a94ae3 | [
"MIT"
] | 37 | 2015-03-03T17:08:23.000Z | 2021-09-21T13:21:08.000Z | rep0st/web/site.py | tomoshizuki/rep0st | 567f625762d7581be434e46fae08515ee5a94ae3 | [
"MIT"
] | 37 | 2015-02-24T20:24:42.000Z | 2021-08-01T16:42:02.000Z | rep0st/web/site.py | tomoshizuki/rep0st | 567f625762d7581be434e46fae08515ee5a94ae3 | [
"MIT"
] | 28 | 2015-02-27T20:05:03.000Z | 2021-07-31T12:54:54.000Z | import logging
from typing import BinaryIO, Optional
import requests
from injector import Module, ProviderOf, inject, singleton
from werkzeug import Request, Response
from werkzeug.routing import Rule
from rep0st.db.post import PostRepository, PostRepositoryModule
from rep0st.framework.data.transaction import transac... | 30.87156 | 135 | 0.720059 | import logging
from typing import BinaryIO, Optional
import requests
from injector import Module, ProviderOf, inject, singleton
from werkzeug import Request, Response
from werkzeug.routing import Rule
from rep0st.db.post import PostRepository, PostRepositoryModule
from rep0st.framework.data.transaction import transac... | 2,156 | 451 | 70 |
dfdbe41568d2a6d379681e6a7f37873634949a5b | 1,967 | py | Python | molecule/default/tests/test_default.py | aschult5/ansible-role-zen-node | d0c9dfe6821f2324a7ec7b1e0e4308082a3de19e | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | aschult5/ansible-role-zen-node | d0c9dfe6821f2324a7ec7b1e0e4308082a3de19e | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | aschult5/ansible-role-zen-node | d0c9dfe6821f2324a7ec7b1e0e4308082a3de19e | [
"MIT"
] | null | null | null | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
| 28.926471 | 79 | 0.688358 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_host(host):
docker_sock_default = '/var/run/docker.sock'
docker_sock = os.environ['ZEND_DOCKER_HOST'].replace('unix://', '', 1... | 1,696 | 0 | 92 |
bb0f20027ec2226e818b1ac4b650b977708c380f | 12,027 | py | Python | hopla/workers.py | AGrigis/hopla | 60147969267b8bf71aec774053d33fa797e2f668 | [
"CECILL-B"
] | null | null | null | hopla/workers.py | AGrigis/hopla | 60147969267b8bf71aec774053d33fa797e2f668 | [
"CECILL-B"
] | null | null | null | hopla/workers.py | AGrigis/hopla | 60147969267b8bf71aec774053d33fa797e2f668 | [
"CECILL-B"
] | null | null | null | ##########################################################################
# Hopla - Copyright (C) AGrigis, 2015 - 2016
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details... | 39.175896 | 79 | 0.573709 | ##########################################################################
# Hopla - Copyright (C) AGrigis, 2015 - 2016
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for details... | 0 | 0 | 0 |
d06a9b5aba8faa38f4e9546363a94d30f0798e45 | 3,483 | py | Python | wsu/tools/simx/simx/python/simx/test/base/Oscilloscope/test_node.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | 1 | 2020-02-28T20:35:09.000Z | 2020-02-28T20:35:09.000Z | wsu/tools/simx/simx/python/simx/test/base/Oscilloscope/test_node.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | wsu/tools/simx/simx/python/simx/test/base/Oscilloscope/test_node.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | from simx.base.testutil import import_assert_functions
import_assert_functions(globals())
from simx.base import TossimBase
from simx.base import Node
from TOSSIM import Tossim
_tossim = Tossim([])
tossim = None
a = None
b = None
c = None
# PST- due to overflow bugs in Tossim (and that there is no way to
# clear t... | 26.18797 | 77 | 0.655757 | from simx.base.testutil import import_assert_functions
import_assert_functions(globals())
from simx.base import TossimBase
from simx.base import Node
from TOSSIM import Tossim
_tossim = Tossim([])
tossim = None
a = None
b = None
c = None
def setUp():
global tossim, a, b, c
# base
tossim = TossimBase(_to... | 2,757 | 0 | 248 |
36cee23ae9ac3c86ed7eb4e393fb042b87a6aec9 | 5,737 | py | Python | tests/interestingptrmaptest.py | netcharm/ironclad | 5892c43b540b216d638e0fed2e6cf3fd8289fdfc | [
"PSF-2.0"
] | null | null | null | tests/interestingptrmaptest.py | netcharm/ironclad | 5892c43b540b216d638e0fed2e6cf3fd8289fdfc | [
"PSF-2.0"
] | null | null | null | tests/interestingptrmaptest.py | netcharm/ironclad | 5892c43b540b216d638e0fed2e6cf3fd8289fdfc | [
"PSF-2.0"
] | null | null | null |
from tests.utils.runtest import makesuite, run
from tests.utils.testcase import TestCase
from tests.utils.gc import gcwait
from System import NullReferenceException, WeakReference
from System.Runtime.InteropServices import Marshal
from Ironclad import BadMappingException, CPyMarshal, InterestingPtrMap, P... | 32.971264 | 82 | 0.567544 |
from tests.utils.runtest import makesuite, run
from tests.utils.testcase import TestCase
from tests.utils.gc import gcwait
from System import NullReferenceException, WeakReference
from System.Runtime.InteropServices import Marshal
from Ironclad import BadMappingException, CPyMarshal, InterestingPtrMap, P... | 4,540 | 17 | 362 |
f0c9ee2a28d8746fe467486ead00c3e7ca13b083 | 2,355 | py | Python | testsphinx/testsphinx/testapp/migrations/0003_add_date_field.py | NewVadim/django-sphinx | fe83ed4455608b5b4039ddf86aea476cc932b257 | [
"BSD-3-Clause"
] | null | null | null | testsphinx/testsphinx/testapp/migrations/0003_add_date_field.py | NewVadim/django-sphinx | fe83ed4455608b5b4039ddf86aea476cc932b257 | [
"BSD-3-Clause"
] | null | null | null | testsphinx/testsphinx/testapp/migrations/0003_add_date_field.py | NewVadim/django-sphinx | fe83ed4455608b5b4039ddf86aea476cc932b257 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| 46.176471 | 129 | 0.549469 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Search.date'
db.add_column('testapp_search', 'date',
self.gf('django.d... | 339 | 1,863 | 23 |
fe0a9f0b391fe67bd905efb9bbafed99bdac09db | 1,340 | py | Python | portfolio/conftest.py | Pompeiro/portfolio | 20b7ffb0a061be7ed0950e87f94164409fef2318 | [
"MIT"
] | null | null | null | portfolio/conftest.py | Pompeiro/portfolio | 20b7ffb0a061be7ed0950e87f94164409fef2318 | [
"MIT"
] | null | null | null | portfolio/conftest.py | Pompeiro/portfolio | 20b7ffb0a061be7ed0950e87f94164409fef2318 | [
"MIT"
] | null | null | null | import pytest
from django.core.files.uploadedfile import SimpleUploadedFile
from portfolio.portfolioapp.tests.factories import PortfolioProjectFactory
from portfolio.templatematching.tests.factories import UploadedImageFactory
from portfolio.tftchampions.tests.factories import ChampionFactory
from portfolio.users.mode... | 27.916667 | 87 | 0.76194 | import pytest
from django.core.files.uploadedfile import SimpleUploadedFile
from portfolio.portfolioapp.tests.factories import PortfolioProjectFactory
from portfolio.templatematching.tests.factories import UploadedImageFactory
from portfolio.tftchampions.tests.factories import ChampionFactory
from portfolio.users.mode... | 625 | 0 | 132 |
be5aea6672360ea16303055bb8172befc5fb1018 | 486 | py | Python | day10/django/app1/urls.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | day10/django/app1/urls.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | day10/django/app1/urls.py | Vanessa-kriby/Python | 1fbef67852fb362712fc48fa5c3c29eac68fe202 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from app1.dateview.addDepartments import *
from app1.dateview.showDepartments import *
from app1.dateview.updateDepartment import *
from app1.dateview.delDepartment import *
urlpatterns =[
path("addDepartments",addDepartments,name="addDepartments"),
path("showDepartments",showDepar... | 40.5 | 70 | 0.796296 | from django.urls import path
from app1.dateview.addDepartments import *
from app1.dateview.showDepartments import *
from app1.dateview.updateDepartment import *
from app1.dateview.delDepartment import *
urlpatterns =[
path("addDepartments",addDepartments,name="addDepartments"),
path("showDepartments",showDepar... | 0 | 0 | 0 |
e754d81a363486bcbb02b4180c9aa685a5e210b3 | 1,598 | py | Python | openpnm/algorithms/TransientIonicConduction.py | s-lunowa/OpenPNM | f176ea2cd76f7879edc7eabe13115a6ba9a8b18e | [
"MIT"
] | null | null | null | openpnm/algorithms/TransientIonicConduction.py | s-lunowa/OpenPNM | f176ea2cd76f7879edc7eabe13115a6ba9a8b18e | [
"MIT"
] | null | null | null | openpnm/algorithms/TransientIonicConduction.py | s-lunowa/OpenPNM | f176ea2cd76f7879edc7eabe13115a6ba9a8b18e | [
"MIT"
] | null | null | null | from openpnm.algorithms import TransientReactiveTransport, IonicConduction
from openpnm.utils import logging, Docorator, GenericSettings
logger = logging.getLogger(__name__)
docstr = Docorator()
@docstr.get_sections(base='TransientIonicConductionSettings',
sections=['Parameters'])
@docstr.dedent
... | 27.084746 | 78 | 0.690864 | from openpnm.algorithms import TransientReactiveTransport, IonicConduction
from openpnm.utils import logging, Docorator, GenericSettings
logger = logging.getLogger(__name__)
docstr = Docorator()
@docstr.get_sections(base='TransientIonicConductionSettings',
sections=['Parameters'])
@docstr.dedent
... | 283 | 0 | 27 |
9d434a8ca5bbb2b4faa659e9649e4830be8018fd | 1,453 | py | Python | tensealstat/tools_context.py | kozzion/tensealstat | 93314a8721ec6b1a2bea466aaeadb06cbf5a4f63 | [
"Apache-2.0"
] | 6 | 2020-12-17T16:05:24.000Z | 2021-12-28T13:26:31.000Z | tensealstat/tools_context.py | kozzion/tensealstat | 93314a8721ec6b1a2bea466aaeadb06cbf5a4f63 | [
"Apache-2.0"
] | null | null | null | tensealstat/tools_context.py | kozzion/tensealstat | 93314a8721ec6b1a2bea466aaeadb06cbf5a4f63 | [
"Apache-2.0"
] | null | null | null | import tenseal as ts
| 33.790698 | 93 | 0.649002 | import tenseal as ts
class ToolsContext:
# @staticmethod
# def get_context_high():
# poly_mod_degree = 32768
# coeff_mod_bit_sizes = [60, 40, 40, 40, 40, 40, 60] # for better accuracy
# context = ts.context(ts.SCHEME_TYPE.CKKS, poly_mod_degree, -1, coeff_mod_bit_sizes)
# cont... | 904 | 504 | 23 |
5dd5209ed52d91a2effd504fb3000119761a9c6d | 2,032 | py | Python | myscripts/dataset_crop.py | SpikeKing/pytorch-image-models-my | c90daf33580dd07d3924a8dfa492511516641ace | [
"Apache-2.0"
] | null | null | null | myscripts/dataset_crop.py | SpikeKing/pytorch-image-models-my | c90daf33580dd07d3924a8dfa492511516641ace | [
"Apache-2.0"
] | null | null | null | myscripts/dataset_crop.py | SpikeKing/pytorch-image-models-my | c90daf33580dd07d3924a8dfa492511516641ace | [
"Apache-2.0"
] | 1 | 2021-09-28T08:13:42.000Z | 2021-09-28T08:13:42.000Z | #!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2021. All rights reserved.
Created by C. L. Wang on 6.12.21
"""
import os
import math
import random
from PIL import Image
from myutils.cv_utils import *
from root_dir import DATA_DIR
def get_params(img, scale, ratio):
"""Get parameters for ``crop`` fo... | 27.835616 | 83 | 0.588091 | #!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2021. All rights reserved.
Created by C. L. Wang on 6.12.21
"""
import os
import math
import random
from PIL import Image
from myutils.cv_utils import *
from root_dir import DATA_DIR
def get_params(img, scale, ratio):
"""Get parameters for ``crop`` fo... | 336 | 0 | 23 |
7e1f8de2d0cc9c87348f629b537b1b12db5a537b | 4,111 | py | Python | tests/test_client.py | BONSAMURAIS/bentso | f2ad192e11793c5506b9b0d7f61f5bd175eafb49 | [
"BSD-3-Clause"
] | null | null | null | tests/test_client.py | BONSAMURAIS/bentso | f2ad192e11793c5506b9b0d7f61f5bd175eafb49 | [
"BSD-3-Clause"
] | 7 | 2019-03-04T13:26:38.000Z | 2019-03-29T09:35:35.000Z | tests/test_client.py | BONSAMURAIS/bentso | f2ad192e11793c5506b9b0d7f61f5bd175eafb49 | [
"BSD-3-Clause"
] | 1 | 2020-10-24T20:08:44.000Z | 2020-10-24T20:08:44.000Z | from bentso import CachingDataClient
from bentso.db import get_database
import numpy as np
import os
import pandas as pd
import pytest
FIXTURES = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"fixtures",
)
| 33.153226 | 83 | 0.645828 | from bentso import CachingDataClient
from bentso.db import get_database
import numpy as np
import os
import pandas as pd
import pytest
FIXTURES = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"fixtures",
)
def test_request_parameters(monkeypatch, tmp_path):
class FakeClient:
def __in... | 3,643 | 0 | 230 |
5d11e136135982bc6b84c0334f5eb61bc13365e6 | 15,345 | py | Python | test/test_pytest/test_flaky_pytest_plugin.py | Jeff-Meadows/flaky | 3bb022f9014c46409662f7352733a4c660e11cd1 | [
"Apache-2.0"
] | 1 | 2018-06-10T23:31:42.000Z | 2018-06-10T23:31:42.000Z | test/test_pytest/test_flaky_pytest_plugin.py | Jeff-Meadows/flaky | 3bb022f9014c46409662f7352733a4c660e11cd1 | [
"Apache-2.0"
] | null | null | null | test/test_pytest/test_flaky_pytest_plugin.py | Jeff-Meadows/flaky | 3bb022f9014c46409662f7352733a4c660e11cd1 | [
"Apache-2.0"
] | 1 | 2020-11-07T10:31:36.000Z | 2020-11-07T10:31:36.000Z | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
from mock import Mock, patch
# pylint:disable=import-error
import pytest
# pylint:enable=import-error
from flaky import flaky
from flaky import _flaky_plugin
from flaky.flaky_pytest_plugin import (
CallInfo,
FlakyPlugin,
FlakyX... | 27.255773 | 80 | 0.607234 | # coding: utf-8
from __future__ import unicode_literals
from io import StringIO
from mock import Mock, patch
# pylint:disable=import-error
import pytest
# pylint:enable=import-error
from flaky import flaky
from flaky import _flaky_plugin
from flaky.flaky_pytest_plugin import (
CallInfo,
FlakyPlugin,
FlakyX... | 12,317 | 597 | 458 |
b94343b87039488324e7c6319d1239d47bb3dff4 | 5,261 | py | Python | src/python/grpcio/grpc/experimental/aio/__init__.py | sachin746/grpc | 98abc22f4cee7289058543f4602185f0ffacf6ed | [
"Apache-2.0"
] | null | null | null | src/python/grpcio/grpc/experimental/aio/__init__.py | sachin746/grpc | 98abc22f4cee7289058543f4602185f0ffacf6ed | [
"Apache-2.0"
] | null | null | null | src/python/grpcio/grpc/experimental/aio/__init__.py | sachin746/grpc | 98abc22f4cee7289058543f4602185f0ffacf6ed | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 gRPC 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 applicable law or agreed to in writing... | 35.073333 | 96 | 0.65881 | # Copyright 2019 gRPC 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 applicable law or agreed to in writing... | 276 | 0 | 27 |
42b37f721e56b667340e27c5dce684303994eeaa | 2,399 | py | Python | examples/MDF/translation/run_translated_FN.py | 29riyasaxena/MDF | 476e6950d0f14f29463eb4f6e3be518dfb2160a5 | [
"Apache-2.0"
] | null | null | null | examples/MDF/translation/run_translated_FN.py | 29riyasaxena/MDF | 476e6950d0f14f29463eb4f6e3be518dfb2160a5 | [
"Apache-2.0"
] | null | null | null | examples/MDF/translation/run_translated_FN.py | 29riyasaxena/MDF | 476e6950d0f14f29463eb4f6e3be518dfb2160a5 | [
"Apache-2.0"
] | null | null | null | import json
import ntpath
from modeci_mdf.functions.standard import mdf_functions, create_python_expression
from typing import List, Tuple, Dict, Optional, Set, Any, Union
from modeci_mdf.utils import load_mdf, print_summary
from modeci_mdf.mdf import *
from modeci_mdf.full_translator import *
from modeci_mdf.executio... | 28.223529 | 101 | 0.599416 | import json
import ntpath
from modeci_mdf.functions.standard import mdf_functions, create_python_expression
from typing import List, Tuple, Dict, Optional, Set, Any, Union
from modeci_mdf.utils import load_mdf, print_summary
from modeci_mdf.mdf import *
from modeci_mdf.full_translator import *
from modeci_mdf.executio... | 1,956 | 0 | 23 |
7444fee397415f3a18ab9829ca6eb1418d83f54f | 829 | py | Python | NetCatKS/Validators/api/implementers/validators/xml/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | NetCatKS/Validators/api/implementers/validators/xml/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | NetCatKS/Validators/api/implementers/validators/xml/__init__.py | dimddev/NetCatKS-CP | 2d9e72b2422e344569fd4eb154866b98e9707561 | [
"BSD-2-Clause"
] | null | null | null | __author__ = 'dimd'
from NetCatKS.Validators.api.interfaces.message import IMessage
from NetCatKS.Validators.api.implementers.validators.default import BaseValidator
from zope.component import adapts
from zope.component import getGlobalSiteManager
from lxml import etree
gsm = getGlobalSiteManager()
gsm.registerSub... | 22.405405 | 81 | 0.703257 | __author__ = 'dimd'
from NetCatKS.Validators.api.interfaces.message import IMessage
from NetCatKS.Validators.api.implementers.validators.default import BaseValidator
from zope.component import adapts
from zope.component import getGlobalSiteManager
from lxml import etree
class XMLValidator(BaseValidator):
adap... | 367 | 89 | 23 |
af738c15e451ead3111b0a2aa4f40cb71e88296b | 437 | py | Python | recipes/migrations/0004_auto_20210324_1236.py | IzmdI/foodgram-project | 280ae3348872b5072c9bb3aa3f06d62ca831369e | [
"MIT"
] | null | null | null | recipes/migrations/0004_auto_20210324_1236.py | IzmdI/foodgram-project | 280ae3348872b5072c9bb3aa3f06d62ca831369e | [
"MIT"
] | null | null | null | recipes/migrations/0004_auto_20210324_1236.py | IzmdI/foodgram-project | 280ae3348872b5072c9bb3aa3f06d62ca831369e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-24 09:36
from django.db import migrations
| 19.863636 | 47 | 0.565217 | # Generated by Django 3.1.7 on 2021-03-24 09:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('recipes', '0003_auto_20210323_1606'),
]
operations = [
migrations.RemoveField(
model_name='recipe',
name='favorites',
... | 0 | 331 | 23 |
f0a0116d9ada4d85bd0d372dee92feac6d85b444 | 1,508 | py | Python | examples/14-daemons/example.py | michaelnarodovitch/kopf | df4e51bf5ca3c1fc9e609ffeb4cc951925135db2 | [
"MIT"
] | null | null | null | examples/14-daemons/example.py | michaelnarodovitch/kopf | df4e51bf5ca3c1fc9e609ffeb4cc951925135db2 | [
"MIT"
] | null | null | null | examples/14-daemons/example.py | michaelnarodovitch/kopf | df4e51bf5ca3c1fc9e609ffeb4cc951925135db2 | [
"MIT"
] | null | null | null | import asyncio
import time
import kopf
# Sync daemons in threads are non-interruptable, they must check for the `stopped` flag.
# This daemon exits after 3 attempts and then 30 seconds of running (unless stopped).
@kopf.daemon('zalando.org', 'v1', 'kopfexamples', backoff=3)
# Async daemons do not need the `stopped... | 39.684211 | 128 | 0.689655 | import asyncio
import time
import kopf
# Sync daemons in threads are non-interruptable, they must check for the `stopped` flag.
# This daemon exits after 3 attempts and then 30 seconds of running (unless stopped).
@kopf.daemon('zalando.org', 'v1', 'kopfexamples', backoff=3)
def background_sync(spec, stopped, logger,... | 686 | 0 | 44 |
a27ed5701f6e6de2e3fa1c0caacfb9061e942c5a | 991 | py | Python | djpaypal/checks.py | SakuradaJun/dj-paypal-py27 | dabcccac4dc89c0d8a901ee4800ac7ded7f7102e | [
"MIT"
] | null | null | null | djpaypal/checks.py | SakuradaJun/dj-paypal-py27 | dabcccac4dc89c0d8a901ee4800ac7ded7f7102e | [
"MIT"
] | null | null | null | djpaypal/checks.py | SakuradaJun/dj-paypal-py27 | dabcccac4dc89c0d8a901ee4800ac7ded7f7102e | [
"MIT"
] | null | null | null | from django.core import checks
from . import settings as djpaypal_settings
VALID_MODES = ("live", "sandbox")
@checks.register("djpaypal")
def check_paypal_api_key(app_configs=None, **kwargs):
"""Check that the Paypal API keys are configured correctly"""
messages = []
mode = getattr(djpaypal_settings, ... | 36.703704 | 94 | 0.687185 | from django.core import checks
from . import settings as djpaypal_settings
VALID_MODES = ("live", "sandbox")
@checks.register("djpaypal")
def check_paypal_api_key(app_configs=None, **kwargs):
"""Check that the Paypal API keys are configured correctly"""
messages = []
mode = getattr(djpaypal_settings, ... | 0 | 0 | 0 |
6974365ddb564f36667977a85d824e25b86f1949 | 60 | py | Python | test_response/clean_response.py | seungguini/DialoGPT | 6b89677496cc674fd5cf951c179e94d330292437 | [
"MIT"
] | null | null | null | test_response/clean_response.py | seungguini/DialoGPT | 6b89677496cc674fd5cf951c179e94d330292437 | [
"MIT"
] | null | null | null | test_response/clean_response.py | seungguini/DialoGPT | 6b89677496cc674fd5cf951c179e94d330292437 | [
"MIT"
] | null | null | null | # Script to clean response into one-response-per-line format | 60 | 60 | 0.816667 | # Script to clean response into one-response-per-line format | 0 | 0 | 0 |
eb433520bb82c6093df638cb8b32c5356357e2a6 | 189 | py | Python | gender_analysis/text/__init__.py | dhmit/gender_analysis | 4ed3e8733f2d078d88b50f8dbec218dfca269037 | [
"BSD-3-Clause"
] | 10 | 2019-07-21T21:57:35.000Z | 2022-01-11T16:13:08.000Z | gender_analysis/text/__init__.py | dhmit/gender_analysis | 4ed3e8733f2d078d88b50f8dbec218dfca269037 | [
"BSD-3-Clause"
] | 128 | 2019-06-18T15:33:29.000Z | 2021-09-24T19:55:03.000Z | gender_analysis/text/__init__.py | dhmit/gender_analysis | 4ed3e8733f2d078d88b50f8dbec218dfca269037 | [
"BSD-3-Clause"
] | 5 | 2020-10-01T23:53:17.000Z | 2021-10-05T22:15:12.000Z | __all__ = [
'character',
'common',
'corpus',
'document',
]
from .common import *
from .character import Character
from .corpus import Corpus
from .document import Document
| 15.75 | 32 | 0.677249 | __all__ = [
'character',
'common',
'corpus',
'document',
]
from .common import *
from .character import Character
from .corpus import Corpus
from .document import Document
| 0 | 0 | 0 |
dbc77373eecf5b95737f9a03db3790caae89ac21 | 297 | py | Python | scanner/badge.py | maddevsio/heimdall | 21f16880030cfdb1c1c97969158bec02ca6c0336 | [
"MIT"
] | 15 | 2018-08-21T09:11:17.000Z | 2022-02-27T02:33:47.000Z | scanner/badge.py | maddevsio/heimdall | 21f16880030cfdb1c1c97969158bec02ca6c0336 | [
"MIT"
] | 40 | 2018-08-09T17:56:53.000Z | 2021-06-01T22:27:32.000Z | scanner/badge.py | maddevsio/mythril-scanner | 21f16880030cfdb1c1c97969158bec02ca6c0336 | [
"MIT"
] | 2 | 2018-09-05T11:41:07.000Z | 2018-11-14T07:04:22.000Z | import anybadge
| 22.846154 | 76 | 0.616162 | import anybadge
def badge_generator(status):
thresholds = {
'critical': 'red',
'minor': 'yellow',
'passed': 'green',
'processing': 'lightgrey',
}
badge = anybadge.Badge('Smart Contracts', status, thresholds=thresholds)
return badge.badge_svg_text
| 257 | 0 | 23 |
6cb70ee23fc97b9e1939ca4f205159bf17cd891e | 4,187 | py | Python | tests/test_api_plugins.py | edgardmota/vent | 67b01abc059a3e9e8d16670c7058f0a9e267d8f1 | [
"Apache-2.0"
] | null | null | null | tests/test_api_plugins.py | edgardmota/vent | 67b01abc059a3e9e8d16670c7058f0a9e267d8f1 | [
"Apache-2.0"
] | null | null | null | tests/test_api_plugins.py | edgardmota/vent | 67b01abc059a3e9e8d16670c7058f0a9e267d8f1 | [
"Apache-2.0"
] | null | null | null | import os
from vent.api.plugins import Plugin
from vent.api.templates import Template
def test_add():
""" Test the add function """
instance = Plugin()
status = instance.add('https://github.com/cyberreboot/vent', build=False)
assert isinstance(status, tuple)
assert status[0] == True
status = i... | 37.383929 | 134 | 0.669453 | import os
from vent.api.plugins import Plugin
from vent.api.templates import Template
def test_add():
""" Test the add function """
instance = Plugin()
status = instance.add('https://github.com/cyberreboot/vent', build=False)
assert isinstance(status, tuple)
assert status[0] == True
status = i... | 0 | 0 | 0 |
6fa2f60b63625317ac8a47010a4b68c75113c15f | 3,172 | py | Python | django/dashboard/imports/dataset.py | sizxy3462g5829bz/mantistable4-modified | d894ade055da4aa7f7febb10ead3527fa6cdc57a | [
"Apache-2.0"
] | null | null | null | django/dashboard/imports/dataset.py | sizxy3462g5829bz/mantistable4-modified | d894ade055da4aa7f7febb10ead3527fa6cdc57a | [
"Apache-2.0"
] | null | null | null | django/dashboard/imports/dataset.py | sizxy3462g5829bz/mantistable4-modified | d894ade055da4aa7f7febb10ead3527fa6cdc57a | [
"Apache-2.0"
] | null | null | null | from dashboard.models import Table, Dataset
import json
import csv
import zipfile
| 30.5 | 104 | 0.563367 | from dashboard.models import Table, Dataset
import json
import csv
import zipfile
class DatasetImport:
def __init__(self, dataset_name, dataset_file):
self._dataset_name = dataset_name
self._dataset_file = dataset_file
self._tables = []
self._rows = 0
self._cols = 0
def... | 2,853 | -1 | 238 |
c46fe8755645ba4ac356bb9cf6d7090b64d2c00d | 146 | py | Python | utils/export.py | FilippoRanza/aps_location | 99d1caf11bfa7ad273202c966cdb397db2d5e0c3 | [
"MIT"
] | null | null | null | utils/export.py | FilippoRanza/aps_location | 99d1caf11bfa7ad273202c966cdb397db2d5e0c3 | [
"MIT"
] | null | null | null | utils/export.py | FilippoRanza/aps_location | 99d1caf11bfa7ad273202c966cdb397db2d5e0c3 | [
"MIT"
] | null | null | null | #! /usr/bin/python
import json
| 16.222222 | 40 | 0.657534 | #! /usr/bin/python
import json
def export_results(file_name, **kwargs):
with open(file_name, "w") as file:
json.dump(kwargs, file)
| 90 | 0 | 23 |
2a405f90d24d3f3f09252b343e3ce35cb9485610 | 1,533 | py | Python | api.py | gajanlee/ZeusKnows3 | 8e22f7d0ca5b8c4563a6d975b1339a859b1268f6 | [
"MIT"
] | null | null | null | api.py | gajanlee/ZeusKnows3 | 8e22f7d0ca5b8c4563a6d975b1339a859b1268f6 | [
"MIT"
] | null | null | null | api.py | gajanlee/ZeusKnows3 | 8e22f7d0ca5b8c4563a6d975b1339a859b1268f6 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from aip import AipNlp
import numpy as np
APP_ID = '10791703'
API_KEY = 'YNMY6eSAz6QlDCeM7KB9GKHC'
SECRET_KEY = 'tSqTt0OikFiYXVIt5kAXZyL0FdciRp5t'
client = AipNlp(APP_ID, API_KEY, SECRET_KEY)
def get_dependency(text):
"""
:param text: prepare to analysis the dependecy of tokens
:return... | 33.326087 | 105 | 0.677104 | #!/usr/bin/python3
from aip import AipNlp
import numpy as np
APP_ID = '10791703'
API_KEY = 'YNMY6eSAz6QlDCeM7KB9GKHC'
SECRET_KEY = 'tSqTt0OikFiYXVIt5kAXZyL0FdciRp5t'
client = AipNlp(APP_ID, API_KEY, SECRET_KEY)
def get_wordEmbedding(word):
we = client.wordEmbedding(word)
return np.array(we['vec']) if 'vec' i... | 503 | 0 | 96 |
142d34a1e53c79b444c600d00c7d0aacde3c14d7 | 6,415 | py | Python | graphrole/features/extract.py | bingrao/GraphRole | 3439cd000e256e7b84159e7083debe7873fca61e | [
"MIT"
] | 60 | 2019-03-07T15:15:49.000Z | 2022-03-25T19:21:18.000Z | graphrole/features/extract.py | bingrao/GraphRole | 3439cd000e256e7b84159e7083debe7873fca61e | [
"MIT"
] | 5 | 2020-08-24T08:51:40.000Z | 2021-12-08T06:50:47.000Z | graphrole/features/extract.py | bingrao/GraphRole | 3439cd000e256e7b84159e7083debe7873fca61e | [
"MIT"
] | 17 | 2019-08-02T04:15:50.000Z | 2022-03-16T21:32:23.000Z | from collections import ChainMap
from typing import Dict, List, Optional
import pandas as pd
from graphrole.features.prune import FeaturePruner
from graphrole.graph import interface
from graphrole.types import DataFrameDict, DataFrameLike
class RecursiveFeatureExtractor:
""" Compute recursive features for node... | 36.867816 | 85 | 0.647233 | from collections import ChainMap
from typing import Dict, List, Optional
import pandas as pd
from graphrole.features.prune import FeaturePruner
from graphrole.graph import interface
from graphrole.types import DataFrameDict, DataFrameLike
class RecursiveFeatureExtractor:
""" Compute recursive features for node... | 0 | 0 | 0 |
96d649293a96c10f012cd771d8121445d8ffd652 | 812 | py | Python | museum_site/migrations/0018_auto_20170816_0336.py | DrDos0016/z2 | b63e77129fefcb4f990ee1cb9952f4f708ee3a2b | [
"MIT"
] | 3 | 2017-05-01T19:53:57.000Z | 2018-08-27T20:14:43.000Z | museum_site/migrations/0018_auto_20170816_0336.py | asiekierka/z2 | d926408423dc98d71d5e7fc2fda3202c03c309de | [
"MIT"
] | 26 | 2020-02-11T22:10:43.000Z | 2022-02-03T20:54:08.000Z | museum_site/migrations/0018_auto_20170816_0336.py | asiekierka/z2 | d926408423dc98d71d5e7fc2fda3202c03c309de | [
"MIT"
] | 1 | 2018-08-27T20:14:46.000Z | 2018-08-27T20:14:46.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-08-16 03:36
from __future__ import unicode_literals
from django.db import migrations, models
| 27.066667 | 96 | 0.598522 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-08-16 03:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0017_auto_20170415_0102'),
]
operations = [
migrations.Remov... | 0 | 633 | 23 |
fe2e86f70df87eaa47fdd63f89aff6dfc19a6360 | 6,403 | py | Python | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from random import random
import random
import webbrowser
import pyttsx3
import datetime
import urllib.request
import re
import speech_recognition as sr
import wikipedia
import os
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice',voi... | 28.584821 | 92 | 0.532875 | from datetime import datetime
from random import random
import random
import webbrowser
import pyttsx3
import datetime
import urllib.request
import re
import speech_recognition as sr
import wikipedia
import os
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice',voi... | 2,276 | 0 | 169 |
89568549dbff5a284e22d17c0fbc6208b8b7837f | 991 | py | Python | convex_api/tool/command/peer_command.py | luisriverag/convex-api-py | 193c0abff1ac5389d2d9032d944a2e8799136861 | [
"Apache-2.0"
] | null | null | null | convex_api/tool/command/peer_command.py | luisriverag/convex-api-py | 193c0abff1ac5389d2d9032d944a2e8799136861 | [
"Apache-2.0"
] | null | null | null | convex_api/tool/command/peer_command.py | luisriverag/convex-api-py | 193c0abff1ac5389d2d9032d944a2e8799136861 | [
"Apache-2.0"
] | 1 | 2021-05-04T04:59:15.000Z | 2021-05-04T04:59:15.000Z | """
Command peer
"""
from .command_base import CommandBase
from .help_command import HelpCommand
from .peer_create_command import PeerCreateCommand
| 24.775 | 72 | 0.621594 | """
Command peer
"""
from .command_base import CommandBase
from .help_command import HelpCommand
from .peer_create_command import PeerCreateCommand
class PeerCommand(CommandBase):
def __init__(self, sub_parser=None):
self._command_list = []
super().__init__('peer', sub_parser)
def cre... | 721 | 10 | 104 |
6e4a27ad0c729c08d3a53b69c7c8abdaa40481b6 | 36,427 | py | Python | SBaaS_quantification/stage01_quantification_peakInformation_io.py | dmccloskey/SBaaS_quantification | b2a9c7a9a0d318f22ff20e311f94c213852ba914 | [
"MIT"
] | null | null | null | SBaaS_quantification/stage01_quantification_peakInformation_io.py | dmccloskey/SBaaS_quantification | b2a9c7a9a0d318f22ff20e311f94c213852ba914 | [
"MIT"
] | null | null | null | SBaaS_quantification/stage01_quantification_peakInformation_io.py | dmccloskey/SBaaS_quantification | b2a9c7a9a0d318f22ff20e311f94c213852ba914 | [
"MIT"
] | null | null | null | # System
import json,re
# SBaaS
from .stage01_quantification_peakInformation_query import stage01_quantification_peakInformation_query
from .stage01_quantification_MQResultsTable_query import stage01_quantification_MQResultsTable_query
# Resources
from io_utilities.base_importData import base_importData
from io_utilit... | 59.716393 | 374 | 0.587037 | # System
import json,re
# SBaaS
from .stage01_quantification_peakInformation_query import stage01_quantification_peakInformation_query
from .stage01_quantification_MQResultsTable_query import stage01_quantification_MQResultsTable_query
# Resources
from io_utilities.base_importData import base_importData
from io_utilit... | 0 | 35,879 | 23 |
213ea17a6e3e233293f1b25f2c7e3c486ad0932a | 28,781 | py | Python | matilda/fundamental_analysis/financial_statements/balance_sheet.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 45 | 2021-01-28T04:12:21.000Z | 2022-02-24T13:15:50.000Z | matilda/fundamental_analysis/financial_statements/balance_sheet.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 32 | 2021-03-02T18:45:16.000Z | 2022-03-12T00:53:10.000Z | matilda/fundamental_analysis/financial_statements/balance_sheet.py | AlainDaccache/Quantropy | 6cfa06ed2b764471382ebf94d40af867f10433bb | [
"MIT"
] | 10 | 2020-12-25T15:02:40.000Z | 2021-12-30T11:40:15.000Z | """
Balance Sheet Entries
"""
from datetime import timedelta
from matilda import config
from matilda.data_pipeline.db_crud import read_financial_statement_entry, companies_in_classification
def cash_and_cash_equivalents(stock, date=None, lookback_period: timedelta = timedelta(days=0), period: str = 'Q'):
"""
... | 65.710046 | 180 | 0.594663 | """
Balance Sheet Entries
"""
from datetime import timedelta
from matilda import config
from matilda.data_pipeline.db_crud import read_financial_statement_entry, companies_in_classification
def cash_and_cash_equivalents(stock, date=None, lookback_period: timedelta = timedelta(days=0), period: str = 'Q'):
"""
... | 22,621 | 0 | 1,081 |
2220eb562017f377eebd9616b61b5042760d0593 | 4,130 | py | Python | Communication/SerialCommunication.py | UncleBench/PREN2 | 039077e098ea97bc5e21b85e35df858d6c33f55d | [
"MIT"
] | null | null | null | Communication/SerialCommunication.py | UncleBench/PREN2 | 039077e098ea97bc5e21b85e35df858d6c33f55d | [
"MIT"
] | null | null | null | Communication/SerialCommunication.py | UncleBench/PREN2 | 039077e098ea97bc5e21b85e35df858d6c33f55d | [
"MIT"
] | null | null | null | import serial
ANGLE_ERROR_CODE = 65535 # -1 signed int
if __name__ == '__main__':
arduino = SerialCommunication('COM3', 9600)
arduino.setGrabber(GrabberState.CLOSE)
print arduino.getRawBeta(), arduino.getRawAlpha() | 28.287671 | 89 | 0.564407 | import serial
ANGLE_ERROR_CODE = 65535 # -1 signed int
class CommException(Exception):
pass
class StopState:
RUNNING = 0
STOP = 1
class SerialCommunication:
def __init__(self, com, baud=115200):
"""
Args:
com (String): Arduino Comport
baud (int): Baudrate
... | 0 | 3,832 | 69 |
d263993c14dfee5fd37e7db7f5ae2dca8b68c651 | 3,088 | py | Python | excut/embedding/ampligraph_extend/model_utils.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | 5 | 2020-11-17T19:59:49.000Z | 2021-09-23T23:10:39.000Z | excut/embedding/ampligraph_extend/model_utils.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | null | null | null | excut/embedding/ampligraph_extend/model_utils.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | null | null | null | import importlib
import pickle
import glob
from excut.utils.logging import logger
def restore_model(model_name_path=None, module_name="ampligraph.latent_features"):
"""Restore a saved model from disk.
See also :meth:`save_model`.
Parameters
----------
model_name_path: string
... | 30.574257 | 84 | 0.632124 | import importlib
import pickle
import glob
from excut.utils.logging import logger
def restore_model(model_name_path=None, module_name="ampligraph.latent_features"):
"""Restore a saved model from disk.
See also :meth:`save_model`.
Parameters
----------
model_name_path: string
... | 0 | 0 | 0 |
39f9fb809bcee1d02f0de9dbfc23338d6fc184f9 | 2,928 | py | Python | src/vendor/Xilinx/S7/x7sadj_All.py | mortbopet/NetCracker | 8b5c1dbe1780c111d1f6810d3ef13400f26f9cb0 | [
"MIT"
] | 9 | 2021-02-21T13:27:03.000Z | 2021-12-22T17:21:43.000Z | src/vendor/Xilinx/S7/x7sadj_All.py | mortbopet/NetCracker | 8b5c1dbe1780c111d1f6810d3ef13400f26f9cb0 | [
"MIT"
] | null | null | null | src/vendor/Xilinx/S7/x7sadj_All.py | mortbopet/NetCracker | 8b5c1dbe1780c111d1f6810d3ef13400f26f9cb0 | [
"MIT"
] | 5 | 2021-02-22T02:55:44.000Z | 2021-12-22T17:23:09.000Z | from src.analysis.adjacencyAnalysis import *
from src.vendor.Xilinx.S7.x7s import *
from src.vendor.Xilinx.S7.x7s_filters import *
from src.vendor.Xilinx.S7.x7s_clusterings import *
| 37.063291 | 115 | 0.627732 | from src.analysis.adjacencyAnalysis import *
from src.vendor.Xilinx.S7.x7s import *
from src.vendor.Xilinx.S7.x7s_filters import *
from src.vendor.Xilinx.S7.x7s_clusterings import *
class X7SAdj_All(AdjacencyAnalysis):
def __init__(self,
description="(Xilinx 7-Series) adjacency analysis from all PJs w... | 1,429 | 1,140 | 175 |
3e7e7f051ce7389716e3b71e792a245dcae7cd10 | 5,975 | py | Python | bjorg.fr.py | mic100/Food_Recipes | fcb11f8c8d06ef5bc6d4b1699557f7174c48ac8b | [
"MIT"
] | 1 | 2022-01-16T03:16:30.000Z | 2022-01-16T03:16:30.000Z | bjorg.fr.py | Oakesso/Food_Recipes | fcb11f8c8d06ef5bc6d4b1699557f7174c48ac8b | [
"MIT"
] | null | null | null | bjorg.fr.py | Oakesso/Food_Recipes | fcb11f8c8d06ef5bc6d4b1699557f7174c48ac8b | [
"MIT"
] | 1 | 2022-01-16T03:15:18.000Z | 2022-01-16T03:15:18.000Z | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------#
# Import Librairies #
#-----------------------------------------------------------------------------#
import tool_kit as tk
#--------------------------------... | 44.259259 | 83 | 0.331381 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------#
# Import Librairies #
#-----------------------------------------------------------------------------#
import tool_kit as tk
#--------------------------------... | 0 | 0 | 0 |
37db107adc28519126aa51faefbddeaeba4c32b7 | 3,309 | py | Python | DimationReduction.py | shalev-habany/Introduction-to-AI | 388bdd358f9e9b6beb09c20d79ade7938c7dbecd | [
"MIT"
] | null | null | null | DimationReduction.py | shalev-habany/Introduction-to-AI | 388bdd358f9e9b6beb09c20d79ade7938c7dbecd | [
"MIT"
] | null | null | null | DimationReduction.py | shalev-habany/Introduction-to-AI | 388bdd358f9e9b6beb09c20d79ade7938c7dbecd | [
"MIT"
] | null | null | null | import preprocess
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import pandas as pd
import plotly.express as px
from sklearn.decomposition import FastICA
import matplotlib.pyplot as plt
import numpy as np
dataPath = r"C:\Users\shalev\Desktop\Introduction_to_AI\Introduction-to-A... | 41.3625 | 104 | 0.667573 | import preprocess
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import pandas as pd
import plotly.express as px
from sklearn.decomposition import FastICA
import matplotlib.pyplot as plt
import numpy as np
dataPath = r"C:\Users\shalev\Desktop\Introduction_to_AI\Introduction-to-A... | 2,482 | 4 | 157 |
a2c8a89002fa14a18334c9ff9b81f0f6218ace23 | 16,770 | py | Python | cinder/tests/test_v6000_fcp_with_mock.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_v6000_fcp_with_mock.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | 1 | 2021-01-12T23:22:22.000Z | 2021-01-12T23:22:22.000Z | cinder/tests/test_v6000_fcp_with_mock.py | rlucio/cinder-violin-driver-icehouse | 1632bf1bdf67f7e26a586c819dd836f6541c4f3d | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 38.819444 | 79 | 0.643113 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | 12,884 | 0 | 563 |
05e3f35b6f81e3fa37ea72b46e2d38a19e1b9221 | 33 | py | Python | third-party/llvm/llvm-src/utils/lit/tests/Inputs/allow-retries/does-not-succeed-within-limit.py | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | third-party/llvm/llvm-src/utils/lit/tests/Inputs/allow-retries/does-not-succeed-within-limit.py | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | third-party/llvm/llvm-src/utils/lit/tests/Inputs/allow-retries/does-not-succeed-within-limit.py | jhh67/chapel | f041470e9b88b5fc4914c75aa5a37efcb46aa08f | [
"ECL-2.0",
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | # ALLOW_RETRIES: 3
# RUN: false
| 8.25 | 18 | 0.666667 | # ALLOW_RETRIES: 3
# RUN: false
| 0 | 0 | 0 |
25e360bea747f09bd9a02d4959f00bea3cfc0d74 | 1,630 | py | Python | assignments/testem.py | hughsw/PythonEtc | cfc30b1df6a62d7e6f51fefe97906de8ade7f65f | [
"Apache-2.0"
] | null | null | null | assignments/testem.py | hughsw/PythonEtc | cfc30b1df6a62d7e6f51fefe97906de8ade7f65f | [
"Apache-2.0"
] | null | null | null | assignments/testem.py | hughsw/PythonEtc | cfc30b1df6a62d7e6f51fefe97906de8ade7f65f | [
"Apache-2.0"
] | null | null | null | """
From: https://taxfoundation.org/2017-tax-brackets/
Rate |Taxable Income Bracket |Tax Owed
:--- |:--------------------- |:--------
10% |$0 to $9,325 |10% of Taxable Income
15% |$9,325 to $37,950 |$932.50 plus 15% of the excess over $9325
25% |$37,950 to $91,900 |$5,226.25 p... | 20.897436 | 84 | 0.552147 | """
From: https://taxfoundation.org/2017-tax-brackets/
Rate |Taxable Income Bracket |Tax Owed
:--- |:--------------------- |:--------
10% |$0 to $9,325 |10% of Taxable Income
15% |$9,325 to $37,950 |$932.50 plus 15% of the excess over $9325
25% |$37,950 to $91,900 |$5,226.25 p... | 17 | 0 | 26 |
0cd08f0aab1f3212412b91ebee56cac2991d0d9e | 887 | py | Python | hard-gists/2438871/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/2438871/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/2438871/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | '''
This is how to track a white ball example using SimpleCV
The parameters may need to be adjusted to match the RGB color
of your object.
The demo video can be found at:
http://www.youtube.com/watch?v=jihxqg3kr-g
'''
print __doc__
import SimpleCV
display = SimpleCV.Display()
cam = SimpleCV.Camera()
normaldisplay =... | 23.972973 | 93 | 0.728298 | '''
This is how to track a white ball example using SimpleCV
The parameters may need to be adjusted to match the RGB color
of your object.
The demo video can be found at:
http://www.youtube.com/watch?v=jihxqg3kr-g
'''
print __doc__
import SimpleCV
display = SimpleCV.Display()
cam = SimpleCV.Camera()
normaldisplay =... | 0 | 0 | 0 |
19bab6ca0a9b906c3cc20ade56860a6eeff7d443 | 2,730 | py | Python | ci/check_airgap_images.py | InfuseAI/primehub | 9e6307c86c30a1217f8e9bbcf83430eb521f0950 | [
"Apache-2.0"
] | 294 | 2019-04-02T13:09:26.000Z | 2022-03-30T09:09:49.000Z | ci/check_airgap_images.py | 3r1ccc/primehub | 72949ff4ce0f83f3ecd99ca6edfe2361b698396a | [
"Apache-2.0"
] | 206 | 2019-04-09T08:41:28.000Z | 2022-03-30T01:28:19.000Z | ci/check_airgap_images.py | 3r1ccc/primehub | 72949ff4ce0f83f3ecd99ca6edfe2361b698396a | [
"Apache-2.0"
] | 26 | 2019-04-16T20:53:12.000Z | 2022-03-10T12:37:16.000Z | import sys
import re
import os
if __name__ == '__main__':
images, bootstrap_crds, phapptemplates_dir = sys.argv[1:]
section("Inputs")
print("images.yaml => {}".format(images))
print("crds.yaml => {}".format(bootstrap_crds))
print("ph-app-templates => {}".format(phapptemplates_dir))
mai... | 31.744186 | 90 | 0.639194 | import sys
import re
import os
def section(title):
print("\n{}".format("=" * 24))
print("{}".format(title))
print("{}".format("=" * 24))
def load(f):
with open(f, "r") as fh:
return fh.read()
def check_notebook_images(all_images, bootstrap_crds):
section("crds.yaml")
image_crds = l... | 2,154 | 0 | 161 |
b1376c82a05251fe02da7708b845cee22d2f820a | 105 | py | Python | function.py | alihussainia/Py2Exe-Converter | a073bf53cc47d385ea0b2bbfe4a7ab569f98b83f | [
"Apache-2.0"
] | 4 | 2021-08-09T06:54:16.000Z | 2021-08-11T10:33:56.000Z | function.py | alihussainia/Py2Exe-Converter | a073bf53cc47d385ea0b2bbfe4a7ab569f98b83f | [
"Apache-2.0"
] | null | null | null | function.py | alihussainia/Py2Exe-Converter | a073bf53cc47d385ea0b2bbfe4a7ab569f98b83f | [
"Apache-2.0"
] | 1 | 2021-08-10T09:39:52.000Z | 2021-08-10T09:39:52.000Z | from py2exe_converter.converter import convert
convert('example.py', 'requirements.txt', 'icon_one.png') | 35 | 57 | 0.8 | from py2exe_converter.converter import convert
convert('example.py', 'requirements.txt', 'icon_one.png') | 0 | 0 | 0 |
4781e53f8cfcf66263537aea18119d72ac548252 | 1,291 | py | Python | Resources/debug_notification.py | remear/rivenx | 659dac405d8780f032859c7e59e0139f1d321f79 | [
"BSD-3-Clause"
] | 1 | 2021-07-18T15:16:06.000Z | 2021-07-18T15:16:06.000Z | Resources/debug_notification.py | remear/rivenx | 659dac405d8780f032859c7e59e0139f1d321f79 | [
"BSD-3-Clause"
] | null | null | null | Resources/debug_notification.py | remear/rivenx | 659dac405d8780f032859c7e59e0139f1d321f79 | [
"BSD-3-Clause"
] | null | null | null | import Foundation
| 33.973684 | 112 | 0.70488 | import Foundation
class _ObjCNotificationBounder(Foundation.NSObject):
def initWithOwner_notificationName_(self, owner, notification_name):
self = super(_ObjCNotificationBounder, self).init()
if self is None:
return None
self.owner = owner
Foundation.NSNotificationCent... | 1,014 | 51 | 208 |
f0d170758b889f177a847af5b34dc5f417b1565f | 9,835 | py | Python | methylprep/processing/raw_dataset.py | holonomicjl/methylprep | 6a503263ae4399a25e13238a6e4890d891f4dec9 | [
"MIT"
] | 1 | 2021-04-08T22:10:55.000Z | 2021-04-08T22:10:55.000Z | methylprep/processing/raw_dataset.py | holonomicjl/methylprep | 6a503263ae4399a25e13238a6e4890d891f4dec9 | [
"MIT"
] | null | null | null | methylprep/processing/raw_dataset.py | holonomicjl/methylprep | 6a503263ae4399a25e13238a6e4890d891f4dec9 | [
"MIT"
] | null | null | null | # Lib
import logging
import pandas as pd
# App
from ..models import (
FG_PROBE_SUBSETS,
ArrayType,
Channel,
ProbeType,
)
from ..files import IdatDataset
from ..utils import inner_join_data
from ..utils.progress_bar import * # checks environment and imports tqdm appropriately.
from collections import Cou... | 39.183267 | 128 | 0.676462 | # Lib
import logging
import pandas as pd
# App
from ..models import (
FG_PROBE_SUBSETS,
ArrayType,
Channel,
ProbeType,
)
from ..files import IdatDataset
from ..utils import inner_join_data
from ..utils.progress_bar import * # checks environment and imports tqdm appropriately.
from collections import Cou... | 1,744 | 0 | 160 |
df3f5721586160468a4db0fdd47d0198d2ca3fb3 | 2,852 | py | Python | Kernel.py | annaromanova/python | 58f514bd807771bd1092c0e9e94dd8ca6b2a93b1 | [
"MIT"
] | null | null | null | Kernel.py | annaromanova/python | 58f514bd807771bd1092c0e9e94dd8ca6b2a93b1 | [
"MIT"
] | null | null | null | Kernel.py | annaromanova/python | 58f514bd807771bd1092c0e9e94dd8ca6b2a93b1 | [
"MIT"
] | null | null | null |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as c
from Perceptron import Perceptron
# Simple kernel
# Do not change these three lines.
data = np.loadtxt("data.csv", delimiter=',')
X = data[:, :2]
Y = data[:, 2]
# These are the parameters for the models. Please play with these a... | 23.766667 | 171 | 0.674965 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as c
from Perceptron import Perceptron
# Simple kernel
def K(x_i, x_j):
return np.dot(x_i, x_j)
class KernelPerceptron(Perceptron):
def __init__(self, numsamples):
self.S = {}
self.numsamples = numsamples
def __calculate_y_hat(sel... | 1,517 | 34 | 331 |
d78596e0b61503113c013475d4382392dabf6563 | 6,455 | py | Python | a10sdk/core/interface/interface_management.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 16 | 2015-05-20T07:26:30.000Z | 2021-01-23T11:56:57.000Z | a10sdk/core/interface/interface_management.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 6 | 2015-03-24T22:07:11.000Z | 2017-03-28T21:31:18.000Z | a10sdk/core/interface/interface_management.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 23 | 2015-03-29T15:43:01.000Z | 2021-06-02T17:12:01.000Z | from a10sdk.common.A10BaseClass import A10BaseClass
class BroadcastRateLimit(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param rate: {"description": "packets per second. Default is 500. (packets per second. Please specify an even number. Default is 500)", "format": ... | 41.11465 | 253 | 0.621534 | from a10sdk.common.A10BaseClass import A10BaseClass
class BroadcastRateLimit(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param rate: {"description": "packets per second. Default is 500. (packets per second. Please specify an even number. Default is 500)", "format": ... | 1,724 | 0 | 130 |
df47de176b21634f656c2ae6036c73b7e6e48cea | 354 | py | Python | setup.py | aarongolliver/asyncirc | e72a3902d581de778b5859fe44ecb9a8178d4698 | [
"MIT"
] | 1 | 2015-12-15T14:27:35.000Z | 2015-12-15T14:27:35.000Z | setup.py | aarongolliver/asyncirc | e72a3902d581de778b5859fe44ecb9a8178d4698 | [
"MIT"
] | null | null | null | setup.py | aarongolliver/asyncirc | e72a3902d581de778b5859fe44ecb9a8178d4698 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name="asyncio-irc",
version="0.2.1",
description="irc based on asyncio",
author="Fox Wilson",
author_email="fwilson@fwilson.me",
url="https://github.com/watchtower/asyncirc",
install_requires=["blinker"],
packages=[... | 27.230769 | 53 | 0.612994 | from distutils.core import setup
setup(
name="asyncio-irc",
version="0.2.1",
description="irc based on asyncio",
author="Fox Wilson",
author_email="fwilson@fwilson.me",
url="https://github.com/watchtower/asyncirc",
install_requires=["blinker"],
packages=[... | 0 | 0 | 0 |
d62cce998f67f712ed45afaab67fa6db7cf13184 | 4,796 | py | Python | tests/generate_new_site/site_data_structs/test_site.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | 1 | 2020-10-01T01:07:11.000Z | 2020-10-01T01:07:11.000Z | tests/generate_new_site/site_data_structs/test_site.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | null | null | null | tests/generate_new_site/site_data_structs/test_site.py | aychen99/Excavating-Occaneechi-Town | 6e864ca69ff1881554eb4c88aebed236bafbeaf4 | [
"MIT"
] | null | null | null | from unittest import mock
from unittest.mock import patch
from src.generate_new_site.site_data_structs import site
from pathlib import Path
################
# Test write() #
################
@patch('jinja2.Template.render')
@patch('src.generate_new_site.site_data_structs.site.Index.update_href')
@patch('src.gene... | 33.305556 | 103 | 0.59779 | from unittest import mock
from unittest.mock import patch
from src.generate_new_site.site_data_structs import site
from pathlib import Path
################
# Test write() #
################
@patch('jinja2.Template.render')
@patch('src.generate_new_site.site_data_structs.site.Index.update_href')
def test_index_writ... | 4,036 | 0 | 111 |
23757e23b01d9932d8204bfeb2e156a42fed3787 | 776 | py | Python | beginner-codes/simple_division.py | kinster007/beginner-python-codes | 1660e1dd56896fe3e5dfffc59975bf3b9b6925a4 | [
"MIT"
] | null | null | null | beginner-codes/simple_division.py | kinster007/beginner-python-codes | 1660e1dd56896fe3e5dfffc59975bf3b9b6925a4 | [
"MIT"
] | null | null | null | beginner-codes/simple_division.py | kinster007/beginner-python-codes | 1660e1dd56896fe3e5dfffc59975bf3b9b6925a4 | [
"MIT"
] | null | null | null | """
fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0 and 1). Complete the body of the function so that it returns the right number. Note: Since division by 0 produces an error, if the denominator is 0, the function should return 0 instead of at... | 43.111111 | 338 | 0.735825 | """
fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0 and 1). Complete the body of the function so that it returns the right number. Note: Since division by 0 produces an error, if the denominator is 0, the function should return 0 instead of at... | 125 | 0 | 25 |
a70d60d4f705c5e3e8dfba58834a2fd7997dcf09 | 901 | py | Python | openvpp-agents/setup.py | mtroeschel/isaac | 47eabfd5a91a61dfe94babe6537ff69d7d18ecd8 | [
"MIT"
] | 8 | 2018-02-09T11:59:09.000Z | 2021-12-02T16:49:48.000Z | openvpp-agents/setup.py | mtroeschel/isaac | 47eabfd5a91a61dfe94babe6537ff69d7d18ecd8 | [
"MIT"
] | null | null | null | openvpp-agents/setup.py | mtroeschel/isaac | 47eabfd5a91a61dfe94babe6537ff69d7d18ecd8 | [
"MIT"
] | 3 | 2018-06-05T18:53:07.000Z | 2020-10-27T20:25:57.000Z | from setuptools import setup, find_packages
setup(
name='openvpp-agents',
version='0.1.0',
author='Martin Tröschel',
author_email='martin.troeschel@gmail.com',
description=('The Open VPP multi-agent system'),
# long_description=(open('README.txt').read() + '\n\n' +
# open... | 28.15625 | 64 | 0.54384 | from setuptools import setup, find_packages
setup(
name='openvpp-agents',
version='0.1.0',
author='Martin Tröschel',
author_email='martin.troeschel@gmail.com',
description=('The Open VPP multi-agent system'),
# long_description=(open('README.txt').read() + '\n\n' +
# open... | 0 | 0 | 0 |
acccaadb9f49197ad547c179cec6a19cf713260f | 892 | py | Python | setup.py | wieden-kennedy/haikus | da3d6674a7e0740279cf3b123dcb756c314d9494 | [
"BSD-3-Clause"
] | 9 | 2016-09-09T19:29:42.000Z | 2022-01-25T07:53:26.000Z | setup.py | wieden-kennedy/haikus | da3d6674a7e0740279cf3b123dcb756c314d9494 | [
"BSD-3-Clause"
] | null | null | null | setup.py | wieden-kennedy/haikus | da3d6674a7e0740279cf3b123dcb756c314d9494 | [
"BSD-3-Clause"
] | 5 | 2016-05-07T15:19:25.000Z | 2020-11-27T19:58:32.000Z | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
setup(
name="haikus",
description="Some classes for finding haikus in text",
author="Grant Thomas",
author_email="grant.thomas@wk.com",
url="https://g... | 29.733333 | 71 | 0.646861 | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
setup(
name="haikus",
description="Some classes for finding haikus in text",
author="Grant Thomas",
author_email="grant.thomas@wk.com",
url="https://g... | 0 | 0 | 0 |
0c4e86fcd0e1f7b39cea3e866ebf888841e43cff | 9,419 | py | Python | perform_gwas/gwas.py | grimmlab/permGWAS | d40b198c34cb2a7d8fdae82c4bdeec90af624053 | [
"MIT"
] | null | null | null | perform_gwas/gwas.py | grimmlab/permGWAS | d40b198c34cb2a7d8fdae82c4bdeec90af624053 | [
"MIT"
] | null | null | null | perform_gwas/gwas.py | grimmlab/permGWAS | d40b198c34cb2a7d8fdae82c4bdeec90af624053 | [
"MIT"
] | null | null | null | # perform gwas, use sub functions
import argparse
import torch
import numpy as np
from itertools import repeat
from perform_gwas import model, kin, perm
from preprocessing import load_files, prepare_data
import time
def gwas(arguments: argparse.Namespace, X: torch.tensor, y: torch.tensor, K: torch.tensor, covs: torch... | 50.913514 | 122 | 0.641151 | # perform gwas, use sub functions
import argparse
import torch
import numpy as np
from itertools import repeat
from perform_gwas import model, kin, perm
from preprocessing import load_files, prepare_data
import time
def gwas(arguments: argparse.Namespace, X: torch.tensor, y: torch.tensor, K: torch.tensor, covs: torch... | 0 | 0 | 0 |
9228c3bc6c4b44dd29a64795186117910eaf6856 | 587 | py | Python | docker/build/face_detection/face_detector/test.py | solderzzc/DeepCamera | a415f6b62901c23c158a946ff86a5ef2063e1b24 | [
"MIT"
] | 2 | 2019-08-21T01:56:01.000Z | 2019-10-26T10:19:15.000Z | docker/build/face_detection/face_detector/test.py | solderzzc/DeepCamera | a415f6b62901c23c158a946ff86a5ef2063e1b24 | [
"MIT"
] | null | null | null | docker/build/face_detection/face_detector/test.py | solderzzc/DeepCamera | a415f6b62901c23c158a946ff86a5ef2063e1b24 | [
"MIT"
] | 4 | 2019-08-21T01:56:09.000Z | 2020-04-29T14:51:21.000Z | import face_detection as m
import time
m.init('./models/ncnn/')
print('warming up')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
start = time.time()
for i in range... | 26.681818 | 65 | 0.705281 | import face_detection as m
import time
m.init('./models/ncnn/')
print('warming up')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
m.detect('./images_480p/1_854x480.jpg')
start = time.time()
for i in range... | 0 | 0 | 0 |