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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1189a746cd75b8a97b4ddd9fc9c698a877b7186a | 1,681 | py | Python | artbot_scraper/spiders/mayspace_spider.py | coreymcdermott/artbot | 848e85d0be0c58b7803d4bd1631a0cef63abb72d | [
"MIT"
] | 3 | 2016-03-04T02:53:05.000Z | 2021-12-02T20:50:11.000Z | artbot_scraper/spiders/mayspace_spider.py | coreymcdermott/artbot | 848e85d0be0c58b7803d4bd1631a0cef63abb72d | [
"MIT"
] | 14 | 2020-02-11T21:53:12.000Z | 2022-03-11T23:16:12.000Z | artbot_scraper/spiders/mayspace_spider.py | coreymcdermott/artbot | 848e85d0be0c58b7803d4bd1631a0cef63abb72d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
from scrapy import Spider, Request
from dateutil import parser
from artbot_scraper.items import EventItem
from pytz import timezone
| 45.432432 | 138 | 0.581202 | # -*- coding: utf-8 -*-
import re
from scrapy import Spider, Request
from dateutil import parser
from artbot_scraper.items import EventItem
from pytz import timezone
class MaySpaceSpider(Spider):
name = 'May Space'
allowed_domains = ['mayspace.com.au']
... | 1,234 | 215 | 23 |
f4bf371008fb34e1b4a5fc3741ba4dc3f841a88a | 771 | py | Python | FortressOfSolitude/_FortressOfSolitude/superhero/forms.py | BDD16/FortressOfSolitude | 51070d3ffa78262d823ae8ccce4f8ae3c7ed83ac | [
"MIT"
] | null | null | null | FortressOfSolitude/_FortressOfSolitude/superhero/forms.py | BDD16/FortressOfSolitude | 51070d3ffa78262d823ae8ccce4f8ae3c7ed83ac | [
"MIT"
] | 6 | 2021-07-26T14:07:30.000Z | 2022-01-09T01:06:40.000Z | FortressOfSolitude/_FortressOfSolitude/superhero/forms.py | BDD16/FortressOfSolitude | 51070d3ffa78262d823ae8ccce4f8ae3c7ed83ac | [
"MIT"
] | null | null | null | """
DBA 1337_TECH, AUSTIN TEXAS © MAY 2021
Proof of Concept code, No liabilities or warranties expressed or implied.
"""
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.urls import reverse
from .models import User
| 24.09375 | 73 | 0.635538 | """
DBA 1337_TECH, AUSTIN TEXAS © MAY 2021
Proof of Concept code, No liabilities or warranties expressed or implied.
"""
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.urls import reverse
from .models import User
class RegisterForm(UserCreationForm):
email = forms.Ch... | 174 | 313 | 23 |
e8cf5a3c936963ef6dc97da97610e804ef344d5d | 3,044 | py | Python | src/main.py | loovien/meida-downloader | c69748081fad236f2de065c5ada37b08fb93cc4c | [
"MIT"
] | 1 | 2021-05-30T04:16:02.000Z | 2021-05-30T04:16:02.000Z | src/main.py | loovien/meida-downloader | c69748081fad236f2de065c5ada37b08fb93cc4c | [
"MIT"
] | 1 | 2020-10-12T08:26:04.000Z | 2020-10-12T08:26:04.000Z | src/main.py | loovien/mediaxz | c69748081fad236f2de065c5ada37b08fb93cc4c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# website: https://loovien.github.io
# author: luowen<bigpao.luo@gmail.com>
# time: 2018/9/29 21:41
# desc:
from src.tools.video_builder import VideoBuilder
import traceback
import click
import logging
from src.crawl import CrawlFactory
from src.logs import config_logging
from src.pub.bilib imp... | 33.822222 | 105 | 0.685611 | # -*- coding: utf-8 -*-
# website: https://loovien.github.io
# author: luowen<bigpao.luo@gmail.com>
# time: 2018/9/29 21:41
# desc:
from src.tools.video_builder import VideoBuilder
import traceback
import click
import logging
from src.crawl import CrawlFactory
from src.logs import config_logging
from src.pub.bilib imp... | 777 | 0 | 133 |
e7a6afa2dd36970c65af2f61db86c15f038b1926 | 3,411 | py | Python | shop/views.py | knkemree/django_ecommerce_website | 19876976bc872cf4835778d12d82756c573cf3b9 | [
"bzip2-1.0.6"
] | null | null | null | shop/views.py | knkemree/django_ecommerce_website | 19876976bc872cf4835778d12d82756c573cf3b9 | [
"bzip2-1.0.6"
] | 8 | 2020-06-06T01:22:59.000Z | 2022-01-13T02:14:24.000Z | shop/views.py | knkemree/django_ecommerce_website | 19876976bc872cf4835778d12d82756c573cf3b9 | [
"bzip2-1.0.6"
] | null | null | null | from django.contrib import messages
from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from home.models import Comment
from .models import Category, Product, ProductImage
from cart.forms import CartAddProductForm
from django.views.generic import Lis... | 33.441176 | 124 | 0.64204 | from django.contrib import messages
from django.shortcuts import render
from django.shortcuts import render, get_object_or_404
from django.db.models import Q
from home.models import Comment
from .models import Category, Product, ProductImage
from cart.forms import CartAddProductForm
from django.views.generic import Lis... | 2,716 | 102 | 92 |
27803b4ad91fcc3857fc8747877f3ed4b0d80420 | 95 | py | Python | src/test/treadmill/test_turtle.py | chrisspen/homebot | cd1a5a2bddcb90d50a00e67b94297942827fbc61 | [
"MIT"
] | 8 | 2017-11-19T01:42:59.000Z | 2021-02-08T09:18:58.000Z | src/test/treadmill/test_turtle.py | chrisspen/homebot | cd1a5a2bddcb90d50a00e67b94297942827fbc61 | [
"MIT"
] | 24 | 2017-02-14T16:50:02.000Z | 2017-06-07T18:38:20.000Z | src/test/treadmill/test_turtle.py | chrisspen/homebot | cd1a5a2bddcb90d50a00e67b94297942827fbc61 | [
"MIT"
] | 6 | 2017-05-17T03:07:05.000Z | 2019-11-14T09:33:06.000Z | #!/usr/bin/env python
import turtle
turtle.pen(fillcolor="black", pencolor="red", pensize=10)
| 19 | 57 | 0.736842 | #!/usr/bin/env python
import turtle
turtle.pen(fillcolor="black", pencolor="red", pensize=10)
| 0 | 0 | 0 |
7d64d8829369775635a1ff730b531c30b755a45f | 653 | py | Python | 1_Python/Desafios/062_PAv3.py | guilhermebaos/Curso-em-Video-Python | 0e67f6f59fa3216889bd2dde4a26b532c7c545fd | [
"MIT"
] | null | null | null | 1_Python/Desafios/062_PAv3.py | guilhermebaos/Curso-em-Video-Python | 0e67f6f59fa3216889bd2dde4a26b532c7c545fd | [
"MIT"
] | null | null | null | 1_Python/Desafios/062_PAv3.py | guilhermebaos/Curso-em-Video-Python | 0e67f6f59fa3216889bd2dde4a26b532c7c545fd | [
"MIT"
] | null | null | null | from termcolor import cprint, colored
ni = float(input(colored('Primeiro termo da progressão aritmética: ', 'blue')))
pa = float(input(colored('Razão da progressão aritmética: ', 'blue')))
c = 0
p = 10
lp = []
lc = []
np = ni
while c < p:
while c < p:
lp += [str(np)]
ne = len(str(np))
np += ... | 28.391304 | 79 | 0.517611 | from termcolor import cprint, colored
ni = float(input(colored('Primeiro termo da progressão aritmética: ', 'blue')))
pa = float(input(colored('Razão da progressão aritmética: ', 'blue')))
c = 0
p = 10
lp = []
lc = []
np = ni
while c < p:
while c < p:
lp += [str(np)]
ne = len(str(np))
np += ... | 0 | 0 | 0 |
be22c1f97af81b9669c5b83a9ecd5bbdc4c94364 | 2,723 | py | Python | django/contrib/sessions/backends/cached_db.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | django/contrib/sessions/backends/cached_db.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 18 | 2015-01-14T07:51:48.000Z | 2021-10-14T01:19:26.000Z | django/contrib/sessions/backends/cached_db.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 70 | 2015-01-01T00:33:24.000Z | 2021-12-10T03:43:07.000Z | """
Cached, database-backed sessions.
"""
import logging
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from django.utils.encoding import force_text
KEY_PREFIX = "djan... | 32.035294 | 78 | 0.61513 | """
Cached, database-backed sessions.
"""
import logging
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from django.utils.encoding import force_text
KEY_PREFIX = "djan... | 1,791 | 0 | 161 |
f81b9afe3d8b8d75a53275d7b14f783c96f2208d | 7,968 | py | Python | kbr/azure_utils.py | brugger/kbr-azure-utils | 92257cef75b035eaac90de958d206dc199ca9ebc | [
"MIT"
] | null | null | null | kbr/azure_utils.py | brugger/kbr-azure-utils | 92257cef75b035eaac90de958d206dc199ca9ebc | [
"MIT"
] | null | null | null | kbr/azure_utils.py | brugger/kbr-azure-utils | 92257cef75b035eaac90de958d206dc199ca9ebc | [
"MIT"
] | null | null | null | from azure.identity import AzureCliCredential
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.storage import StorageManagementClient
from azure.common.credentials import ServicePrincipa... | 35.891892 | 197 | 0.591114 | from azure.identity import AzureCliCredential
from azure.mgmt.resource import ResourceManagementClient
from azure.mgmt.network import NetworkManagementClient
from azure.mgmt.compute import ComputeManagementClient
from azure.mgmt.storage import StorageManagementClient
from azure.common.credentials import ServicePrincipa... | 6,974 | 0 | 230 |
4a9a1be887c7457284810624885cb4c658d4c5b1 | 626 | py | Python | scripts/dset64Test.py | tijyojwad/shasta | dffb41279bbc606d06f5323add40c0b1ebd5ae65 | [
"BSD-3-Clause"
] | 267 | 2018-07-31T16:12:24.000Z | 2022-03-29T13:57:53.000Z | scripts/dset64Test.py | tijyojwad/shasta | dffb41279bbc606d06f5323add40c0b1ebd5ae65 | [
"BSD-3-Clause"
] | 140 | 2018-08-10T14:14:19.000Z | 2022-02-18T22:05:05.000Z | scripts/dset64Test.py | tijyojwad/shasta | dffb41279bbc606d06f5323add40c0b1ebd5ae65 | [
"BSD-3-Clause"
] | 47 | 2018-09-28T18:29:37.000Z | 2022-02-21T02:45:40.000Z | #!/usr/bin/python3
helpMessage = """
This runs a unit test for dset64/dset64-gccAtomic.hpp.
Invoke with 5 arguments:
- The number of items (vertices).
- The number of union operations (edges).
- The number of threads.
- The number of union operations per batch.
- The random seed.
"""
import shasta
import sys
if no... | 17.388889 | 54 | 0.662939 | #!/usr/bin/python3
helpMessage = """
This runs a unit test for dset64/dset64-gccAtomic.hpp.
Invoke with 5 arguments:
- The number of items (vertices).
- The number of union operations (edges).
- The number of threads.
- The number of union operations per batch.
- The random seed.
"""
import shasta
import sys
if no... | 0 | 0 | 0 |
85bd3903c23b1449d55e1f1be2c9dacc1531e0c8 | 698 | py | Python | math_lib/combinatorics.py | vesteny77/proj_euler | d12d6c6a6e6c717b5ab9d0415005945d983eea53 | [
"MIT"
] | 1 | 2021-12-27T22:18:51.000Z | 2021-12-27T22:18:51.000Z | math_lib/combinatorics.py | vesteny77/proj_euler | d12d6c6a6e6c717b5ab9d0415005945d983eea53 | [
"MIT"
] | null | null | null | math_lib/combinatorics.py | vesteny77/proj_euler | d12d6c6a6e6c717b5ab9d0415005945d983eea53 | [
"MIT"
] | null | null | null | import math
import doctest
def pick(n, k):
"""
Return the number of ways to select k objects from n objects with order
:param n: int
:param k: int
:return: int
>>> pick(1, 0)
1
>>> pick(1, 2)
0
>>> pick(5, 2)
20
"""
return math.factorial(n) // math.factorial(n - k) ... | 17.897436 | 78 | 0.540115 | import math
import doctest
def pick(n, k):
"""
Return the number of ways to select k objects from n objects with order
:param n: int
:param k: int
:return: int
>>> pick(1, 0)
1
>>> pick(1, 2)
0
>>> pick(5, 2)
20
"""
return math.factorial(n) // math.factorial(n - k) ... | 0 | 0 | 0 |
e0bf1326727788764078f2927151ee1302c33c40 | 1,129 | py | Python | sms/utils/datetimes.py | NovelLab/sms | b9df8d22d8a5bd555a4c7f5bf9cdd0084f156ae9 | [
"MIT"
] | null | null | null | sms/utils/datetimes.py | NovelLab/sms | b9df8d22d8a5bd555a4c7f5bf9cdd0084f156ae9 | [
"MIT"
] | null | null | null | sms/utils/datetimes.py | NovelLab/sms | b9df8d22d8a5bd555a4c7f5bf9cdd0084f156ae9 | [
"MIT"
] | null | null | null | """Utility module for date and time controls."""
# Official Libraries
import datetime
from typing import Union
# Thirdparty Libraries
from dateutil.relativedelta import relativedelta
# My Modules
__all__ = (
'after_day_str_from',
'next_day_str_from',
'next_month_str_from',
)
# D... | 24.021277 | 74 | 0.692648 | """Utility module for date and time controls."""
# Official Libraries
import datetime
from typing import Union
# Thirdparty Libraries
from dateutil.relativedelta import relativedelta
# My Modules
__all__ = (
'after_day_str_from',
'next_day_str_from',
'next_month_str_from',
)
# D... | 678 | 0 | 68 |
6a0e398064f5e12cb4d5acb4655162fd3e72f755 | 34,218 | py | Python | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py | Anillab/One-Minute-Pitch | 123f7b2010d3ae0f031066db1bcfe6eda7a41e84 | [
"MIT"
] | 4 | 2019-10-03T21:58:22.000Z | 2021-02-12T13:33:32.000Z | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py | Anillab/One-Minute-Pitch | 123f7b2010d3ae0f031066db1bcfe6eda7a41e84 | [
"MIT"
] | 4 | 2020-01-22T13:45:12.000Z | 2022-02-10T20:58:09.000Z | pgAdmin4/pgAdmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py | Anillab/One-Minute-Pitch | 123f7b2010d3ae0f031066db1bcfe6eda7a41e84 | [
"MIT"
] | 1 | 2021-01-13T09:30:29.000Z | 2021-01-13T09:30:29.000Z | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
""" Implements Co... | 33.350877 | 95 | 0.525425 | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
""" Implements Co... | 1,223 | 0 | 30 |
31424884e1eca24c7acd2daedba2d1014e95cdda | 17,297 | py | Python | pmix/xlsdiff.py | jkpr/pmix | 96a88ca8fdcbc0aa91061cc8f77f5aba8eb7acb2 | [
"MIT"
] | 1 | 2018-07-26T05:51:02.000Z | 2018-07-26T05:51:02.000Z | pmix/xlsdiff.py | jkpr/pmix | 96a88ca8fdcbc0aa91061cc8f77f5aba8eb7acb2 | [
"MIT"
] | 14 | 2017-05-06T16:28:14.000Z | 2018-08-24T17:00:17.000Z | pmix/xlsdiff.py | jkpr/pmix | 96a88ca8fdcbc0aa91061cc8f77f5aba8eb7acb2 | [
"MIT"
] | 2 | 2017-03-15T00:25:14.000Z | 2018-07-09T19:09:36.000Z | """Module for the xls diffing and CLI.
IndexedVenn
This is a named tuple that is meant to carry information about two
sequences (called "a" and "b"). It has the following ordered members:
- common_a: The index and item of all items in both a and b with the
condition that the item appears ex... | 39.672018 | 79 | 0.598601 | """Module for the xls diffing and CLI.
IndexedVenn
This is a named tuple that is meant to carry information about two
sequences (called "a" and "b"). It has the following ordered members:
- common_a: The index and item of all items in both a and b with the
condition that the item appears ex... | 0 | 0 | 0 |
3ff996876becdebc477dae5bc01eb0e02195a0b9 | 275 | py | Python | PythonTutor/session-4/conditionIf.py | krishnamanchikalapudi/examples.py | 7a373d24df06b8882d07b850435b268a24317b1e | [
"MIT"
] | null | null | null | PythonTutor/session-4/conditionIf.py | krishnamanchikalapudi/examples.py | 7a373d24df06b8882d07b850435b268a24317b1e | [
"MIT"
] | 1 | 2020-02-14T13:24:01.000Z | 2020-02-14T13:24:01.000Z | PythonTutor/session-4/conditionIf.py | krishnamanchikalapudi/examples.py | 7a373d24df06b8882d07b850435b268a24317b1e | [
"MIT"
] | 2 | 2020-02-14T13:21:20.000Z | 2021-06-30T00:50:33.000Z | """
Session: 4
Topic: Conditional: IF statement
"""
x = 200
y = 1000
if (x > y):
print ('x > y is true')
print ('new line 1')
print('new line 11')
print ('new line 2')
"""
if (x < y):
print ('x < y is true')
print ('new line 3')
print ('new line 4')
""" | 14.473684 | 32 | 0.523636 | """
Session: 4
Topic: Conditional: IF statement
"""
x = 200
y = 1000
if (x > y):
print ('x > y is true')
print ('new line 1')
print('new line 11')
print ('new line 2')
"""
if (x < y):
print ('x < y is true')
print ('new line 3')
print ('new line 4')
""" | 0 | 0 | 0 |
1db7bbd439c0503c27468f11fc54609cfe295b87 | 1,075 | py | Python | cryptocompsdk/urls.py | whoopnip/cryptocompare-py | 847b2109f7e54c7c6da3fa6efdf104e155e519bf | [
"MIT"
] | null | null | null | cryptocompsdk/urls.py | whoopnip/cryptocompare-py | 847b2109f7e54c7c6da3fa6efdf104e155e519bf | [
"MIT"
] | 12 | 2020-03-15T17:13:51.000Z | 2021-12-20T00:10:06.000Z | cryptocompsdk/urls.py | whoopnip/cryptocompare-py | 847b2109f7e54c7c6da3fa6efdf104e155e519bf | [
"MIT"
] | null | null | null |
API_BASE_URL = 'https://min-api.cryptocompare.com/'
DATA_URL = API_BASE_URL + 'data/'
DATA_V2_URL = DATA_URL + 'v2/'
DATA_V3_URL = DATA_URL + 'v3/'
DATA_V3_ALL_URL = DATA_V3_URL + 'all/'
# Specific APIs
# History APIs
DAILY_HISTORY_URL = DATA_V2_URL + 'histoday'
HOURLY_HISTORY_URL = DATA_V2_URL + 'histohour'
MINUTE_... | 28.289474 | 67 | 0.774884 |
API_BASE_URL = 'https://min-api.cryptocompare.com/'
DATA_URL = API_BASE_URL + 'data/'
DATA_V2_URL = DATA_URL + 'v2/'
DATA_V3_URL = DATA_URL + 'v3/'
DATA_V3_ALL_URL = DATA_V3_URL + 'all/'
# Specific APIs
# History APIs
DAILY_HISTORY_URL = DATA_V2_URL + 'histoday'
HOURLY_HISTORY_URL = DATA_V2_URL + 'histohour'
MINUTE_... | 0 | 0 | 0 |
57c205ad59d36aa9bd2c08132c8d5524437eec89 | 7,392 | py | Python | utctime/parsers.py | chrsbats/utctime | 94e6fcca36fcd8d6bc6a05303b1d0306b94ec97d | [
"MIT"
] | 1 | 2015-05-07T07:04:49.000Z | 2015-05-07T07:04:49.000Z | utctime/parsers.py | chrsbats/utctime | 94e6fcca36fcd8d6bc6a05303b1d0306b94ec97d | [
"MIT"
] | null | null | null | utctime/parsers.py | chrsbats/utctime | 94e6fcca36fcd8d6bc6a05303b1d0306b94ec97d | [
"MIT"
] | null | null | null | import re
import datetime
import dateutil.parser
from bs4 import BeautifulSoup
def from_requests_response(response):
"""Attempts to find a date from a response object.
If a more reliable method can be used, (RSS timestamp) use that
in preference to this.
"""
content_date = from_content(response.co... | 31.589744 | 166 | 0.494048 | import re
import datetime
import dateutil.parser
from bs4 import BeautifulSoup
def from_requests_response(response):
"""Attempts to find a date from a response object.
If a more reliable method can be used, (RSS timestamp) use that
in preference to this.
"""
content_date = from_content(response.co... | 6,669 | 0 | 92 |
746c2b2890aa4d425301473bbb137706d13717e4 | 2,664 | py | Python | apgs/resampler.py | Hao-W/svae | 4c03c74df4ac98f631b9db644f116558f3e8e481 | [
"Apache-2.0"
] | 4 | 2021-05-14T14:25:14.000Z | 2021-12-14T18:58:56.000Z | apgs/resampler.py | hao-w/apgs | 4c03c74df4ac98f631b9db644f116558f3e8e481 | [
"Apache-2.0"
] | null | null | null | apgs/resampler.py | hao-w/apgs | 4c03c74df4ac98f631b9db644f116558f3e8e481 | [
"Apache-2.0"
] | null | null | null | import torch
from torch.distributions.categorical import Categorical
from torch.distributions.uniform import Uniform
import torch.nn.functional as F
| 48.436364 | 136 | 0.652778 | import torch
from torch.distributions.categorical import Categorical
from torch.distributions.uniform import Uniform
import torch.nn.functional as F
class Resampler():
def __init__(self, strategy, sample_size, CUDA, device):
super(Resampler, self).__init__()
self.strategy = strategy
assert... | 1,220 | 1,271 | 23 |
58a4ad4a6c6235654425ba8690b30ddd13a4077d | 371 | py | Python | WSItk/fast/setup.py | vladpopovici/WSItk | 02db9dbf1148106a576d7b4dd7965c73607efdae | [
"MIT"
] | 6 | 2017-03-18T19:17:42.000Z | 2019-05-05T14:57:31.000Z | WSItk/fast/setup.py | vladpopovici/WSItk | 02db9dbf1148106a576d7b4dd7965c73607efdae | [
"MIT"
] | null | null | null | WSItk/fast/setup.py | vladpopovici/WSItk | 02db9dbf1148106a576d7b4dd7965c73607efdae | [
"MIT"
] | 4 | 2015-11-29T14:47:25.000Z | 2019-11-28T03:16:39.000Z | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_module = Extension(
"pdist",
["pdist.pyx"],
extra_compile_args=['-fopenmp'],
extra_link_args=['-fopenmp'],
)
setup(
name = 'Cython-based sped-up routines',
cmdclass = {'build_e... | 21.823529 | 43 | 0.698113 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_module = Extension(
"pdist",
["pdist.pyx"],
extra_compile_args=['-fopenmp'],
extra_link_args=['-fopenmp'],
)
setup(
name = 'Cython-based sped-up routines',
cmdclass = {'build_e... | 0 | 0 | 0 |
9d9faa88f542777b9a4b8ca06a500aa9761dfb01 | 4,727 | py | Python | showtext.py | Breazile/MandoPuterPi | a89c4c261cec2274f9e3e2a9f808776722d14633 | [
"MIT"
] | 4 | 2020-10-11T16:00:43.000Z | 2022-03-21T18:23:07.000Z | showtext.py | Breazile/MandoPuterPi | a89c4c261cec2274f9e3e2a9f808776722d14633 | [
"MIT"
] | 1 | 2022-02-17T04:44:54.000Z | 2022-02-17T04:44:54.000Z | showtext.py | Breazile/MandoPuterPi | a89c4c261cec2274f9e3e2a9f808776722d14633 | [
"MIT"
] | null | null | null | """
This demo will draw a few rectangles onto the screen along with some text
on top of that.
This example is for use on (Linux) computers that are using CPython with
Adafruit Blinka to support CircuitPython libraries. CircuitPython does
not support PIL/pillow (python imaging library)!
Author(s): Melissa LeBl... | 40.059322 | 146 | 0.677597 | """
This demo will draw a few rectangles onto the screen along with some text
on top of that.
This example is for use on (Linux) computers that are using CPython with
Adafruit Blinka to support CircuitPython libraries. CircuitPython does
not support PIL/pillow (python imaging library)!
Author(s): Melissa LeBl... | 395 | 0 | 23 |
b68e54196115fc822984f01aefda2fddb5f6cb35 | 34 | py | Python | cli.py | SenZhangAI/urgent-lang | 5b74d6b4eb23c00b5e955aee8f0237cc81e5c039 | [
"MIT"
] | 7 | 2020-01-25T04:29:30.000Z | 2021-05-01T09:52:03.000Z | cli.py | SenZhangAI/urgent-lang | 5b74d6b4eb23c00b5e955aee8f0237cc81e5c039 | [
"MIT"
] | 9 | 2020-01-23T06:57:47.000Z | 2020-02-03T14:16:49.000Z | cli.py | SenZhangAI/urgent-lang | 5b74d6b4eb23c00b5e955aee8f0237cc81e5c039 | [
"MIT"
] | 3 | 2020-02-01T05:17:32.000Z | 2020-02-03T14:09:53.000Z | from urgent.cli import main
main() | 17 | 27 | 0.794118 | from urgent.cli import main
main() | 0 | 0 | 0 |
aaab2ced51a44f29baf0d0df65d940ac2868dd22 | 359 | py | Python | src/demo.py | JKtubage/Neural-Network-deep-learning | 5e2ae55aa2fe23700847ffafe7e8fa6b998a07e1 | [
"Unlicense"
] | 1 | 2020-07-27T14:11:52.000Z | 2020-07-27T14:11:52.000Z | src/demo.py | JKtubage/Neural-Network-deep-learning | 5e2ae55aa2fe23700847ffafe7e8fa6b998a07e1 | [
"Unlicense"
] | null | null | null | src/demo.py | JKtubage/Neural-Network-deep-learning | 5e2ae55aa2fe23700847ffafe7e8fa6b998a07e1 | [
"Unlicense"
] | null | null | null | import mnist_loader
import network
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
# print("training data")
# print(type(training_data))
# print(len(training_data))
# print(training_data[0][0].shape)
# print(training_data[0][1].shape)
net = network.Network([784, 30, 10])
net.SGD(training_... | 29.916667 | 76 | 0.763231 | import mnist_loader
import network
training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
# print("training data")
# print(type(training_data))
# print(len(training_data))
# print(training_data[0][0].shape)
# print(training_data[0][1].shape)
net = network.Network([784, 30, 10])
net.SGD(training_... | 0 | 0 | 0 |
26a15701d56fba312a51a8a9bd5083d8cb0730ef | 17,676 | py | Python | imagenet/main.py | sebgao/LIP | 6724ec63c1f1ebefa25d7269e29d17c4411a7941 | [
"MIT"
] | 209 | 2019-08-13T01:51:49.000Z | 2022-03-28T09:59:28.000Z | imagenet/main.py | Abel1997/LIP | 6724ec63c1f1ebefa25d7269e29d17c4411a7941 | [
"MIT"
] | 12 | 2019-08-14T07:39:47.000Z | 2021-09-24T10:08:55.000Z | imagenet/main.py | Abel1997/LIP | 6724ec63c1f1ebefa25d7269e29d17c4411a7941 | [
"MIT"
] | 26 | 2019-08-15T02:37:05.000Z | 2021-12-10T06:32:40.000Z | ### Based on https://github.com/pytorch/examples/tree/master/imagenet/main.py
import argparse
import os
import random
import shutil
import time
import warnings
import sys
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.opti... | 37.850107 | 115 | 0.606246 | ### Based on https://github.com/pytorch/examples/tree/master/imagenet/main.py
import argparse
import os
import random
import shutil
import time
import warnings
import sys
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.opti... | 12,024 | 0 | 287 |
e896dbfbdc911432437d9bf9ea671211382c995e | 491 | py | Python | setup.py | jcmcken/bp | 894b35b32408643404605daf75ca248262858ecc | [
"BSD-3-Clause"
] | null | null | null | setup.py | jcmcken/bp | 894b35b32408643404605daf75ca248262858ecc | [
"BSD-3-Clause"
] | 8 | 2016-12-05T21:01:18.000Z | 2019-08-22T12:13:29.000Z | setup.py | jcmcken/bp | 894b35b32408643404605daf75ca248262858ecc | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
setup(
name='bp',
version=open('VERSION').read().strip(),
description='A command-line interface for populating Jinja2 templates',
long_description='Populate Jinja2 templates from plaintext JSON, YAML, or'
' TXT files.',
author='Jon McKenzie',
au... | 28.882353 | 78 | 0.643585 | from setuptools import setup
setup(
name='bp',
version=open('VERSION').read().strip(),
description='A command-line interface for populating Jinja2 templates',
long_description='Populate Jinja2 templates from plaintext JSON, YAML, or'
' TXT files.',
author='Jon McKenzie',
au... | 0 | 0 | 0 |
01a7dc010fb31d85c2180b905abc6fc5be639616 | 316,208 | py | Python | src/nifgen/metadata/functions.py | dan-davello/nimi-python | 8d89e4cfb205f789630cf7725f0c3d57bfe7d755 | [
"MIT"
] | null | null | null | src/nifgen/metadata/functions.py | dan-davello/nimi-python | 8d89e4cfb205f789630cf7725f0c3d57bfe7d755 | [
"MIT"
] | null | null | null | src/nifgen/metadata/functions.py | dan-davello/nimi-python | 8d89e4cfb205f789630cf7725f0c3d57bfe7d755 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# This file is code generated, do not make changes here
# If the generated information is not correct for python
# changes can be made in functions_addon.py and they will be
# applied at build time
functions = {
'AbortGeneration': {
'returns': 'ViStatus',
'parameters': ... | 32.131694 | 1,891 | 0.630525 |
# -*- coding: utf-8 -*-
# This file is code generated, do not make changes here
# If the generated information is not correct for python
# changes can be made in functions_addon.py and they will be
# applied at build time
functions = {
'AbortGeneration': {
'returns': 'ViStatus',
'parameters': ... | 0 | 0 | 0 |
b214869851627f023d97d24b883707f9c228a02f | 673 | py | Python | tests/test_utils.py | wbuchwalter/fairing-1 | e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab | [
"Apache-2.0"
] | 21 | 2018-08-09T19:13:47.000Z | 2020-07-22T05:21:11.000Z | tests/test_utils.py | wbuchwalter/fairing-1 | e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab | [
"Apache-2.0"
] | 14 | 2018-08-02T18:44:09.000Z | 2018-11-08T15:32:55.000Z | tests/test_utils.py | wbuchwalter/fairing-1 | e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab | [
"Apache-2.0"
] | 4 | 2018-08-09T19:13:59.000Z | 2018-10-08T05:44:31.000Z | import pytest
from fairing.utils import is_runtime_phase, get_image_full, get_image
REPO_NAME = 'testrepo'
IMAGE_NAME = 'fairing-test'
IMAGE_TAG = 'some-tag'
@pytest.mark.parametrize("runtime_phase", [True, False])
| 30.590909 | 69 | 0.736999 | import pytest
from fairing.utils import is_runtime_phase, get_image_full, get_image
REPO_NAME = 'testrepo'
IMAGE_NAME = 'fairing-test'
IMAGE_TAG = 'some-tag'
@pytest.mark.parametrize("runtime_phase", [True, False])
def test_is_runtime_phase(runtime_phase, monkeypatch):
if runtime_phase:
monkeypatch.seten... | 387 | 0 | 68 |
833adf82067cf9e2f5c7e841d79fc3f5e3efbdec | 588 | py | Python | synthesis/synthesizer/tf_to_torch/nlp.py | aidanby/SOAR | c9bca57727a94b21bb667cc314482a2fbb0fd51a | [
"Apache-2.0"
] | 2 | 2021-01-16T00:09:56.000Z | 2021-02-06T06:04:34.000Z | synthesis/synthesizer/tf_to_torch/nlp.py | aidanby/SOAR | c9bca57727a94b21bb667cc314482a2fbb0fd51a | [
"Apache-2.0"
] | null | null | null | synthesis/synthesizer/tf_to_torch/nlp.py | aidanby/SOAR | c9bca57727a94b21bb667cc314482a2fbb0fd51a | [
"Apache-2.0"
] | null | null | null | from transformers import *
from synthesis import *
err_msg = "sparse_coo_tensor(): argument 'size' must be tuple of ints\", ' not NoneTyp"
sentences = err_msg
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertModel.from_pretrained('bert-base-uncased')
sentence_embeddings = tokenizer.encode(er... | 34.588235 | 87 | 0.760204 | from transformers import *
from synthesis import *
err_msg = "sparse_coo_tensor(): argument 'size' must be tuple of ints\", ' not NoneTyp"
sentences = err_msg
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
model = BertModel.from_pretrained('bert-base-uncased')
sentence_embeddings = tokenizer.encode(er... | 0 | 0 | 0 |
9e54a5c837396c258ee83eba70e7a441c2bc35dd | 8,843 | py | Python | conv_is_all_you_need/src/Cropping_Window_Xception/scripts/find_leaked_imgs.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | conv_is_all_you_need/src/Cropping_Window_Xception/scripts/find_leaked_imgs.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | conv_is_all_you_need/src/Cropping_Window_Xception/scripts/find_leaked_imgs.py | guitarmind/HPA-competition-solutions | 547d53aaca148fdb5f4585526ad7364dfa47967d | [
"MIT"
] | null | null | null | import pandas as pd
import sys
from multiprocessing import Pool
import numpy as np
import cv2
from lib.utils import load_image, info, debug, display_imgs
from lib.config import gen_config
config = gen_config()
# use the ladder trick to make it O(n) instead of O(n^2)
# identical_pair = {
# 'test_id': te... | 33.496212 | 131 | 0.604207 | import pandas as pd
import sys
from multiprocessing import Pool
import numpy as np
import cv2
from lib.utils import load_image, info, debug, display_imgs
from lib.config import gen_config
config = gen_config()
# use the ladder trick to make it O(n) instead of O(n^2)
def compare_fn(img_record):
return img_record... | 7,453 | 0 | 207 |
11f321e965fb717bcbae2d1ccc2b26a7ecf53bae | 1,909 | py | Python | src/king/geometry/king_curve.py | KingAirC/KingPaint | 32753c48415c3ed1474c5b5c55388ad6e2201600 | [
"MIT"
] | 1 | 2021-06-11T12:35:12.000Z | 2021-06-11T12:35:12.000Z | src/king/geometry/king_curve.py | KingAirC/KingPaint | 32753c48415c3ed1474c5b5c55388ad6e2201600 | [
"MIT"
] | null | null | null | src/king/geometry/king_curve.py | KingAirC/KingPaint | 32753c48415c3ed1474c5b5c55388ad6e2201600 | [
"MIT"
] | null | null | null | from ..core.king_geometry import KingGeometry
from matplotlib.pyplot import Line2D
import abc
from matplotlib.transforms import Affine2D
from matplotlib.text import Text
| 32.913793 | 87 | 0.614458 | from ..core.king_geometry import KingGeometry
from matplotlib.pyplot import Line2D
import abc
from matplotlib.transforms import Affine2D
from matplotlib.text import Text
class KingCurve(KingGeometry, Line2D, metaclass=abc.ABCMeta):
def __init__(self, depends=(), essential_data=None, create_type=1, infinite=False)... | 1,409 | 306 | 23 |
168e223e222d69dfb227f3000b7bcaa7c37d049a | 1,381 | py | Python | models/testing/svr_testing.py | inovex/RCIS2021-degradation-bearing-vessels | 27bd1a2e3f08c5b42011596aa98e5ac627a416d6 | [
"MIT"
] | 2 | 2021-06-21T11:40:38.000Z | 2021-12-29T02:40:30.000Z | models/testing/svr_testing.py | chenzhengkun7/RCIS2021-degradation-estimation-bearing-vessels | 27bd1a2e3f08c5b42011596aa98e5ac627a416d6 | [
"MIT"
] | 2 | 2021-04-08T11:30:28.000Z | 2021-04-12T06:41:31.000Z | models/testing/svr_testing.py | chenzhengkun7/RCIS2021-degradation-estimation-bearing-vessels | 27bd1a2e3f08c5b42011596aa98e5ac627a416d6 | [
"MIT"
] | 2 | 2021-06-21T11:40:43.000Z | 2021-12-29T02:36:51.000Z | from pre_processing.features import read_feature_dfs_as_dict
from pre_processing.features import df_dict_to_df_dataframe
from util.helper import pop_labels
from models.ComputedFeaturesFFNN import ComputedFeaturesFFNN
from util.metrics import rmse, correlation_coefficient
from util.constants import LEARNING_SET, FULL_TE... | 49.321429 | 118 | 0.768284 | from pre_processing.features import read_feature_dfs_as_dict
from pre_processing.features import df_dict_to_df_dataframe
from util.helper import pop_labels
from models.ComputedFeaturesFFNN import ComputedFeaturesFFNN
from util.metrics import rmse, correlation_coefficient
from util.constants import LEARNING_SET, FULL_TE... | 851 | 0 | 23 |
a704b440e30d81a83496195144f6eba1c8e04106 | 2,664 | py | Python | ddbb/users.py | babieca/pms | 938aec985ca522f7532d16c6568c8bef31942299 | [
"Apache-2.0"
] | null | null | null | ddbb/users.py | babieca/pms | 938aec985ca522f7532d16c6568c8bef31942299 | [
"Apache-2.0"
] | 8 | 2021-03-18T21:44:41.000Z | 2022-03-11T23:37:33.000Z | ddbb/users.py | babieca/pms | 938aec985ca522f7532d16c6568c8bef31942299 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
sys.path.insert(0, '../config/')
from sqlalchemy import create_engine, Table, MetaData, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relationship, sessionmaker
from config import config
if __name__ == '__main__':
run() | 28.340426 | 90 | 0.591216 | #!/usr/bin/env python
import sys
sys.path.insert(0, '../config/')
from sqlalchemy import create_engine, Table, MetaData, Column, Integer, String, ForeignKey
from sqlalchemy.orm import mapper, relationship, sessionmaker
from config import config
class User():
def __init__(self, name, password):
self.na... | 2,212 | -18 | 185 |
a1020946f5db9d2e5cf73986a0e4574af3e2de6a | 5,461 | py | Python | py16db/make_silva_style_db_from_contigs.py | FEMLab/focusdb | ed799eca80cd969ac59de566f96f685bb7fcaa2d | [
"MIT"
] | null | null | null | py16db/make_silva_style_db_from_contigs.py | FEMLab/focusdb | ed799eca80cd969ac59de566f96f685bb7fcaa2d | [
"MIT"
] | 1 | 2019-12-12T11:26:17.000Z | 2019-12-12T11:26:17.000Z | py16db/make_silva_style_db_from_contigs.py | FEMLab/focusdb | ed799eca80cd969ac59de566f96f685bb7fcaa2d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import sys
import os
import subprocess
import shutil
import logging
import glob
import multiprocessing
import tempfile
from pathlib import Path
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from py16db.shared_methods import filter_sraFind, ... | 34.345912 | 84 | 0.611976 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import sys
import os
import subprocess
import shutil
import logging
import glob
import multiprocessing
import tempfile
from pathlib import Path
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from py16db.shared_methods import filter_sraFind, ... | 4,948 | 0 | 69 |
9cd2c1a1e017625c719365d99c9aa7f6ae44f52c | 562 | py | Python | supervisr/puppet/apps.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | 1 | 2020-01-12T21:33:03.000Z | 2020-01-12T21:33:03.000Z | supervisr/puppet/apps.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | null | null | null | supervisr/puppet/apps.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | null | null | null | """Supervisr Puppet Apps Config"""
from supervisr.core.apps import SettingBootstrapper, SupervisrAppConfig
class SupervisrPuppetConfig(SupervisrAppConfig):
"""Supervisr Puppet app config"""
name = 'supervisr.puppet'
verbose_name = 'Supervisr Puppet'
navbar_enabled = lambda self, request: request.use... | 29.578947 | 71 | 0.706406 | """Supervisr Puppet Apps Config"""
from supervisr.core.apps import SettingBootstrapper, SupervisrAppConfig
class SupervisrPuppetConfig(SupervisrAppConfig):
"""Supervisr Puppet app config"""
name = 'supervisr.puppet'
verbose_name = 'Supervisr Puppet'
navbar_enabled = lambda self, request: request.use... | 148 | 0 | 27 |
daf3b659ba59d5d6db45266d2aa72aa4d6b41182 | 1,093 | py | Python | test/test_change_requests_page.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | test/test_change_requests_page.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | test/test_change_requests_page.py | CiscoDevNet/python-msx-sdk | d7e0a08c656504b4f4551d263e67c671a2a04b3f | [
"MIT"
] | null | null | null | """
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import python_msx_sdk
from python_msx_sdk.model.change_request_summary import ChangeRequestSummary
from python_msx_sdk.model.change_reques... | 26.02381 | 84 | 0.747484 | """
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import python_msx_sdk
from python_msx_sdk.model.change_request_summary import ChangeRequestSummary
from python_msx_sdk.model.change_reques... | 19 | 0 | 54 |
533327431de9b5a55de6b70927d056f8f96a84a9 | 1,094 | py | Python | cloudkitty-9.0.0/cloudkitty/common/db/models.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | cloudkitty-9.0.0/cloudkitty/common/db/models.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | cloudkitty-9.0.0/cloudkitty/common/db/models.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Objectif Libre
#
# 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 ... | 34.1875 | 78 | 0.706581 | # -*- coding: utf-8 -*-
# Copyright 2016 Objectif Libre
#
# 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 ... | 108 | 0 | 23 |
b94078f0be785a1f9f96ed27e024ba0b40d2625c | 3,011 | py | Python | lanenet_model/lanenet.py | Lewington-pitsos/lanenet-lane-detection | 12009ebc0cd7b418b1e07a646b4e1b7285466790 | [
"Apache-2.0"
] | null | null | null | lanenet_model/lanenet.py | Lewington-pitsos/lanenet-lane-detection | 12009ebc0cd7b418b1e07a646b4e1b7285466790 | [
"Apache-2.0"
] | null | null | null | lanenet_model/lanenet.py | Lewington-pitsos/lanenet-lane-detection | 12009ebc0cd7b418b1e07a646b4e1b7285466790 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 19-4-24 下午8:50
# @Author : MaybeShewill-CV
# @Site : https://github.com/MaybeShewill-CV/lanenet-lane-detection
# @File : lanenet.py
# @IDE: PyCharm
"""
Implement LaneNet Model
"""
import tensorflow as tf
from lanenet_model import lanenet_back_end
from ... | 32.728261 | 92 | 0.613085 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 19-4-24 下午8:50
# @Author : MaybeShewill-CV
# @Site : https://github.com/MaybeShewill-CV/lanenet-lane-detection
# @File : lanenet.py
# @IDE: PyCharm
"""
Implement LaneNet Model
"""
import tensorflow as tf
from lanenet_model import lanenet_back_end
from ... | 0 | 0 | 0 |
0adab473a3ac4c0d6d4ee747fdfbce846bb10bc3 | 135 | py | Python | graphql/pyutils/maybe_awaitable.py | dfee/graphql-core-next | 1ada7146bd0510171ae931b68f6c77dbdf5d5c63 | [
"MIT"
] | null | null | null | graphql/pyutils/maybe_awaitable.py | dfee/graphql-core-next | 1ada7146bd0510171ae931b68f6c77dbdf5d5c63 | [
"MIT"
] | null | null | null | graphql/pyutils/maybe_awaitable.py | dfee/graphql-core-next | 1ada7146bd0510171ae931b68f6c77dbdf5d5c63 | [
"MIT"
] | null | null | null | from typing import Awaitable, TypeVar, Union
__all__ = ['MaybeAwaitable']
T = TypeVar('T')
MaybeAwaitable = Union[Awaitable[T], T]
| 15 | 44 | 0.718519 | from typing import Awaitable, TypeVar, Union
__all__ = ['MaybeAwaitable']
T = TypeVar('T')
MaybeAwaitable = Union[Awaitable[T], T]
| 0 | 0 | 0 |
cce60a2d36978cf04b9f4833990e1c31a01a29b6 | 195 | py | Python | reamber/dummy/DmSv.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | null | null | null | reamber/dummy/DmSv.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | null | null | null | reamber/dummy/DmSv.py | Bestfast/reamberPy | 91b76ca6adf11fbe8b7cee7c186481776a4d7aaa | [
"MIT"
] | null | null | null | from __future__ import annotations
from dataclasses import dataclass
from reamber.base.Timed import Timed
MIN_SV = 0.01
MAX_SV = 10.0
@dataclass | 16.25 | 36 | 0.769231 | from __future__ import annotations
from dataclasses import dataclass
from reamber.base.Timed import Timed
MIN_SV = 0.01
MAX_SV = 10.0
@dataclass
class DmSv(Timed):
multiplier: float = 1.0 | 0 | 25 | 22 |
ce2059dd5c71761640c5e0a95c4c531a6f5fddc6 | 3,275 | py | Python | examples/legacy_examples/dagster_examples/gcp_data_platform/airflow.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | examples/legacy_examples/dagster_examples/gcp_data_platform/airflow.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 7 | 2022-03-16T06:55:04.000Z | 2022-03-18T07:03:25.000Z | examples/legacy_examples/dagster_examples/gcp_data_platform/airflow.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | import datetime
import os
from airflow.contrib.operators import dataproc_operator
from airflow.contrib.operators.bigquery_operator import BigQueryOperator
from airflow.contrib.operators.gcs_to_bq import GoogleCloudStorageToBigQueryOperator
from airflow.models import DAG
from airflow.utils import trigger_rule
PROJECT_... | 32.425743 | 102 | 0.692519 | import datetime
import os
from airflow.contrib.operators import dataproc_operator
from airflow.contrib.operators.bigquery_operator import BigQueryOperator
from airflow.contrib.operators.gcs_to_bq import GoogleCloudStorageToBigQueryOperator
from airflow.models import DAG
from airflow.utils import trigger_rule
PROJECT_... | 0 | 0 | 0 |
b86c8e4e563d630c9d189fbed056cd014ce91eb1 | 306 | py | Python | api/node/vm/serializers.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 97 | 2016-11-15T14:44:23.000Z | 2022-03-13T18:09:15.000Z | api/node/vm/serializers.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 334 | 2016-11-17T19:56:57.000Z | 2022-03-18T10:45:53.000Z | api/node/vm/serializers.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 33 | 2017-01-02T16:04:13.000Z | 2022-02-07T19:20:24.000Z | from api import serializers as s
from api.vm.base.serializers import VmSerializer as _VmSerializer, ExtendedVmSerializer as _ExtendedVmSerializer
| 27.818182 | 112 | 0.794118 | from api import serializers as s
from api.vm.base.serializers import VmSerializer as _VmSerializer, ExtendedVmSerializer as _ExtendedVmSerializer
class VmSerializer(_VmSerializer):
dc = s.Field(source='dc.name')
class ExtendedVmSerializer(_ExtendedVmSerializer):
dc = s.Field(source='dc.name')
| 0 | 112 | 46 |
74b6978982a47fc9fc8bc63123001253b0b4b94e | 4,023 | py | Python | standalone_bot.py | Rangeeshar/movie_check | fa0e0a7e8ed381032f8efc161ec5184c995377b1 | [
"MIT"
] | null | null | null | standalone_bot.py | Rangeeshar/movie_check | fa0e0a7e8ed381032f8efc161ec5184c995377b1 | [
"MIT"
] | null | null | null | standalone_bot.py | Rangeeshar/movie_check | fa0e0a7e8ed381032f8efc161ec5184c995377b1 | [
"MIT"
] | null | null | null | import urllib3
import telegram
from bs4 import BeautifulSoup
import time
import requests
from lxml import html
import argparse
from urllib.parse import urlparse
import threading
CHECKING = "Sorry bookings are not open for Movie you wanted, Don't worry i will be checking and will tell you once it is available."
BOOKIN... | 32.443548 | 133 | 0.605518 | import urllib3
import telegram
from bs4 import BeautifulSoup
import time
import requests
from lxml import html
import argparse
from urllib.parse import urlparse
import threading
CHECKING = "Sorry bookings are not open for Movie you wanted, Don't worry i will be checking and will tell you once it is available."
BOOKIN... | 2,794 | 53 | 310 |
20e21dd3c3bf23b90b474d9bb9ce3e6f6252870f | 65 | py | Python | pyarchops_dnsmasq/__init__.py | pyarchops/dnsmasq | 074adffda3578738e53d71359c7812f8f23d43de | [
"MIT"
] | 1 | 2019-09-04T03:23:07.000Z | 2019-09-04T03:23:07.000Z | pyarchops_dnsmasq/__init__.py | pyarchops/dnsmasq | 074adffda3578738e53d71359c7812f8f23d43de | [
"MIT"
] | null | null | null | pyarchops_dnsmasq/__init__.py | pyarchops/dnsmasq | 074adffda3578738e53d71359c7812f8f23d43de | [
"MIT"
] | null | null | null | """ __init__.py for pyarchops_dnsmasq """
__version__ = '0.0.2'
| 16.25 | 41 | 0.676923 | """ __init__.py for pyarchops_dnsmasq """
__version__ = '0.0.2'
| 0 | 0 | 0 |
e221521b11b0f1bfc2ea74c1e0192e8e638577c6 | 346 | py | Python | manage.py | eddowh/flask-react-redux-demo | 68384efe7a4c2999c2cd947208b8f8db887fd802 | [
"Unlicense"
] | 6 | 2017-09-15T08:14:12.000Z | 2021-03-20T06:50:53.000Z | manage.py | eddowh/flask-react-redux-demo | 68384efe7a4c2999c2cd947208b8f8db887fd802 | [
"Unlicense"
] | null | null | null | manage.py | eddowh/flask-react-redux-demo | 68384efe7a4c2999c2cd947208b8f8db887fd802 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from importlib import import_module
import sys
from flask_migrate import MigrateCommand
import settings
sys.path.insert(1, settings.BASE_DIR)
sys.path.insert(1, settings.APP_DIR)
api = import_module('api')
manager = api.manager
manager.add_command('db', MigrateCommand)
if __name__ == '__m... | 17.3 | 41 | 0.748555 | # -*- coding: utf-8 -*-
from importlib import import_module
import sys
from flask_migrate import MigrateCommand
import settings
sys.path.insert(1, settings.BASE_DIR)
sys.path.insert(1, settings.APP_DIR)
api = import_module('api')
manager = api.manager
manager.add_command('db', MigrateCommand)
if __name__ == '__m... | 0 | 0 | 0 |
6028378a36889501280b602ea6d96c50da7ac963 | 2,669 | py | Python | rlkit/torch/bc/bc.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 56 | 2019-10-20T03:09:02.000Z | 2022-03-25T09:21:40.000Z | rlkit/torch/bc/bc.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 3 | 2020-10-01T07:33:51.000Z | 2021-05-12T03:40:57.000Z | rlkit/torch/bc/bc.py | yifan-you-37/rl_swiss | 8b0ee7caa5c1fa93860916004cf4fd970667764f | [
"MIT"
] | 10 | 2019-11-04T16:56:09.000Z | 2022-03-25T09:21:41.000Z | import numpy as np
from collections import OrderedDict
import torch
import torch.optim as optim
import rlkit.torch.pytorch_util as ptu
from rlkit.torch.core import np_to_pytorch_batch
from rlkit.torch.torch_base_algorithm import TorchBaseAlgorithm
| 29.01087 | 81 | 0.61746 | import numpy as np
from collections import OrderedDict
import torch
import torch.optim as optim
import rlkit.torch.pytorch_util as ptu
from rlkit.torch.core import np_to_pytorch_batch
from rlkit.torch.torch_base_algorithm import TorchBaseAlgorithm
class BC(TorchBaseAlgorithm):
def __init__(
self,
... | 2,235 | 160 | 23 |
4d3469617d2735c859a7dd18cb85391252acdef9 | 9,099 | py | Python | fuseq/collection.py | kinkalow/fuseq | 020c359881acb7971a350da16f1b687760dfa78e | [
"MIT"
] | null | null | null | fuseq/collection.py | kinkalow/fuseq | 020c359881acb7971a350da16f1b687760dfa78e | [
"MIT"
] | null | null | null | fuseq/collection.py | kinkalow/fuseq | 020c359881acb7971a350da16f1b687760dfa78e | [
"MIT"
] | null | null | null | import csv
import glob
import multiprocessing
import os
from fuseq.timer import Timer
from fuseq.base import Base
| 38.392405 | 110 | 0.527091 | import csv
import glob
import multiprocessing
import os
from fuseq.timer import Timer
from fuseq.base import Base
class Collection(Base):
def __init__(self, params):
super().__init__()
self.params = params
self.input_dir = f'{os.path.dirname(params.work_dir)}/input'
self.mf_path =... | 7,158 | 1,803 | 23 |
930d447660672c37e1fca72c534e1d7c0031776a | 464 | py | Python | games/migrations/0022_auto_20200701_0832.py | Geroxus/boards | e743674532a84754a8e48031d606871539e293b6 | [
"MIT"
] | null | null | null | games/migrations/0022_auto_20200701_0832.py | Geroxus/boards | e743674532a84754a8e48031d606871539e293b6 | [
"MIT"
] | null | null | null | games/migrations/0022_auto_20200701_0832.py | Geroxus/boards | e743674532a84754a8e48031d606871539e293b6 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-01 08:32
from django.db import migrations, models
import django.db.models.deletion
| 23.2 | 99 | 0.633621 | # Generated by Django 3.0.7 on 2020-07-01 08:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('games', '0021_auto_20200701_0830'),
]
operations = [
migrations.AlterField(
model_name='piece',... | 0 | 317 | 23 |
c2c1bd497ad8f71048371d0c48512587f14b17c8 | 1,728 | py | Python | scripts/plot_cplx_seq.py | jweber94/complex_number_sequence | 13416fd95f30985b48ed98297c1a7a3d20ffb3ce | [
"MIT"
] | null | null | null | scripts/plot_cplx_seq.py | jweber94/complex_number_sequence | 13416fd95f30985b48ed98297c1a7a3d20ffb3ce | [
"MIT"
] | null | null | null | scripts/plot_cplx_seq.py | jweber94/complex_number_sequence | 13416fd95f30985b48ed98297c1a7a3d20ffb3ce | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import matplotlib.pyplot as plt
import numpy as np
import argparse
parser = argparse.ArgumentParser(
description="Pass path to the data storage location")
parser.add_argument(
"-p",
"--path",
type=str,
help="Path to the result data of run_mandelbrot that should be plotted.")
par... | 25.791045 | 77 | 0.69213 | #!/usr/bin/python3
import matplotlib.pyplot as plt
import numpy as np
import argparse
parser = argparse.ArgumentParser(
description="Pass path to the data storage location")
parser.add_argument(
"-p",
"--path",
type=str,
help="Path to the result data of run_mandelbrot that should be plotted.")
par... | 1,163 | 0 | 92 |
633f1b1df140231070406f497760b23038391d7a | 476 | py | Python | all_the_chatbots/catty.py | OpenJarbas/all_the_chatbots | 4c927a30a428079745603a8a8c8a687643065ae6 | [
"Apache-2.0"
] | 1 | 2020-06-17T10:53:25.000Z | 2020-06-17T10:53:25.000Z | all_the_chatbots/catty.py | OpenJarbas/all_the_chatbots | 4c927a30a428079745603a8a8c8a687643065ae6 | [
"Apache-2.0"
] | null | null | null | all_the_chatbots/catty.py | OpenJarbas/all_the_chatbots | 4c927a30a428079745603a8a8c8a687643065ae6 | [
"Apache-2.0"
] | 2 | 2020-08-16T16:38:27.000Z | 2021-03-08T11:33:15.000Z | import requests
from bs4 import BeautifulSoup
if __name__ == "__main__":
print(ask_catty())
| 26.444444 | 108 | 0.605042 | import requests
from bs4 import BeautifulSoup
def ask_catty(text="do aliens exist"):
url = " http://lcamtuf.coredump.cx/c3-2.shtml"
data = {
"said": text}
html = requests.post(url, data).text
soup = BeautifulSoup(html, 'html.parser')
text = str(soup.p)
text = text.split("\n")[-1]
r... | 354 | 0 | 23 |
faa8961721faac3dfd2ef086ab5e9e2cbbee9109 | 295 | py | Python | henchman/__init__.py | FeatureLabs/henchman | f8c64494e8a074de169a33e25665a9cda3368cc3 | [
"BSD-3-Clause"
] | 13 | 2018-09-29T02:54:06.000Z | 2021-07-26T07:07:17.000Z | henchman/__init__.py | evgeni-nikolaev/henchman | f8c64494e8a074de169a33e25665a9cda3368cc3 | [
"BSD-3-Clause"
] | 2 | 2021-06-09T17:53:41.000Z | 2021-11-15T17:49:43.000Z | henchman/__init__.py | evgeni-nikolaev/henchman | f8c64494e8a074de169a33e25665a9cda3368cc3 | [
"BSD-3-Clause"
] | 3 | 2019-11-23T07:49:23.000Z | 2021-04-22T00:47:35.000Z | # -*- coding: utf-8 -*-
'''Top-level package for Henchman.
Has the following modules:
diagnostics
learning
selection
plotting
Package is under active development.
'''
__author__ = '''Feature Labs Team'''
__email__ = 'team@featurelabs.com'
__version__ = '0.0.4'
| 19.666667 | 36 | 0.647458 | # -*- coding: utf-8 -*-
'''Top-level package for Henchman.
Has the following modules:
diagnostics
learning
selection
plotting
Package is under active development.
'''
__author__ = '''Feature Labs Team'''
__email__ = 'team@featurelabs.com'
__version__ = '0.0.4'
| 0 | 0 | 0 |
1994455e0acc60f69e9ff58fae6df65b5efe6c13 | 5,564 | py | Python | pypospack/potential/pair_morse.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 4 | 2018-01-18T19:59:56.000Z | 2020-08-25T11:56:52.000Z | mexm/potential/pair_morse.py | eragasa/mexm-base | c8d84057c483e1bd06bb8b2e835274f6a4cd61b9 | [
"MIT"
] | 1 | 2018-04-22T23:02:13.000Z | 2018-04-22T23:02:13.000Z | mexm/potential/pair_morse.py | eragasa/mexm-base | c8d84057c483e1bd06bb8b2e835274f6a4cd61b9 | [
"MIT"
] | 1 | 2019-09-14T07:04:42.000Z | 2019-09-14T07:04:42.000Z | """
this module impplements the morse potential
"""
import copy
from collections import OrderedDict
import numpy as np
from pypospack.potential import PairPotential
from pypospack.potential import determine_symbol_pairs
__author__ = "Eugene J. Ragasa"
__copyright__ = "Copyright (C) 2017"
__license__ = "Simplified BSD L... | 36.366013 | 111 | 0.573508 | """
this module impplements the morse potential
"""
import copy
from collections import OrderedDict
import numpy as np
from pypospack.potential import PairPotential
from pypospack.potential import determine_symbol_pairs
__author__ = "Eugene J. Ragasa"
__copyright__ = "Copyright (C) 2017"
__license__ = "Simplified BSD L... | 1,110 | 0 | 129 |
17ff492b281da24d35356ca9584b9a9b23938228 | 2,633 | py | Python | app/services/mail/service.py | maxzhenzhera/my_vocab_backend | 2e9f968374e0bc2fcc0ae40830ca40f3cf5754d1 | [
"MIT"
] | null | null | null | app/services/mail/service.py | maxzhenzhera/my_vocab_backend | 2e9f968374e0bc2fcc0ae40830ca40f3cf5754d1 | [
"MIT"
] | null | null | null | app/services/mail/service.py | maxzhenzhera/my_vocab_backend | 2e9f968374e0bc2fcc0ae40830ca40f3cf5754d1 | [
"MIT"
] | null | null | null | import logging
import warnings
from dataclasses import dataclass
from fastapi import (
BackgroundTasks,
Depends,
Request
)
from fastapi_mail import (
FastMail,
MessageSchema
)
from ...api.dependencies.mail import MailSenderMarker
from ...resources.mail.subjects import (
CONFIRMATION_MAIL_SUBJE... | 28.619565 | 90 | 0.669199 | import logging
import warnings
from dataclasses import dataclass
from fastapi import (
BackgroundTasks,
Depends,
Request
)
from fastapi_mail import (
FastMail,
MessageSchema
)
from ...api.dependencies.mail import MailSenderMarker
from ...resources.mail.subjects import (
CONFIRMATION_MAIL_SUBJE... | 1,580 | 290 | 22 |
4dd60bd46dafc9a0dcc821c4b1d816850f82b1c7 | 3,242 | py | Python | fboss/agent/tools/fboss_route.py | NunoEdgarGFlowHub/fboss | b665a1dac4917dd8984573ef5a471e4825d506f9 | [
"BSD-3-Clause"
] | 1 | 2015-03-12T11:40:43.000Z | 2015-03-12T11:40:43.000Z | fboss/agent/tools/fboss_route.py | NunoEdgarGFlowHub/fboss | b665a1dac4917dd8984573ef5a471e4825d506f9 | [
"BSD-3-Clause"
] | null | null | null | fboss/agent/tools/fboss_route.py | NunoEdgarGFlowHub/fboss | b665a1dac4917dd8984573ef5a471e4825d506f9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2004-present Facebook. All Rights Reserved
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
"""Add, change, or delete a route on FBOSS controller
"""
import contextlib
import ipaddr
from argparse impo... | 32.42 | 77 | 0.698643 | # Copyright (C) 2004-present Facebook. All Rights Reserved
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
"""Add, change, or delete a route on FBOSS controller
"""
import contextlib
import ipaddr
from argparse impo... | 1,079 | 0 | 137 |
cde13c67bda582fd8819954b6601faa11656495d | 417 | py | Python | ml_source/src/diabetes/scoring/batch/run.py | GolamRashed/azure-databricks-mlops-mlflow | d1e4a21cb5047213ac0d4c620aac8938048d8168 | [
"MIT"
] | 33 | 2021-06-02T12:57:33.000Z | 2022-03-02T19:21:03.000Z | ml_source/src/diabetes/scoring/batch/run.py | GolamRashed/azure-databricks-mlops-mlflow | d1e4a21cb5047213ac0d4c620aac8938048d8168 | [
"MIT"
] | 5 | 2021-09-16T12:35:19.000Z | 2021-12-12T19:20:15.000Z | ml_source/src/diabetes/scoring/batch/run.py | GolamRashed/azure-databricks-mlops-mlflow | d1e4a21cb5047213ac0d4c620aac8938048d8168 | [
"MIT"
] | 17 | 2021-06-02T13:11:39.000Z | 2022-03-28T10:08:20.000Z | import numpy as np
import pandas as pd
from sklearn.linear_model import Ridge
def batch_scoring(model: Ridge, df: pd.DataFrame) -> np.array:
"""[Batch scoring method]
Args:
model (Ridge): [Model]
df (pd.DataFrame): [Input dataframe for prediction]
Returns:
np.array : Returns pred... | 23.166667 | 63 | 0.661871 | import numpy as np
import pandas as pd
from sklearn.linear_model import Ridge
def batch_scoring(model: Ridge, df: pd.DataFrame) -> np.array:
"""[Batch scoring method]
Args:
model (Ridge): [Model]
df (pd.DataFrame): [Input dataframe for prediction]
Returns:
np.array : Returns pred... | 0 | 0 | 0 |
2f9c80cc70dc98f03e2c0549432dda13a732fdbd | 294 | py | Python | testapp/urls.py | rohitchopra32/Django-Celery-With-Progress-Bar | 208e03c7efbaab95d51cae875c31b1c5dfdab88b | [
"MIT"
] | null | null | null | testapp/urls.py | rohitchopra32/Django-Celery-With-Progress-Bar | 208e03c7efbaab95d51cae875c31b1c5dfdab88b | [
"MIT"
] | null | null | null | testapp/urls.py | rohitchopra32/Django-Celery-With-Progress-Bar | 208e03c7efbaab95d51cae875c31b1c5dfdab88b | [
"MIT"
] | null | null | null | from django.urls import include, path
from . import views
urlpatterns = [
# Examples:
# url(r'^$', 'celery_try.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', views.index,name='index'),
path('poll_state', views.poll_state,name='poll_state'),
]
| 24.5 | 59 | 0.629252 | from django.urls import include, path
from . import views
urlpatterns = [
# Examples:
# url(r'^$', 'celery_try.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
path('', views.index,name='index'),
path('poll_state', views.poll_state,name='poll_state'),
]
| 0 | 0 | 0 |
f55fb9a9fd1fdcb34d3b94b4d59506d82ef36630 | 3,250 | py | Python | settings/production.py | smevirtual/aperte | cc63e2fbaaca4e1d38db911b496fe5cf32070886 | [
"Apache-2.0"
] | null | null | null | settings/production.py | smevirtual/aperte | cc63e2fbaaca4e1d38db911b496fe5cf32070886 | [
"Apache-2.0"
] | 12 | 2018-11-02T23:59:34.000Z | 2019-04-10T12:24:03.000Z | settings/production.py | smevirtual/aperte | cc63e2fbaaca4e1d38db911b496fe5cf32070886 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 SME Virtual Network Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 40.625 | 93 | 0.577846 | # Copyright 2018 SME Virtual Network Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 0 | 2,220 | 23 |
3467d161f5beba95f52fe0fb3dfe619923b0dd7e | 450 | py | Python | packages/pyright-internal/src/tests/samples/protocol34.py | Microsoft/pyright | adf7c3e92e4540d930e3652de3c1c335855af595 | [
"MIT"
] | 3,934 | 2019-03-22T09:26:41.000Z | 2019-05-06T21:03:08.000Z | packages/pyright-internal/src/tests/samples/protocol34.py | Microsoft/pyright | adf7c3e92e4540d930e3652de3c1c335855af595 | [
"MIT"
] | 107 | 2019-03-24T04:09:37.000Z | 2019-05-06T17:00:04.000Z | packages/pyright-internal/src/tests/samples/protocol34.py | Microsoft/pyright | adf7c3e92e4540d930e3652de3c1c335855af595 | [
"MIT"
] | 119 | 2019-03-23T10:48:04.000Z | 2019-05-06T08:57:56.000Z | # This sample tests a case where a method calls its own constructor
# with a specialized type that uses its own TypeVar and the expected
# type is a protocol.
from typing import Generic, TypeVar, Protocol
T = TypeVar("T")
| 20.454545 | 68 | 0.64 | # This sample tests a case where a method calls its own constructor
# with a specialized type that uses its own TypeVar and the expected
# type is a protocol.
from typing import Generic, TypeVar, Protocol
T = TypeVar("T")
class X(Protocol):
def f(self) -> int:
...
class Y(Generic[T]):
def f(self) ... | 103 | -4 | 125 |
990c53575dcdd68d321005e1d0bf91dacc6daebe | 252 | py | Python | auth/views.py | EVEprosper/ProsperForecast | ffc5a9fb9c6bf5ac0827a52107fe3c8884050c3b | [
"MIT"
] | null | null | null | auth/views.py | EVEprosper/ProsperForecast | ffc5a9fb9c6bf5ac0827a52107fe3c8884050c3b | [
"MIT"
] | 1 | 2018-11-22T03:14:50.000Z | 2018-11-22T03:14:50.000Z | auth/views.py | EVEprosper/ProsperForecast | ffc5a9fb9c6bf5ac0827a52107fe3c8884050c3b | [
"MIT"
] | null | null | null | """endpoint stuff goes here?"""
import flask
import flask_restful
from . import endpoints
blueprint = flask.Blueprint(
'auth',
__name__,
url_prefix='/auth',
)
api = flask_restful.Api(blueprint)
api.add_resource(endpoints.Login, '/login')
| 18 | 43 | 0.718254 | """endpoint stuff goes here?"""
import flask
import flask_restful
from . import endpoints
blueprint = flask.Blueprint(
'auth',
__name__,
url_prefix='/auth',
)
api = flask_restful.Api(blueprint)
api.add_resource(endpoints.Login, '/login')
| 0 | 0 | 0 |
c97d63df0fc9d6be27a5179e296acd028832cf3a | 3,385 | py | Python | tests/argument_tests.py | stepan-anokhin/comandante | 9fa7da93ae91e4a3c1cde4ad34b4a78edca5aa16 | [
"MIT"
] | 2 | 2019-10-06T16:00:51.000Z | 2020-01-17T20:11:35.000Z | tests/argument_tests.py | stepan-anokhin/comandante | 9fa7da93ae91e4a3c1cde4ad34b4a78edca5aa16 | [
"MIT"
] | null | null | null | tests/argument_tests.py | stepan-anokhin/comandante | 9fa7da93ae91e4a3c1cde4ad34b4a78edca5aa16 | [
"MIT"
] | null | null | null | import unittest
import comandante as cli
import comandante.errors as error
from comandante.inner.test import suppress_output, capture_output
class ArgumentTests(unittest.TestCase):
"""Integration tests for cli-argument passing."""
| 36.010638 | 115 | 0.664697 | import unittest
import comandante as cli
import comandante.errors as error
from comandante.inner.test import suppress_output, capture_output
class App(cli.Handler):
@cli.signature(int_arg=int)
@cli.command()
def test_int(self, int_arg):
return int_arg
@cli.signature(bool_arg=bool, int_arg=in... | 2,431 | 341 | 374 |
781e7157d81fb19e85b1ed49ec4e992573427a85 | 447 | py | Python | src/refactory/spec.py | lmmx/refactory | 39e97528733f4cb2607a89184e3b0049f9784547 | [
"MIT"
] | null | null | null | src/refactory/spec.py | lmmx/refactory | 39e97528733f4cb2607a89184e3b0049f9784547 | [
"MIT"
] | 1 | 2022-02-07T22:18:30.000Z | 2022-02-07T22:18:30.000Z | src/refactory/spec.py | lmmx/refactory | 39e97528733f4cb2607a89184e3b0049f9784547 | [
"MIT"
] | null | null | null | from __future__ import annotations
import ujson
from .data_model import RefactorRuleSpec
from .log_utils import Console
__all__ = ["load_spec"]
logger = Console(name=__name__).logger
| 22.35 | 57 | 0.720358 | from __future__ import annotations
import ujson
from .data_model import RefactorRuleSpec
from .log_utils import Console
__all__ = ["load_spec"]
logger = Console(name=__name__).logger
def load_spec(spec: str) -> RefactorRuleSpec:
if isinstance(spec, str):
spec = ujson.loads(spec)
if not isinstance(... | 236 | 0 | 23 |
1005ad4eccf108b7018cd5b1cc1d67f72692d201 | 3,957 | py | Python | inference/models/vgg.py | matthewfeickert/mining-for-substructure-lens | 9360e678aac78b6b260dab55ce264bfddea0c206 | [
"MIT"
] | 24 | 2019-09-06T02:55:57.000Z | 2021-11-26T19:55:44.000Z | inference/models/vgg.py | johannbrehmer/mining-for-substructure-lens | a15a257051b68adad7ca88a388b0084abab1d97f | [
"MIT"
] | null | null | null | inference/models/vgg.py | johannbrehmer/mining-for-substructure-lens | a15a257051b68adad7ca88a388b0084abab1d97f | [
"MIT"
] | 11 | 2019-09-04T15:42:08.000Z | 2021-08-01T21:24:13.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
import torch.nn as nn
from torch.autograd import grad
import logging
logger = logging.getLogger(__name__)
| 37.330189 | 156 | 0.5628 | from __future__ import absolute_import, division, print_function, unicode_literals
import torch
import torch.nn as nn
from torch.autograd import grad
import logging
logger = logging.getLogger(__name__)
class VGGRatioEstimator(nn.Module):
def __init__(self, n_parameters, cfg="A", input_mean=None, input_std=None,... | 3,563 | 166 | 23 |
294cbcf669b1cb6cd8cad63e2dd81c9f505f5c0a | 432 | py | Python | deliberately_vulnerable_flask_app/rce.py | gbleaney/pyre-check | d27297ed13537df076de1ec3772b121f03d79d8b | [
"MIT"
] | null | null | null | deliberately_vulnerable_flask_app/rce.py | gbleaney/pyre-check | d27297ed13537df076de1ec3772b121f03d79d8b | [
"MIT"
] | null | null | null | deliberately_vulnerable_flask_app/rce.py | gbleaney/pyre-check | d27297ed13537df076de1ec3772b121f03d79d8b | [
"MIT"
] | null | null | null | import subprocess
from flask import Flask
app = Flask(__name__)
@app.route("/rce/<string:payload>")
@app.route("/rce/<string:payload>")
@app.route("/rce/<int:payload>")
| 19.636364 | 49 | 0.696759 | import subprocess
from flask import Flask
app = Flask(__name__)
@app.route("/rce/<string:payload>")
def definite_rce(payload: str) -> None:
subprocess.run(payload, shell=True)
@app.route("/rce/<string:payload>")
def potential_rce_1(payload: str) -> None:
subprocess.run(["echo", payload])
@app.route("/r... | 188 | 0 | 66 |
3d2d21110006b8a41fe6665f273c809200c38e18 | 5,063 | py | Python | ai/rl/mcts.py | aquintero/HandOfDog | 517e25d4f9625053fa73d86202038476db71a2b4 | [
"MIT"
] | null | null | null | ai/rl/mcts.py | aquintero/HandOfDog | 517e25d4f9625053fa73d86202038476db71a2b4 | [
"MIT"
] | null | null | null | ai/rl/mcts.py | aquintero/HandOfDog | 517e25d4f9625053fa73d86202038476db71a2b4 | [
"MIT"
] | null | null | null | from ai.go.go_player import GoPlayer
import numpy as np
| 40.830645 | 141 | 0.595892 | from ai.go.go_player import GoPlayer
import numpy as np
class MCTree:
def __init__(self, root_state, root_prior_values, root_prior_win_rate):
self.root = MCNode(None, None, root_state, root_prior_values, root_prior_win_rate)
class MCNode:
def __init__(self, parent, parent_action, state, pr... | 4,604 | -18 | 411 |
48646922e772366334acf855f52ef4ebc13688b5 | 361 | py | Python | tests/test_import_export_numpy.py | HEBOS/PILasOPENCV | 7253d0ad98eba199a600d55f2e1e40acd4a5990b | [
"MIT"
] | 19 | 2019-05-05T07:37:10.000Z | 2021-12-09T15:52:51.000Z | tests/test_import_export_numpy.py | AnkaChan/PILasOPENCV | 0a5b14628d831c23be25688b5a99097c55ce492c | [
"MIT"
] | 5 | 2019-04-09T23:54:17.000Z | 2021-05-16T08:31:22.000Z | tests/test_import_export_numpy.py | AnkaChan/PILasOPENCV | 0a5b14628d831c23be25688b5a99097c55ce492c | [
"MIT"
] | 6 | 2019-04-08T12:33:34.000Z | 2021-05-15T14:57:50.000Z | from __future__ import print_function
import PILasOPENCV as Image
import cv2
im = Image.open("lena.jpg")
numpy_image = im.getim()
print(type(numpy_image), numpy_image.shape)
cv2.imshow("numpy_image", numpy_image)
cv2.waitKey(0)
# import numpy image
new_im = Image.new("RGB", (512, 512), "black")
new_im.show()
... | 27.769231 | 47 | 0.739612 | from __future__ import print_function
import PILasOPENCV as Image
import cv2
im = Image.open("lena.jpg")
numpy_image = im.getim()
print(type(numpy_image), numpy_image.shape)
cv2.imshow("numpy_image", numpy_image)
cv2.waitKey(0)
# import numpy image
new_im = Image.new("RGB", (512, 512), "black")
new_im.show()
... | 0 | 0 | 0 |
fae86cbb6ce5d8dc6ad374ae3ea9ea94eaeca3bc | 160 | py | Python | pygmm/types.py | arkottke/pygmm | e3b37ea3f81ffb847e040292c6731e36627ac9aa | [
"MIT"
] | 15 | 2016-03-29T05:01:09.000Z | 2022-02-09T08:26:07.000Z | pygmm/types.py | arkottke/pygmm | e3b37ea3f81ffb847e040292c6731e36627ac9aa | [
"MIT"
] | 3 | 2016-03-29T05:12:28.000Z | 2017-08-18T21:49:34.000Z | pygmm/types.py | arkottke/pygmm | e3b37ea3f81ffb847e040292c6731e36627ac9aa | [
"MIT"
] | 13 | 2016-03-29T05:18:39.000Z | 2022-01-26T03:37:08.000Z | # -*- coding: utf-8 -*-
"""Common types used across the project."""
import typing
import numpy as np
ArrayLike = typing.Union[typing.List[float], np.ndarray]
| 20 | 56 | 0.7 | # -*- coding: utf-8 -*-
"""Common types used across the project."""
import typing
import numpy as np
ArrayLike = typing.Union[typing.List[float], np.ndarray]
| 0 | 0 | 0 |
df066d476034a94b4570ce8102c7fea21964b8ea | 12,631 | py | Python | support/utils.py | nsacyber/BAM | 1eda2407211586b755eeae6e1f9006ff06f899ec | [
"CC0-1.0"
] | 125 | 2019-09-08T17:20:04.000Z | 2022-03-15T02:06:42.000Z | support/utils.py | demirelcan/BAM | 1eda2407211586b755eeae6e1f9006ff06f899ec | [
"CC0-1.0"
] | 1 | 2019-11-20T13:46:15.000Z | 2019-11-20T13:46:15.000Z | support/utils.py | demirelcan/BAM | 1eda2407211586b755eeae6e1f9006ff06f899ec | [
"CC0-1.0"
] | 23 | 2019-10-24T16:04:41.000Z | 2021-07-10T07:07:25.000Z | '''
This module contains various utilitarian functions used by other modules.
'''
#***************************************
# Imports
#***************************************
import sys
import os
import stat
import threading
import logging, logging.handlers
from dependencies.pefile import pefile
import globs
impo... | 33.327177 | 107 | 0.590531 | '''
This module contains various utilitarian functions used by other modules.
'''
#***************************************
# Imports
#***************************************
import sys
import os
import stat
import threading
import logging, logging.handlers
from dependencies.pefile import pefile
import globs
impo... | 510 | 0 | 46 |
8a8bf3a8283ff2eccb9347a4c472588e81de418b | 332 | py | Python | models.py | VisualDudio/iquicker | 2f3e9375020b89461536553b500da517715f0d88 | [
"Unlicense"
] | null | null | null | models.py | VisualDudio/iquicker | 2f3e9375020b89461536553b500da517715f0d88 | [
"Unlicense"
] | 3 | 2018-02-25T17:12:02.000Z | 2018-02-25T17:15:48.000Z | models.py | VisualDudio/iquicker | 2f3e9375020b89461536553b500da517715f0d88 | [
"Unlicense"
] | null | null | null | from flask_login import UserMixin | 25.538462 | 51 | 0.644578 | from flask_login import UserMixin
class User(UserMixin):
def __init__(self, uid, first_name, last_name):
self.uid = str(uid)
self.first_name = first_name
self.last_name = last_name
def get_id(self):
return self.uid
def get_by_id(db, uid):
return db.Users.find_one({... | 195 | 1 | 103 |
4a79a54443d366332ff5b78911a124f5c2c47690 | 8,901 | py | Python | syntaxnet_wrapper/src/parser_eval.py | lint-ai/syntaxnet-wrapper | 558d89a6d22028a94ddc18779193075037c4dc65 | [
"Apache-2.0"
] | null | null | null | syntaxnet_wrapper/src/parser_eval.py | lint-ai/syntaxnet-wrapper | 558d89a6d22028a94ddc18779193075037c4dc65 | [
"Apache-2.0"
] | null | null | null | syntaxnet_wrapper/src/parser_eval.py | lint-ai/syntaxnet-wrapper | 558d89a6d22028a94ddc18779193075037c4dc65 | [
"Apache-2.0"
] | null | null | null | #
# Heavily inspired from https://github.com/IINemo/docker-syntaxnet_rus://github.com/IINemo/docker-syntaxnet_rus
# itself inspired from https://github.com/tensorflow/models/blob/master/syntaxnet/syntaxnet/parser_eval.py
# just modified to be able to call wrapper several time for the same process
#
"""A program to ann... | 41.018433 | 148 | 0.588473 | #
# Heavily inspired from https://github.com/IINemo/docker-syntaxnet_rus://github.com/IINemo/docker-syntaxnet_rus
# itself inspired from https://github.com/tensorflow/models/blob/master/syntaxnet/syntaxnet/parser_eval.py
# just modified to be able to call wrapper several time for the same process
#
"""A program to ann... | 6,872 | 3 | 249 |
cd2f825dfbb7d7ee0e55543b0a0ea7b86ab54d63 | 497 | py | Python | exercises/Desafio008.py | zThiago15/Curso-em-Video | ef25e0497edb79bdfbe71fde485f4dafc0d2a0e6 | [
"MIT"
] | null | null | null | exercises/Desafio008.py | zThiago15/Curso-em-Video | ef25e0497edb79bdfbe71fde485f4dafc0d2a0e6 | [
"MIT"
] | null | null | null | exercises/Desafio008.py | zThiago15/Curso-em-Video | ef25e0497edb79bdfbe71fde485f4dafc0d2a0e6 | [
"MIT"
] | 1 | 2021-07-24T21:39:26.000Z | 2021-07-24T21:39:26.000Z | cores = {'branco':'\033[30m','vermelho':'\033[31m','amarelo':'\033[33m'}
m = float(input('\033[32mDigite uma distância em metros: '))
km = m/1000
hm = m/100
dam = m/10
dm = m*10
c = m*100
mm = m*1000
print(f'{(cores["branco"])}A medida de {(cores["vermelho"])}{m}m {(cores["branco"])}equivale a:\n{(cores["amarelo"])}{k... | 45.181818 | 295 | 0.60161 | cores = {'branco':'\033[30m','vermelho':'\033[31m','amarelo':'\033[33m'}
m = float(input('\033[32mDigite uma distância em metros: '))
km = m/1000
hm = m/100
dam = m/10
dm = m*10
c = m*100
mm = m*1000
print(f'{(cores["branco"])}A medida de {(cores["vermelho"])}{m}m {(cores["branco"])}equivale a:\n{(cores["amarelo"])}{k... | 0 | 0 | 0 |
0b1307435e3d19a954c38a3d9ed98980158d1af3 | 19,421 | py | Python | primitives_ubc/regCCFS/src/training_utils/grow_CCT.py | tonyjo/ubc_primitives | bc94a403f176fe28db2a9ac9d1a48cb9db021f90 | [
"Apache-2.0"
] | null | null | null | primitives_ubc/regCCFS/src/training_utils/grow_CCT.py | tonyjo/ubc_primitives | bc94a403f176fe28db2a9ac9d1a48cb9db021f90 | [
"Apache-2.0"
] | 4 | 2020-07-19T00:45:29.000Z | 2020-12-10T18:25:41.000Z | primitives_ubc/regCCFS/src/training_utils/grow_CCT.py | tonyjo/ubc_primitives | bc94a403f176fe28db2a9ac9d1a48cb9db021f90 | [
"Apache-2.0"
] | 1 | 2021-04-30T18:13:49.000Z | 2021-04-30T18:13:49.000Z | import inspect
import numpy as np
from primitives_ubc.regCCFS.src.utils.commonUtils import sVT
from primitives_ubc.regCCFS.src.utils.commonUtils import is_numeric
from primitives_ubc.regCCFS.src.utils.commonUtils import fastUnique
from primitives_ubc.regCCFS.src.utils.commonUtils import queryIfColumnsVary
from primitiv... | 47.13835 | 155 | 0.562226 | import inspect
import numpy as np
from primitives_ubc.regCCFS.src.utils.commonUtils import sVT
from primitives_ubc.regCCFS.src.utils.commonUtils import is_numeric
from primitives_ubc.regCCFS.src.utils.commonUtils import fastUnique
from primitives_ubc.regCCFS.src.utils.commonUtils import queryIfColumnsVary
from primitiv... | 501 | 0 | 44 |
91604e61768226066486603c80880446342f3a51 | 11,704 | py | Python | projects/tutorials/pointnav_ithor_rgb_ddppo.py | ehsanik/allenact | 043487d542bc856ad70bc7ad27eca60b8ea9e37f | [
"MIT"
] | null | null | null | projects/tutorials/pointnav_ithor_rgb_ddppo.py | ehsanik/allenact | 043487d542bc856ad70bc7ad27eca60b8ea9e37f | [
"MIT"
] | null | null | null | projects/tutorials/pointnav_ithor_rgb_ddppo.py | ehsanik/allenact | 043487d542bc856ad70bc7ad27eca60b8ea9e37f | [
"MIT"
] | null | null | null | import glob
import os
from math import ceil
from typing import Dict, Any, List, Optional, Sequence
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from torchvision import models
from constants import ABS_PATH_OF_TOP_LEVEL_DIR
f... | 34.627219 | 106 | 0.603554 | import glob
import os
from math import ceil
from typing import Dict, Any, List, Optional, Sequence
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from torchvision import models
from constants import ABS_PATH_OF_TOP_LEVEL_DIR
f... | 8,025 | 0 | 265 |
89540012dde4ea5fca2d83cb2d910ae782e69e46 | 518 | py | Python | harutya-project/harutya-lol-api/app/routes.py | Old-Interest/Harutya | 8bfd34ee65d2a0acbae499ae6ae544336037b4b4 | [
"MIT"
] | null | null | null | harutya-project/harutya-lol-api/app/routes.py | Old-Interest/Harutya | 8bfd34ee65d2a0acbae499ae6ae544336037b4b4 | [
"MIT"
] | null | null | null | harutya-project/harutya-lol-api/app/routes.py | Old-Interest/Harutya | 8bfd34ee65d2a0acbae499ae6ae544336037b4b4 | [
"MIT"
] | null | null | null | __author__ = 'Harutya'
__date__ = '2021/07/07'
from app.server import opggApi
from flask import Blueprint
from utils import harutyaResponse
servlet = Blueprint('harutya-lol-api', __name__)
@servlet.route('/tiers')
@servlet.route('/heroes')
@servlet.route('/hero/<string:hero_name>')
| 21.583333 | 63 | 0.756757 | __author__ = 'Harutya'
__date__ = '2021/07/07'
from app.server import opggApi
from flask import Blueprint
from utils import harutyaResponse
servlet = Blueprint('harutya-lol-api', __name__)
@servlet.route('/tiers')
def tiers():
return harutyaResponse.success(opggApi.get_tiers())
@servlet.route('/heroes')
def h... | 161 | 0 | 66 |
4db0470277e0579be25c21fcd80a1c66fdfe2862 | 836 | py | Python | prepareData.py | pbrazdil/deepmask | 876df280d46fca181b56e7c03327840c403488a9 | [
"BSD-3-Clause"
] | 1 | 2017-12-06T01:20:18.000Z | 2017-12-06T01:20:18.000Z | prepareData.py | pbrazdil/deepmask | 876df280d46fca181b56e7c03327840c403488a9 | [
"BSD-3-Clause"
] | null | null | null | prepareData.py | pbrazdil/deepmask | 876df280d46fca181b56e7c03327840c403488a9 | [
"BSD-3-Clause"
] | null | null | null | from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import os.path
import sys
if len(sys.argv) <= 1:
print("Data Type argument needs to be `val2014` or `train2014`.")
sys.exit(1)
dataDir = './data'
dataType = sys.argv[1]
fdir = '%s/%s' % (dataDir, dataType)
if not os.path.exists(fdir):
... | 23.222222 | 73 | 0.655502 | from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import os.path
import sys
if len(sys.argv) <= 1:
print("Data Type argument needs to be `val2014` or `train2014`.")
sys.exit(1)
dataDir = './data'
dataType = sys.argv[1]
fdir = '%s/%s' % (dataDir, dataType)
if not os.path.exists(fdir):
... | 0 | 0 | 0 |
76857e9d67df12aaa2c33423f6804d24336b1d35 | 1,583 | py | Python | python/cuml/comm/serialize.py | harrism/cuml | 060dcd94138deed2ac692031cfe70a674b15c6f0 | [
"Apache-2.0"
] | 1 | 2020-07-13T04:16:50.000Z | 2020-07-13T04:16:50.000Z | python/cuml/comm/serialize.py | harrism/cuml | 060dcd94138deed2ac692031cfe70a674b15c6f0 | [
"Apache-2.0"
] | null | null | null | python/cuml/comm/serialize.py | harrism/cuml | 060dcd94138deed2ac692031cfe70a674b15c6f0 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 29.867925 | 74 | 0.735313 | #
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 59 | 0 | 23 |
908b3c63a394490253c29a02598faff31584f719 | 6,689 | py | Python | P1_Facial_Keypoints/models.py | aliabid2243/CV_ND | fdad3bb29ed7b12de038b5d6aa57719b0154c37d | [
"MIT"
] | 2 | 2020-04-27T14:55:34.000Z | 2021-01-19T14:05:07.000Z | P1_Facial_Keypoints/models.py | aliabid2243/CV_ND | fdad3bb29ed7b12de038b5d6aa57719b0154c37d | [
"MIT"
] | 3 | 2021-09-08T01:56:12.000Z | 2022-03-12T00:26:13.000Z | P1_Facial_Keypoints/models.py | aliabid2243/CV_ND | fdad3bb29ed7b12de038b5d6aa57719b0154c37d | [
"MIT"
] | null | null | null | ## TODO: define the convolutional neural network architecture
import torch
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
## TODO: define the convolutional neural network architecture
| 39.579882 | 153 | 0.596203 | ## TODO: define the convolutional neural network architecture
import torch
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net(nn.Module):
def __init__(self):
super(Net, self).__init... | 6,203 | 7 | 166 |
49b4b60d2d74d6447a41a3fe4b70b16a8f35618c | 56 | py | Python | helper.py | jacksonnegus/cs3240-labdemo | 81ed8799c49934f6d909963f902aceb71a53e458 | [
"MIT"
] | null | null | null | helper.py | jacksonnegus/cs3240-labdemo | 81ed8799c49934f6d909963f902aceb71a53e458 | [
"MIT"
] | null | null | null | helper.py | jacksonnegus/cs3240-labdemo | 81ed8799c49934f6d909963f902aceb71a53e458 | [
"MIT"
] | null | null | null | # Jackson Negus | 11.2 | 19 | 0.660714 | # Jackson Negus
def greeting(msg):
print(str(msg)) | 18 | 0 | 23 |
c3a8a05455d8756c2c435f596c0a4c87087d2133 | 1,642 | py | Python | assignment2/src/train.py | nilax97/nlp | 008779d9794395f27f022d466f6d1570eb9e679c | [
"MIT"
] | 4 | 2021-05-31T07:03:41.000Z | 2022-01-31T11:52:03.000Z | assignment2/src/train.py | nilax97/nlp | 008779d9794395f27f022d466f6d1570eb9e679c | [
"MIT"
] | null | null | null | assignment2/src/train.py | nilax97/nlp | 008779d9794395f27f022d466f6d1570eb9e679c | [
"MIT"
] | null | null | null | import gensim
from gensim.models import Word2Vec, word2vec, KeyedVectors
import numpy as np
import os
import sys
import warnings
import string
import multiprocessing
import string
import pickle
import pandas as pd
if not sys.warnoptions:
warnings.simplefilter("ignore")
import nltk
nltk.download('averaged_perceptron_t... | 24.878788 | 105 | 0.698538 | import gensim
from gensim.models import Word2Vec, word2vec, KeyedVectors
import numpy as np
import os
import sys
import warnings
import string
import multiprocessing
import string
import pickle
import pandas as pd
if not sys.warnoptions:
warnings.simplefilter("ignore")
import nltk
nltk.download('averaged_perceptron_t... | 223 | 5 | 71 |
6701efe067d34fd0d0da2a85114ee384a9f14723 | 238 | py | Python | project/data_science/train_test_split.py | RiccardoNizzolo/prime_num | 3a28a85228b6abc2b6097dae8d8c7363ae80757c | [
"MIT"
] | 1 | 2019-02-26T09:32:41.000Z | 2019-02-26T09:32:41.000Z | project/data_science/train_test_split.py | RiccardoNizzolo/prime_num | 3a28a85228b6abc2b6097dae8d8c7363ae80757c | [
"MIT"
] | null | null | null | project/data_science/train_test_split.py | RiccardoNizzolo/prime_num | 3a28a85228b6abc2b6097dae8d8c7363ae80757c | [
"MIT"
] | null | null | null | from sklearn.model_selection import train_test_split as tts
| 29.75 | 59 | 0.752101 | from sklearn.model_selection import train_test_split as tts
def train_test_split_simple(x,y):
return tts(x, y, test_size = 0.33,shuffle=False )
def train_test_split_random(x,y):
return tts(x, y, test_size = 0.33,shuffle=False ) | 132 | 0 | 46 |
99f5159ca3652250900af0da693dc5dbc2ee7af8 | 1,648 | py | Python | beir/losses/margin_mse_loss.py | ArthurCamara/beir | 2739990b719f2d4814d88473cf9965d92d4f4c18 | [
"Apache-2.0"
] | 24 | 2022-03-20T18:48:52.000Z | 2022-03-31T08:28:42.000Z | beir/losses/margin_mse_loss.py | ArthurCamara/beir | 2739990b719f2d4814d88473cf9965d92d4f4c18 | [
"Apache-2.0"
] | 9 | 2022-03-19T14:50:30.000Z | 2022-03-30T17:31:18.000Z | beir/losses/margin_mse_loss.py | ArthurCamara/beir | 2739990b719f2d4814d88473cf9965d92d4f4c18 | [
"Apache-2.0"
] | 3 | 2022-03-25T15:45:14.000Z | 2022-03-25T17:51:23.000Z | from .. import util
import torch
from torch import nn, Tensor
from typing import Union, Tuple, List, Iterable, Dict
from torch.nn import functional as F
class MarginMSELoss(nn.Module):
"""
Computes the Margin MSE loss between the query, positive passage and negative passage. This loss
is used to train den... | 43.368421 | 114 | 0.688107 | from .. import util
import torch
from torch import nn, Tensor
from typing import Union, Tuple, List, Iterable, Dict
from torch.nn import functional as F
class MarginMSELoss(nn.Module):
"""
Computes the Margin MSE loss between the query, positive passage and negative passage. This loss
is used to train den... | 836 | 0 | 53 |
0f149eb1192e16dd41b865536f6be57cffafaf1b | 5,684 | py | Python | cto/icon.py | losenineai/CTO | 6c328b2be7b10ed2b219c8f3e9f99842c9e3d1d0 | [
"MIT"
] | 138 | 2021-10-07T21:35:13.000Z | 2022-03-26T07:31:20.000Z | cto/icon.py | losenineai/CTO | 6c328b2be7b10ed2b219c8f3e9f99842c9e3d1d0 | [
"MIT"
] | 2 | 2021-10-10T07:27:28.000Z | 2021-10-20T02:34:41.000Z | cto/icon.py | losenineai/CTO | 6c328b2be7b10ed2b219c8f3e9f99842c9e3d1d0 | [
"MIT"
] | 12 | 2021-10-08T19:38:02.000Z | 2022-03-16T08:16:35.000Z | import ida_kernwin
import codecs
g_icon_data_ascii = (
b"89504E470D0A1A0A0000000D4948445200000020000000200806000000737A7A",
b"F4000000097048597300000EC300000EC301C76FA8640000001974455874536F",
b"667477617265007777772E696E6B73636170652E6F72679BEE3C1A0000036249",
b"4441545885ADD75B8855651407F0DF... | 41.794118 | 92 | 0.679099 | import ida_kernwin
import codecs
g_icon_data_ascii = (
b"89504E470D0A1A0A0000000D4948445200000020000000200806000000737A7A",
b"F4000000097048597300000EC300000EC301C76FA8640000001974455874536F",
b"667477617265007777772E696E6B73636170652E6F72679BEE3C1A0000036249",
b"4441545885ADD75B8855651407F0DF... | 3,004 | 252 | 24 |
d994e822dde457aa69be15421c8059f7fa1112a7 | 1,655 | py | Python | WordTranslationWithoutParallelData/src/net.py | jsenellart/papers | d5525cba87ff40f1ee1aab66a4b3fcda9e9e1148 | [
"MIT"
] | 14 | 2017-11-06T07:30:51.000Z | 2021-06-15T12:48:48.000Z | WordTranslationWithoutParallelData/src/net.py | jsenellart/papers | d5525cba87ff40f1ee1aab66a4b3fcda9e9e1148 | [
"MIT"
] | 1 | 2017-11-07T09:01:43.000Z | 2017-11-07T09:01:43.000Z | WordTranslationWithoutParallelData/src/net.py | jsenellart/papers | d5525cba87ff40f1ee1aab66a4b3fcda9e9e1148 | [
"MIT"
] | 4 | 2017-11-06T07:30:53.000Z | 2019-10-03T16:42:37.000Z | import torch
from torch.autograd import Variable
import torch.nn as nn
from scipy.stats import special_ortho_group
| 26.693548 | 81 | 0.659215 | import torch
from torch.autograd import Variable
import torch.nn as nn
from scipy.stats import special_ortho_group
class Generator(nn.Module):
def __init__(self, args):
super(Generator, self).__init__()
print("* Generator Model Initialization")
self.net = nn.Linear(args.dim, args.dim, False)
if ar... | 1,278 | 16 | 244 |
48f4bc41c04f5bd44abcf538a17769c81efb510b | 5,328 | py | Python | beorn_lib/dialog/text_dialog/text_drop_down_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/dialog/text_dialog/text_drop_down_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/dialog/text_dialog/text_drop_down_element.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# ... | 30.976744 | 88 | 0.54467 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# ... | 0 | 0 | 0 |
e9254a9915a316ee6c4bffee28601d74f51ea0e2 | 5,229 | py | Python | src/restfuls/apps/v1/apis/resource.py | Qinnnnnn/Watero_DataCenter | fc56dc13fa9a71817de9243b494dc01ab1d193bd | [
"MIT"
] | null | null | null | src/restfuls/apps/v1/apis/resource.py | Qinnnnnn/Watero_DataCenter | fc56dc13fa9a71817de9243b494dc01ab1d193bd | [
"MIT"
] | null | null | null | src/restfuls/apps/v1/apis/resource.py | Qinnnnnn/Watero_DataCenter | fc56dc13fa9a71817de9243b494dc01ab1d193bd | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
File : resource.py
Author : Zerui Qin
CreateDate : 2018-12-07 10:00:00
Note : 设备资源信息,POST
"""
from flask_restful import Resource
from flask_restful import fields
from flask_restful import marshal_with
from flask_restful import reqparse
from src.restfuls.apps.db_model imp... | 40.223077 | 119 | 0.638363 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
File : resource.py
Author : Zerui Qin
CreateDate : 2018-12-07 10:00:00
Note : 设备资源信息,POST
"""
from flask_restful import Resource
from flask_restful import fields
from flask_restful import marshal_with
from flask_restful import reqparse
from src.restfuls.apps.db_model imp... | 0 | 0 | 0 |
cba18c28a6ad83b04938ac4766daea3d48671bfa | 6,465 | py | Python | tests/test_language.py | Croebh/draconic | c63c3ebc3cc59b344e136e17b12ad28c7a2a1461 | [
"MIT"
] | 6 | 2020-05-20T22:09:23.000Z | 2022-03-26T19:09:53.000Z | tests/test_language.py | Croebh/draconic | c63c3ebc3cc59b344e136e17b12ad28c7a2a1461 | [
"MIT"
] | 13 | 2020-05-19T20:02:38.000Z | 2022-03-28T20:26:32.000Z | tests/test_language.py | Croebh/draconic | c63c3ebc3cc59b344e136e17b12ad28c7a2a1461 | [
"MIT"
] | 7 | 2020-05-19T17:31:44.000Z | 2022-03-04T05:28:22.000Z | import sys
import pytest
from draconic.exceptions import *
class TestOperations:
"""
Tests the operations with a custom handler:
ast.Add: self._safe_add,
ast.Sub: self._safe_sub,
ast.Mult: self._safe_mult,
ast.Pow: self._safe_power,
ast.LShift: self._safe_lshift,
"""
| 23.089286 | 90 | 0.408662 | import sys
import pytest
from draconic.exceptions import *
def test_comps(e):
assert e('[a + 1 for a in [1,2,3]]') == [2, 3, 4]
assert e('{a + 1 for a in [1,2,3]}') == {2, 3, 4}
assert e('{a + 1: a - 1 for a in [1,2,3]}') == {2: 0, 3: 1, 4: 2}
def test_setcomp(e):
assert e('{0 for a in [1,2,3]}') ... | 5,545 | 16 | 592 |
327436658acda76cab7a2e4ab2d44b12cc389ae5 | 21,574 | py | Python | ghreport/ghreport.py | gramster/ghreport | 4b9fe3e80627afad587aff674f88c3612b05256a | [
"MIT"
] | null | null | null | ghreport/ghreport.py | gramster/ghreport | 4b9fe3e80627afad587aff674f88c3612b05256a | [
"MIT"
] | null | null | null | ghreport/ghreport.py | gramster/ghreport | 4b9fe3e80627afad587aff674f88c3612b05256a | [
"MIT"
] | null | null | null | import abc
from dataclasses import dataclass
from datetime import date, datetime, timedelta, timezone
import time
from typing import List, Optional
import asyncio
from github import Github
import pytz
import httpx
import gidgethub.httpx
import matplotlib.pyplot as plt
from bokeh.plotting import figure, output_file, sho... | 35.956667 | 145 | 0.544498 | import abc
from dataclasses import dataclass
from datetime import date, datetime, timedelta, timezone
import time
from typing import List, Optional
import asyncio
from github import Github
import pytz
import httpx
import gidgethub.httpx
import matplotlib.pyplot as plt
from bokeh.plotting import figure, output_file, sho... | 17,007 | 732 | 852 |
20097e08b94964cf3677ea2a4760490f92d2fd77 | 1,106 | py | Python | tests/core/context/test_get_unallocated.py | investing-algorithms/investing-algorithm-framework | d579e142a3857e2e2dfb59b7d6e54202f7df5466 | [
"Apache-2.0"
] | 1 | 2019-12-23T21:23:45.000Z | 2019-12-23T21:23:45.000Z | tests/core/context/test_get_unallocated.py | investing-algorithms/investing-algorithm-framework | d579e142a3857e2e2dfb59b7d6e54202f7df5466 | [
"Apache-2.0"
] | null | null | null | tests/core/context/test_get_unallocated.py | investing-algorithms/investing-algorithm-framework | d579e142a3857e2e2dfb59b7d6e54202f7df5466 | [
"Apache-2.0"
] | 1 | 2019-12-23T21:23:50.000Z | 2019-12-23T21:23:50.000Z | from investing_algorithm_framework import Position
from tests.resources import TestBase
| 34.5625 | 62 | 0.691682 | from investing_algorithm_framework import Position
from tests.resources import TestBase
class Test(TestBase):
def setUp(self):
super(Test, self).setUp()
def test(self) -> None:
self.algo_app.start_algorithm()
position = self.algo_app.algorithm.get_unallocated()
self.assertIsN... | 886 | 0 | 131 |
b64db1204f240f36e3b97e3440a620747d2139ea | 2,639 | py | Python | boss_train.py | hasibzunair/boss-detector | 6e3c425766b8ab396fa4a4b25cbcaff88f4f43b8 | [
"MIT"
] | 74 | 2018-07-04T06:50:54.000Z | 2022-01-10T02:03:18.000Z | boss_train.py | hasibzunair/boss-detector | 6e3c425766b8ab396fa4a4b25cbcaff88f4f43b8 | [
"MIT"
] | null | null | null | boss_train.py | hasibzunair/boss-detector | 6e3c425766b8ab396fa4a4b25cbcaff88f4f43b8 | [
"MIT"
] | 3 | 2018-07-18T21:48:21.000Z | 2018-08-08T11:49:33.000Z | import cv2
import numpy
from os import path, walk, listdir, makedirs
from __config__ import *
face_detector = cv2.CascadeClassifier(CASCADE_FILE)
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
# build dataset for face recognizer
# train face recognizer
print("buil... | 32.9875 | 85 | 0.615764 | import cv2
import numpy
from os import path, walk, listdir, makedirs
from __config__ import *
face_detector = cv2.CascadeClassifier(CASCADE_FILE)
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
# build dataset for face recognizer
def build():
face_name = input("ent... | 2,212 | 0 | 44 |
48a3f1ce008cd47292a917a26b9814e5429c6c0f | 5,738 | py | Python | colour/models/cie_lab.py | canavandl/colour | a453cd37b6135a9092d5ea5b2aafb8d19134bdff | [
"BSD-3-Clause"
] | 1 | 2019-06-27T11:32:48.000Z | 2019-06-27T11:32:48.000Z | colour/models/cie_lab.py | canavandl/colour | a453cd37b6135a9092d5ea5b2aafb8d19134bdff | [
"BSD-3-Clause"
] | null | null | null | colour/models/cie_lab.py | canavandl/colour | a453cd37b6135a9092d5ea5b2aafb8d19134bdff | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CIE Lab Colourspace
===================
Defines the *CIE Lab* colourspace transformations:
- :func:`XYZ_to_Lab`
- :func:`Lab_to_XYZ`
- :func:`Lab_to_LCHab`
- :func:`LCHab_to_Lab`
See Also
--------
`CIE Lab Colourspace IPython Notebook
<http://nbviewer.ipytho... | 25.056769 | 119 | 0.555943 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CIE Lab Colourspace
===================
Defines the *CIE Lab* colourspace transformations:
- :func:`XYZ_to_Lab`
- :func:`Lab_to_XYZ`
- :func:`Lab_to_LCHab`
- :func:`LCHab_to_Lab`
See Also
--------
`CIE Lab Colourspace IPython Notebook
<http://nbviewer.ipytho... | 0 | 0 | 0 |
6199b3666386dd5691210baebaf3f74fe1e30cef | 13,625 | py | Python | case-study-HSR/data_HSR.py | stefanoborto/optimization-equilibrium-dcm | 3b671d42bdcc6908c02aa0b3f1cb13dc866c1f6d | [
"MIT"
] | null | null | null | case-study-HSR/data_HSR.py | stefanoborto/optimization-equilibrium-dcm | 3b671d42bdcc6908c02aa0b3f1cb13dc866c1f6d | [
"MIT"
] | null | null | null | case-study-HSR/data_HSR.py | stefanoborto/optimization-equilibrium-dcm | 3b671d42bdcc6908c02aa0b3f1cb13dc866c1f6d | [
"MIT"
] | null | null | null | '''
Data used in Section 5.3 of the following article:
S. Bortolomiol, V. Lurkin, M. Bierlaire (2021).
A Simulation-Based Heuristic to Find Approximate Equilibria with
Disaggregate Demand Models. Transportation Science 55(5):1025-1045.
https://doi.org/10.1287/trsc.2021.1071
Discrete choice model derived from th... | 54.282869 | 148 | 0.496073 | '''
Data used in Section 5.3 of the following article:
S. Bortolomiol, V. Lurkin, M. Bierlaire (2021).
A Simulation-Based Heuristic to Find Approximate Equilibria with
Disaggregate Demand Models. Transportation Science 55(5):1025-1045.
https://doi.org/10.1287/trsc.2021.1071
Discrete choice model derived from th... | 11,561 | 0 | 74 |
ae20acc5b0d113491d893ece8a78c7de22528707 | 2,689 | py | Python | Sketches/MH/filereading/SimpleMultiFileStreamer.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MH/filereading/SimpleMultiFileStreamer.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MH/filereading/SimpleMultiFileStreamer.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | 36.835616 | 98 | 0.712161 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | 413 | 0 | 23 |
364332f06d3280962715298d754e1137e73c6d79 | 4,689 | py | Python | nfv/nfv-vim/nfv_vim/vim_api.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | 2 | 2020-02-07T19:01:36.000Z | 2022-02-23T01:41:46.000Z | nfv/nfv-vim/nfv_vim/vim_api.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | 1 | 2021-01-14T12:02:25.000Z | 2021-01-14T12:02:25.000Z | nfv/nfv-vim/nfv_vim/vim_api.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | 2 | 2021-01-13T08:39:21.000Z | 2022-02-09T00:21:55.000Z | #
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import argparse
from netaddr import IPAddress
import signal
import socket
import sys
from wsgiref import simple_server
from nfv_common import config
from nfv_common import debug
from nfv_common import selobj
from nfv_common ... | 27.910714 | 82 | 0.644061 | #
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import argparse
from netaddr import IPAddress
import signal
import socket
import sys
from wsgiref import simple_server
from nfv_common import config
from nfv_common import debug
from nfv_common import selobj
from nfv_common ... | 327 | 0 | 23 |
5acbfad43e856c43c59d0edcc4335d7143f8c35c | 396 | py | Python | Chapter02/sources/numpy-ex3.py | gabrielmahia/AIWuShu | 0c2507e812ab0824f50e44c17470ba15fc1042d2 | [
"MIT"
] | 63 | 2019-08-26T04:52:37.000Z | 2022-02-16T19:04:46.000Z | Chapter02/sources/numpy-ex3.py | urantialife/Hands-On-Artificial-Intelligence-for-Cybersecurity | 507e736b23b8c62ded7f544763edaf3ccaba506d | [
"MIT"
] | null | null | null | Chapter02/sources/numpy-ex3.py | urantialife/Hands-On-Artificial-Intelligence-for-Cybersecurity | 507e736b23b8c62ded7f544763edaf3ccaba506d | [
"MIT"
] | 47 | 2019-08-15T21:46:01.000Z | 2022-03-08T01:12:23.000Z | import numpy as np
# w is the vector of weights
w = np.array([0.1, 0.2, 0.3])
# matrices as input datasets
data1 = np.array([0.3, 1.5, 2.8])
data2 = np.array([0.5, 0.4, 0.9])
data3 = np.array([2.3, 3.1, 0.5])
data_in = np.array([data1[0],data2[0],data3[0]])
print('Predicted value: $%.2f' % ... | 18 | 56 | 0.565657 | import numpy as np
def predict(data, w):
return data.dot(w)
# w is the vector of weights
w = np.array([0.1, 0.2, 0.3])
# matrices as input datasets
data1 = np.array([0.3, 1.5, 2.8])
data2 = np.array([0.5, 0.4, 0.9])
data3 = np.array([2.3, 3.1, 0.5])
data_in = np.array([data1[0],data2[0... | 26 | 0 | 25 |
fd1e84fd89b6a77d68873530fb1019ca2ba77b28 | 7,384 | py | Python | v2g_score_prototype/scripts/score_v2g_v2.py | thehyve/genetics-v2g-data | 96544d075955282ab0f8bef287a11bb782942cf7 | [
"Apache-2.0"
] | 7 | 2019-01-30T01:08:15.000Z | 2022-03-07T20:43:53.000Z | v2g_score_prototype/scripts/score_v2g_v2.py | thehyve/genetics-v2g-data | 96544d075955282ab0f8bef287a11bb782942cf7 | [
"Apache-2.0"
] | null | null | null | v2g_score_prototype/scripts/score_v2g_v2.py | thehyve/genetics-v2g-data | 96544d075955282ab0f8bef287a11bb782942cf7 | [
"Apache-2.0"
] | 5 | 2019-07-11T09:37:58.000Z | 2021-07-30T23:05:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Ed Mountjoy
#
import sys
import os
import argparse
import pandas as pd
import numpy as np
from sklearn.preprocessing import quantile_transform
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import rcParams
# from scipy.stats import rankdata
def... | 30.386831 | 100 | 0.568662 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Ed Mountjoy
#
import sys
import os
import argparse
import pandas as pd
import numpy as np
from sklearn.preprocessing import quantile_transform
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib import rcParams
# from scipy.stats import rankdata
def... | 4,470 | 0 | 46 |
e2f6f24dc97b9bf45f5e45851e6ff340f485a4cf | 315 | py | Python | tests/test_integration.py | itaym120/twine | 58777afba40ac4412293dd74da5feda0e79ec443 | [
"Apache-2.0"
] | null | null | null | tests/test_integration.py | itaym120/twine | 58777afba40ac4412293dd74da5feda0e79ec443 | [
"Apache-2.0"
] | null | null | null | tests/test_integration.py | itaym120/twine | 58777afba40ac4412293dd74da5feda0e79ec443 | [
"Apache-2.0"
] | null | null | null | from twine.cli import dispatch
| 24.230769 | 53 | 0.644444 | from twine.cli import dispatch
def test_devpi_upload(devpi_server, uploadable_dist):
command = [
'upload',
'--repository-url', devpi_server.url,
'--username', devpi_server.username,
'--password', devpi_server.password,
str(uploadable_dist),
]
dispatch(command)
| 260 | 0 | 23 |
4d469f5db762841c6dcb0a51a4541d5a92a7b971 | 5,353 | py | Python | fHDHR/device/tuners/stream/ffmpeg_stream.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | 2 | 2021-11-21T18:45:35.000Z | 2022-01-11T16:11:48.000Z | fHDHR/device/tuners/stream/ffmpeg_stream.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | null | null | null | fHDHR/device/tuners/stream/ffmpeg_stream.py | deathbybandaid/fHDHR_NewsOn | 06d205a3ca677b88fa93b9b7503465aed1838c6b | [
"WTFPL"
] | null | null | null | import sys
import subprocess
# from fHDHR.exceptions import TunerError
| 40.24812 | 111 | 0.542686 | import sys
import subprocess
# from fHDHR.exceptions import TunerError
class FFMPEG_Stream():
def __init__(self, fhdhr, stream_args, tuner):
self.fhdhr = fhdhr
self.stream_args = stream_args
self.tuner = tuner
self.bytes_per_read = int(self.fhdhr.config.dict["ffmpeg"]["bytes_per... | 3,067 | 2,206 | 23 |
43d0e2bdb73d9d4912c702b09cc770800404f29f | 306 | py | Python | view/msgparser.py | WareLee/LANTIM | d21b446441e30fe4b67dedd2a38da31b73df8824 | [
"Apache-2.0"
] | null | null | null | view/msgparser.py | WareLee/LANTIM | d21b446441e30fe4b67dedd2a38da31b73df8824 | [
"Apache-2.0"
] | null | null | null | view/msgparser.py | WareLee/LANTIM | d21b446441e30fe4b67dedd2a38da31b73df8824 | [
"Apache-2.0"
] | null | null | null | # 用于显示层view的消息解析与组装的工具模块
# 自报家门数据格式: self:{username}:{any info}
# 请求广播格式:broadcast:{username}:{info wanted to send}, 注:广播消息根据实际到达client的时间排序
# 单播数据报格式: {time of client msg creating}:{friendusername}:{info wanted to send},注:单播消息的数据顺序由接收客户端负责
# 上下文:
# 剩余工作
# 完成该工具模块
# 完成view层的各种事件 | 34 | 99 | 0.699346 | # 用于显示层view的消息解析与组装的工具模块
# 自报家门数据格式: self:{username}:{any info}
# 请求广播格式:broadcast:{username}:{info wanted to send}, 注:广播消息根据实际到达client的时间排序
# 单播数据报格式: {time of client msg creating}:{friendusername}:{info wanted to send},注:单播消息的数据顺序由接收客户端负责
# 上下文:
# 剩余工作
# 完成该工具模块
# 完成view层的各种事件 | 0 | 0 | 0 |
f43e9e33969cef07fef042453d3ef75db55d58d4 | 524 | py | Python | general.py | aaronjohnsabu1999/tk2NN | 89bd1883d1230b880a76d854b54f89cf0a1d6e02 | [
"MIT"
] | 2 | 2020-07-01T21:10:10.000Z | 2020-07-01T23:55:05.000Z | general.py | aaronjohnsabu1999/tk2NN | 89bd1883d1230b880a76d854b54f89cf0a1d6e02 | [
"MIT"
] | null | null | null | general.py | aaronjohnsabu1999/tk2NN | 89bd1883d1230b880a76d854b54f89cf0a1d6e02 | [
"MIT"
] | null | null | null | import sys
from colour import Color
from random import random, randint | 32.75 | 122 | 0.688931 | import sys
from colour import Color
from random import random, randint
def version():
return sys.version_info[0]
def colorPicker(pointSet = []):
choiceSet = {}
for point in pointSet:
if not point[1] in choiceSet:
choiceSet[point[1]] = Color(rgb=(random(), random(), random()))
retur... | 385 | 0 | 69 |
816ebd3c6947050737cf4d0521f97ed014a894a5 | 3,185 | py | Python | queenbee/io/outputs/function.py | AntoineDao/queenbee | 800d5b26a69cffbce85864ea9430304b7fb8d11a | [
"MIT"
] | 10 | 2020-12-17T06:08:46.000Z | 2022-02-12T12:06:08.000Z | queenbee/io/outputs/function.py | AntoineDao/queenbee | 800d5b26a69cffbce85864ea9430304b7fb8d11a | [
"MIT"
] | 213 | 2020-12-06T03:34:01.000Z | 2022-03-28T01:07:41.000Z | queenbee/io/outputs/function.py | AntoineDao/queenbee | 800d5b26a69cffbce85864ea9430304b7fb8d11a | [
"MIT"
] | 4 | 2019-08-14T22:10:29.000Z | 2020-09-21T22:46:11.000Z | """Queenbee output types for functions.
For more information on plugins see plugin module.
"""
from typing import Union
from pydantic import constr, Field
from ..common import PathOutput, ItemType
class FunctionFileOutput(PathOutput):
"""Function File output."""
type: constr(regex='^FunctionFileOutput$') =... | 26.541667 | 88 | 0.695761 | """Queenbee output types for functions.
For more information on plugins see plugin module.
"""
from typing import Union
from pydantic import constr, Field
from ..common import PathOutput, ItemType
class FunctionFileOutput(PathOutput):
"""Function File output."""
type: constr(regex='^FunctionFileOutput$') =... | 85 | 0 | 104 |
4aec7f142bfb271d99ddb0515cb122038dcb12e3 | 5,316 | py | Python | SVassembly/count_bcs_in_windows.py | AV321/SVassembly2 | 71b061403ef72dece0023098625436d0f32b8649 | [
"MIT"
] | null | null | null | SVassembly/count_bcs_in_windows.py | AV321/SVassembly2 | 71b061403ef72dece0023098625436d0f32b8649 | [
"MIT"
] | null | null | null | SVassembly/count_bcs_in_windows.py | AV321/SVassembly2 | 71b061403ef72dece0023098625436d0f32b8649 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#From Stephanie Greer's github
"""
:Author: Ji Research Group/Stanford Genome Technology Center
:Contact: sgreer2@stanford.edu
:Creation date: 24.11.2016
:Description:
This script counts the number of unique barcodes in windows around the SV breakpoints
This script requires:
- all of the pyt... | 32.414634 | 147 | 0.677765 | #!/usr/bin/env python
#From Stephanie Greer's github
"""
:Author: Ji Research Group/Stanford Genome Technology Center
:Contact: sgreer2@stanford.edu
:Creation date: 24.11.2016
:Description:
This script counts the number of unique barcodes in windows around the SV breakpoints
This script requires:
- all of the pyt... | 2,347 | 0 | 69 |
5a32c3421e6af9d46c13d5cea16b87bf5ba932b1 | 2,466 | py | Python | CondTools/DT/test/popcon_hv.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondTools/DT/test/popcon_hv.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondTools/DT/test/popcon_hv.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("CondCore.DBCommon.CondDBCommon_cfi")
process.CondDBCommon.connect = 'sqlite_file:testhv.db'
process.CondDBCommon.DBParameters.authenticationPath = '.'
#process.DTHVCheckByAbsoluteValues = cms.Service("DTHVCheckByAbsoluteValues")
pro... | 35.228571 | 77 | 0.636253 | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("CondCore.DBCommon.CondDBCommon_cfi")
process.CondDBCommon.connect = 'sqlite_file:testhv.db'
process.CondDBCommon.DBParameters.authenticationPath = '.'
#process.DTHVCheckByAbsoluteValues = cms.Service("DTHVCheckByAbsoluteValues")
pro... | 0 | 0 | 0 |
38767e19adb333e2bc1fd7a303bddeb82b1648db | 279 | py | Python | uveb/resources/index.py | NataRich/uveb_b | 1767caa60b48ca937dba6e99c9866223a33982d0 | [
"MIT"
] | null | null | null | uveb/resources/index.py | NataRich/uveb_b | 1767caa60b48ca937dba6e99c9866223a33982d0 | [
"MIT"
] | null | null | null | uveb/resources/index.py | NataRich/uveb_b | 1767caa60b48ca937dba6e99c9866223a33982d0 | [
"MIT"
] | null | null | null | from flask import jsonify
from flask_restful import Resource
from . import app
| 18.6 | 50 | 0.623656 | from flask import jsonify
from flask_restful import Resource
from . import app
class IndexResource(Resource):
@staticmethod
def get():
return jsonify({
'Project': app.config['PROJECT_NAME'],
'Version': app.config['VERSION']
})
| 121 | 53 | 23 |
ef2b62767798f4dc52aa404a9cf6f2377be97fc4 | 3,019 | py | Python | tests/test_generate.py | gitter-badger/phasespace | bf22aecb29163a222b76fe44af64849c4d19ab29 | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate.py | gitter-badger/phasespace | bf22aecb29163a222b76fe44af64849c4d19ab29 | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate.py | gitter-badger/phasespace | bf22aecb29163a222b76fe44af64849c4d19ab29 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# @file test_generate.py
# @author Albert Puig (albert.puig@cern.ch)
# @date 27.02.2019
# =============================================================================
"""Basic dimensionali... | 35.940476 | 98 | 0.558132 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# @file test_generate.py
# @author Albert Puig (albert.puig@cern.ch)
# @date 27.02.2019
# =============================================================================
"""Basic dimensionali... | 0 | 0 | 0 |