hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d4ea8d0544d32bf366920147a6e0481967b26f78 | 11,865 | py | Python | eneel/load_strategies.py | alangsbo/eneel | da6b9e83006bfabc698c4f379ccb4683a981d26c | [
"Apache-2.0"
] | null | null | null | eneel/load_strategies.py | alangsbo/eneel | da6b9e83006bfabc698c4f379ccb4683a981d26c | [
"Apache-2.0"
] | null | null | null | eneel/load_strategies.py | alangsbo/eneel | da6b9e83006bfabc698c4f379ccb4683a981d26c | [
"Apache-2.0"
] | null | null | null | import eneel.load_functions as load_functions
import eneel.printer as printer
import logging
logger = logging.getLogger("main_logger")
| 28.25 | 103 | 0.510409 | import eneel.load_functions as load_functions
import eneel.printer as printer
import logging
logger = logging.getLogger("main_logger")
def strategy_full_table_load(
return_code,
index,
total,
source,
source_schema,
source_table,
source_where,
columns,
temp_path_load,
csv_deli... | 0 | 0 | 0 | 0 | 0 | 11,656 | 0 | 0 | 69 |
40e672e25128882c333a12ff8a5d1bce0082721b | 10,296 | py | Python | lime/qchem/DFT/G0W0.py | binggu56/scitools | 3f7ce3d8411a23186c73f1bb87a8778e039fbd0b | [
"MIT"
] | 2 | 2018-11-25T21:57:11.000Z | 2018-12-15T09:10:18.000Z | lime/qchem/DFT/G0W0.py | binggu56/scitools | 3f7ce3d8411a23186c73f1bb87a8778e039fbd0b | [
"MIT"
] | null | null | null | lime/qchem/DFT/G0W0.py | binggu56/scitools | 3f7ce3d8411a23186c73f1bb87a8778e039fbd0b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Author: Timothy Berkelbach
Bing Gu
Spin-orbital G0W0
Refs
[1] Lange and Berkelbach, 2018, JCTC
"""
import numpy as np
import scipy.linalg
from scipy.optimize import newton
from pyscf.lib import logger
import pyscf.ao2mo
def g0(gw, omega):
'''Return the 0th order GF matri... | 28.921348 | 95 | 0.534965 | # -*- coding: utf-8 -*-
"""
@Author: Timothy Berkelbach
Bing Gu
Spin-orbital G0W0
Refs
[1] Lange and Berkelbach, 2018, JCTC
"""
import numpy as np
import scipy.linalg
from scipy.optimize import newton
from pyscf.lib import logger
import pyscf.ao2mo
import pyscf
from functools import reduce
def g0(gw, om... | 0 | 0 | 0 | 3,024 | 0 | 366 | 0 | -2 | 144 |
83927dab959f91d040e155d02a8784ff1d9e1f8b | 1,533 | py | Python | test/script_test/basic_test.py | kbaseIncubator/core_genome_utilities | 63a4cf0de2910a985ad3b9a1527a55dd0ef4e399 | [
"MIT"
] | null | null | null | test/script_test/basic_test.py | kbaseIncubator/core_genome_utilities | 63a4cf0de2910a985ad3b9a1527a55dd0ef4e399 | [
"MIT"
] | null | null | null | test/script_test/basic_test.py | kbaseIncubator/core_genome_utilities | 63a4cf0de2910a985ad3b9a1527a55dd0ef4e399 | [
"MIT"
] | null | null | null | # Test script for genome_util package - it should be launched from
# the root of the genome_util module, ideally just with 'make test', as
# it looks for a hardcoded relative path to find the 'test.cfg' file
import unittest
# Before all the tests, read the config file and get a user token and
# save it to a file used ... | 30.66 | 71 | 0.708415 | # Test script for genome_util package - it should be launched from
# the root of the genome_util module, ideally just with 'make test', as
# it looks for a hardcoded relative path to find the 'test.cfg' file
import unittest
import json
import ConfigParser
from pprint import pprint
from subprocess import call
from bi... | 0 | 0 | 0 | 895 | 0 | 0 | 0 | 8 | 157 |
689f44de4e6287f106fe98a425a5f08dfb110a89 | 740 | py | Python | garfield/garfield/urls.py | RobSpectre/garfield | ab806b7ad9221bd1b17c92daadd0a53a4f261cbe | [
"MIT"
] | 3 | 2017-10-15T20:55:00.000Z | 2018-04-25T21:30:57.000Z | garfield/garfield/urls.py | RobSpectre/garfield | ab806b7ad9221bd1b17c92daadd0a53a4f261cbe | [
"MIT"
] | 12 | 2018-07-15T20:42:01.000Z | 2021-06-10T17:39:46.000Z | garfield/garfield/urls.py | RobSpectre/garfield | ab806b7ad9221bd1b17c92daadd0a53a4f261cbe | [
"MIT"
] | 1 | 2018-06-30T02:51:31.000Z | 2018-06-30T02:51:31.000Z | from django.conf import settings
from django.conf.urls import url
from django.urls import include
from django.urls import path
from django.contrib import admin
from controlcenter.views import controlcenter
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^admin/dashboard/', controlcenter.urls),
ur... | 26.428571 | 59 | 0.675676 | from django.conf import settings
from django.conf.urls import url
from django.urls import include
from django.urls import path
from django.contrib import admin
from controlcenter.views import controlcenter
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^admin/dashboard/', controlcenter.urls),
ur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f6b2d31a946d31078d5eb5ac93a0717f97d43f87 | 55,117 | py | Python | prover/simplex.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | 22 | 2021-06-15T00:01:27.000Z | 2022-03-15T11:22:25.000Z | prover/simplex.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | null | null | null | prover/simplex.py | crisperdue/holpy | fe88eb91a8db8386184329e3f51a80d11ecdb316 | [
"BSD-3-Clause"
] | 2 | 2021-11-30T08:56:03.000Z | 2022-01-24T10:46:39.000Z | """
Note that the equality dict in Simplex data structure can be simplified by elimate the jar whose coefficient
is zero. This will be fixed later.
"""
"""
Implementation of Simplex-based quantifier-free linear arithmetic solver.
Reference:
Bruno Dutertre and Leonardo de Moura. A Fast Linear-Arithmetic Solver for DP... | 40.438004 | 139 | 0.561986 | """
Note that the equality dict in Simplex data structure can be simplified by elimate the jar whose coefficient
is zero. This will be fixed later.
"""
"""
Implementation of Simplex-based quantifier-free linear arithmetic solver.
Reference:
Bruno Dutertre and Leonardo de Moura. A Fast Linear-Arithmetic Solver for DP... | 168 | 3,729 | 0 | 43,692 | 0 | 0 | 0 | 168 | 522 |
d9ab90b6c55373550252968f64b17854851835c9 | 2,141 | py | Python | exact/models.py | TravelDeal/django-exact | d88bcd15f9e028907eab989ea4572cea24992c3d | [
"MIT"
] | null | null | null | exact/models.py | TravelDeal/django-exact | d88bcd15f9e028907eab989ea4572cea24992c3d | [
"MIT"
] | null | null | null | exact/models.py | TravelDeal/django-exact | d88bcd15f9e028907eab989ea4572cea24992c3d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 41.980392 | 141 | 0.734236 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.sites.models import Site
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
class Session(models.Model):
api_url = models.URLField(_("API base URL"), help_text=_("E.g... | 0 | 0 | 0 | 1,748 | 0 | 94 | 0 | 74 | 158 |
a6b3018ff14a6de65121a9b8e8b222020e0ddfa8 | 217 | py | Python | loss.py | terry97-guel/POENet-ActiveLearning | 78e959c8c5eacc5b2dc4e3334ed609d182ce7b6c | [
"MIT"
] | null | null | null | loss.py | terry97-guel/POENet-ActiveLearning | 78e959c8c5eacc5b2dc4e3334ed609d182ce7b6c | [
"MIT"
] | null | null | null | loss.py | terry97-guel/POENet-ActiveLearning | 78e959c8c5eacc5b2dc4e3334ed609d182ce7b6c | [
"MIT"
] | 1 | 2022-01-12T05:16:25.000Z | 2022-01-12T05:16:25.000Z | #%%
| 15.5 | 47 | 0.589862 | #%%
import torch
class Get_Loss_Function():
def Pos_norm2(self,output, label):
loss = torch.nn.MSELoss()(output,label)
return loss
# def se3_norm2(output, label):
#Fill me
| 0 | 0 | 0 | 175 | 0 | 0 | 0 | -9 | 45 |
ed7be6914d5a42821c1d0b1be9c2b88b16f4d889 | 2,261 | py | Python | src/cmsplugin_filer_image/cms_plugins.py | FinalAngel/cmsplugin-filer | 6cee997f3486a2446362e10811661cfc96c50d67 | [
"MIT"
] | null | null | null | src/cmsplugin_filer_image/cms_plugins.py | FinalAngel/cmsplugin-filer | 6cee997f3486a2446362e10811661cfc96c50d67 | [
"MIT"
] | null | null | null | src/cmsplugin_filer_image/cms_plugins.py | FinalAngel/cmsplugin-filer | 6cee997f3486a2446362e10811661cfc96c50d67 | [
"MIT"
] | null | null | null | from cms.plugin_pool import plugin_pool
plugin_pool.register_plugin(FilerImagePlugin)
| 41.87037 | 128 | 0.636886 | import os
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from django.utils.translation import ugettext_lazy as _
import models
from django.conf import settings
from filer.settings import FILER_ADMIN_ICON_SIZES, FILER_PUBLICMEDIA_PREFIX, FILER_PRIVATEMEDIA_PREFIX, FILER_STATICMEDIA_PR... | 0 | 0 | 0 | 1,867 | 0 | 0 | 0 | 152 | 156 |
d6c44d81ed48110959a0c2ff629cc507de1acc67 | 690 | py | Python | mysite/finance/urls.py | jingluomaf/django-mysite | 5a106df6c18e7bd49e02cd29fa3dfe11b5c26ff5 | [
"MIT"
] | null | null | null | mysite/finance/urls.py | jingluomaf/django-mysite | 5a106df6c18e7bd49e02cd29fa3dfe11b5c26ff5 | [
"MIT"
] | 14 | 2020-06-05T22:51:09.000Z | 2022-03-12T00:03:07.000Z | mysite/finance/urls.py | jingluomaf/django-mysite | 5a106df6c18e7bd49e02cd29fa3dfe11b5c26ff5 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.urls import path
from finance.views import company_article_list, ChartData, dash, dash_ajax
app_name = 'finance'
urlpatterns = [
path('companies/', company_article_list, name='companies'),
path('api/chart/data/', ChartData.... | 34.5 | 74 | 0.701449 | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from finance.views import company_article_list, ChartData, dash, dash_ajax
app_name = 'finance'
urlpatterns = [
path('companies/', company_article_list, name='companies... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 22 |
decb5d3b387f214dc4339f311729c45dce7da7a4 | 284 | py | Python | request_learn/CrawBinData.py | luoyefeiwu/learn_python | e888537c538309d2600a302c0c6e92456dd785c0 | [
"Apache-2.0"
] | null | null | null | request_learn/CrawBinData.py | luoyefeiwu/learn_python | e888537c538309d2600a302c0c6e92456dd785c0 | [
"Apache-2.0"
] | null | null | null | request_learn/CrawBinData.py | luoyefeiwu/learn_python | e888537c538309d2600a302c0c6e92456dd785c0 | [
"Apache-2.0"
] | null | null | null | #
import requests
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') # Change default encoding to utf8
r=requests.get('http://github.com/favicon.ico')
print(r.text)
print(r.content)
with open('favicon.ico','wb') as f:
f.write(r.content)
| 25.818182 | 98 | 0.742958 | # 抓取二进制数据
import requests
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') # Change default encoding to utf8
r=requests.get('http://github.com/favicon.ico')
print(r.text)
print(r.content)
with open('favicon.ico','wb') as f:
f.write(r.content)
| 21 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e4bbc163e827717d01a6e031701959e688c3825 | 1,384 | py | Python | accounts/urls.py | code-goodbuy/Goodbuy | d23363a46988f65f121a6edb75609fdddaa95cde | [
"Unlicense"
] | 2 | 2019-03-20T20:30:16.000Z | 2019-04-10T19:54:32.000Z | accounts/urls.py | code-goodbuy/Goodbuy | d23363a46988f65f121a6edb75609fdddaa95cde | [
"Unlicense"
] | 30 | 2019-02-22T17:24:13.000Z | 2019-05-15T09:29:51.000Z | accounts/urls.py | code-goodbuy/Goodbuy | d23363a46988f65f121a6edb75609fdddaa95cde | [
"Unlicense"
] | 1 | 2019-04-23T08:59:34.000Z | 2019-04-23T08:59:34.000Z | from django.urls import path
from django.contrib.auth.views import (LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView)
from . import views as accounts_view
app_name = "accounts"
urlpatterns = [
path("login/", LoginView.as_view(
template_... | 30.755556 | 75 | 0.675578 | from django.urls import path
from django.contrib.auth.views import (
LoginView,
LogoutView,
PasswordResetView,
PasswordResetDoneView,
PasswordResetConfirmView,
PasswordResetCompleteView,
)
from . import views as accounts_view
app_name = "accounts"
urlpatterns = [
path("login/", LoginView... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0 |
9c7002bc41c3dd99694caeb90996c28b750837da | 1,902 | py | Python | src/leetcode_1855_maximum_distance_between_a_pair_of_values.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | 2 | 2020-12-08T13:59:10.000Z | 2021-05-01T05:07:39.000Z | src/leetcode_1855_maximum_distance_between_a_pair_of_values.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | null | null | null | src/leetcode_1855_maximum_distance_between_a_pair_of_values.py | yurirocha15/coding_practice | 952506932c47414da689454853ee745637413160 | [
"MIT"
] | 1 | 2021-05-02T17:42:02.000Z | 2021-05-02T17:42:02.000Z | # @l2g 1855 python3
# [1855] Maximum Distance Between a Pair of Values
# Difficulty: Medium
# https://leetcode.com/problems/maximum-distance-between-a-pair-of-values
#
# You are given two non-increasing 0-indexed integer arrays nums1 and nums2.
# A pair of indices (i,j),where 0 <= i < nums1.length and 0 <= j < nums2.le... | 27.565217 | 94 | 0.59674 | # @l2g 1855 python3
# [1855] Maximum Distance Between a Pair of Values
# Difficulty: Medium
# https://leetcode.com/problems/maximum-distance-between-a-pair-of-values
#
# You are given two non-increasing 0-indexed integer arrays nums1 and nums2.
# A pair of indices (i,j),where 0 <= i < nums1.length and 0 <= ... | 48 | 0 | 0 | 244 | 0 | 0 | 0 | 2 | 46 |
25f94d5d242c8c0f613c64c928201050f5cd7ff6 | 2,974 | py | Python | library/rabbitmq_cluster_name.py | joe-pll/rabbitmq-ansible-modules | e56ff0caa650c7417d32d39b7e6e961e8ce5e124 | [
"Apache-2.0"
] | null | null | null | library/rabbitmq_cluster_name.py | joe-pll/rabbitmq-ansible-modules | e56ff0caa650c7417d32d39b7e6e961e8ce5e124 | [
"Apache-2.0"
] | null | null | null | library/rabbitmq_cluster_name.py | joe-pll/rabbitmq-ansible-modules | e56ff0caa650c7417d32d39b7e6e961e8ce5e124 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# (c) 2017, Giuseppe Pellegrino <mr.giuseppepellegrino@gmail.com>
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: rabbitmq_cluster_name
short_description: Ensure RabbitMQ clust... | 27.284404 | 78 | 0.631809 | #!/usr/bin/python
# (c) 2017, Giuseppe Pellegrino <mr.giuseppepellegrino@gmail.com>
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: rabbitmq_cluster_name
short_description: Ensure RabbitMQ clust... | 0 | 0 | 0 | 1,218 | 0 | 0 | 0 | 28 | 68 |
6d01df67e09ff307a9d5974b925008cd3ba33686 | 253 | py | Python | ABC128/ABC128_B.py | consommee/AtCoder | 9beccf6a1202ca48491b4fcf748aa3dba0f12fb3 | [
"MIT"
] | null | null | null | ABC128/ABC128_B.py | consommee/AtCoder | 9beccf6a1202ca48491b4fcf748aa3dba0f12fb3 | [
"MIT"
] | null | null | null | ABC128/ABC128_B.py | consommee/AtCoder | 9beccf6a1202ca48491b4fcf748aa3dba0f12fb3 | [
"MIT"
] | null | null | null | n=int(input())
i = 1
alllist = []
while i < n+1 :
a,b=map(str, input().split())
c = [a ,int(b),i]
alllist.append(c)
i += 1
alllist.sort(key=lambda x:(x[0],-x[1]),reverse=True)
alllist.reverse()
j = 0
while j < n :
print(alllist[j][2])
j += 1 | 18.071429 | 52 | 0.561265 | n=int(input())
i = 1
alllist = []
while i < n+1 :
a,b=map(str, input().split())
c = [a ,int(b),i]
alllist.append(c)
i += 1
alllist.sort(key=lambda x:(x[0],-x[1]),reverse=True)
alllist.reverse()
j = 0
while j < n :
print(alllist[j][2])
j += 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f95203dd7abdb62cc8043fd36f44c38eecc29fb6 | 637 | py | Python | gis_timezones/models.py | marcosgabarda/-django-gis-timezones | fc580e8f519d54b68a66aaf436ac7c8e397b3a30 | [
"MIT"
] | 1 | 2020-07-25T05:25:58.000Z | 2020-07-25T05:25:58.000Z | gis_timezones/models.py | marcosgabarda/-django-gis-timezones | fc580e8f519d54b68a66aaf436ac7c8e397b3a30 | [
"MIT"
] | null | null | null | gis_timezones/models.py | marcosgabarda/-django-gis-timezones | fc580e8f519d54b68a66aaf436ac7c8e397b3a30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division, absolute_import
| 26.541667 | 82 | 0.766091 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division, absolute_import
from belt.models import GisTimeStampedModel
from django.contrib.gis.db import models
from django.utils.encoding import python_2_unicode_compatible
from gis_timezones.managers import TimeZoneManager
@python_2_u... | 0 | 306 | 0 | 0 | 0 | 0 | 0 | 110 | 113 |
0aaf9257a97d9a48b03bd4fd19203da735958968 | 11,731 | py | Python | StellarInfra/DirManage.py | StellarBlocks/StellarInfra | 7f6a826b248f0a076c6d0044580b1e2ba795ea90 | [
"MIT"
] | null | null | null | StellarInfra/DirManage.py | StellarBlocks/StellarInfra | 7f6a826b248f0a076c6d0044580b1e2ba795ea90 | [
"MIT"
] | null | null | null | StellarInfra/DirManage.py | StellarBlocks/StellarInfra | 7f6a826b248f0a076c6d0044580b1e2ba795ea90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 17 12:11:13 2020
@author: Jin Dou
"""
import os
import yaml
def isFolderOrFile(path:str):
'''
not exist 0
dir 1
file 2
others -1
'''
out = -1
if checkExists(path):
if os.path.isdir(path):
out = 1
elif os.path.i... | 31.034392 | 131 | 0.556815 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 17 12:11:13 2020
@author: Jin Dou
"""
import os
import warnings
from configparser import ConfigParser,BasicInterpolation
import yaml
import re
def getUpperDir(path:str):
out = os.path.split(path)
if isinstance(path, CPath):
return CPath(out[0]),out[1]
... | 0 | 308 | 0 | 8,926 | 228 | 1,200 | 0 | 17 | 565 |
81f493833c74efb3cfa812576c02c8ddfb1d2423 | 969 | py | Python | examples/groonga_microblog_tutorial/3_search_with_pyarrow.py | tetsuo-dance/poyonga | 33e407b172d1b9a1879beda26eaecee1ab0f07bf | [
"MIT"
] | 13 | 2015-03-20T02:48:25.000Z | 2021-05-23T22:33:39.000Z | examples/groonga_microblog_tutorial/3_search_with_pyarrow.py | tetsuo-dance/poyonga | 33e407b172d1b9a1879beda26eaecee1ab0f07bf | [
"MIT"
] | 9 | 2015-10-27T06:25:34.000Z | 2021-07-01T12:58:19.000Z | examples/groonga_microblog_tutorial/3_search_with_pyarrow.py | tetsuo-dance/poyonga | 33e407b172d1b9a1879beda26eaecee1ab0f07bf | [
"MIT"
] | 7 | 2015-12-13T23:33:20.000Z | 2020-11-27T10:18:29.000Z | # coding: utf-8
from poyonga import Groonga
g = Groonga()
_call_with_apachearrow(
g,
"select",
table="Users",
match_columns="name,location_str,description",
query="",
output_type="apache-arrow",
output_columns="_key,name",
)
# NOTE: Groonga's Apache Arrow output doesn't support drilldow... | 23.071429 | 68 | 0.640867 | # coding: utf-8
from poyonga import Groonga
def _call_with_apachearrow(g, cmd, **kwargs):
print("[http with apache arrow response]")
ret = g.call(cmd, **kwargs)
print("status:", ret.status)
if cmd == "select":
print("item:", len(ret.items))
print(type(ret.items))
for item in re... | 6 | 0 | 0 | 0 | 0 | 345 | 0 | 0 | 23 |
24db0571e3f944c80c8664387bc35198e5049c87 | 1,237 | py | Python | string/151_reverse_words_in_a_string.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | string/151_reverse_words_in_a_string.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | string/151_reverse_words_in_a_string.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z |
solver = Solution()
print(solver.reverseWords2("the sky is blue")) | 30.170732 | 106 | 0.408246 | class Solution(object):
def reverseWords(self, s):
"""
:type s: str
:rtype: str
"""
if s == " ":
return ""
s = list(s[::-1])
print(len(s))
l, r = 0, 0
while r < len(s) + 1:
# the two condition must not be reversed, or t... | 0 | 0 | 0 | 1,148 | 0 | 0 | 0 | 0 | 22 |
085a4a6221880db28f0236317d1d479008607ac0 | 1,612 | py | Python | vit_jax/models_resnet.py | Kasumigaoka-Utaha/self-copy-and-modify-about-the-vision-transformer | 1b840336809171d181ffa80d15955fb03ed29859 | [
"Apache-2.0"
] | 1 | 2022-02-12T15:15:36.000Z | 2022-02-12T15:15:36.000Z | vit_jax/models_resnet.py | Thanusan19/Vision_Transformer | 80179d57e617ef6cd9599de93c7c7633f891f9a9 | [
"Apache-2.0"
] | null | null | null | vit_jax/models_resnet.py | Thanusan19/Vision_Transformer | 80179d57e617ef6cd9599de93c7c7633f891f9a9 | [
"Apache-2.0"
] | 1 | 2022-02-25T06:26:28.000Z | 2022-02-25T06:26:28.000Z | import flax.nn as nn
import jax.numpy as jnp
def weight_standardize(w, axis, eps):
"""Subtracts mean and divides by standard deviation."""
w = w - jnp.mean(w, axis=axis)
w = w / (jnp.std(w, axis=axis) + eps)
return w
| 29.309091 | 73 | 0.616625 | import flax.nn as nn
import jax.numpy as jnp
def weight_standardize(w, axis, eps):
"""Subtracts mean and divides by standard deviation."""
w = w - jnp.mean(w, axis=axis)
w = w / (jnp.std(w, axis=axis) + eps)
return w
class StdConv(nn.Conv):
"""Convolution with weight standardization."""
def param(self,... | 0 | 0 | 0 | 1,313 | 0 | 0 | 0 | 0 | 69 |
73591285f67afce9f59507bc71a39e5da837a863 | 136 | py | Python | encapsulation/car.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | encapsulation/car.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | encapsulation/car.py | poojavaibhavsahu/Pooja_Python | 58122bfa8586883145042b11fe1cc013c803ab4f | [
"bzip2-1.0.6"
] | null | null | null | obj=car()
obj .speed=200
obj.display() | 19.428571 | 44 | 0.654412 | class car:
__speed__ =100
def display(self):
print("speed of car",self.__speed__)
obj=car()
obj .speed=200
obj.display() | 0 | 0 | 0 | 76 | 0 | 0 | 0 | 0 | 22 |
15a1eecee086417b55c500d87f7d87751188e2ed | 2,195 | py | Python | tuning/competition/mnist_keras_dnn.py | tobegit3hub/tuning_game | 92e01e24c01793dc60b227c9894da865aa1040f4 | [
"Apache-2.0"
] | 14 | 2017-12-27T12:04:16.000Z | 2021-06-21T09:57:30.000Z | tuning/competition/mnist_keras_dnn.py | tobegit3hub/tuning_game | 92e01e24c01793dc60b227c9894da865aa1040f4 | [
"Apache-2.0"
] | null | null | null | tuning/competition/mnist_keras_dnn.py | tobegit3hub/tuning_game | 92e01e24c01793dc60b227c9894da865aa1040f4 | [
"Apache-2.0"
] | 2 | 2018-01-09T03:30:22.000Z | 2018-04-23T03:32:45.000Z | from __future__ import print_function
| 28.141026 | 76 | 0.692938 | from __future__ import print_function
import json
import keras
from keras.datasets import mnist
from keras.layers import Dense, Dropout
from keras.models import Sequential
from keras.optimizers import RMSprop
from abstract_competition import AbstractCompetition
class MnistKerasDnn(AbstractCompetition):
"""
Dee... | 0 | 0 | 0 | 1,906 | 0 | 0 | 0 | 70 | 180 |
95a96145bde02fa3b55735765033920212a330bf | 222 | py | Python | vsparsedvd/__init__.py | Setsugennoao/vs-parsedvd | fe89ff51b85758dca32e73b3c884acfccf583451 | [
"MIT"
] | 2 | 2021-12-06T05:48:14.000Z | 2022-02-10T09:17:18.000Z | vsparsedvd/__init__.py | Setsugennoao/vs-parsedvd | fe89ff51b85758dca32e73b3c884acfccf583451 | [
"MIT"
] | null | null | null | vsparsedvd/__init__.py | Setsugennoao/vs-parsedvd | fe89ff51b85758dca32e73b3c884acfccf583451 | [
"MIT"
] | null | null | null | # flake8: noqa: F401 | 22.2 | 65 | 0.788288 | # flake8: noqa: F401
from .IsoFile import IsoFile
from .DVDIndexers import DVDIndexer, D2VWitch, DGIndexNV, DGIndex
from .dataclasses import *
from .utils.spathlib import SPath
from .utils import spathlib, types, utils | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 114 |
52bc30a6348d74531277198eb3330d2e5ce8c0ce | 6,748 | py | Python | desktop/mode.py | ccamacho89/caliban | 81f42273cb583d5cb655b510bef7fc597033f517 | [
"Apache-2.0"
] | null | null | null | desktop/mode.py | ccamacho89/caliban | 81f42273cb583d5cb655b510bef7fc597033f517 | [
"Apache-2.0"
] | null | null | null | desktop/mode.py | ccamacho89/caliban | 81f42273cb583d5cb655b510bef7fc597033f517 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 40.89697 | 102 | 0.538382 | # Copyright 2018-2019 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 0 | 34 | 0 | 5,409 | 0 | 0 | 0 | 0 | 22 |
bef1915ffdf4767d2b726b6ee21f33d44a323b47 | 1,890 | py | Python | supervised-learning/Logistic_Regression_Cat.py | neemiasbsilva/machine-learning-algorithm | cecb7bd387148ea98a826c6f39f7d014061b797f | [
"MIT"
] | 2 | 2021-04-18T22:11:39.000Z | 2021-10-05T03:47:01.000Z | supervised-learning/Logistic_Regression_Cat.py | hamzaelanssari/machine-learning-algorithm | c9c02242c114160141183470ac1bb97cb926fde0 | [
"MIT"
] | null | null | null | supervised-learning/Logistic_Regression_Cat.py | hamzaelanssari/machine-learning-algorithm | c9c02242c114160141183470ac1bb97cb926fde0 | [
"MIT"
] | 2 | 2020-01-30T02:02:01.000Z | 2021-02-04T21:25:35.000Z | import numpy as np
# from utils import salva_imagem_com_predicao
X = []
y = []
arquivos_de_gatos = "train/cat/"
arquivos_nao_gatos = "train/noncat/"
get_dataset(arquivos_de_gatos)
get_dataset(arquivos_nao_gatos, False)
X = np.asarray(X)
Y = np.asarray(y)
print(X.shape)
print(Y.shape)
m, n = X.shape
X = X/255
... | 21.976744 | 59 | 0.631746 | import cv2
import glob
import numpy as np
# from utils import salva_imagem_com_predicao
import pandas as pd
import matplotlib.pyplot as plt
from skimage import transform
from PIL import Image
import os
X = []
y = []
def get_dataset(path_image, Cat=True):
images = glob.glob(path_image+"*.png")
for image in im... | 0 | 0 | 0 | 0 | 0 | 636 | 0 | -17 | 291 |
a7258a219d17a24b1450485157cf7842ae7f6dea | 32 | py | Python | user_login.py | mr-mdl/football | 0d495ce30bb4ff2c438f3577d5dd767fe56555a6 | [
"Apache-2.0"
] | null | null | null | user_login.py | mr-mdl/football | 0d495ce30bb4ff2c438f3577d5dd767fe56555a6 | [
"Apache-2.0"
] | null | null | null | user_login.py | mr-mdl/football | 0d495ce30bb4ff2c438f3577d5dd767fe56555a6 | [
"Apache-2.0"
] | null | null | null | Mein neuer Code
neue Codezeile
| 8 | 15 | 0.8125 | Mein neuer Code
neue Codezeile
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
771a8015d3522a9d5cbbbabbc279cbb92e497d16 | 730 | py | Python | coding/learn_algorithm/leetcode/1371_find_long_substring.py | yatao91/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | 3 | 2021-05-25T16:58:52.000Z | 2022-02-05T09:37:17.000Z | coding/learn_algorithm/leetcode/1371_find_long_substring.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | coding/learn_algorithm/leetcode/1371_find_long_substring.py | yataosu/learning_road | e88dc43de98e35922bfc71c222ec71766851e618 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
leetcode:1371.
"""
| 24.333333 | 53 | 0.360274 | # -*- coding: UTF-8 -*-
"""
leetcode:1371.每个元音包含偶数次的最长子字符串
"""
class Solution:
def findTheLongestSubstring(self, s: str) -> int:
ans, status, n = 0, 0, len(s)
pos = [-1] * (1 << 5)
pos[0] = 0
for i in range(n):
if s[i] == 'hardware':
status ^= 1 << 0
... | 48 | 0 | 0 | 643 | 0 | 0 | 0 | 0 | 23 |
a66b2955dbd07a54d2ffac2a61ca8715a84951ed | 25,705 | py | Python | time_allocations/allocations.py | gthomsen/time-allocations | 672712fc43f8a83214e6bcee9d8aaf25cc143d1c | [
"MIT"
] | null | null | null | time_allocations/allocations.py | gthomsen/time-allocations | 672712fc43f8a83214e6bcee9d8aaf25cc143d1c | [
"MIT"
] | null | null | null | time_allocations/allocations.py | gthomsen/time-allocations | 672712fc43f8a83214e6bcee9d8aaf25cc143d1c | [
"MIT"
] | 1 | 2019-04-16T04:51:05.000Z | 2019-04-16T04:51:05.000Z | from __future__ import print_function
STRING_INPUT_LABEL = "(string)"
| 39.485407 | 158 | 0.569306 | from __future__ import print_function
import re
import sys
STRING_INPUT_LABEL = "(string)"
class AllocationsConfig( object ):
"""
"""
def __init__( self, default_year=None, strict_parsing=False, validate_dates=True ):
"""
"""
self._default_year = default_year
self._str... | 0 | 0 | 0 | 25,566 | 0 | 0 | 0 | -23 | 91 |
e8a52667d74666ef4ea46be720112454d6154fd7 | 89 | py | Python | app.py | youssoufCherif/pentago | 0206c663ad2084e2bc93125e3af5deb0a4b4ed29 | [
"MIT"
] | null | null | null | app.py | youssoufCherif/pentago | 0206c663ad2084e2bc93125e3af5deb0a4b4ed29 | [
"MIT"
] | null | null | null | app.py | youssoufCherif/pentago | 0206c663ad2084e2bc93125e3af5deb0a4b4ed29 | [
"MIT"
] | null | null | null | from modules.pentgoGUI import play
# Lancer le jeu Pentago en interface graphique
play() | 22.25 | 46 | 0.808989 | from modules.pentgoGUI import play
# Lancer le jeu Pentago en interface graphique
play() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fbf3a1401585a69e62a26935aacb6cf004f773e0 | 4,770 | py | Python | samples/fcd_attach_vdisk_to_vm.py | jm66/pyvmomi-community-samples | 5ca4a50b767500e07b9bce9fba70240bfa963a4e | [
"Apache-2.0"
] | 4 | 2016-01-04T06:19:56.000Z | 2018-09-09T01:03:07.000Z | samples/fcd_attach_vdisk_to_vm.py | zhangjiahaol/pyvmomi-community-samples | 905ec34edfbd151531832e98b6a0748fa6ff5e0e | [
"Apache-2.0"
] | 12 | 2019-04-17T02:47:25.000Z | 2021-04-02T09:15:37.000Z | samples/fcd_attach_vdisk_to_vm.py | zhangjiahaol/pyvmomi-community-samples | 905ec34edfbd151531832e98b6a0748fa6ff5e0e | [
"Apache-2.0"
] | 15 | 2018-04-26T05:18:12.000Z | 2021-11-06T04:44:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: carceneaux@thinksis.com
# Website: http://arsano.ninja
#
# Note: Example code For testing purposes only
#
# This code has been released under the terms of the Apache-2.0 license
# http://opensou... | 31.176471 | 78 | 0.590147 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: carceneaux@thinksis.com
# Website: http://arsano.ninja
#
# Note: Example code For testing purposes only
#
# This code has been released under the terms of the Apache-2.0 license
# http://opensou... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a356be645302e9ec8714f28265c73353177a5f43 | 3,153 | py | Python | problem/breadcrumb/cluster.py | jhanley634/testing-tools | 3f3f8a34df53015347e1e1cc37d20c8d03652cad | [
"MIT"
] | null | null | null | problem/breadcrumb/cluster.py | jhanley634/testing-tools | 3f3f8a34df53015347e1e1cc37d20c8d03652cad | [
"MIT"
] | 3 | 2020-09-07T17:24:36.000Z | 2020-09-08T17:37:33.000Z | problem/breadcrumb/cluster.py | jhanley634/testing-tools | 3f3f8a34df53015347e1e1cc37d20c8d03652cad | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Copyright 2017 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... | 32.173469 | 78 | 0.680622 | #! /usr/bin/env python3
# Copyright 2017 John Hanley.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, m... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1cd873557929da99dc8e724637af66077f1dbafa | 190,463 | py | Python | src/sage/combinat/root_system/root_lattice_realizations.py | LaisRast/sage | 5fb2a6ea44400e469caee82748cf863ca0c5f724 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/root_system/root_lattice_realizations.py | LaisRast/sage | 5fb2a6ea44400e469caee82748cf863ca0c5f724 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/root_system/root_lattice_realizations.py | LaisRast/sage | 5fb2a6ea44400e469caee82748cf863ca0c5f724 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Root lattice realizations
"""
# ****************************************************************************
# Copyright (C) 2007-2013 Nicolas M. Thiery <nthiery at users.sf.net>
# 2012 Nicolas Borie <nicolas.borie at univ-mlv.fr>
#
# (with contributions... | 42.156485 | 189 | 0.501221 | # -*- coding: utf-8 -*-
"""
Root lattice realizations
"""
# ****************************************************************************
# Copyright (C) 2007-2013 Nicolas M. Thiery <nthiery at users.sf.net>
# 2012 Nicolas Borie <nicolas.borie at univ-mlv.fr>
#
# (with contributions... | 0 | 39,067 | 0 | 149,904 | 0 | 0 | 0 | 554 | 398 |
fab42f8cde5a80d634dd3c1fd214d8f81e40f8ab | 1,886 | py | Python | src/srcom/runs.py | randomidiot13/speedrunbot-plusplus | 2eb1251a2f71f1063c183bd07313eb3f291f6590 | [
"Unlicense"
] | null | null | null | src/srcom/runs.py | randomidiot13/speedrunbot-plusplus | 2eb1251a2f71f1063c183bd07313eb3f291f6590 | [
"Unlicense"
] | null | null | null | src/srcom/runs.py | randomidiot13/speedrunbot-plusplus | 2eb1251a2f71f1063c183bd07313eb3f291f6590 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3.9
"""
This program gets the number of runs that a given player (argv[1]) has set.
"""
from sys import exit
if __name__ == "__main__":
RET: int = main()
exit(RET)
| 23 | 75 | 0.673383 | #!/usr/bin/env python3.9
"""
This program gets the number of runs that a given player (argv[1]) has set.
"""
import asyncio
import concurrent.futures
from asyncio.events import AbstractEventLoop
from itertools import count
from sys import argv, exit, stderr
from typing import Awaitable, Iterator
import requests
from... | 0 | 0 | 1,084 | 0 | 0 | 359 | 0 | 49 | 202 |
5b4bb7221da5589df7d355d411101be50f69d412 | 1,725 | py | Python | serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio/model_handler.py | arthurtibame/cvat | 0062ecdec34a9ffcad33e1664a7cac663bec4ecf | [
"MIT"
] | 1 | 2020-02-26T08:49:18.000Z | 2020-02-26T08:49:18.000Z | serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio/model_handler.py | arthurtibame/cvat | 0062ecdec34a9ffcad33e1664a7cac663bec4ecf | [
"MIT"
] | 23 | 2021-04-08T21:58:10.000Z | 2022-03-12T00:52:31.000Z | serverless/openvino/omz/intel/semantic-segmentation-adas-0001/nuclio/model_handler.py | arthurtibame/cvat | 0062ecdec34a9ffcad33e1664a7cac663bec4ecf | [
"MIT"
] | 1 | 2021-11-09T14:50:57.000Z | 2021-11-09T14:50:57.000Z | # Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT | 34.5 | 84 | 0.590145 | # Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
import os
import cv2
import numpy as np
from skimage.measure import approximate_polygon, find_contours
from model_loader import ModelLoader
class ModelHandler:
def __init__(self, labels):
base_dir = os.environ.get("MODEL_PATH",
... | 0 | 0 | 0 | 1,490 | 0 | 0 | 0 | 30 | 134 |
70e139f6b158895b6866651927fc687c7ba78f89 | 7,512 | py | Python | tests/common/test_run/conv_backprop_input_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/common/test_run/conv_backprop_input_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/common/test_run/conv_backprop_input_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 40.605405 | 173 | 0.615282 | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 0 | 0 | 6,498 | 0 | 123 | 284 |
786321aaaab4d3431300482a98fa614df7a00269 | 3,886 | py | Python | boring/wsgi.py | Horlarwumhe/boring | 40fd36f403d869dd5c41e07ce94c3d71fd47d62c | [
"MIT"
] | 1 | 2021-01-29T07:41:00.000Z | 2021-01-29T07:41:00.000Z | boring/wsgi.py | Horlarwumhe/boring | 40fd36f403d869dd5c41e07ce94c3d71fd47d62c | [
"MIT"
] | null | null | null | boring/wsgi.py | Horlarwumhe/boring | 40fd36f403d869dd5c41e07ce94c3d71fd47d62c | [
"MIT"
] | null | null | null |
def getapp(app):
''' get wsgi callable object'''
try:
module, func = app.split(":")
except (ValueError, TypeError):
module, func = app, "application"
return module, func
| 31.088 | 79 | 0.576943 | import importlib
import os
import socket
import sys
import traceback
from boring import SERVER_SOFTWARE
from boring.exception import HttpException
from boring.http import Response
from boring.middleware import StaticsHandler
class WsgiApp:
def __init__(self, app, request, conn, log=None, server=None, config=None... | 0 | 0 | 0 | 2,739 | 0 | 645 | 0 | 27 | 268 |
1971a6f9561d1ac66180ee3b48c24e1af637e7ab | 751 | py | Python | celery_connectors/build_ssl_options.py | jay-johnson/celery-connectors | f6d48bf3e48513228a86a1ff6014b6e6cf465742 | [
"Apache-2.0"
] | 38 | 2017-12-03T21:02:08.000Z | 2022-03-02T21:20:50.000Z | celery_connectors/build_ssl_options.py | jay-johnson/celery-connectors | f6d48bf3e48513228a86a1ff6014b6e6cf465742 | [
"Apache-2.0"
] | null | null | null | celery_connectors/build_ssl_options.py | jay-johnson/celery-connectors | f6d48bf3e48513228a86a1ff6014b6e6cf465742 | [
"Apache-2.0"
] | 7 | 2019-03-18T00:17:38.000Z | 2021-06-16T02:18:37.000Z |
# end of build_ssl_options
| 27.814815 | 62 | 0.631158 | import ssl
from celery_connectors.utils import ev
def build_ssl_options(ca_cert="",
keyfile="",
certfile="",
ssl_required="0"):
use_ca_certs = ev("SSL_CA_CERT", ca_cert)
use_keyfile = ev("SSL_KEYFILE", keyfile)
use_certfile = ev("SSL_CERTF... | 0 | 0 | 0 | 0 | 0 | 650 | 0 | 6 | 67 |
6fd3b280e0dd6d83d0164323924ec133000dd12d | 9,001 | py | Python | rnachipintegrator/xls_output.py | fls-bioinformatics-core/RnaChipIntegrator | d02aa34459a7dc4ab0c7955d295af1c939545526 | [
"Artistic-2.0"
] | null | null | null | rnachipintegrator/xls_output.py | fls-bioinformatics-core/RnaChipIntegrator | d02aa34459a7dc4ab0c7955d295af1c939545526 | [
"Artistic-2.0"
] | 42 | 2015-09-02T15:42:27.000Z | 2020-01-06T13:30:09.000Z | rnachipintegrator/xls_output.py | fls-bioinformatics-core/RnaChipIntegrator | d02aa34459a7dc4ab0c7955d295af1c939545526 | [
"Artistic-2.0"
] | 1 | 2019-07-29T02:50:47.000Z | 2019-07-29T02:50:47.000Z | #!/bin/env python
#
# xls_output.py: functions for writing analysis results to Excel files
# Copyright (C) University of Manchester 2015-2019 Peter Briggs, Leo Zeef
# & Ian Donaldson
#
"""
xls_output.py
Functions for outputting analysis results to XLSX spreadsheet
"""
import re
# Regular expressions for ... | 31.582456 | 81 | 0.523053 | #!/bin/env python
#
# xls_output.py: functions for writing analysis results to Excel files
# Copyright (C) University of Manchester 2015-2019 Peter Briggs, Leo Zeef
# & Ian Donaldson
#
"""
xls_output.py
Functions for outputting analysis results to XLSX spreadsheet
"""
import datetime
import xlsxwriter
imp... | 0 | 118 | 0 | 7,783 | 0 | 0 | 0 | -25 | 133 |
f9536233dbccdd441a1a4ba6ed5a894dbe6c0a2a | 979 | py | Python | src/setup.py | GML22/GeocoderPL | b9dbb5e42695272c2b2cdfa9bf3ea540ab559207 | [
"MIT"
] | null | null | null | src/setup.py | GML22/GeocoderPL | b9dbb5e42695272c2b2cdfa9bf3ea540ab559207 | [
"MIT"
] | null | null | null | src/setup.py | GML22/GeocoderPL | b9dbb5e42695272c2b2cdfa9bf3ea540ab559207 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='geocoderpl',
version='1.1',
description='GeocoderPL is an application written in Python, which can be used for geocoding address points in ' +
'Poland along with the possibility to display basic information about a given address point and the ' +
... | 51.526316 | 119 | 0.679265 | from setuptools import setup
setup(
name='geocoderpl',
version='1.1',
description='GeocoderPL is an application written in Python, which can be used for geocoding address points in ' +
'Poland along with the possibility to display basic information about a given address point and the ' +
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
586ac15985ab49f0a2bf56bd8fb82d99403b0429 | 497 | py | Python | back/models/city.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | null | null | null | back/models/city.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | null | null | null | back/models/city.py | Bash-Air/bashair | 76d07c0cca9323f5089d0c49450470bde887c4ea | [
"MIT"
] | 1 | 2022-02-14T11:27:50.000Z | 2022-02-14T11:27:50.000Z | from cities_light.receivers import connect_default_signals
connect_default_signals(City)
| 19.88 | 107 | 0.820926 | from django.contrib.auth.models import User
from django.db import models
from django_extensions.db.models import TimeStampedModel
from cities_light.abstract_models import (AbstractCity, AbstractRegion, AbstractCountry, AbstractSubRegion)
from cities_light.receivers import connect_default_signals
class Country(Abstrac... | 0 | 0 | 0 | 72 | 0 | 0 | 0 | 150 | 180 |
7331fd68e65954991a8f4848669ad0b536e3be4f | 639 | py | Python | setup.py | evhub/kapre | 5780bcccaf03c100863e8868ae213c1c39d5db8a | [
"MIT"
] | null | null | null | setup.py | evhub/kapre | 5780bcccaf03c100863e8868ae213c1c39d5db8a | [
"MIT"
] | null | null | null | setup.py | evhub/kapre | 5780bcccaf03c100863e8868ae213c1c39d5db8a | [
"MIT"
] | 1 | 2019-11-20T04:42:13.000Z | 2019-11-20T04:42:13.000Z | from setuptools import setup
setup(name='kapre',
version='0.1.2.1',
description='Kapre: Keras Audio Preprocessors. Keras layers for audio pre-processing in deep learning',
author='Keunwoo Choi',
url='http://github.com/keunwoo/kapre/',
download_url='http://github.com/keunwoochoi/kapre/rele... | 30.428571 | 109 | 0.600939 | from setuptools import setup
setup(name='kapre',
version='0.1.2.1',
description='Kapre: Keras Audio Preprocessors. Keras layers for audio pre-processing in deep learning',
author='Keunwoo Choi',
url='http://github.com/keunwoo/kapre/',
download_url='http://github.com/keunwoochoi/kapre/rele... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3745ad56745cceebde5c6d3c10cd42a8a39d448e | 128,441 | py | Python | dataset/id_to_label_3.py | rskmoi/landmark-retrieval-2020-with-pytorch | 41917b1f588b5ad396cb1095867a0f042c611675 | [
"MIT"
] | 1 | 2020-09-08T08:48:25.000Z | 2020-09-08T08:48:25.000Z | dataset/id_to_label_3.py | rskmoi/landmark-retrieval-2020-with-pytorch | 41917b1f588b5ad396cb1095867a0f042c611675 | [
"MIT"
] | null | null | null | dataset/id_to_label_3.py | rskmoi/landmark-retrieval-2020-with-pytorch | 41917b1f588b5ad396cb1095867a0f042c611675 | [
"MIT"
] | null | null | null | ID_TO_LABEL = \
{'100028': 0,
'100082': 1,
'100167': 2,
'100191': 3,
'100192': 4,
'100207': 5,
'10022': 6,
'100230': 7,
'100280': 8,
'100338': 9,
'100363': 10,
'100372': 11,
'100407': 12,
'100474': 13,
'100484': 14,
'100485': 15,
'10050... | 20.278023 | 20 | 0.457673 | ID_TO_LABEL = \
{'100028': 0,
'100082': 1,
'100167': 2,
'100191': 3,
'100192': 4,
'100207': 5,
'10022': 6,
'100230': 7,
'100280': 8,
'100338': 9,
'100363': 10,
'100372': 11,
'100407': 12,
'100474': 13,
'100484': 14,
'100485': 15,
'10050... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e7949e7fe99877edba5e11aaaf3f0b7445b4aaf2 | 2,238 | py | Python | modules/text/text_to_knowledge/nptag/module.py | AK391/PaddleHub | a51ab7447e089776766becb3297e560dfed98573 | [
"Apache-2.0"
] | 8,360 | 2019-01-18T10:46:45.000Z | 2022-03-31T14:50:02.000Z | modules/text/text_to_knowledge/nptag/module.py | AK391/PaddleHub | a51ab7447e089776766becb3297e560dfed98573 | [
"Apache-2.0"
] | 1,158 | 2019-04-11T09:22:43.000Z | 2022-03-31T12:12:09.000Z | modules/text/text_to_knowledge/nptag/module.py | AK391/PaddleHub | a51ab7447e089776766becb3297e560dfed98573 | [
"Apache-2.0"
] | 1,677 | 2019-04-09T15:07:40.000Z | 2022-03-31T06:41:10.000Z | # -*- coding:utf-8 -*-
| 30.657534 | 135 | 0.5563 | # -*- coding:utf-8 -*-
import os
import argparse
import paddle
import paddlehub as hub
from paddlehub.module.module import serving, moduleinfo, runnable
from paddlenlp import Taskflow
@moduleinfo(
name="nptag",
version="1.0.0",
summary="",
author="Baidu",
author_email="",
type="nlp/text_to_kn... | 0 | 2,029 | 0 | 0 | 0 | 0 | 0 | 29 | 156 |
df7c3c299e778864f95e22ecb6986012ee2e1106 | 362 | py | Python | fibonacci/fib-generator.py | alejandrosocorro/pytudes | 2498957d2d0c4d26fdbe1f50429e1aef51b92eee | [
"MIT"
] | 1 | 2020-02-23T13:11:41.000Z | 2020-02-23T13:11:41.000Z | fibonacci/fib-generator.py | alejandrosocorro/pyprog | 2498957d2d0c4d26fdbe1f50429e1aef51b92eee | [
"MIT"
] | null | null | null | fibonacci/fib-generator.py | alejandrosocorro/pyprog | 2498957d2d0c4d26fdbe1f50429e1aef51b92eee | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
for i in fib(50):
print(i)
| 18.1 | 46 | 0.535912 | from typing import Generator
def fib(n: int) -> Generator[int, None, None]:
yield 0 # special case
if n > 0:
yield 1 # special case
last: int = 0 # fib(0)
next: int = 1 # fib(1)
for _ in range(1, n):
last, next = next, last + next
yield next
if __name__ == "__main__... | 0 | 0 | 0 | 0 | 241 | 0 | 0 | 7 | 45 |
2c4ae23879585f5fc317fd41016fc5d4c0536f77 | 4,793 | py | Python | scripts/test/m2py.py | architectureofthings/openmeta-vahana | 81f7590765ccf8b14b6dea5473be6cefb0677284 | [
"MIT"
] | 11 | 2018-04-18T02:53:29.000Z | 2021-11-06T00:53:51.000Z | scripts/test/m2py.py | architectureofthings/openmeta-vahana | 81f7590765ccf8b14b6dea5473be6cefb0677284 | [
"MIT"
] | 2 | 2017-11-14T21:18:34.000Z | 2017-11-15T16:04:36.000Z | scripts/test/m2py.py | metamorph-inc/openmeta-vahana | f526f5ad36f735ebf719fd0489e6a707523e1f74 | [
"MIT"
] | 10 | 2018-01-17T01:28:00.000Z | 2021-01-24T05:08:00.000Z | # author: tthomas@metamorphsoftware.com
# date: 2017-06-05
# description: automations script for converting '.m' files to python wrappers
import re
import glob
if __name__ == '__main__':
component_name = ""
params_orig = list()
params_new = list()
unknowns_orig = list()
unknowns_new = list()
... | 43.18018 | 98 | 0.402462 | # author: tthomas@metamorphsoftware.com
# date: 2017-06-05
# description: automations script for converting '.m' files to python wrappers
import re
import glob
if __name__ == '__main__':
component_name = ""
params_orig = list()
params_new = list()
unknowns_orig = list()
unknowns_new = list()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a60c5462ab0b35947bc188d0278b606cb2e96f4b | 3,921 | py | Python | main.py | Arnzero/QTMiniPlayer | 20821615371d9c510f8e95c47a53b58bc05cbe2d | [
"Apache-2.0"
] | null | null | null | main.py | Arnzero/QTMiniPlayer | 20821615371d9c510f8e95c47a53b58bc05cbe2d | [
"Apache-2.0"
] | null | null | null | main.py | Arnzero/QTMiniPlayer | 20821615371d9c510f8e95c47a53b58bc05cbe2d | [
"Apache-2.0"
] | null | null | null | import sys
from PySide2.QtWidgets import QApplication
if __name__ == '__main__':
app = QApplication(sys.argv)
main_window = MainWindow('MainWindow.ui')
sys.exit(app.exec_())
| 34.095652 | 128 | 0.690895 | import sys, os
from PySide2.QtUiTools import QUiLoader #allows us to import .ui files
from PySide2.QtWidgets import QApplication, QLineEdit, QPushButton, QFileDialog, QAction, QSlider, QMouseEventTransition, QLabel
from PySide2.QtCore import QFile, QObject, QUrl
from PySide2.QtMultimedia import QMediaPlayer
from PySide... | 0 | 0 | 0 | 3,417 | 0 | 0 | 0 | 170 | 142 |
50d3cf150be3a823530fd3b4513c40cdb80789c1 | 8,532 | py | Python | RL/agents/exp_buff_agent_old.py | bhatiaabhinav/RL-v2 | 38322aac7d1dcb1f9e86dd32bc1d861d143dcd7a | [
"MIT"
] | 4 | 2021-01-14T02:32:37.000Z | 2022-02-20T19:36:51.000Z | RL/agents/exp_buff_agent_old.py | bhatiaabhinav/RL-v2 | 38322aac7d1dcb1f9e86dd32bc1d861d143dcd7a | [
"MIT"
] | 3 | 2020-08-15T13:46:00.000Z | 2021-06-08T21:58:42.000Z | RL/agents/exp_buff_agent_old.py | bhatiaabhinav/RL-v2 | 38322aac7d1dcb1f9e86dd32bc1d861d143dcd7a | [
"MIT"
] | 1 | 2020-09-16T05:50:34.000Z | 2020-09-16T05:50:34.000Z | import logging
ids = 0
logger = logging.getLogger(__name__)
ldebug = logger.isEnabledFor(logging.DEBUG)
| 43.090909 | 299 | 0.616503 | from RL.utils.util_fns import update_mean_std
import logging
import sys
from typing import List
import numpy as np
import RL
ids = 0
logger = logging.getLogger(__name__)
ldebug = logger.isEnabledFor(logging.DEBUG)
class Experience:
def __init__(self, state, action, reward, done, info, next_state, cost=0):
... | 0 | 101 | 0 | 8,142 | 0 | 0 | 0 | 0 | 181 |
42f1e8ffb20a9a0b6271cb45e7258d171c7510fc | 4,012 | py | Python | stats_transcriptomic_type_ephys.py | danielmk/PatchSeq | cc623e58697a2f1545268e08716e1f7719e237aa | [
"MIT"
] | 1 | 2022-01-23T21:11:46.000Z | 2022-01-23T21:11:46.000Z | stats_transcriptomic_type_ephys.py | danielmk/PatchSeq | cc623e58697a2f1545268e08716e1f7719e237aa | [
"MIT"
] | null | null | null | stats_transcriptomic_type_ephys.py | danielmk/PatchSeq | cc623e58697a2f1545268e08716e1f7719e237aa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Do statistics on the transcriptomic type and plot low-dimensional
embeddings.
"""
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
from scipy.stats import ranksums
plt.rcParams["svg.fonttype"] = "none"
sns.set(
context="paper",
style="ticks",
... | 24.919255 | 75 | 0.632851 | # -*- coding: utf-8 -*-
"""
Do statistics on the transcriptomic type and plot low-dimensional
embeddings.
"""
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
from scipy.stats import ranksums
plt.rcParams["svg.fonttype"] = "none"
sns.set(
context="paper",
style="ticks",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
45d6c63043c46af04bbae64124b9d0cdad4eb02a | 8,888 | py | Python | src/apex/cli.py | Syncleus/apex | 99ab661f0993fcee8064578b6a6020f5b742d75f | [
"Apache-2.0"
] | 13 | 2016-03-23T09:35:13.000Z | 2019-09-23T09:39:37.000Z | src/apex/cli.py | freemo/apex | 99ab661f0993fcee8064578b6a6020f5b742d75f | [
"Apache-2.0"
] | 31 | 2016-09-21T10:29:36.000Z | 2016-09-30T12:11:28.000Z | src/apex/cli.py | freemo/apex | 99ab661f0993fcee8064578b6a6020f5b742d75f | [
"Apache-2.0"
] | 5 | 2016-03-27T21:32:09.000Z | 2022-01-13T17:04:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -mapex` pyt... | 38.145923 | 137 | 0.650428 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -mapex` pyt... | 0 | 1,927 | 0 | 0 | 0 | 5,107 | 0 | 66 | 381 |
aca95e0e54e5ca1a68e0599cbacc7db0b39e9970 | 6,934 | py | Python | jsb/plugs/common/topic.py | NURDspace/jsonbot | 400dce602700a93db80e10707c3785a0fbdfaaeb | [
"MIT"
] | 1 | 2019-04-12T12:20:12.000Z | 2019-04-12T12:20:12.000Z | jsb/plugs/common/topic.py | Petraea/jsonbot | 04a3a0c586a8a1a3b0e5316d10cda16df9be415b | [
"MIT"
] | null | null | null | jsb/plugs/common/topic.py | Petraea/jsonbot | 04a3a0c586a8a1a3b0e5316d10cda16df9be415b | [
"MIT"
] | 1 | 2020-05-06T18:46:53.000Z | 2020-05-06T18:46:53.000Z | # jsb/plugs/core/topic.py
#
#
""" manage topics. """
## jsb imports
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
## basic imports
import time
## checktopicmode function
def checktopicmode(bot, ievent):
""" callback for change in channel topic mode """
chan = ievent.channel
... | 40.080925 | 116 | 0.667436 | # jsb/plugs/core/topic.py
#
#
""" manage topics. """
## jsb imports
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
## basic imports
import time
## checktopicmode function
def checktopicmode(bot, ievent):
""" callback for change in channel topic mode """
chan = ievent.channel
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c739d9e3df6c17840ad1fe727b834881c2868a81 | 1,353 | py | Python | pycrobit/utils.py | MrGallo/pycrob | 5d41ec54191bb31048dcb69374efd26c99e06844 | [
"MIT"
] | null | null | null | pycrobit/utils.py | MrGallo/pycrob | 5d41ec54191bb31048dcb69374efd26c99e06844 | [
"MIT"
] | 9 | 2019-12-23T15:43:36.000Z | 2022-03-12T00:16:32.000Z | pycrobit/utils.py | MrGallo/pycrob | 5d41ec54191bb31048dcb69374efd26c99e06844 | [
"MIT"
] | 1 | 2019-05-21T18:46:57.000Z | 2019-05-21T18:46:57.000Z |
from collections import namedtuple
from typing import Dict, NamedTuple
def dict_to_object(data_dict: Dict) -> NamedTuple:
"""Converts dict to an object"""
try:
Data = namedtuple("Data", " ".join(data_dict.keys()))
except AttributeError:
raise TypeError("Must be a dict.")
data = Dat... | 25.528302 | 72 | 0.620843 | import json
from collections import namedtuple
from typing import Dict, NamedTuple
class JSONStringCorruptError(Exception):
pass
def string_to_dict(string: str) -> Dict:
try:
return json.loads(string)
except json.decoder.JSONDecodeError:
raise JSONStringCorruptError(f"Cannot decode str... | 0 | 0 | 0 | 28 | 0 | 463 | 0 | -10 | 114 |
d4c2a58b7ce41764641116451ed8dad1dd1291a9 | 2,800 | py | Python | data_preparation/split_librilight/prepare_vads_tests.py | dweekly/libri-light | 2a181b2482e0e3a539bf4d8b387b1838fdbfacac | [
"MIT"
] | 246 | 2019-12-19T21:40:48.000Z | 2022-03-30T12:40:22.000Z | data_preparation/split_librilight/prepare_vads_tests.py | dweekly/libri-light | 2a181b2482e0e3a539bf4d8b387b1838fdbfacac | [
"MIT"
] | 11 | 2020-01-17T14:45:05.000Z | 2021-09-20T21:53:27.000Z | data_preparation/split_librilight/prepare_vads_tests.py | dweekly/libri-light | 2a181b2482e0e3a539bf4d8b387b1838fdbfacac | [
"MIT"
] | 48 | 2019-12-20T16:34:12.000Z | 2022-03-26T13:14:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
if __name__ == '__main__':
unittest.main()
| 36.363636 | 101 | 0.566071 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from prepare_vads import split_vad
class TestSplit(unittest.TestCase):
def test_all_silence(self):
p_silence = [1... | 0 | 0 | 0 | 2,499 | 0 | 0 | 0 | 13 | 45 |
92a600ca725df4ccb3cff0cee721d32c8e1cdee1 | 5,796 | py | Python | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/_erfa/tests/test_erfa.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | null | null | null | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/_erfa/tests/test_erfa.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | null | null | null | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/_erfa/tests/test_erfa.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .. import core as erfa
def test_erfa_wrapper():
"""
Runs a set of tests that mostly make sure vectorization is
working as expected
"""
jd = np.linspace(2456855.5, 2456855.5+1.0/24.0/60.0, 60*2+1)
ra = np.... | 34.094118 | 164 | 0.607315 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .. import core as erfa
def test_erfa_wrapper():
"""
Runs a set of tests that mostly make sure vectorization is
working as expected
"""
jd = np.linspace(2456855.5, 2456855.5+1.0/24.0/60.0, 60*2+1)
ra = np.... | 0 | 0 | 0 | 0 | 0 | 1,634 | 0 | 0 | 23 |
504408c5ef505dcb9b3f1c00fbd05face76ed795 | 9,098 | py | Python | rpi_temperature_mqtt/logger.py | yliniemi/rpi-temperature-mqtt | 23ca7080e7bdab7de476abb15d4485d92cf740f3 | [
"MIT"
] | null | null | null | rpi_temperature_mqtt/logger.py | yliniemi/rpi-temperature-mqtt | 23ca7080e7bdab7de476abb15d4485d92cf740f3 | [
"MIT"
] | null | null | null | rpi_temperature_mqtt/logger.py | yliniemi/rpi-temperature-mqtt | 23ca7080e7bdab7de476abb15d4485d92cf740f3 | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
| 44.165049 | 172 | 0.561882 | import RPi.GPIO as GPIO
import time
import re
import socket
import sys
import traceback
import paho.mqtt.client as mqtt
from threading import Thread
class TemperatureLogger:
config = None
mqtt_client = None
mqtt_connected = False
worker_sensor = None
worker_mqtt = None
def __... | 0 | 299 | 0 | 8,615 | 0 | 0 | 0 | -29 | 188 |
918f2cc42cac37adde8288e0de41cd8a120a49d3 | 17,152 | py | Python | core/domain/stats_jobs_one_off_test.py | ivanDad/oppiaV | 1d96585e375d0fa2c289efcf439b29db0c7207f5 | [
"Apache-2.0"
] | 1 | 2017-11-30T02:16:01.000Z | 2017-11-30T02:16:01.000Z | core/domain/stats_jobs_one_off_test.py | ivanDad/oppiaV | 1d96585e375d0fa2c289efcf439b29db0c7207f5 | [
"Apache-2.0"
] | null | null | null | core/domain/stats_jobs_one_off_test.py | ivanDad/oppiaV | 1d96585e375d0fa2c289efcf439b29db0c7207f5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 43.095477 | 80 | 0.680329 | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 18 | 0 | 0 | 15,919 | 0 | 0 | 0 | 140 | 268 |
619beccb7ece7a805cd0c6f95bf19e062aa56295 | 790 | py | Python | tests/test_text_provider.py | ggiuffre/tf-lyrics | ea00a97f985ac2204da6eca94217ca77f888bc81 | [
"MIT"
] | 3 | 2021-07-31T09:55:49.000Z | 2022-03-03T18:39:06.000Z | tests/test_text_provider.py | ggiuffre/tf-lyrics | ea00a97f985ac2204da6eca94217ca77f888bc81 | [
"MIT"
] | null | null | null | tests/test_text_provider.py | ggiuffre/tf-lyrics | ea00a97f985ac2204da6eca94217ca77f888bc81 | [
"MIT"
] | 1 | 2020-03-20T15:12:03.000Z | 2020-03-20T15:12:03.000Z | from tflyrics.text_provider import TextProvider
import pytest
def test_abstractness():
"""A TextProvider object cannot be instantiated."""
with pytest.raises(TypeError):
abstract_prov = TextProvider()
def test_concreteness():
"""A concrete sub-class of TextProvider can be instantiated."""
... | 21.944444 | 67 | 0.65443 | from tflyrics.text_provider import TextProvider
import pytest
class MockProvider(TextProvider):
"""A mock TextProvider."""
def __init__(self, mock_arg: object):
"""Create a MockProvider object."""
super(MockProvider, self).__init__()
self.mock_arg = mock_arg
def resources(self,... | 0 | 0 | 0 | 386 | 0 | 0 | 0 | 0 | 23 |
434c230ba82e01322a3dc8f20ba645b5bc3eab81 | 2,340 | py | Python | setup.py | shibaken/commercialoperator | 1e0adfe683288626d9d3113e9efb44e0eba78adb | [
"Apache-2.0"
] | null | null | null | setup.py | shibaken/commercialoperator | 1e0adfe683288626d9d3113e9efb44e0eba78adb | [
"Apache-2.0"
] | 12 | 2020-02-12T06:26:55.000Z | 2022-02-13T05:52:54.000Z | setup.py | dbca-wa/boranga_v1 | c6677068d147bfaa32386ab9cbed3a255d2fe1cd | [
"Apache-2.0"
] | 8 | 2020-02-24T05:11:18.000Z | 2021-02-26T07:54:24.000Z | from setuptools import setup
setup(name='ledger',
version='1.6',
description='Ledger Payments App',
url='https://github.com/dbca-wa/ledger',
author='Department of Parks and Wildlife',
author_email='asi@dbca.wa.gov.au',
license='BSD',
packages=['ledger','ledger.accounts','ledge... | 68.823529 | 296 | 0.666667 | from setuptools import setup
setup(name='ledger',
version='1.6',
description='Ledger Payments App',
url='https://github.com/dbca-wa/ledger',
author='Department of Parks and Wildlife',
author_email='asi@dbca.wa.gov.au',
license='BSD',
packages=['ledger','ledger.accounts','ledge... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
22d141f3f03b6605c911e4a746b3989d01e67184 | 4,909 | py | Python | tests/bandwidth/account/test_available_number.py | katapal/python-bandwidth | 4477c4129ce856ccd41adbc94e951336b56d7898 | [
"MIT"
] | null | null | null | tests/bandwidth/account/test_available_number.py | katapal/python-bandwidth | 4477c4129ce856ccd41adbc94e951336b56d7898 | [
"MIT"
] | null | null | null | tests/bandwidth/account/test_available_number.py | katapal/python-bandwidth | 4477c4129ce856ccd41adbc94e951336b56d7898 | [
"MIT"
] | null | null | null | import six
if six.PY3:
from unittest.mock import patch
else:
| 35.832117 | 95 | 0.553473 | import unittest
import six
import requests
from tests.bandwidth.helpers import get_account_client as get_client
from tests.bandwidth.helpers import create_response, AUTH, headers
if six.PY3:
from unittest.mock import patch
else:
from mock import patch
from bandwidth_old.voice import Client
class AvailableNum... | 0 | 0 | 0 | 4,585 | 0 | 0 | 0 | 98 | 160 |
0025df4b9b7e59fdd3d556a7cb77764c93b5b442 | 4,811 | py | Python | practical_data_science/Assignment4/evaluate-f1.py | SpyrosMouselinos/Msc-AUEB-Data-Science | 179e0d107448d5a547651d60dafbc2345817c4a9 | [
"Apache-2.0"
] | 1 | 2021-06-25T13:19:38.000Z | 2021-06-25T13:19:38.000Z | practical_data_science/Assignment4/evaluate-f1.py | SpyrosMouselinos/Msc-AUEB-Data-Science | 179e0d107448d5a547651d60dafbc2345817c4a9 | [
"Apache-2.0"
] | null | null | null | practical_data_science/Assignment4/evaluate-f1.py | SpyrosMouselinos/Msc-AUEB-Data-Science | 179e0d107448d5a547651d60dafbc2345817c4a9 | [
"Apache-2.0"
] | null | null | null | import sys
# Read a Tab-separated ImageID - Caption pair file
# Print 1-level key-value dictionary, sorted (with numeric key)
# Main
if __name__ == '__main__':
main(sys.argv[1:])
| 32.288591 | 99 | 0.596342 | import sys, argparse, string
import csv
import warnings
from sklearn.metrics import f1_score
def main(argv):
# Hide warnings
warnings.filterwarnings('ignore')
# Concept stats
min_concepts = sys.maxsize
max_concepts = 0
total_concepts = 0
concepts_distrib = {}
# Parse arguments
p... | 0 | 0 | 0 | 0 | 0 | 4,473 | 0 | 16 | 134 |
d16072dd11796f84fc85ce13b9e3c1fae09c60e1 | 1,194 | py | Python | leetcode/129.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | leetcode/129.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | leetcode/129.py | pingrunhuang/CodeChallenge | a8e5274e04c47d851836197907266418af4f1a22 | [
"MIT"
] | null | null | null | '''
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the total sum of all root-to-leaf numbers.
For example,
1
/ \
2 3
The root-to-leaf path 1->2 represents the number 12.... | 25.956522 | 115 | 0.644891 | '''
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the total sum of all root-to-leaf numbers.
For example,
1
/ \
2 3
The root-to-leaf path 1->2 represents the number 12.... | 0 | 0 | 0 | 525 | 0 | 0 | 0 | 9 | 68 |
84bf5d290a4e55fab5bc65cd01a88e38065025f6 | 100 | py | Python | hitron_cpe/common/__init__.py | jersmith/hitron-cable-cpe | b7dfd7801dbdebd92b3bb4d417b8430531182d33 | [
"MIT"
] | 1 | 2022-01-10T21:38:35.000Z | 2022-01-10T21:38:35.000Z | hitron_cpe/common/__init__.py | jersmith/hitron-cable-cpe | b7dfd7801dbdebd92b3bb4d417b8430531182d33 | [
"MIT"
] | null | null | null | hitron_cpe/common/__init__.py | jersmith/hitron-cable-cpe | b7dfd7801dbdebd92b3bb4d417b8430531182d33 | [
"MIT"
] | null | null | null | """ Common utilities for logging, command line processing and more. """
| 25 | 71 | 0.75 | """ Common utilities for logging, command line processing and more. """
from .logger import Logger
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
514fc2a12e9c14f549ccee7911ec9b607eefc014 | 2,665 | py | Python | custom_components/smartweather/entity.py | hwikene/smartweather | c6fbd383108d93a44bbc693f766dd7e84554a920 | [
"MIT"
] | null | null | null | custom_components/smartweather/entity.py | hwikene/smartweather | c6fbd383108d93a44bbc693f766dd7e84554a920 | [
"MIT"
] | null | null | null | custom_components/smartweather/entity.py | hwikene/smartweather | c6fbd383108d93a44bbc693f766dd7e84554a920 | [
"MIT"
] | null | null | null | """Base Entity definition for SmartWeather Integration."""
| 29.611111 | 79 | 0.649531 | """Base Entity definition for SmartWeather Integration."""
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.device_registry as dr
from typing import Dict, List
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_FRIENDLY_NAME,
)
from .const import (
DOMAIN,
ATTR_BRAND,
... | 0 | 942 | 295 | 941 | 0 | 0 | 0 | 294 | 133 |
d2edbd69aceb627d0e0b3728ada282d28e0a4193 | 7,645 | py | Python | Code/userMainWindow.py | grey-wings/dynamic_desktop | a58ef6109112bd89fde24e0ca7bf7ecefc51cc8d | [
"MIT"
] | null | null | null | Code/userMainWindow.py | grey-wings/dynamic_desktop | a58ef6109112bd89fde24e0ca7bf7ecefc51cc8d | [
"MIT"
] | null | null | null | Code/userMainWindow.py | grey-wings/dynamic_desktop | a58ef6109112bd89fde24e0ca7bf7ecefc51cc8d | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtWidgets import QApplication
if __name__ == "__main__":
app = QApplication(sys.argv)
win = userUI()
win.show()
sys.exit(app.exec_())
| 34.908676 | 109 | 0.539045 | import os
import sys
from subprocess import call
from cv2 import VideoCapture, cvtColor, COLOR_BGR2RGB
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QImage, QPixmap, QIcon
from PyQt5.QtWidgets import QMainWindow, QFileDia... | 594 | 0 | 0 | 6,867 | 0 | 0 | 0 | 159 | 234 |
87fc16bb8a379d7bbe45c105ec05653b7846a83d | 910 | py | Python | bluebottle/impact/admin.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/impact/admin.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/impact/admin.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | from django.contrib import admin
from bluebottle.impact.models import ImpactType
admin.site.register(ImpactType, ImpactTypeAdmin)
| 26.764706 | 84 | 0.69011 | from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from parler.admin import TranslatableAdmin
from bluebottle.impact.models import ImpactType, ImpactGoal
class ImpactGoalInline(admin.TabularInline):
model = ImpactGoal
extra = 0
readonly_fields = ('unit', 'realized_fr... | 0 | 0 | 0 | 618 | 0 | 0 | 0 | 66 | 91 |
a3d8af67ce731bc5ce1f42e2c87bf76da47bcc68 | 6,483 | py | Python | src/libnrl/tadw.py | river-li/DeepBinDiff | a5f6fa1a23743ca462a126d3636e8fc4099ac841 | [
"BSD-3-Clause"
] | null | null | null | src/libnrl/tadw.py | river-li/DeepBinDiff | a5f6fa1a23743ca462a126d3636e8fc4099ac841 | [
"BSD-3-Clause"
] | null | null | null | src/libnrl/tadw.py | river-li/DeepBinDiff | a5f6fa1a23743ca462a126d3636e8fc4099ac841 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
| 41.292994 | 110 | 0.530464 | from __future__ import print_function
import numpy as np
from sklearn.preprocessing import normalize
import preprocessing
class TADW(object):
def __init__(self, graph, dim, lamb=0.2, threshold=0.1):
self.g = graph
self.lamb = lamb
self.dim = dim
self.threshold = threshold
... | 0 | 0 | 0 | 6,337 | 0 | 0 | 0 | 18 | 90 |
262b315464af5ecf135c07f0531458af72954336 | 518 | py | Python | plugin/fiftyone/tests/__main__.py | phoenix-xhuang/ymir | 537d3ac389c4a365ce4daef431c95b42ddcd5b1b | [
"Apache-2.0"
] | null | null | null | plugin/fiftyone/tests/__main__.py | phoenix-xhuang/ymir | 537d3ac389c4a365ce4daef431c95b42ddcd5b1b | [
"Apache-2.0"
] | null | null | null | plugin/fiftyone/tests/__main__.py | phoenix-xhuang/ymir | 537d3ac389c4a365ce4daef431c95b42ddcd5b1b | [
"Apache-2.0"
] | null | null | null | import sys
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
| 24.666667 | 75 | 0.629344 | import os
import sys
import subprocess
def main(args):
params = " ".join(sys.argv[1:])
repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# --cov-report term-missing
cmd = (
"PYTHONPATH=$PYTHONPATH:{repo_root} pytest -vv -xs --durations=0 "
"--cov=app --cov-config=... | 0 | 0 | 0 | 0 | 0 | 393 | 0 | -16 | 67 |
b37fcc186a5d444d1a74f6847425ff91fa363ed4 | 565 | py | Python | findwork/migrations/0003_auto_20210108_1254.py | sawe-daisy/findjobo | 6c77d2140a9701b747680e22c2f56d4395a663ab | [
"MIT"
] | null | null | null | findwork/migrations/0003_auto_20210108_1254.py | sawe-daisy/findjobo | 6c77d2140a9701b747680e22c2f56d4395a663ab | [
"MIT"
] | null | null | null | findwork/migrations/0003_auto_20210108_1254.py | sawe-daisy/findjobo | 6c77d2140a9701b747680e22c2f56d4395a663ab | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2021-01-08 09:54
| 23.541667 | 61 | 0.582301 | # Generated by Django 3.1.3 on 2021-01-08 09:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('findwork', '0002_auto_20210104_1010'),
]
operations = [
migrations.AlterField(
model_name='user',
name='first_name',... | 0 | 0 | 0 | 451 | 0 | 0 | 0 | 19 | 46 |
4c45d23cc87e6259996a509ed1421b22d9e4c9b9 | 15,865 | py | Python | app/migrations/0001_initial.py | encarcelado/ultra_eruz | 7e09f69dd1792a7e7be4302e76a0da219a214a48 | [
"MIT"
] | null | null | null | app/migrations/0001_initial.py | encarcelado/ultra_eruz | 7e09f69dd1792a7e7be4302e76a0da219a214a48 | [
"MIT"
] | null | null | null | app/migrations/0001_initial.py | encarcelado/ultra_eruz | 7e09f69dd1792a7e7be4302e76a0da219a214a48 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-04-22 07:01
| 43.346995 | 114 | 0.522597 | # Generated by Django 2.1.15 on 2020-04-22 07:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AuthGroup',
fields=[
('id', models.AutoFie... | 0 | 0 | 0 | 15,750 | 0 | 0 | 0 | 19 | 46 |
c528a13ed396799c19df64f3d6a7a6a5b4427066 | 585 | py | Python | ex13_3.py | DexHunter/Think-Python-book-exercise-solutions | d0abae261eda1dca99043e17e8a1e614caad2140 | [
"CC-BY-4.0"
] | 24 | 2019-05-07T15:11:28.000Z | 2022-03-02T04:50:28.000Z | ex13_3.py | Dekzu/Think-Python-book-exercise-solutions | d0abae261eda1dca99043e17e8a1e614caad2140 | [
"CC-BY-4.0"
] | null | null | null | ex13_3.py | Dekzu/Think-Python-book-exercise-solutions | d0abae261eda1dca99043e17e8a1e614caad2140 | [
"CC-BY-4.0"
] | 19 | 2019-08-05T20:59:04.000Z | 2022-03-07T05:13:32.000Z |
from collections import Counter
# I have downloaded _Pride and Prejudice_ from Gutenberg website and modified header with '#'
def count_number_frequency(l):
'''Print the 20 most frequently used words in the book'''
c = Counter(l)
print(c.most_common(20))
if __name__ == '__main__':
#print(list(read_file('Pridean... | 34.411765 | 93 | 0.74359 | from ex13_1 import *
from ex13_2 import *
from collections import Counter
# I have downloaded _Pride and Prejudice_ from Gutenberg website and modified header with '#'
def count_number_frequency(l):
'''Print the 20 most frequently used words in the book'''
c = Counter(l)
print(c.most_common(20))
if __name__ == '... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 44 |
2d544e39d0341b35a452feddd5b00b50f021c4ba | 4,753 | py | Python | supervised_learning/train.py | gonzalezJohnas/SpeechCommand-recognition | d5351abe45c571a075c24bd04d328e76293f9230 | [
"MIT"
] | null | null | null | supervised_learning/train.py | gonzalezJohnas/SpeechCommand-recognition | d5351abe45c571a075c24bd04d328e76293f9230 | [
"MIT"
] | 2 | 2021-04-10T18:12:44.000Z | 2022-02-09T23:36:43.000Z | supervised_learning/train.py | gonzalezJohnas/SpeechCommand-recognition | d5351abe45c571a075c24bd04d328e76293f9230 | [
"MIT"
] | null | null | null | import argparse
# Data Loading
import pickle
from tensorflow.keras.backend import squeeze
import models
random.seed(42)
if __name__ == "__main__":
print("TensorFlow version: {}".format(tf.__version__))
print("Eager execution: {}".format(tf.executing_eagerly()))
parser = argparse.ArgumentParser()
... | 32.554795 | 117 | 0.644856 | import argparse
# Data Loading
import pickle
from tensorflow.keras.backend import squeeze
from global_utils import *
import models
random.seed(42)
if __name__ == "__main__":
print("TensorFlow version: {}".format(tf.__version__))
print("Eager execution: {}".format(tf.executing_eagerly()))
parser = argp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
1f61a7689932a6c4d733db5675f722b24e3edd0b | 903 | py | Python | test/ResultsAndPrizes/zodiac/test_zodiac_winning_draw_numbers_for_previous_draw.py | FearFactor1/SPA | a05aaa924c5bebb52cd508ebdf7fd3b81c49fac7 | [
"Apache-2.0"
] | 1 | 2019-12-05T06:50:54.000Z | 2019-12-05T06:50:54.000Z | test/ResultsAndPrizes/zodiac/test_zodiac_winning_draw_numbers_for_previous_draw.py | FearFactor1/SPA | a05aaa924c5bebb52cd508ebdf7fd3b81c49fac7 | [
"Apache-2.0"
] | null | null | null | test/ResultsAndPrizes/zodiac/test_zodiac_winning_draw_numbers_for_previous_draw.py | FearFactor1/SPA | a05aaa924c5bebb52cd508ebdf7fd3b81c49fac7 | [
"Apache-2.0"
] | null | null | null | # + + 2000
| 53.117647 | 89 | 0.815061 | # зодиак + Выигрышные номера тиража + предыдущий тираж к примеру 2000
def test_zodiac_winning_draw_numbers_for_previous_draw(app):
app.ResultAndPrizes.open_page_results_and_prizes()
app.ResultAndPrizes.click_game_zodiac()
app.ResultAndPrizes.click_winning_draw_numbers()
app.ResultAndPrizes.select_dra... | 162 | 0 | 0 | 0 | 0 | 779 | 0 | 0 | 23 |
47f05809874c71072314877ca5fecaa45b3e49da | 870 | py | Python | 06_taches_finale/02_arnaud_jullien/Projet_eolienne/Prog_ok/CGestionEolienne.py | Izakun/banc_de_test_eolienne | 3554e22f278bb015f9226862e590b9092e39c91f | [
"MIT"
] | 2 | 2018-01-15T10:59:42.000Z | 2018-01-15T10:59:44.000Z | 06_taches_finale/02_arnaud_jullien/Projet_eolienne/Prog_ok/CGestionEolienne.py | Izakun/banc_de_test_eolienne | 3554e22f278bb015f9226862e590b9092e39c91f | [
"MIT"
] | null | null | null | 06_taches_finale/02_arnaud_jullien/Projet_eolienne/Prog_ok/CGestionEolienne.py | Izakun/banc_de_test_eolienne | 3554e22f278bb015f9226862e590b9092e39c91f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
'''
Programme : heure.py version 1.0
Date : 19-12-2017
Auteur : Jullien Arnaud
Matriel utilis : Fonctionnement programme :
'''
if __name__ == "__main__":
eole = CGestionEolienne()
eole.start()
| 21.75 | 78 | 0.636782 | #!/usr/bin/env python3
# coding: utf-8
'''
Programme : heure.py version 1.0
Date : 19-12-2017
Auteur : Jullien Arnaud
Matériel utilisé : Fonctionnement programme :
'''
from raspiomix import Raspiomix
from datetime import datetime
from threading import Thread
import time
from CAcqPuissance import CAcqPuissa... | 6 | 0 | 0 | 423 | 0 | 0 | 0 | 33 | 133 |
3812a7391f189f03379ecdd3019689a7aa22e866 | 8,717 | py | Python | datasets/NOPC.py | wuminye/nerf_pl | 521709d9c3437b94521755bf5fe761c0017fdf30 | [
"MIT"
] | null | null | null | datasets/NOPC.py | wuminye/nerf_pl | 521709d9c3437b94521755bf5fe761c0017fdf30 | [
"MIT"
] | null | null | null | datasets/NOPC.py | wuminye/nerf_pl | 521709d9c3437b94521755bf5fe761c0017fdf30 | [
"MIT"
] | 1 | 2020-06-23T06:43:10.000Z | 2020-06-23T06:43:10.000Z | import torch
import numpy as np
from PIL import Image
from torchvision import transforms as T
| 26.335347 | 155 | 0.542388 | import torch
from torch.utils.data import Dataset
import json
import numpy as np
import os
from PIL import Image
from torchvision import transforms as T
from .ray_utils import *
import torchvision.transforms as T
from torch.utils import data
import torch
from tqdm import tqdm
import numpy as np
import random
im... | 0 | 0 | 0 | 6,419 | 0 | 1,749 | 0 | -17 | 451 |
be85b1b991f098f311442c0ebe493372f2806e69 | 872 | py | Python | bokeh/bokeh_magic.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | 2 | 2021-09-01T12:36:06.000Z | 2021-11-17T10:48:36.000Z | bokeh/bokeh_magic.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | null | null | null | bokeh/bokeh_magic.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | null | null | null | # This is the bokeh_magic loader and installer, if you want to see the
# bokeh_magic source code check the following url:
# https://github.com/bokeh/bokeh/blob/master/extensions/bokeh_magic.py
from __future__ import print_function
from IPython import get_ipython
def install_bokeh_magic():
"An alternative way to... | 36.333333 | 79 | 0.761468 | # This is the bokeh_magic loader and installer, if you want to see the
# bokeh_magic source code check the following url:
# https://github.com/bokeh/bokeh/blob/master/extensions/bokeh_magic.py
from __future__ import print_function
from IPython import get_ipython
def install_bokeh_magic():
"An alternative way to... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1c566f6711f94ebcc790509c9f0dca0ac3dcd7b6 | 2,178 | py | Python | src/cinnamon/common/dev_utils.py | zelros/cinnamon | 9fbac281ed3ab2a1ce61fb48d845f3a6e97d1221 | [
"MIT"
] | 51 | 2021-11-18T10:52:30.000Z | 2022-03-17T10:23:09.000Z | src/cinnamon/common/dev_utils.py | zelros/cinnamon | 9fbac281ed3ab2a1ce61fb48d845f3a6e97d1221 | [
"MIT"
] | 3 | 2021-11-28T01:09:01.000Z | 2022-03-16T10:32:13.000Z | src/cinnamon/common/dev_utils.py | zelros/cinnamon | 9fbac281ed3ab2a1ce61fb48d845f3a6e97d1221 | [
"MIT"
] | 4 | 2021-11-22T14:11:45.000Z | 2022-03-08T09:06:11.000Z | import sys
def safe_isinstance(obj, class_path_str):
# this function is copy-paste from the code of the SHAP Python library
# Copyright (c) 2018 Scott Lundberg
"""
Acts as a safe version of isinstance without having to explicitly
import packages which may not exist in the users environment.
C... | 32.507463 | 100 | 0.656566 | import sys
import numpy as np
def safe_isinstance(obj, class_path_str):
# this function is copy-paste from the code of the SHAP Python library
# Copyright (c) 2018 Scott Lundberg
"""
Acts as a safe version of isinstance without having to explicitly
import packages which may not exist in the users... | 0 | 0 | 0 | 0 | 0 | 165 | 0 | -3 | 45 |
5470e7784f571f8520059dbc8ba8a2f138177195 | 3,451 | py | Python | experiment/custom.py | joshrule/list-routines-human-experiments | 9ea3a4fc92e4f4e5886897c9981f87a3c1554fa3 | [
"MIT"
] | null | null | null | experiment/custom.py | joshrule/list-routines-human-experiments | 9ea3a4fc92e4f4e5886897c9981f87a3c1554fa3 | [
"MIT"
] | null | null | null | experiment/custom.py | joshrule/list-routines-human-experiments | 9ea3a4fc92e4f4e5886897c9981f87a3c1554fa3 | [
"MIT"
] | null | null | null | # this file imports custom routes into the experiment server
from flask import Blueprint
from psiturk.psiturk_config import PsiturkConfig
from psiturk.user_utils import PsiTurkAuthorization
# # Database setup
# load the configuration options
config = PsiturkConfig()
config.load_config()
# if you want to add a passw... | 33.504854 | 92 | 0.596349 | # this file imports custom routes into the experiment server
from flask import Blueprint, render_template, request, jsonify, Response, abort, current_app
from jinja2 import TemplateNotFound
from functools import wraps
from sqlalchemy import or_
from psiturk.psiturk_config import PsiturkConfig
from psiturk.experiment_... | 0 | 1,774 | 0 | 0 | 0 | 0 | 0 | 191 | 243 |
8e55a8243222f4eea762e2e6dd828ccf7834139f | 11,951 | py | Python | pyvision/misc/NeuralStyleTransfer/neural_style.py | indiradutta/PyVision | cf74da32a3469ddcce9917ac1f2fcaaeefdeacdf | [
"BSD-3-Clause"
] | 31 | 2020-05-03T07:03:01.000Z | 2022-01-29T15:29:22.000Z | pyvision/misc/NeuralStyleTransfer/neural_style.py | indiradutta/PyVision | cf74da32a3469ddcce9917ac1f2fcaaeefdeacdf | [
"BSD-3-Clause"
] | 13 | 2020-05-25T14:23:46.000Z | 2021-08-04T10:38:02.000Z | pyvision/misc/NeuralStyleTransfer/neural_style.py | indiradutta/PyVision | cf74da32a3469ddcce9917ac1f2fcaaeefdeacdf | [
"BSD-3-Clause"
] | 12 | 2020-05-24T22:26:59.000Z | 2021-08-03T18:30:51.000Z | from __future__ import print_function
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
import torchvision.models as models
# content loss
# style loss
# for normalizing the input image
| 36.325228 | 194 | 0.581876 | from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from PIL import Image
import matplotlib.pyplot as plt
import cv2
import os
import time
import warnings
import torchvision.transforms as transforms
import torchvision.models as models
... | 0 | 0 | 0 | 11,451 | 0 | 0 | 0 | -38 | 290 |
30f60c27fdf86153413afe6545e96be85a9660a6 | 6,266 | py | Python | tests/plugins/test_trainer.py | baajur/transfer-nlp | 85515b73165c299b7a9b96d3608bd4e8ee567154 | [
"MIT"
] | 307 | 2019-03-26T11:06:41.000Z | 2022-02-20T00:34:25.000Z | tests/plugins/test_trainer.py | baajur/transfer-nlp | 85515b73165c299b7a9b96d3608bd4e8ee567154 | [
"MIT"
] | 30 | 2019-04-14T01:35:48.000Z | 2021-04-15T20:11:59.000Z | tests/plugins/test_trainer.py | baajur/transfer-nlp | 85515b73165c299b7a9b96d3608bd4e8ee567154 | [
"MIT"
] | 19 | 2019-04-13T20:36:51.000Z | 2020-07-05T15:19:17.000Z | from pathlib import Path
import ignite.metrics as metrics
import torch.nn as nn
import torch.optim as optim
PLUGINS = {
'CrossEntropyLoss': nn.CrossEntropyLoss,
'BCEWithLogitsLoss': nn.BCEWithLogitsLoss,
"Adam": optim.Adam,
"SGD": optim.SGD,
"AdaDelta": optim.Adadelta,
"AdaGrad": optim.Adagrad,... | 34.428571 | 108 | 0.633738 | import copy
import unittest
from pathlib import Path
import ignite
import ignite.metrics as metrics
import torch.nn as nn
import torch.optim as optim
from ignite.metrics import Precision, Recall, MetricsLambda
from transfer_nlp.plugins.config import ExperimentConfig
from transfer_nlp.plugins.regularizers import L1
fr... | 0 | 105 | 0 | 2,414 | 0 | 193 | 0 | 83 | 225 |
e57f9a2cd28feb4907367078aeae3bfbf6954e64 | 1,981 | py | Python | examples/sample_graph_io.py | AtsushiHashimoto/isolated_clique_enumeration | 9ff817f57d929b5db07265fe6d85013c13825869 | [
"MIT"
] | null | null | null | examples/sample_graph_io.py | AtsushiHashimoto/isolated_clique_enumeration | 9ff817f57d929b5db07265fe6d85013c13825869 | [
"MIT"
] | null | null | null | examples/sample_graph_io.py | AtsushiHashimoto/isolated_clique_enumeration | 9ff817f57d929b5db07265fe6d85013c13825869 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import sys
sys.path.append('../isoclique')
import isoclique as ic
import networkx as nx
import time
if __name__ == '__main__':
E = nx.karate_club_graph().edges()
'''
encode_method=None
E = [[x,y] for x,y in E]
'''
'''
# generate a graph with node id ... | 25.075949 | 80 | 0.604745 | #!/usr/bin/env python
# coding: utf-8
import sys
sys.path.append('../isoclique')
import isoclique as ic
import networkx as nx
import random
import time
def generate_random_color():
return '#{:X}{:X}{:X}'.format(*[random.randint(16, 255) for _ in range(3)])
def generate_random_color_list(num):
colors = [None]... | 0 | 0 | 0 | 0 | 0 | 213 | 0 | -8 | 67 |
bb94caafab4b061ddf434e878675f029bd90ddc3 | 1,351 | py | Python | async_sched/client/stop_schedule.py | justengel/async_sched | f980722d51d15025522b2265426b0188ff368418 | [
"MIT"
] | 1 | 2020-10-19T13:36:20.000Z | 2020-10-19T13:36:20.000Z | async_sched/client/stop_schedule.py | justengel/async_sched | f980722d51d15025522b2265426b0188ff368418 | [
"MIT"
] | null | null | null | async_sched/client/stop_schedule.py | justengel/async_sched | f980722d51d15025522b2265426b0188ff368418 | [
"MIT"
] | null | null | null | """
module to run with the -m flag
python -m async_sched.client.stop_schedule "Task 1" --list_schedules 1
"""
__all__ = ['NAME', 'get_argparse', 'main']
NAME = 'stop_schedule'
if __name__ == '__main__':
P = get_argparse()
ARGS = P.parse_args()
KWARGS = {n: getattr(ARGS, n) for n in dir(ARGS) if n... | 30.704545 | 118 | 0.694301 | """
module to run with the -m flag
python -m async_sched.client.stop_schedule "Task 1" --list_schedules 1
"""
import argparse
from async_sched.client.client import stop_schedule
from async_sched.utils import DEFAULT_HOST, DEFAULT_PORT
__all__ = ['NAME', 'get_argparse', 'main']
NAME = 'stop_schedule'
def get_arg... | 0 | 0 | 0 | 0 | 0 | 780 | 0 | 59 | 112 |
dcc581968ca295a357b08c7c307d5de440b0fc66 | 750 | py | Python | scripts/create_arcade_structure.py | netor27/codefights-arcade-solutions | 69701ab06d45902c79ec9221137f90b75969d8c8 | [
"MIT"
] | null | null | null | scripts/create_arcade_structure.py | netor27/codefights-arcade-solutions | 69701ab06d45902c79ec9221137f90b75969d8c8 | [
"MIT"
] | null | null | null | scripts/create_arcade_structure.py | netor27/codefights-arcade-solutions | 69701ab06d45902c79ec9221137f90b75969d8c8 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main()
| 27.777778 | 67 | 0.604 | import os
def main():
directory = 'arcade/python/'
new_language = 'go'
file_extension = '.go'
not_implemented_text = '# Not implemented yet!'
for root, dirs, files in os.walk(directory):
for file in files:
#with open(os.path.join(root, file), "r") as auto:
print("{} - {}".format(root, ... | 0 | 0 | 0 | 0 | 0 | 677 | 0 | -12 | 45 |
9cdbf43c6bb2fc49d0d9c3c7070ac23cecedc8ba | 2,515 | py | Python | hw4/cost_functions.py | Self-Education-Liavontsi-Brechka/deep-rl | 6d984754a800c7c9e95b6afc2625186f0f3949d3 | [
"MIT"
] | null | null | null | hw4/cost_functions.py | Self-Education-Liavontsi-Brechka/deep-rl | 6d984754a800c7c9e95b6afc2625186f0f3949d3 | [
"MIT"
] | null | null | null | hw4/cost_functions.py | Self-Education-Liavontsi-Brechka/deep-rl | 6d984754a800c7c9e95b6afc2625186f0f3949d3 | [
"MIT"
] | null | null | null |
# ========================================================
#
# Environment-specific cost functions:
#
# ========================================================
#
# Cost function for a whole trajectory:
#
| 26.197917 | 98 | 0.572167 | import numpy as np
# ========================================================
#
# Environment-specific cost functions:
#
def cheetah_cost_fn(state, action, next_state):
if len(state.shape) > 1:
heading_penalty_factor = 10
scores = np.zeros((state.shape[0],))
# dont move front shin back ... | 0 | 0 | 0 | 0 | 0 | 2,191 | 0 | -3 | 114 |
7cda3433bb42ceaec12a2a6b3207ab866dbb3fda | 9,582 | py | Python | mindspore/python/mindspore/nn/optim/asgd.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | 1 | 2022-03-05T02:59:21.000Z | 2022-03-05T02:59:21.000Z | mindspore/python/mindspore/nn/optim/asgd.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/nn/optim/asgd.py | TangYuan-Liu/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.887755 | 120 | 0.639741 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 1,267 | 0 | 7,269 | 0 | 0 | 0 | 168 | 199 |
5bad650851f7b0cbf50d0e6ebffea0953ad01118 | 74 | py | Python | Imaobong Tom/Phase 1/Python Basic 1/Day 6/No. 7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Imaobong Tom/Phase 1/Python Basic 1/Day 6/No. 7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Imaobong Tom/Phase 1/Python Basic 1/Day 6/No. 7.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | import multiprocessing
print("cpu count is", multiprocessing.cpu_count())
| 24.666667 | 50 | 0.810811 | import multiprocessing
print("cpu count is", multiprocessing.cpu_count())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4549ff92bbc002de34a10cdc05a42eeb0d80f5b0 | 7,917 | py | Python | toolkit/pxt/project.py | AlexGustafsson/ev3-emulator-toolkit | 641737660839dc85e2caaab9431518597b8fd263 | [
"Unlicense"
] | null | null | null | toolkit/pxt/project.py | AlexGustafsson/ev3-emulator-toolkit | 641737660839dc85e2caaab9431518597b8fd263 | [
"Unlicense"
] | null | null | null | toolkit/pxt/project.py | AlexGustafsson/ev3-emulator-toolkit | 641737660839dc85e2caaab9431518597b8fd263 | [
"Unlicense"
] | null | null | null | import logging
log = logging.getLogger(__name__)
| 38.432039 | 128 | 0.610585 | import json
import lzma
import struct
import logging
from typing import Tuple, Iterator, List
from lzma import LZMAError, LZMADecompressor
from toolkit.uf2.uf2 import UF2
log = logging.getLogger(__name__)
class Project:
def __init__(self, archive: UF2) -> None:
self.__archive = archive
self.__me... | 0 | 1,125 | 0 | 6,561 | 0 | 0 | 0 | 24 | 156 |
75f2d906b67f4f1b42186950bed3db63b5663f18 | 1,052 | py | Python | thrift/lib/py/util/tests/test_struct_to_dict.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | null | null | null | thrift/lib/py/util/tests/test_struct_to_dict.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | null | null | null | thrift/lib/py/util/tests/test_struct_to_dict.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
| 26.974359 | 65 | 0.365019 | #!/usr/bin/env python3
import unittest
from collections import OrderedDict
from thrift.test.sample_structs.ttypes import DummyStruct, Struct
from thrift.util import struct_to_dict
class TestStructToDict(unittest.TestCase):
def test_struct_to_dict(self) -> None:
dummy_struct = DummyStruct(1)
test_... | 0 | 0 | 0 | 847 | 0 | 0 | 0 | 69 | 112 |
badc2bba52dbc79fe661f60444073a6165ce4de2 | 1,346 | py | Python | dj_cqrs/management/commands/cqrs_diff_sync.py | maxipavlovic/django-cqrs | d401819b5bca7c2e833d44e8426251fdd4b6b8b9 | [
"Apache-2.0"
] | 52 | 2020-05-28T13:25:36.000Z | 2022-03-05T12:31:45.000Z | dj_cqrs/management/commands/cqrs_diff_sync.py | maxipavlovic/django-cqrs | d401819b5bca7c2e833d44e8426251fdd4b6b8b9 | [
"Apache-2.0"
] | 26 | 2020-07-30T08:17:13.000Z | 2022-02-18T12:54:38.000Z | dj_cqrs/management/commands/cqrs_diff_sync.py | maxipavlovic/django-cqrs | d401819b5bca7c2e833d44e8426251fdd4b6b8b9 | [
"Apache-2.0"
] | 15 | 2020-05-28T13:25:40.000Z | 2022-03-07T04:14:36.000Z | # Copyright 2021 Ingram Micro Inc. All rights reserved.
| 29.26087 | 75 | 0.605498 | # Copyright © 2021 Ingram Micro Inc. All rights reserved.
import sys
from dj_cqrs.constants import NO_QUEUE
from dj_cqrs.management.commands.cqrs_sync import Command as SyncCommand
from dj_cqrs.registries import MasterRegistry
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCom... | 2 | 364 | 0 | 661 | 0 | 0 | 0 | 125 | 136 |
d54ace02bb6705a177142d6f2e33dd5df9cf857f | 2,448 | py | Python | seamseg/utils/snapshot.py | gladcolor/seamseg | 9e6c7e2828f32b311a7b0c16b279ac194e8aaf94 | [
"BSD-3-Clause"
] | 21 | 2022-01-12T16:47:59.000Z | 2022-03-29T07:33:03.000Z | cirtorch/utils/snapshot.py | Tarekbouamer/Image-Retrieval-for-Image-Based-Localization | fcad9af4f558bebb3cbec1d08e49603a452f439d | [
"BSD-3-Clause"
] | 6 | 2022-01-18T01:30:46.000Z | 2022-03-21T12:06:06.000Z | cirtorch/utils/snapshot.py | Tarekbouamer/Image-Retrieval-for-Image-Based-Localization | fcad9af4f558bebb3cbec1d08e49603a452f439d | [
"BSD-3-Clause"
] | 2 | 2022-02-11T15:29:28.000Z | 2022-03-23T13:48:22.000Z |
def _load_pretraining_dict(model, state_dict):
"""Load state dictionary from a pre-training snapshot
This is an even less strict version of `model.load_state_dict(..., False)`, which also ignores parameters from
`state_dict` that don't have the same shapes as the corresponding ones in `model`. This is... | 32.210526 | 114 | 0.640114 | import torch
from .misc import config_to_string
def save_snapshot(file, config, epoch, last_score, best_score, global_step, **kwargs):
data = {
"config": config_to_string(config),
"state_dict": dict(kwargs),
"training_meta": {
"epoch": epoch,
"last_score": last_sco... | 0 | 0 | 0 | 0 | 0 | 1,549 | 0 | 4 | 114 |
bea00290a4b5f831b2703c083765a837cb4ccbc6 | 24,100 | py | Python | model/classifier.py | ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2 | cb2e441a81f947ba17bb921f4b374953ecf6818c | [
"MIT"
] | null | null | null | model/classifier.py | ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2 | cb2e441a81f947ba17bb921f4b374953ecf6818c | [
"MIT"
] | null | null | null | model/classifier.py | ChristianLin0420/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2 | cb2e441a81f947ba17bb921f4b374953ecf6818c | [
"MIT"
] | null | null | null |
# import tensorflow as tf
# def get_pretrained_classfier(path = '/home/jupyter-ivanljh123/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2/pretrained/09_0.92'):
# #load pretrained model
# model = tf.keras.models.load_model(path)
# model.trainable = False
# return model
import os
from te... | 41.056218 | 192 | 0.567137 |
# import tensorflow as tf
# def get_pretrained_classfier(path = '/home/jupyter-ivanljh123/Simulating-Brain-signal-to-control-Hand-Movement-using-GPT2/pretrained/09_0.92'):
# #load pretrained model
# model = tf.keras.models.load_model(path)
# model.trainable = False
# return model
import mne
impor... | 0 | 593 | 0 | 0 | 0 | 22,061 | 0 | 349 | 667 |
67cc539629e1f0c248477d6c7f97e8b4b753227c | 718 | py | Python | setup.py | poorna-kumar/v-coco | 43287b2e1bb987e664a6848f0ff47961beca3bc1 | [
"MIT"
] | 131 | 2017-06-17T09:00:54.000Z | 2022-03-09T12:49:44.000Z | setup.py | poorna-kumar/v-coco | 43287b2e1bb987e664a6848f0ff47961beca3bc1 | [
"MIT"
] | 10 | 2018-04-18T07:16:32.000Z | 2021-04-05T23:29:14.000Z | setup.py | poorna-kumar/v-coco | 43287b2e1bb987e664a6848f0ff47961beca3bc1 | [
"MIT"
] | 36 | 2017-07-21T05:14:38.000Z | 2022-03-29T11:57:53.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE_fast_rcnn for details]
# Written by Ross Girshick
# --------------------------------------------------------
import numpy as np
from distutils.core import setup
from dist... | 24.758621 | 68 | 0.587744 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE_fast_rcnn for details]
# Written by Ross Girshick
# --------------------------------------------------------
import numpy as np
from distutils.core import setup
from dist... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b407f971125e15429df9fe5495b16a574b40dc54 | 2,923 | py | Python | downloaded_kernels/university_rankings/converted_notebooks/kernel_175.py | josepablocam/common-code-extraction | a6978fae73eee8ece6f1db09f2f38cf92f03b3ad | [
"MIT"
] | null | null | null | downloaded_kernels/university_rankings/converted_notebooks/kernel_175.py | josepablocam/common-code-extraction | a6978fae73eee8ece6f1db09f2f38cf92f03b3ad | [
"MIT"
] | null | null | null | downloaded_kernels/university_rankings/converted_notebooks/kernel_175.py | josepablocam/common-code-extraction | a6978fae73eee8ece6f1db09f2f38cf92f03b3ad | [
"MIT"
] | 2 | 2021-07-12T00:48:08.000Z | 2021-08-11T12:53:05.000Z | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
i... | 24.982906 | 112 | 0.72973 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as np # linear algebra
i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 40 | 66 |
f870a0467dc926deab127c8396e403b3c160fd4f | 795 | py | Python | mopidy_ytmusic/__init__.py | ppepos/mopidy-ytmusic | 4d0f2e078740b4426d87d75e68755d58d83e4875 | [
"Apache-2.0"
] | null | null | null | mopidy_ytmusic/__init__.py | ppepos/mopidy-ytmusic | 4d0f2e078740b4426d87d75e68755d58d83e4875 | [
"Apache-2.0"
] | null | null | null | mopidy_ytmusic/__init__.py | ppepos/mopidy-ytmusic | 4d0f2e078740b4426d87d75e68755d58d83e4875 | [
"Apache-2.0"
] | 1 | 2021-01-06T03:58:40.000Z | 2021-01-06T03:58:40.000Z | import logging
import pkg_resources
__version__ = pkg_resources.get_distribution("Mopidy-YTMusic").version
logger = logging.getLogger(__name__)
| 22.714286 | 70 | 0.700629 | import logging
import pathlib
import pkg_resources
from mopidy import config, ext
__version__ = pkg_resources.get_distribution("Mopidy-YTMusic").version
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = "Mopidy-YTMusic"
ext_name = "ytmusic"
version = __version__
de... | 0 | 0 | 0 | 577 | 0 | 0 | 0 | 2 | 68 |
a8bcd1f71c665c65437b5cadce21ebf805f3349e | 2,502 | py | Python | code/main.py | DataNetworkAnalysis/WhiteBox-Part2 | d66c9f646f150caa30aaba89be266f1c2a37d803 | [
"MIT"
] | 1 | 2019-12-11T16:44:19.000Z | 2019-12-11T16:44:19.000Z | code/main.py | DataNetworkAnalysis/WhiteBox-Part2 | d66c9f646f150caa30aaba89be266f1c2a37d803 | [
"MIT"
] | null | null | null | code/main.py | DataNetworkAnalysis/WhiteBox-Part2 | d66c9f646f150caa30aaba89be266f1c2a37d803 | [
"MIT"
] | null | null | null | import json
import os
import argparse
if __name__ == '__main__':
# arguments
parser = argparse.ArgumentParser()
parser.add_argument('--model', type=str, choices=['LR','DT','RF','XGB','DNN'],
help='LR: Logistic Regression or Linear Regression / DT: Decision Tree / RF: Random ... | 41.016393 | 158 | 0.67546 | from loaddata import TitanicData, HousePriceData, CervicalCancerData
from models import Classifier, Regressor
import json
import os
import argparse
def model_train(file_path, dataset, model_type, savedir, **kwargs):
# load data
# TODO: 아래 나머지 채울것
if dataset=='titanic':
titanic = TitanicData(file_p... | 24 | 0 | 0 | 0 | 0 | 1,023 | 0 | 66 | 67 |
47306ab415775a9ba960d301b060a9c59d9ab03e | 239 | py | Python | src/__main__.py | thiagoluiznunes/vehicle-detection | 66041e51038481a3a3d12e81d7fed3cac2a798a6 | [
"MIT"
] | null | null | null | src/__main__.py | thiagoluiznunes/vehicle-detection | 66041e51038481a3a3d12e81d7fed3cac2a798a6 | [
"MIT"
] | null | null | null | src/__main__.py | thiagoluiznunes/vehicle-detection | 66041e51038481a3a3d12e81d7fed3cac2a798a6 | [
"MIT"
] | null | null | null | "Main"
import sys
from detection.detection import capture_video, run_detection
if __name__ == '__main__':
VIDEO = sys.argv[1]
XML = sys.argv[2]
CAP, CAR_CASCADE = capture_video(VIDEO, XML)
run_detection(CAP, CAR_CASCADE)
| 21.727273 | 60 | 0.715481 | "Main"
import sys
from detection.detection import capture_video, run_detection
if __name__ == '__main__':
VIDEO = sys.argv[1]
XML = sys.argv[2]
CAP, CAR_CASCADE = capture_video(VIDEO, XML)
run_detection(CAP, CAR_CASCADE)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bebbdfad7041f13149ba4a0e66c08befd2b8f10a | 53 | py | Python | DTL/pycis/__init__.py | rocktavious/DevToolsLib | 117200c91a3361e04f7c8e07d2ed4999bbcfc469 | [
"MIT"
] | 1 | 2015-03-23T18:52:12.000Z | 2015-03-23T18:52:12.000Z | DTL/pycis/__init__.py | rocktavious/DevToolsLib | 117200c91a3361e04f7c8e07d2ed4999bbcfc469 | [
"MIT"
] | null | null | null | DTL/pycis/__init__.py | rocktavious/DevToolsLib | 117200c91a3361e04f7c8e07d2ed4999bbcfc469 | [
"MIT"
] | 2 | 2017-05-21T12:50:41.000Z | 2021-10-17T03:32:45.000Z | '''pyCis - Python Console Intelligence System'''
| 26.5 | 48 | 0.679245 | '''pyCis - Python Console Intelligence System'''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db2acab406e33c5fb54bef03413f005ada21a946 | 1,237 | py | Python | VoiceAssistant/wakeword/scripts/split_audio_into_chunks.py | pbazard/Voice-Assistant | c9ccdd311fa689cfd8bb43d5e4e3cb94cb690a29 | [
"MIT"
] | null | null | null | VoiceAssistant/wakeword/scripts/split_audio_into_chunks.py | pbazard/Voice-Assistant | c9ccdd311fa689cfd8bb43d5e4e3cb94cb690a29 | [
"MIT"
] | null | null | null | VoiceAssistant/wakeword/scripts/split_audio_into_chunks.py | pbazard/Voice-Assistant | c9ccdd311fa689cfd8bb43d5e4e3cb94cb690a29 | [
"MIT"
] | null | null | null | import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="script to split audio files into chunks")
parser.add_argument('--seconds', type=int, default=None,
help='if set to None, then will record forever until keyboard interrupt')
parser.add_argument... | 35.342857 | 97 | 0.632175 | import os
import argparse
from pydub import AudioSegment
from pydub.utils import make_chunks
def main(args):
def chunk_and_save(file):
audio = AudioSegment.from_file(file)
length = args.seconds * 1000 # this is in milliseconds
chunks = make_chunks(audio, length)
names = []
... | 0 | 0 | 0 | 0 | 0 | 493 | 0 | 11 | 89 |
38f5bfad3ea3c080258aa50507cfc6f2bc6204cf | 3,061 | py | Python | examples/payout_example.py | adyaksaw/xendit-python | 47b05f2a6582104a274dc12a172c6421de86febc | [
"MIT"
] | 10 | 2020-10-31T23:34:34.000Z | 2022-03-08T19:08:55.000Z | examples/payout_example.py | adyaksaw/xendit-python | 47b05f2a6582104a274dc12a172c6421de86febc | [
"MIT"
] | 22 | 2020-07-30T14:25:07.000Z | 2022-03-31T03:55:46.000Z | examples/payout_example.py | adyaksaw/xendit-python | 47b05f2a6582104a274dc12a172c6421de86febc | [
"MIT"
] | 11 | 2020-07-28T08:09:40.000Z | 2022-03-18T00:14:02.000Z |
# Hackish method to import from another directory
# Useful while xendit-python isn't released yet to the public
import importlib.machinery
loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py")
xendit = loader.load_module("xendit")
| 30.61 | 81 | 0.595557 | import time
from print_running_function import print_running_function
# Hackish method to import from another directory
# Useful while xendit-python isn't released yet to the public
import importlib.machinery
loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py")
xendit = loader.lo... | 0 | 1,576 | 0 | -11 | 0 | 852 | 0 | 26 | 341 |
b7b18e06985b828d1f5a5fab650aa921dbe618a6 | 2,317 | py | Python | src/Testing/ZopeTestCase/layer.py | hitotsunorb1/Zope | 6beac6385e1a302903889561385013874ef94cb1 | [
"ZPL-2.1"
] | null | null | null | src/Testing/ZopeTestCase/layer.py | hitotsunorb1/Zope | 6beac6385e1a302903889561385013874ef94cb1 | [
"ZPL-2.1"
] | 1 | 2020-11-11T07:11:31.000Z | 2020-11-11T07:11:31.000Z | src/Testing/ZopeTestCase/layer.py | hitotsunorb1/Zope | 6beac6385e1a302903889561385013874ef94cb1 | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 27.915663 | 78 | 0.596461 | ##############################################################################
#
# Copyright (c) 2007 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 0 | 390 | 0 | 86 | 0 | 353 | 0 | 17 | 98 |
1bded35fd5a778a23250e91822980c606179d908 | 3,075 | py | Python | p4_symbolic/bmv2/test_sdiff.py | googleinterns/p4-symbolic | 8c5ea48ecd9f82313a1c1137beac7c5b885a3a66 | [
"Apache-2.0"
] | 4 | 2020-07-05T14:48:27.000Z | 2020-11-17T06:21:38.000Z | p4_symbolic/bmv2/test_sdiff.py | googleinterns/p4-symbolic | 8c5ea48ecd9f82313a1c1137beac7c5b885a3a66 | [
"Apache-2.0"
] | 35 | 2020-06-09T21:39:00.000Z | 2020-08-14T23:11:49.000Z | p4_symbolic/bmv2/test_sdiff.py | googleinterns/p4-symbolic-test-gen | 8c5ea48ecd9f82313a1c1137beac7c5b885a3a66 | [
"Apache-2.0"
] | 1 | 2021-06-28T16:19:10.000Z | 2021-06-28T16:19:10.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.791209 | 77 | 0.665691 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e0d30687357b3d24efe8b36641a97e71e73bfd75 | 1,094 | py | Python | LeetCode/941 Valid Mountain Array.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/941 Valid Mountain Array.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | LeetCode/941 Valid Mountain Array.py | gesuwen/Algorithms | 0c9cf4412d76f8b69ef68cc80636323f5a0e5786 | [
"MIT"
] | null | null | null | # Array
# Given an array A of integers, return true if and only if it is a valid mountain array.
#
# Recall that A is a mountain array if and only if:
#
# A.length >= 3
# There exists some i with 0 < i < A.length - 1 such that:
# A[0] < A[1] < ... A[i-1] < A[i]
# A[i] > A[i+1] > ... > A[B.length - 1]
#
#
# Example 1:
... | 19.890909 | 88 | 0.447898 | # Array
# Given an array A of integers, return true if and only if it is a valid mountain array.
#
# Recall that A is a mountain array if and only if:
#
# A.length >= 3
# There exists some i with 0 < i < A.length - 1 such that:
# A[0] < A[1] < ... A[i-1] < A[i]
# A[i] > A[i+1] > ... > A[B.length - 1]
#
#
# Example 1:
... | 0 | 0 | 0 | 561 | 0 | 0 | 0 | 0 | 23 |
226bcb639bcea4f89452d8260ed27685fd41e137 | 759 | py | Python | song_wave_mfcc.py | flpxzglgh/Audio_Recognition | 8c6f8faac769cf82edf37215a8393b3ae7ae2484 | [
"Apache-2.0"
] | null | null | null | song_wave_mfcc.py | flpxzglgh/Audio_Recognition | 8c6f8faac769cf82edf37215a8393b3ae7ae2484 | [
"Apache-2.0"
] | null | null | null | song_wave_mfcc.py | flpxzglgh/Audio_Recognition | 8c6f8faac769cf82edf37215a8393b3ae7ae2484 | [
"Apache-2.0"
] | null | null | null | import librosa, librosa.display
import matplotlib.pyplot as plt
FIG_SIZE = (15,10)
file = "/home/jack/Documents/python/PycharmProjects/untitled2/show the wav/dog.wav"
signal, sample_rate = librosa.load(file, sr=22050)
plt.figure(figsize=FIG_SIZE)
librosa.display.waveplot(signal, sample_rate, alpha=0.4)
plt.xlabel("... | 23.71875 | 96 | 0.766798 | import numpy as np
import librosa, librosa.display
import matplotlib.pyplot as plt
FIG_SIZE = (15,10)
file = "/home/jack/Documents/python/PycharmProjects/untitled2/show the wav/dog.wav"
signal, sample_rate = librosa.load(file, sr=22050)
plt.figure(figsize=FIG_SIZE)
librosa.display.waveplot(signal, sample_rate, alph... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |