hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f4a2510555d14215c6a77a34b928cda043c130 | 4,628 | py | Python | bot/reviewbot/tools/jshint.py | reviewboard/ReviewBot | 6c529706229da647cc8cdef27db75cebc0abf216 | [
"MIT"
] | 91 | 2015-04-30T21:00:40.000Z | 2022-03-30T07:19:03.000Z | bot/reviewbot/tools/jshint.py | reviewboard/ReviewBot | 6c529706229da647cc8cdef27db75cebc0abf216 | [
"MIT"
] | 11 | 2015-01-08T13:48:21.000Z | 2018-07-03T13:18:35.000Z | bot/reviewbot/tools/jshint.py | reviewboard/ReviewBot | 6c529706229da647cc8cdef27db75cebc0abf216 | [
"MIT"
] | 23 | 2015-04-03T17:17:00.000Z | 2022-03-07T08:14:27.000Z | from __future__ import unicode_literals
import json
import os
from reviewbot.config import config
from reviewbot.tools.base import BaseTool, FilePatternsFromSettingMixin
from reviewbot.utils.filesystem import make_tempfile
from reviewbot.utils.process import execute
class JSHintTool(FilePatternsFromSettingMixin, Ba... | 33.057143 | 79 | 0.496543 | from __future__ import unicode_literals
import json
import os
from reviewbot.config import config
from reviewbot.tools.base import BaseTool, FilePatternsFromSettingMixin
from reviewbot.utils.filesystem import make_tempfile
from reviewbot.utils.process import execute
class JSHintTool(FilePatternsFromSettingMixin, Ba... | true | true |
f7f4a2c03ded93e13996f0859423af03e3096b1a | 106,592 | py | Python | api/migrations/0001_initial.py | LuchaComics/comicscantina-django | 78e630000fb1e1f6299f80655c8f57a496236ab1 | [
"BSD-2-Clause"
] | null | null | null | api/migrations/0001_initial.py | LuchaComics/comicscantina-django | 78e630000fb1e1f6299f80655c8f57a496236ab1 | [
"BSD-2-Clause"
] | 5 | 2021-03-19T02:58:32.000Z | 2022-03-11T23:57:30.000Z | api/migrations/0001_initial.py | lendierickx/comics-django | 3f5c6e85c89ff157dbf67179ea3b9007d7de446c | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
import django.db.models.deletion
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency... | 93.256343 | 5,778 | 0.572679 |
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
import django.db.models.deletion
from django.conf import settings
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MOD... | true | true |
f7f4a30e273e88cd16c28b354b04b902a10bcef4 | 1,502 | py | Python | __main__.py | ishansharma/open_cv_feature_detection | 34f09d6e144d8220cca9295f0a59dba7f9488516 | [
"MIT"
] | null | null | null | __main__.py | ishansharma/open_cv_feature_detection | 34f09d6e144d8220cca9295f0a59dba7f9488516 | [
"MIT"
] | null | null | null | __main__.py | ishansharma/open_cv_feature_detection | 34f09d6e144d8220cca9295f0a59dba7f9488516 | [
"MIT"
] | null | null | null | from brief import brief
from camshift import camshift
from depth_detection import depth_detection as dd
from fast import fast
from hand_contours import detector as hc
from harris_corner_detection import subpixel as hsp
from image_operations import laplacian_derivative as lp
from image_operations import transformations ... | 20.297297 | 58 | 0.738349 | from brief import brief
from camshift import camshift
from depth_detection import depth_detection as dd
from fast import fast
from hand_contours import detector as hc
from harris_corner_detection import subpixel as hsp
from image_operations import laplacian_derivative as lp
from image_operations import transformations ... | true | true |
f7f4a34b0895923a9e1b7733f5c983c0b323fa68 | 1,791 | py | Python | docs/example-ingestion-script.py | vlro/terracotta | 26ef2f61bd8306fd8fecd27288df6426a6751534 | [
"MIT"
] | null | null | null | docs/example-ingestion-script.py | vlro/terracotta | 26ef2f61bd8306fd8fecd27288df6426a6751534 | [
"MIT"
] | null | null | null | docs/example-ingestion-script.py | vlro/terracotta | 26ef2f61bd8306fd8fecd27288df6426a6751534 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import re
import glob
import tqdm
import boto3
s3 = boto3.resource('s3')
import terracotta as tc
# settings
DB_NAME = 'terracotta.sqlite'
RASTER_GLOB = r'/path/to/rasters/*.tif'
RASTER_NAME_PATTERN = r'(?P<sensor>\w{2})_(?P<tile>\w{5})_(?P<date>\d{8})_(?P<band>\w+).tif'
KEYS = ('sen... | 27.553846 | 92 | 0.695142 |
import os
import re
import glob
import tqdm
import boto3
s3 = boto3.resource('s3')
import terracotta as tc
DB_NAME = 'terracotta.sqlite'
RASTER_GLOB = r'/path/to/rasters/*.tif'
RASTER_NAME_PATTERN = r'(?P<sensor>\w{2})_(?P<tile>\w{5})_(?P<date>\d{8})_(?P<band>\w+).tif'
KEYS = ('sensor', 'tile', 'date', 'band')
KE... | true | true |
f7f4a53437399c7fe17de4ff690fc933eba1457f | 1,232 | py | Python | siapp/tests/static_pages/test_vews.py | saidulislam/siapp-python-crud-template | 4ee8ae8855f703eee36031244341a88f5c8dd2e2 | [
"Apache-2.0"
] | null | null | null | siapp/tests/static_pages/test_vews.py | saidulislam/siapp-python-crud-template | 4ee8ae8855f703eee36031244341a88f5c8dd2e2 | [
"Apache-2.0"
] | null | null | null | siapp/tests/static_pages/test_vews.py | saidulislam/siapp-python-crud-template | 4ee8ae8855f703eee36031244341a88f5c8dd2e2 | [
"Apache-2.0"
] | null | null | null | from flask import url_for
# to run test
# docker-compose exec website py.test siapp/tests
# to check code coverage
# docker-compose exec website py.test --conv-report term-missing --cov siapp
# running static code analysis
# docker-compose exec website flake8 . --exclude __init__.py
# or docker-compose e... | 37.333333 | 77 | 0.671266 | from flask import url_for
class TestPage(object):
def test_home_page(self, client):
response = client.get(url_for('static_pages.home'))
assert response.status_code == 200
def test_terms_page(self, client):
response = client.get(url_for('static_pages.terms'))
... | true | true |
f7f4a53a4769b38e22fde862434d5d2277839fd6 | 1,107 | py | Python | Chapter 08/Chap08_Example8.71.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 08/Chap08_Example8.71.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | Chapter 08/Chap08_Example8.71.py | bpbpublications/Programming-Techniques-using-Python | 49b785f37e95a3aad1d36cef51e219ac56e5e9f0 | [
"MIT"
] | null | null | null | class Human:
def __init__(self,myname,myage):
self.myname = myname
self.myage = myage
def mydisplay(self):
print("The name is: ", self.myname)
print("The age is: ", self.myage)
class Mystudent(Human):
def __init__(self,myname,myage, mycity, myhobby):
... | 30.75 | 61 | 0.607949 | class Human:
def __init__(self,myname,myage):
self.myname = myname
self.myage = myage
def mydisplay(self):
print("The name is: ", self.myname)
print("The age is: ", self.myage)
class Mystudent(Human):
def __init__(self,myname,myage, mycity, myhobby):
... | true | true |
f7f4a55f16b151737e710d9bef426ebc681b7c96 | 1,263 | py | Python | oxe-api/test/resource/setting/test_add_setting.py | CybersecurityLuxembourg/openxeco | 8d4e5578bde6a07f5d6d569b16b4de224abf7bf0 | [
"BSD-2-Clause"
] | null | null | null | oxe-api/test/resource/setting/test_add_setting.py | CybersecurityLuxembourg/openxeco | 8d4e5578bde6a07f5d6d569b16b4de224abf7bf0 | [
"BSD-2-Clause"
] | null | null | null | oxe-api/test/resource/setting/test_add_setting.py | CybersecurityLuxembourg/openxeco | 8d4e5578bde6a07f5d6d569b16b4de224abf7bf0 | [
"BSD-2-Clause"
] | null | null | null | from test.BaseCase import BaseCase
class TestAddSetting(BaseCase):
@BaseCase.login
@BaseCase.grant_access("/setting/add_setting")
def test_ok(self, token):
payload = {
"property": "PROP",
"value": "VALUE",
}
response = self.application.post('/setting/add_... | 33.236842 | 89 | 0.563737 | from test.BaseCase import BaseCase
class TestAddSetting(BaseCase):
@BaseCase.login
@BaseCase.grant_access("/setting/add_setting")
def test_ok(self, token):
payload = {
"property": "PROP",
"value": "VALUE",
}
response = self.application.post('/setting/add_... | true | true |
f7f4a615790e9f400b2e30ce776b836f61e63468 | 12,064 | py | Python | backend/scripts/curation/leng2020_AD/curate.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | null | null | null | backend/scripts/curation/leng2020_AD/curate.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | 1 | 2021-02-23T22:56:13.000Z | 2021-02-23T22:56:13.000Z | backend/scripts/curation/leng2020_AD/curate.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | null | null | null | """Create the 'original' and 'remix' datasets for the snRNAseq of human neurons AD (Leng,
et. al. 2020) biorxiv preprint submission"""
import anndata
import numpy as np
import pandas as pd
import scanpy as sc
from scipy.sparse import csr_matrix
import utils.hgnc
import utils.ontology
def basic_curation(adata):
... | 37.12 | 120 | 0.728697 |
import anndata
import numpy as np
import pandas as pd
import scanpy as sc
from scipy.sparse import csr_matrix
import utils.hgnc
import utils.ontology
def basic_curation(adata):
if not adata.obs.index.is_unique:
raise Exception("Cell IDs not unique.")
if not adata.var.index.is_unique:
... | true | true |
f7f4a74970adef7ee7e2bfe178852008403a1b3c | 3,118 | py | Python | News_fetcher/Sure/sure_info.py | PPjaisri/Senior-project | cf29a51bdff33e1cc9ae505b454a002457bc3245 | [
"MIT"
] | null | null | null | News_fetcher/Sure/sure_info.py | PPjaisri/Senior-project | cf29a51bdff33e1cc9ae505b454a002457bc3245 | [
"MIT"
] | null | null | null | News_fetcher/Sure/sure_info.py | PPjaisri/Senior-project | cf29a51bdff33e1cc9ae505b454a002457bc3245 | [
"MIT"
] | null | null | null | import os
import csv
import time
import logging
import requests
import pandas as pd
from bs4 import BeautifulSoup
class sure_info(object):
path = os.getcwd()
path = os.path.dirname(path)
# If directly run this file --> uncomment line 16 and 17.
path = os.path.dirname(path)
input_path = os.path.joi... | 28.87037 | 83 | 0.534958 | import os
import csv
import time
import logging
import requests
import pandas as pd
from bs4 import BeautifulSoup
class sure_info(object):
path = os.getcwd()
path = os.path.dirname(path)
path = os.path.dirname(path)
input_path = os.path.join(path, 'result\\Sure\\sure_thread.csv')
save_path = ... | true | true |
f7f4a760f8759bc38003574648f76467155a2480 | 2,659 | py | Python | AO3/JSON2URL.py | ecjoseph42/toastystats | bd8fba7601bd4a11759bec7c826406fca67563c2 | [
"MIT"
] | 27 | 2019-07-28T03:33:04.000Z | 2022-03-30T18:56:14.000Z | AO3/JSON2URL.py | ecjoseph42/toastystats | bd8fba7601bd4a11759bec7c826406fca67563c2 | [
"MIT"
] | null | null | null | AO3/JSON2URL.py | ecjoseph42/toastystats | bd8fba7601bd4a11759bec7c826406fca67563c2 | [
"MIT"
] | 6 | 2019-08-02T21:41:53.000Z | 2022-02-08T22:15:13.000Z | import json
import sys
import convert
if len(sys.argv) < 2:
sys.exit('Usage: %s JSON_file [-verbose]' % sys.argv[0])
verbose = False
# get cmd line args
if len(sys.argv) > 2:
arg = sys.argv[2]
if arg == "-verbose" or arg == "-v":
verbose = True
filename = sys.argv[1]
if verbose:
print "file... | 23.741071 | 128 | 0.522377 | import json
import sys
import convert
if len(sys.argv) < 2:
sys.exit('Usage: %s JSON_file [-verbose]' % sys.argv[0])
verbose = False
if len(sys.argv) > 2:
arg = sys.argv[2]
if arg == "-verbose" or arg == "-v":
verbose = True
filename = sys.argv[1]
if verbose:
print "filename: ", filename
... | false | true |
f7f4aa0c5c1ea0b37e0ad6e001f8b1078807bcb6 | 6,122 | py | Python | scripts/model.py | OleguerCanal/kaggle_digit-recognizer | 89268df3e13744faacec5bf18bdc5071abf094d4 | [
"MIT"
] | null | null | null | scripts/model.py | OleguerCanal/kaggle_digit-recognizer | 89268df3e13744faacec5bf18bdc5071abf094d4 | [
"MIT"
] | null | null | null | scripts/model.py | OleguerCanal/kaggle_digit-recognizer | 89268df3e13744faacec5bf18bdc5071abf094d4 | [
"MIT"
] | null | null | null | import datetime
import os
import pandas as pd
import numpy as np
from pathlib import Path
import sys
import time
import yaml
# Keras
from keras.models import model_from_json
from keras.optimizers import RMSprop, Adam
from keras.preprocessing.image import ImageDataGenerator
# Own imports TODO(oleguer): Fix this path p... | 40.813333 | 118 | 0.582163 | import datetime
import os
import pandas as pd
import numpy as np
from pathlib import Path
import sys
import time
import yaml
from keras.models import model_from_json
from keras.optimizers import RMSprop, Adam
from keras.preprocessing.image import ImageDataGenerator
sys.path.append(str(Path(__file__).parent))
from a... | true | true |
f7f4aa647f0869b96289b26885822b5e604b12af | 25,908 | py | Python | pyaig/aig.py | sterin/pyaig | e630c6188e03bf98504ea74b27bf1279ba6708a8 | [
"MIT"
] | 4 | 2020-09-13T04:03:25.000Z | 2021-09-27T05:05:23.000Z | pyaig/aig.py | sterin/pyaig | e630c6188e03bf98504ea74b27bf1279ba6708a8 | [
"MIT"
] | null | null | null | pyaig/aig.py | sterin/pyaig | e630c6188e03bf98504ea74b27bf1279ba6708a8 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Author: Baruch Sterin <sterin@berkeley.edu>
# Simple Python AIG package
from past.builtins import xrange
from future.utils import iteritems
import itertools
class _Node(object):
# Node types
CONST0 = 0
PI = 1
LATCH = 2
AND = 3
BUFFER = 4
# Latch initial... | 26.116935 | 139 | 0.523776 |
from past.builtins import xrange
from future.utils import iteritems
import itertools
class _Node(object):
CONST0 = 0
PI = 1
LATCH = 2
AND = 3
BUFFER = 4
INIT_ZERO = 0
INIT_ONE = 1
INIT_NONDET = 2
def __init__(self, node_type, left=0, right=0)... | true | true |
f7f4ad070b400d83a0f0d68b1019bf63521fe6a2 | 1,550 | py | Python | src/rtde/__init__.py | lucascimeca/Robotics_Palpation | 107b39f8ec464441e64e66905e718e5f1a79761e | [
"MIT"
] | 19 | 2018-07-24T22:44:22.000Z | 2022-03-26T09:37:08.000Z | src/rtde/__init__.py | lucascimeca/Robotics_Palpation | 107b39f8ec464441e64e66905e718e5f1a79761e | [
"MIT"
] | 4 | 2018-05-02T12:52:35.000Z | 2021-02-15T22:59:54.000Z | src/rtde/__init__.py | lucascimeca/Robotics_Palpation | 107b39f8ec464441e64e66905e718e5f1a79761e | [
"MIT"
] | 4 | 2018-01-22T11:06:28.000Z | 2020-03-17T08:37:24.000Z | # Copyright (c) 2016, Universal Robots A/S,
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditio... | 67.391304 | 81 | 0.775484 | true | true | |
f7f4ad2bf8d42c9435e9733de12933a3e894f180 | 2,352 | py | Python | dechorate/cadzow.py | Chutlhu/DechorateDB | 378eda37ed296f2823e3306238101343c5f4084a | [
"MIT"
] | 7 | 2021-06-01T10:57:58.000Z | 2022-03-30T03:17:16.000Z | dechorate/cadzow.py | Chutlhu/DechorateDB | 378eda37ed296f2823e3306238101343c5f4084a | [
"MIT"
] | 3 | 2021-06-25T14:48:40.000Z | 2022-02-10T05:36:30.000Z | dechorate/cadzow.py | Chutlhu/DechorateDB | 378eda37ed296f2823e3306238101343c5f4084a | [
"MIT"
] | null | null | null | import numpy as np
from dechorate.utils.dsp_utils import make_toepliz_as_in_mulan, reshape_toeplitz, enforce_toeplitz, build_frobenius_weights
def cadzow_denoise(A, n_spikes, thr_Cadzow=2e-5):
'''
Cadzow denoising method
from Condat implementation
'''
N, P = A.shape
K = n_spikes
# run Cadz... | 29.4 | 123 | 0.608418 | import numpy as np
from dechorate.utils.dsp_utils import make_toepliz_as_in_mulan, reshape_toeplitz, enforce_toeplitz, build_frobenius_weights
def cadzow_denoise(A, n_spikes, thr_Cadzow=2e-5):
N, P = A.shape
K = n_spikes
for _ in range(100):
u, s, vh = np.linalg.svd(A, full_matrices=... | true | true |
f7f4b06c8a888dedad50f4c93f188939d156e66a | 181 | py | Python | corehq/sql_proxy_accessors/migrations/0008_get_case_types_for_domain.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/sql_proxy_accessors/migrations/0008_get_case_types_for_domain.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/sql_proxy_accessors/migrations/0008_get_case_types_for_domain.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sql_proxy_accessors', '0007_ledger_accessors'),
]
operations = []
| 16.454545 | 57 | 0.679558 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sql_proxy_accessors', '0007_ledger_accessors'),
]
operations = []
| true | true |
f7f4b0765f743d8aef0ebc5645170adc7666e223 | 32,168 | py | Python | rasa/telemetry.py | kunci115/rasa | 41e3b227101e6ace3f85c2d99a7f48f4528a8b93 | [
"Apache-2.0"
] | 1 | 2021-08-02T03:42:30.000Z | 2021-08-02T03:42:30.000Z | rasa/telemetry.py | kunci115/rasa | 41e3b227101e6ace3f85c2d99a7f48f4528a8b93 | [
"Apache-2.0"
] | 42 | 2021-05-26T08:35:31.000Z | 2022-03-01T13:31:49.000Z | rasa/telemetry.py | kunci115/rasa | 41e3b227101e6ace3f85c2d99a7f48f4528a8b93 | [
"Apache-2.0"
] | null | null | null | import asyncio
from datetime import datetime
from functools import wraps
import hashlib
import json
import logging
import multiprocessing
import os
from pathlib import Path
import platform
import sys
import textwrap
import typing
from typing import Any, Callable, Dict, List, Optional, Text
import uuid
import async_gen... | 33.68377 | 88 | 0.681578 | import asyncio
from datetime import datetime
from functools import wraps
import hashlib
import json
import logging
import multiprocessing
import os
from pathlib import Path
import platform
import sys
import textwrap
import typing
from typing import Any, Callable, Dict, List, Optional, Text
import uuid
import async_gen... | true | true |
f7f4b07d9bb172bca5a017090812d865965668dd | 32,713 | py | Python | xrootdSiteMover.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | xrootdSiteMover.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | xrootdSiteMover.py | virthead/COMPASS-multijob-pilot | beac49ec432d24382d4d23aacfe6c9674a59e118 | [
"Apache-2.0"
] | null | null | null | # xrootdSiteMover.py
""" Site mover used at e.g. UTA, SLACXRD """
import os
import shutil
import commands
import urllib
from time import time
import SiteMover
from re import compile, findall
from futil import *
from PilotErrors import PilotErrors
from pUtil import tolog, readpar, verifySetupCommand, getSiteInformatio... | 42.595052 | 191 | 0.571027 |
""" Site mover used at e.g. UTA, SLACXRD """
import os
import shutil
import commands
import urllib
from time import time
import SiteMover
from re import compile, findall
from futil import *
from PilotErrors import PilotErrors
from pUtil import tolog, readpar, verifySetupCommand, getSiteInformation
from config import... | false | true |
f7f4b0ced5af07dc040d5ff95aae1c26c66241f5 | 10,604 | py | Python | tests/models/validators/v3_0_0/jsd_f831d9ed2beb5c2b967aa10db8c22046.py | CiscoISE/ciscoisesdk | 860b0fc7cc15d0c2a39c64608195a7ab3d5f4885 | [
"MIT"
] | 36 | 2021-05-18T16:24:19.000Z | 2022-03-05T13:44:41.000Z | tests/models/validators/v3_0_0/jsd_f831d9ed2beb5c2b967aa10db8c22046.py | CiscoISE/ciscoisesdk | 860b0fc7cc15d0c2a39c64608195a7ab3d5f4885 | [
"MIT"
] | 15 | 2021-06-08T19:03:37.000Z | 2022-02-25T14:47:33.000Z | tests/models/validators/v3_0_0/jsd_f831d9ed2beb5c2b967aa10db8c22046.py | CiscoISE/ciscoisesdk | 860b0fc7cc15d0c2a39c64608195a7ab3d5f4885 | [
"MIT"
] | 6 | 2021-06-10T09:32:01.000Z | 2022-01-12T08:34:39.000Z | # -*- coding: utf-8 -*-
"""Identity Services Engine getDeviceAdminAuthorizationRules data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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 wi... | 29.131868 | 83 | 0.342512 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from ciscoisesdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidatorF831D9Ed2Beb5C2B967AA10Db8C22046(object):
def __init__(self):
s... | true | true |
f7f4b2a0f35f2a6006db97542c3632c23998b2d6 | 731 | py | Python | src/peltak/extra/gitflow/commands/__init__.py | novopl/peltak | 7c8ac44f994d923091a534870960fdae1e15e95e | [
"Apache-2.0"
] | 6 | 2015-09-10T13:20:34.000Z | 2021-02-15T08:10:27.000Z | src/peltak/extra/gitflow/commands/__init__.py | novopl/peltak | 7c8ac44f994d923091a534870960fdae1e15e95e | [
"Apache-2.0"
] | 41 | 2015-09-09T12:44:55.000Z | 2021-06-01T23:25:56.000Z | src/peltak/extra/gitflow/commands/__init__.py | novopl/peltak | 7c8ac44f994d923091a534870960fdae1e15e95e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 Mateusz Klos
#
# 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.227273 | 74 | 0.686731 | true | true | |
f7f4b2a26f0964a8abf23111472ace6f079c8584 | 65,624 | py | Python | class_mbdata.py | lilianschuster/PyGEM | c805d09960f937fe6e35cdd1587f9089d4bec6b8 | [
"MIT"
] | null | null | null | class_mbdata.py | lilianschuster/PyGEM | c805d09960f937fe6e35cdd1587f9089d4bec6b8 | [
"MIT"
] | null | null | null | class_mbdata.py | lilianschuster/PyGEM | c805d09960f937fe6e35cdd1587f9089d4bec6b8 | [
"MIT"
] | null | null | null | """class of mass balance data and functions associated with manipulating the dataset to be in the proper format"""
# External libraries
import pandas as pd
import numpy as np
import calendar
import collections
import datetime
# Local libraries
import pygem_input as input
import pygemfxns_modelsetup as modelsetup
cla... | 59.174031 | 121 | 0.548671 |
import pandas as pd
import numpy as np
import calendar
import collections
import datetime
import pygem_input as input
import pygemfxns_modelsetup as modelsetup
class MBData():
def __init__(self,
name='wgms_d',
):
self.name = name
if ... | true | true |
f7f4b2b7173094e5bfb49c7d2a15f48d8f379b92 | 829 | py | Python | gluon/tests/base.py | lfntac/ipv6 | 1cf305a5fe370e71157723a40833c73aeffdf35e | [
"Apache-2.0"
] | null | null | null | gluon/tests/base.py | lfntac/ipv6 | 1cf305a5fe370e71157723a40833c73aeffdf35e | [
"Apache-2.0"
] | null | null | null | gluon/tests/base.py | lfntac/ipv6 | 1cf305a5fe370e71157723a40833c73aeffdf35e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2010-2011 OpenStack Foundation
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# htt... | 30.703704 | 75 | 0.73462 |
from oslotest import base
class TestCase(base.BaseTestCase):
def setup(self):
pass
| true | true |
f7f4b4de48a8b9fd3c5edf9a5244dc403e239a3f | 25,248 | py | Python | orgbook-issuer-agent/issuer_controller/src/issuer.py | brianorwhatever/jag-lcrb-carla-public | 8146cb866cfc9ba54b571e29738046ee068a140d | [
"Apache-2.0"
] | null | null | null | orgbook-issuer-agent/issuer_controller/src/issuer.py | brianorwhatever/jag-lcrb-carla-public | 8146cb866cfc9ba54b571e29738046ee068a140d | [
"Apache-2.0"
] | null | null | null | orgbook-issuer-agent/issuer_controller/src/issuer.py | brianorwhatever/jag-lcrb-carla-public | 8146cb866cfc9ba54b571e29738046ee068a140d | [
"Apache-2.0"
] | null | null | null | import json
import os
import threading
import time
import logging
import requests
from flask import jsonify
import config
AGENT_ADMIN_API_KEY = os.environ.get("AGENT_ADMIN_API_KEY")
ADMIN_REQUEST_HEADERS = {"Content-Type": "application/json"}
if AGENT_ADMIN_API_KEY is not None and 0 < len(AGENT_ADMIN_API_KEY):
... | 35.965812 | 105 | 0.592918 | import json
import os
import threading
import time
import logging
import requests
from flask import jsonify
import config
AGENT_ADMIN_API_KEY = os.environ.get("AGENT_ADMIN_API_KEY")
ADMIN_REQUEST_HEADERS = {"Content-Type": "application/json"}
if AGENT_ADMIN_API_KEY is not None and 0 < len(AGENT_ADMIN_API_KEY):
... | true | true |
f7f4b50a1751778c556d0163ed3ab50e01c4821b | 257 | py | Python | django_covid19/apps.py | zhangguoyuanshuai/Python-Covid19API | 2c5f69a8eed16df4c04af5137fb5574ea5125ee5 | [
"MIT"
] | 103 | 2020-05-07T06:13:25.000Z | 2022-03-27T14:15:35.000Z | django_covid19/apps.py | zhangguoyuanshuai/Python-Covid19API | 2c5f69a8eed16df4c04af5137fb5574ea5125ee5 | [
"MIT"
] | 13 | 2020-05-14T05:18:41.000Z | 2022-03-02T14:53:44.000Z | django_covid19/apps.py | zhangguoyuanshuai/Python-Covid19API | 2c5f69a8eed16df4c04af5137fb5574ea5125ee5 | [
"MIT"
] | 31 | 2020-05-17T13:24:09.000Z | 2022-03-28T09:22:31.000Z | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangoCovid19Config(AppConfig):
name = 'django_covid19'
verbose_name = _('django_covid19')
def ready(self):
import django_covid19.signals | 23.363636 | 55 | 0.754864 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class DjangoCovid19Config(AppConfig):
name = 'django_covid19'
verbose_name = _('django_covid19')
def ready(self):
import django_covid19.signals | true | true |
f7f4b56f63f5d8c54b6e8c706fae9c24ea4913fe | 3,742 | py | Python | pyhole/plugins/admin.py | roaet/pyhole | 472ab6e51e475188eecdb0221a10e3ccc2332e09 | [
"Apache-2.0"
] | null | null | null | pyhole/plugins/admin.py | roaet/pyhole | 472ab6e51e475188eecdb0221a10e3ccc2332e09 | [
"Apache-2.0"
] | null | null | null | pyhole/plugins/admin.py | roaet/pyhole | 472ab6e51e475188eecdb0221a10e3ccc2332e09 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010-2015 Josh Kearney
#
# 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 agre... | 34.018182 | 78 | 0.640299 |
from pyhole.core import plugin
from pyhole.core import utils
class Admin(plugin.Plugin):
@plugin.hook_add_command("help")
def help(self, message, params=None, **kwargs):
if params:
doc = _find_doc_string(params)
if doc:
message.dispatch(doc)
... | true | true |
f7f4b5b7445d488deeb01eef9aec21d416086347 | 10,707 | py | Python | keras/utils/layer_utils.py | IndigenousEngineering/keras_docker_with_NLTK | 075958831a3f74763ad1e094b3642f5174c7f817 | [
"MIT"
] | 300 | 2018-04-04T05:01:21.000Z | 2022-02-25T18:56:04.000Z | keras/utils/layer_utils.py | Qily/keras | 1d81a20292ca6926e595d06a6cd725dbb104a146 | [
"MIT"
] | 163 | 2018-04-03T17:41:22.000Z | 2021-09-03T16:44:04.000Z | keras/utils/layer_utils.py | Qily/keras | 1d81a20292ca6926e595d06a6cd725dbb104a146 | [
"MIT"
] | 72 | 2018-04-21T06:42:30.000Z | 2021-12-26T06:02:42.000Z | """Utilities related to layer/model functionality.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .conv_utils import convert_kernel
from .. import backend as K
import numpy as np
def count_params(weights):
"""Count the total number of scalars... | 36.667808 | 79 | 0.580648 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .conv_utils import convert_kernel
from .. import backend as K
import numpy as np
def count_params(weights):
return int(np.sum([K.count_params(p) for p in set(weights)]))
def print_summary(model, li... | true | true |
f7f4b5e2ecacf272093bdcb87da37d04d9a3e1b2 | 69,444 | py | Python | hooks/webkitpy/common/checkout/scm/scm_unittest.py | nizovn/luna-sysmgr | 48b7e2546e81d6ad1604353f2e5ab797a7d1667c | [
"Apache-2.0"
] | 3 | 2018-11-16T14:51:17.000Z | 2019-11-21T10:55:24.000Z | hooks/webkitpy/common/checkout/scm/scm_unittest.py | nizovn/luna-sysmgr | 48b7e2546e81d6ad1604353f2e5ab797a7d1667c | [
"Apache-2.0"
] | 1 | 2021-02-20T13:12:15.000Z | 2021-02-20T13:12:15.000Z | hooks/webkitpy/common/checkout/scm/scm_unittest.py | ericblade/luna-sysmgr | 82d5d7ced4ba21d3802eb2c8ae063236b6562331 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... | 43.813249 | 353 | 0.70536 |
from __future__ import with_statement
import atexit
import base64
import codecs
import getpass
import os
import os.path
import re
import stat
import sys
import subprocess
import tempfile
import time
import unittest
import urllib
import shutil
from datetime import date
from webkitpy.commo... | true | true |
f7f4b5e6412ce2f783b94d79b418c3c22a8b467e | 756 | py | Python | pydantic_aioredis/config.py | estesistech/pydantic-aioredis | facf41d04fb68349ce2e15b5aa30e574e1ba3db3 | [
"MIT"
] | 20 | 2021-08-07T23:17:59.000Z | 2022-02-15T05:08:31.000Z | pydantic_aioredis/config.py | estesistech/pydantic-aioredis | facf41d04fb68349ce2e15b5aa30e574e1ba3db3 | [
"MIT"
] | 28 | 2021-10-08T22:02:29.000Z | 2022-03-30T19:28:49.000Z | pydantic_aioredis/config.py | andrewthetechie/pydantic-aioredis | 0b83d3366e112855892bcb7fe2e460aae8f67d7e | [
"MIT"
] | 7 | 2021-10-09T08:34:02.000Z | 2022-02-20T14:58:44.000Z | """Module containing the main config classes"""
from typing import Optional
from pydantic import BaseModel
class RedisConfig(BaseModel):
"""A config object for connecting to redis"""
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
ssl: bool = False
enc... | 26.068966 | 78 | 0.611111 | from typing import Optional
from pydantic import BaseModel
class RedisConfig(BaseModel):
host: str = "localhost"
port: int = 6379
db: int = 0
password: Optional[str] = None
ssl: bool = False
encoding: Optional[str] = "utf-8"
@property
def redis_url(self) -> str:
proto = "red... | true | true |
f7f4b5fe3dee9b4abc37bdfcf868b3decfa386b1 | 5,670 | py | Python | src/prms6bmi/prms6bmi/reader.py | nhm-usgs/bmi-test-projects | 9ed065f291f0b33be9a9faeb0a02b3a253f36e9e | [
"MIT"
] | null | null | null | src/prms6bmi/prms6bmi/reader.py | nhm-usgs/bmi-test-projects | 9ed065f291f0b33be9a9faeb0a02b3a253f36e9e | [
"MIT"
] | 1 | 2020-08-14T17:45:15.000Z | 2020-08-14T17:49:00.000Z | src/prms6bmi/prms6bmi/reader.py | nhm-usgs/bmi-test-projects | 9ed065f291f0b33be9a9faeb0a02b3a253f36e9e | [
"MIT"
] | null | null | null | """
Created on Thu Dec 12 08:00:48 2019
@author:rmcd build on pangeo package by Steve Markstrom - USGS
"""
import xarray as xr
import glob
import os
import pandas as pd
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def get_DataSet_p... | 35.660377 | 104 | 0.621517 |
import xarray as xr
import glob
import os
import pandas as pd
import geopandas as gpd
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
def get_DataSet_prms6(summary, myparam):
ds = xr.open_dataset(summary)
param = xr.open_dataset(myparam)
hru_... | true | true |
f7f4b6138cd1f4bfc9502c42c16210e9224ef1ad | 959 | py | Python | zoomus/components/recording.py | appfluence/zoomus | a14e1f08700b9dad89f00b0d5c2a73a24d421c78 | [
"Apache-2.0"
] | 2 | 2020-03-14T14:47:18.000Z | 2020-04-06T23:20:54.000Z | zoomus/components/recording.py | appfluence/zoomus | a14e1f08700b9dad89f00b0d5c2a73a24d421c78 | [
"Apache-2.0"
] | null | null | null | zoomus/components/recording.py | appfluence/zoomus | a14e1f08700b9dad89f00b0d5c2a73a24d421c78 | [
"Apache-2.0"
] | 1 | 2022-03-04T11:54:56.000Z | 2022-03-04T11:54:56.000Z | """Zoom.us REST API Python Client -- Recording component"""
__author__ = "Tomas Garzon"
__email__ = "tomasgarzonhervas@gmail.com"
from zoomus import util
from zoomus.components import base
class RecordingComponent(base.BaseComponent):
"""Component dealing with all recording related matters"""
def list(self... | 31.966667 | 68 | 0.657977 |
__author__ = "Tomas Garzon"
__email__ = "tomasgarzonhervas@gmail.com"
from zoomus import util
from zoomus.components import base
class RecordingComponent(base.BaseComponent):
def list(self, **kwargs):
util.require_keys(kwargs, 'host_id')
start = kwargs.pop('start', None)
if start:
... | true | true |
f7f4b70b5e8e3945792755b04b1491ff244620e7 | 1,516 | py | Python | expenses_report/visualizations/transaction_bubbles_visualization.py | kircher-sw/expenses-tracker | afd9550616a79f54dd119d91cec209c7748e9689 | [
"BSD-3-Clause"
] | 2 | 2019-07-24T16:01:12.000Z | 2021-07-21T01:51:33.000Z | expenses_report/visualizations/transaction_bubbles_visualization.py | kircher-sw/expenses-tracker | afd9550616a79f54dd119d91cec209c7748e9689 | [
"BSD-3-Clause"
] | null | null | null | expenses_report/visualizations/transaction_bubbles_visualization.py | kircher-sw/expenses-tracker | afd9550616a79f54dd119d91cec209c7748e9689 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
from plotly import graph_objects as go
from expenses_report.chart_builder import ChartBuilder
from expenses_report.config import config
from expenses_report.preprocessing.data_provider import DataProvider
from expenses_report.visualizations.i_visualization import IVisualization
class TransactionB... | 45.939394 | 115 | 0.659631 | import pandas as pd
from plotly import graph_objects as go
from expenses_report.chart_builder import ChartBuilder
from expenses_report.config import config
from expenses_report.preprocessing.data_provider import DataProvider
from expenses_report.visualizations.i_visualization import IVisualization
class TransactionB... | true | true |
f7f4b83c9aee3f00078a498cb0077d33a4ab6da8 | 10,551 | py | Python | python/ray/_private/runtime_env/utils.py | jamesliu/ray | 11ab412db1fa3603a3006e8ed414e80dd1f11c0c | [
"Apache-2.0"
] | 3 | 2021-06-24T17:00:18.000Z | 2021-09-20T15:49:11.000Z | python/ray/_private/runtime_env/utils.py | jamesliu/ray | 11ab412db1fa3603a3006e8ed414e80dd1f11c0c | [
"Apache-2.0"
] | 227 | 2021-10-01T08:00:01.000Z | 2021-12-28T16:47:26.000Z | python/ray/_private/runtime_env/utils.py | gramhagen/ray | c18caa4db36d466718bdbcb2229aa0b2dc03da1f | [
"Apache-2.0"
] | 1 | 2020-12-03T20:36:00.000Z | 2020-12-03T20:36:00.000Z | from typing import Dict, List, Tuple, Any
import json
from ray.core.generated.runtime_env_common_pb2 \
import RuntimeEnv as ProtoRuntimeEnv
from google.protobuf import json_format
def _build_proto_pip_runtime_env(runtime_env_dict: dict,
runtime_env: ProtoRuntimeEnv):
""" Const... | 40.737452 | 79 | 0.659084 | from typing import Dict, List, Tuple, Any
import json
from ray.core.generated.runtime_env_common_pb2 \
import RuntimeEnv as ProtoRuntimeEnv
from google.protobuf import json_format
def _build_proto_pip_runtime_env(runtime_env_dict: dict,
runtime_env: ProtoRuntimeEnv):
if runtim... | true | true |
f7f4b847b74d74dfe53484e104e3962c9bfcfcd6 | 10,548 | py | Python | django_project/django_project/settings.py | jsolly/shower-thought-blog | b1f61b50f20b6cc20a10f87bbd6d9532dc0b06c5 | [
"MIT"
] | null | null | null | django_project/django_project/settings.py | jsolly/shower-thought-blog | b1f61b50f20b6cc20a10f87bbd6d9532dc0b06c5 | [
"MIT"
] | null | null | null | django_project/django_project/settings.py | jsolly/shower-thought-blog | b1f61b50f20b6cc20a10f87bbd6d9532dc0b06c5 | [
"MIT"
] | null | null | null | """
Django settings for django_project project.
Generated by 'django-admin startproject' using Django 2.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
f... | 28.203209 | 91 | 0.552522 | import os
from dotenv import load_dotenv
load_dotenv()
GIT_TOKEN = os.environ["GIT_TOKEN"]
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.environ["SECRET_KEY"]
SITE_ID = 1
DEBUG = False
CAPTCHA_TEST_MODE = False
USE_SRI = True
# HTTPS SETTINGS
SESSION_COOKIE_SECURE =... | true | true |
f7f4b9084c9040ca98af3b4ad1cca8b7c7bfbca9 | 431 | py | Python | venv/Scripts/pip3.7-script.py | kaduprasad/Face-recognition-system | febb3022a38a32c55dc1f21b7c278f5463376a6a | [
"MIT"
] | null | null | null | venv/Scripts/pip3.7-script.py | kaduprasad/Face-recognition-system | febb3022a38a32c55dc1f21b7c278f5463376a6a | [
"MIT"
] | null | null | null | venv/Scripts/pip3.7-script.py | kaduprasad/Face-recognition-system | febb3022a38a32c55dc1f21b7c278f5463376a6a | [
"MIT"
] | null | null | null | #!C:\Users\prasad\PycharmProjects\project1\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3.7'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '... | 33.153846 | 71 | 0.651972 |
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3.7')()
)
| true | true |
f7f4b952fefbc69760335d13669cb73b4ae63bb8 | 4,737 | py | Python | babel-updater/updater.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | babel-updater/updater.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | 125 | 2017-10-12T12:14:23.000Z | 2022-03-11T23:50:19.000Z | babel-updater/updater.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | # updates babel application
from distutils.dir_util import copy_tree
import logging
import logging.config
import os
import psutil
import shutil
import sys
import time
def run_update(src_directory, dst_directory):
# set up logging
LOG_FILE = 'updater_log.out'
ulogger = logging.getLogger('updater_logger')... | 37.007813 | 74 | 0.527127 |
from distutils.dir_util import copy_tree
import logging
import logging.config
import os
import psutil
import shutil
import sys
import time
def run_update(src_directory, dst_directory):
LOG_FILE = 'updater_log.out'
ulogger = logging.getLogger('updater_logger')
ulogger.setLevel(logging.DEBUG)
fo... | true | true |
f7f4bb7ec66c59ecf9c383e0854a106e9832d927 | 18,952 | py | Python | roc_auc.py | wentaozhu/deep-mil-for-whole-mammogram-classification | 8c046bbd77d268499849319cf57254015778549c | [
"MIT"
] | 106 | 2017-03-12T17:26:49.000Z | 2022-02-12T01:37:17.000Z | roc_auc.py | huhansan666666/deep-mil-for-whole-mammogram-classification | 8c046bbd77d268499849319cf57254015778549c | [
"MIT"
] | 17 | 2017-04-11T14:49:34.000Z | 2022-03-19T07:57:37.000Z | roc_auc.py | huhansan666666/deep-mil-for-whole-mammogram-classification | 8c046bbd77d268499849319cf57254015778549c | [
"MIT"
] | 41 | 2017-03-21T09:48:39.000Z | 2021-11-29T06:51:16.000Z | """
TrainExtension subclass for calculating ROC AUC scores on monitoring
dataset(s), reported via monitor channels.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
import numpy as np
try:
from sklearn.metrics import roc_auc_score, roc... | 37.088063 | 119 | 0.575981 |
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
import numpy as np
try:
from sklearn.metrics import roc_auc_score, roc_curve
except ImportError:
roc_auc_score = None
import logging
import theano
from theano import gof, config
from t... | true | true |
f7f4bbfb2c849749f466e7fe364a7d1fb17bc7dc | 217 | py | Python | loader/modules/model.py | dmvieira/ETL-example | 0734f0190ad3af57e6e55636bc75ded533537cfe | [
"MIT"
] | 1 | 2021-02-15T23:43:46.000Z | 2021-02-15T23:43:46.000Z | loader/modules/model.py | dmvieira/ETL-example | 0734f0190ad3af57e6e55636bc75ded533537cfe | [
"MIT"
] | null | null | null | loader/modules/model.py | dmvieira/ETL-example | 0734f0190ad3af57e6e55636bc75ded533537cfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
def get_db():
# database interface need these fields:
#uri = Field()
#name = Field()
#site = Field()
#kind = Field()
pass # MAKE your database connection and interface
| 21.7 | 54 | 0.589862 |
def get_db():
pass
| true | true |
f7f4bc93c34de5e87243892cad9a7c4099e1a21d | 7,604 | py | Python | tests/unit/test_pure_translators.py | yusdacra/dream2nix | 7e31c966fb0f6511115e4a128a0343c85817991d | [
"MIT"
] | 57 | 2021-11-16T13:17:47.000Z | 2022-03-30T07:19:37.000Z | tests/unit/test_pure_translators.py | yusdacra/dream2nix | 7e31c966fb0f6511115e4a128a0343c85817991d | [
"MIT"
] | 35 | 2021-11-16T18:02:33.000Z | 2022-03-30T21:10:49.000Z | tests/unit/test_pure_translators.py | yusdacra/dream2nix | 7e31c966fb0f6511115e4a128a0343c85817991d | [
"MIT"
] | 15 | 2021-11-16T21:54:16.000Z | 2022-03-23T00:26:03.000Z | import nix_ffi
import os
import pytest
def get_projects_to_test():
tests = nix_ffi.eval(
'subsystems.allTranslators',
wrapper_code = '''
{result}: let
lib = (import <nixpkgs> {}).lib;
l = lib // builtins;
in
l.flatten (
l.map
(
translator:
... | 26.587413 | 75 | 0.603761 | import nix_ffi
import os
import pytest
def get_projects_to_test():
tests = nix_ffi.eval(
'subsystems.allTranslators',
wrapper_code = '''
{result}: let
lib = (import <nixpkgs> {}).lib;
l = lib // builtins;
in
l.flatten (
l.map
(
translator:
... | true | true |
f7f4bc9a39586ce7163d6739eadf68232b36739a | 12,398 | py | Python | busca-jogos/buscaccold.py | IvanBrasilico/AI-NanoDegree | 531e63d99ae906b5908e064e9b716ebe22e48c8f | [
"MIT"
] | null | null | null | busca-jogos/buscaccold.py | IvanBrasilico/AI-NanoDegree | 531e63d99ae906b5908e064e9b716ebe22e48c8f | [
"MIT"
] | null | null | null | busca-jogos/buscaccold.py | IvanBrasilico/AI-NanoDegree | 531e63d99ae906b5908e064e9b716ebe22e48c8f | [
"MIT"
] | null | null | null | import random
from collections import OrderedDict
COLUNAS = 'ABCDEF'
PILHAS = 'abcde'
ALTURAS = '12345'
def busca_acima(posicoes, stack, posicao=None, conteiner=None):
if posicao is None:
posicao = posicoes[conteiner]
coluna = posicao[0]
pilha = posicao[1]
altura = int(posicao[2])
"""resu... | 33.061333 | 90 | 0.63599 | import random
from collections import OrderedDict
COLUNAS = 'ABCDEF'
PILHAS = 'abcde'
ALTURAS = '12345'
def busca_acima(posicoes, stack, posicao=None, conteiner=None):
if posicao is None:
posicao = posicoes[conteiner]
coluna = posicao[0]
pilha = posicao[1]
altura = int(posicao[2])
return ... | true | true |
f7f4bcbaaf66c974775580d50b3f253290ddff72 | 631 | py | Python | test/programytest/clients/render/test_passthrough.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 5 | 2018-08-21T00:13:45.000Z | 2018-09-01T20:00:55.000Z | test/programytest/clients/render/test_passthrough.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 1 | 2018-09-12T18:30:17.000Z | 2018-09-12T18:30:17.000Z | test/programytest/clients/render/test_passthrough.py | motazsaad/fit-bot-fb-clt | 580477aa1ec91855b621d9ae276f2705962f6a87 | [
"MIT"
] | 5 | 2018-08-21T00:08:36.000Z | 2018-09-23T06:11:04.000Z | import unittest
import unittest.mock
from programy.clients.render.passthrough import PassThroughRenderer
class MockConsoleBotClient(object):
def __init__(self):
self._response = None
def process_response(self, client_context, response):
self._response = response
class PassThroughRendererT... | 24.269231 | 67 | 0.735341 | import unittest
import unittest.mock
from programy.clients.render.passthrough import PassThroughRenderer
class MockConsoleBotClient(object):
def __init__(self):
self._response = None
def process_response(self, client_context, response):
self._response = response
class PassThroughRendererT... | true | true |
f7f4bd06621a1b3a71c71328142506f0024b8094 | 6,927 | py | Python | backend/weeklyemailapp_1/settings.py | crowdbotics-dev/weeklyemailapp-1 | fcf086394e864b8fa3606e18f6c5fe26146cc622 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/weeklyemailapp_1/settings.py | crowdbotics-dev/weeklyemailapp-1 | fcf086394e864b8fa3606e18f6c5fe26146cc622 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/weeklyemailapp_1/settings.py | crowdbotics-dev/weeklyemailapp-1 | fcf086394e864b8fa3606e18f6c5fe26146cc622 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for weeklyemailapp_1 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
imp... | 29.602564 | 112 | 0.730908 |
import os
import environ
import logging
from modules.manifest import get_modules
env = environ.Env()
DEBUG = env.bool("DEBUG", default=False)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development se... | true | true |
f7f4bd4cdba5e9c2a6b359065b553ed5fb37e22b | 1,586 | py | Python | examples/9-add-an-attribute-to-the-string-set.py | sprucegum/lucid-dynamodb | 1e7145b14f1f462e2d8fe320b46b3820967bbcbf | [
"MIT"
] | 70 | 2021-05-30T13:34:57.000Z | 2021-06-13T21:05:06.000Z | examples/9-add-an-attribute-to-the-string-set.py | dineshsonachalam/Course_Registration_System | 1e7145b14f1f462e2d8fe320b46b3820967bbcbf | [
"MIT"
] | 21 | 2021-07-31T07:10:51.000Z | 2022-02-05T23:46:21.000Z | examples/9-add-an-attribute-to-the-string-set.py | dineshsonachalam/Course_Registration_System | 1e7145b14f1f462e2d8fe320b46b3820967bbcbf | [
"MIT"
] | 3 | 2021-07-12T10:52:36.000Z | 2021-12-06T19:51:05.000Z | from LucidDynamodb import DynamoDb
from LucidDynamodb.exceptions import (
UnexpectedError
)
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
try:
db = DynamoDb()
db.update_item(
table_name="dev_jobs",
key={
"company_name":... | 27.824561 | 97 | 0.598991 | from LucidDynamodb import DynamoDb
from LucidDynamodb.exceptions import (
UnexpectedError
)
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
try:
db = DynamoDb()
db.update_item(
table_name="dev_jobs",
key={
"company_name":... | true | true |
f7f4be00ce835131a743c6fdfce2d9112c021dca | 39,689 | py | Python | gaofenbisai_9436.py | aDecisionTree/HRNet_for_PolSAR_seg | 5243437ffa99ac4bce074d8f19bbdc1ec054f4b0 | [
"MIT"
] | 2 | 2021-05-18T15:27:00.000Z | 2022-02-16T01:40:02.000Z | gaofenbisai_9436.py | aDecisionTree/HRNet_for_PolSAR_seg | 5243437ffa99ac4bce074d8f19bbdc1ec054f4b0 | [
"MIT"
] | 1 | 2021-11-08T09:38:36.000Z | 2021-11-10T03:01:23.000Z | gaofenbisai_9436.py | aDecisionTree/HRNet_for_PolSAR_seg | 5243437ffa99ac4bce074d8f19bbdc1ec054f4b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from PIL import Image,ImagePalette
import numpy as np
import yaml
from skimage import io
from torchvision import transforms
import os
import logging
# import functools
import torch
import torch.nn as nn
# import torch._utils
import torch.nn.functional as F
import torch.optim as optim
import xm... | 42.267306 | 3,286 | 0.587568 |
from PIL import Image,ImagePalette
import numpy as np
import yaml
from skimage import io
from torchvision import transforms
import os
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import xml.dom.minidom as xml
import glob
import threading
def writeD... | true | true |
f7f4bf0eb39d44e3864f7b087c652ccf7ed75d87 | 589 | py | Python | stepik/stepik 1_6_7.py | vittorio5/python_training | 8efba515d3e8da343dd038acee176f5ee021b230 | [
"Apache-2.0"
] | null | null | null | stepik/stepik 1_6_7.py | vittorio5/python_training | 8efba515d3e8da343dd038acee176f5ee021b230 | [
"Apache-2.0"
] | null | null | null | stepik/stepik 1_6_7.py | vittorio5/python_training | 8efba515d3e8da343dd038acee176f5ee021b230 | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
import time
from selenium.webdriver.common.by import By
try:
browser = webdriver.Chrome()
browser.get("http://suninjuly.github.io/huge_form.html")
elements = browser.find_elements(By.TAG_NAME, "input")
for element in elements:
element.send_keys("Мой ответ")
b... | 28.047619 | 64 | 0.724958 | from selenium import webdriver
import time
from selenium.webdriver.common.by import By
try:
browser = webdriver.Chrome()
browser.get("http://suninjuly.github.io/huge_form.html")
elements = browser.find_elements(By.TAG_NAME, "input")
for element in elements:
element.send_keys("Мой ответ")
b... | true | true |
f7f4c13112143253c489354d4e72eec33b7521a1 | 29 | py | Python | ciw/trackers/__init__.py | KAI10/Ciw | be035267e197ac75f8da5f0d966ef02dffb3692f | [
"MIT"
] | 107 | 2016-11-18T22:44:58.000Z | 2022-03-29T01:38:12.000Z | ciw/trackers/__init__.py | KAI10/Ciw | be035267e197ac75f8da5f0d966ef02dffb3692f | [
"MIT"
] | 117 | 2016-09-25T19:12:39.000Z | 2022-03-31T14:01:47.000Z | ciw/trackers/__init__.py | KAI10/Ciw | be035267e197ac75f8da5f0d966ef02dffb3692f | [
"MIT"
] | 34 | 2016-12-21T12:04:29.000Z | 2022-03-29T10:46:29.000Z | from .state_tracker import *
| 14.5 | 28 | 0.793103 | from .state_tracker import *
| true | true |
f7f4c1fcb6d95e6e2ba354b9da6b781d0b1ed22f | 26,234 | py | Python | old_projects/triangle_of_power/triangle.py | ianyhx/manim | 9df81ef2526025a699053e409e9543a345e670ba | [
"MIT"
] | null | null | null | old_projects/triangle_of_power/triangle.py | ianyhx/manim | 9df81ef2526025a699053e409e9543a345e670ba | [
"MIT"
] | null | null | null | old_projects/triangle_of_power/triangle.py | ianyhx/manim | 9df81ef2526025a699053e409e9543a345e670ba | [
"MIT"
] | null | null | null | import numbers
from big_ol_pile_of_manim_imports import *
from functools import reduce
OPERATION_COLORS = [YELLOW, GREEN, BLUE_B]
def get_equation(index, x = 2, y = 3, z = 8, expression_only = False):
assert(index in [0, 1, 2])
if index == 0:
tex1 = "\\sqrt[%d]{%d}"%(y, z),
tex2 = " = %d"%x
... | 31.683575 | 87 | 0.542693 | import numbers
from big_ol_pile_of_manim_imports import *
from functools import reduce
OPERATION_COLORS = [YELLOW, GREEN, BLUE_B]
def get_equation(index, x = 2, y = 3, z = 8, expression_only = False):
assert(index in [0, 1, 2])
if index == 0:
tex1 = "\\sqrt[%d]{%d}"%(y, z),
tex2 = " = %d"%x
... | true | true |
f7f4c3f03fd1e93fa2f2f599b170636bcf450aec | 463 | py | Python | DynamicTesting/buildImage.py | AbhiTaker/Container-Testing-Platform | 90d597a533a29a7984f9c7dc8ce2b59c71bd85ec | [
"MIT"
] | 1 | 2019-09-18T13:52:09.000Z | 2019-09-18T13:52:09.000Z | DynamicTesting/buildImage.py | AbhiTaker/Container-Testing-Platform | 90d597a533a29a7984f9c7dc8ce2b59c71bd85ec | [
"MIT"
] | null | null | null | DynamicTesting/buildImage.py | AbhiTaker/Container-Testing-Platform | 90d597a533a29a7984f9c7dc8ce2b59c71bd85ec | [
"MIT"
] | null | null | null | import compilers
import docker
def basicImage():
client = docker.from_env()
for key in compilers.compilers:
print(key)
tagName = key
dockerFileText = compilers.compilers[key]
dockerFile = open('dfile/Dockerfile', 'w', encoding = 'utf-8') # Getting the content of Re... | 28.9375 | 119 | 0.643629 | import compilers
import docker
def basicImage():
client = docker.from_env()
for key in compilers.compilers:
print(key)
tagName = key
dockerFileText = compilers.compilers[key]
dockerFile = open('dfile/Dockerfile', 'w', encoding = 'utf-8')
dockerFile.write(d... | true | true |
f7f4c44405a26e02bf7f109f2d2e9af3566bfdd8 | 11,046 | py | Python | sdk/python/pulumi_azure_native/datadog/v20200201preview/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/datadog/v20200201preview/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/datadog/v20200201preview/_inputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.699659 | 145 | 0.658157 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = [
'DatadogOrganizationPropertiesArgs',
'IdentityPropertiesArgs',
'MonitorPropertiesArgs',
'ResourceSkuArgs',
'UserIn... | true | true |
f7f4c44e03f96aae5aed1f58f7eca21bcb5bdba6 | 1,699 | py | Python | backtesting/backtester/BackTest/backtest.py | SankaW/teamfx | 88d4a6295b4c5e050fbb96c23d632097956e5cf8 | [
"MIT"
] | null | null | null | backtesting/backtester/BackTest/backtest.py | SankaW/teamfx | 88d4a6295b4c5e050fbb96c23d632097956e5cf8 | [
"MIT"
] | null | null | null | backtesting/backtester/BackTest/backtest.py | SankaW/teamfx | 88d4a6295b4c5e050fbb96c23d632097956e5cf8 | [
"MIT"
] | null | null | null |
from abc import ABCMeta, abstractmethod
class Strategy(object):
"""Strategy is an abstract base class providing an interface for
all subsequent (inherited) trading strategies.
The goal of a (derived) Strategy object is to output a list of signals,
which has the form of a time series indexed pandas Da... | 38.613636 | 75 | 0.728075 |
from abc import ABCMeta, abstractmethod
class Strategy(object):
__metaclass__ = ABCMeta
@abstractmethod
def generate_signals(self):
raise NotImplementedError("Should implement generate_signals()!")
class Portfolio(object):
__metaclass__ = ABCMeta
@abstractmethod
def generate_positions(self):
rais... | true | true |
f7f4c46ffbc95efb9a8733d177f945f9b84df6af | 4,064 | py | Python | flax/types/spend_bundle.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | flax/types/spend_bundle.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | flax/types/spend_bundle.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | import dataclasses
import warnings
from dataclasses import dataclass
from typing import List
from blspy import AugSchemeMPL, G2Element
from flax.types.blockchain_format.coin import Coin
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.util.streamable import Streamable, dataclass_from_dict, recu... | 37.284404 | 115 | 0.679626 | import dataclasses
import warnings
from dataclasses import dataclass
from typing import List
from blspy import AugSchemeMPL, G2Element
from flax.types.blockchain_format.coin import Coin
from flax.types.blockchain_format.sized_bytes import bytes32
from flax.util.streamable import Streamable, dataclass_from_dict, recu... | true | true |
f7f4c4efa690166b3df688287cfb0d313ebf4bfb | 267 | py | Python | software/python/potentiostat/examples/get_device_id.py | GVRX/potentiostat | 1bb44639180ad6d81697631d4d5f699e6fb4eef1 | [
"MIT"
] | null | null | null | software/python/potentiostat/examples/get_device_id.py | GVRX/potentiostat | 1bb44639180ad6d81697631d4d5f699e6fb4eef1 | [
"MIT"
] | null | null | null | software/python/potentiostat/examples/get_device_id.py | GVRX/potentiostat | 1bb44639180ad6d81697631d4d5f699e6fb4eef1 | [
"MIT"
] | null | null | null | from __future__ import print_function
from potentiostat import Potentiostat
import sys
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/tty.usbmodem65156601'
dev = Potentiostat(port)
rsp = dev.get_device_id()
print('device id: {0}'.format(rsp))
| 19.071429 | 38 | 0.722846 | from __future__ import print_function
from potentiostat import Potentiostat
import sys
if len(sys.argv) > 1:
port = sys.argv[1]
else:
port = '/dev/tty.usbmodem65156601'
dev = Potentiostat(port)
rsp = dev.get_device_id()
print('device id: {0}'.format(rsp))
| true | true |
f7f4c50af7d31fda0da774e1571e4acc94db1c9e | 1,477 | py | Python | multi_thread.py | maneeshdisodia/pythonic_examples | f722bfbe253bbcead111ba082550bdfd1c6046d3 | [
"MIT"
] | null | null | null | multi_thread.py | maneeshdisodia/pythonic_examples | f722bfbe253bbcead111ba082550bdfd1c6046d3 | [
"MIT"
] | null | null | null | multi_thread.py | maneeshdisodia/pythonic_examples | f722bfbe253bbcead111ba082550bdfd1c6046d3 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from threading import Thread
from multiprocessing import Queue
df = pd.DataFrame(data=np.random.rand(100).reshape(10, 10))
print(df.head())
rows = df.index
column = df.columns
que = Queue()
# long run
def long_run(row, col, pv):
for r in row:
for c in col:
... | 21.405797 | 104 | 0.570752 | import pandas as pd
import numpy as np
from threading import Thread
from multiprocessing import Queue
df = pd.DataFrame(data=np.random.rand(100).reshape(10, 10))
print(df.head())
rows = df.index
column = df.columns
que = Queue()
def long_run(row, col, pv):
for r in row:
for c in col:
pv.at... | true | true |
f7f4c5e305e171a8a91aa2eb3a10aa23a29972f3 | 4,905 | py | Python | drosoph_vae/settings/skeleton.py | samuelsmal/drosophVAE | 4b1887e55a5eed1d26c07b6c43de59ffab5fc7c7 | [
"MIT"
] | null | null | null | drosoph_vae/settings/skeleton.py | samuelsmal/drosophVAE | 4b1887e55a5eed1d26c07b6c43de59ffab5fc7c7 | [
"MIT"
] | null | null | null | drosoph_vae/settings/skeleton.py | samuelsmal/drosophVAE | 4b1887e55a5eed1d26c07b6c43de59ffab5fc7c7 | [
"MIT"
] | null | null | null | from enum import Enum
import numpy as np
num_cameras = 7
class Tracked(Enum):
BODY_COXA = 0
COXA_FEMUR = 1
FEMUR_TIBIA = 2
TIBIA_TARSUS = 3
TARSUS_TIP = 4
ANTENNA = 5
STRIPE = 6
tracked_points = [Tracked.BODY_COXA, Tracked.COXA_FEMUR, Tracked.FEMUR_TIBIA, Tracked.TIBIA_TARSUS, Tracked.... | 30.65625 | 154 | 0.628746 | from enum import Enum
import numpy as np
num_cameras = 7
class Tracked(Enum):
BODY_COXA = 0
COXA_FEMUR = 1
FEMUR_TIBIA = 2
TIBIA_TARSUS = 3
TARSUS_TIP = 4
ANTENNA = 5
STRIPE = 6
tracked_points = [Tracked.BODY_COXA, Tracked.COXA_FEMUR, Tracked.FEMUR_TIBIA, Tracked.TIBIA_TARSUS, Tracked.... | true | true |
f7f4c66e3e6c6e0b09291fc26896e0f0da035e95 | 4,577 | py | Python | aiokubernetes/models/v1beta2_stateful_set_update_strategy.py | tantioch/aiokubernetes | 2f332498598ece14d22f8e59ecb02665db6db68d | [
"Apache-2.0"
] | 24 | 2018-07-07T15:12:19.000Z | 2021-09-01T07:33:11.000Z | aiokubernetes/models/v1beta2_stateful_set_update_strategy.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 5 | 2018-07-11T00:09:17.000Z | 2018-10-22T16:41:54.000Z | aiokubernetes/models/v1beta2_stateful_set_update_strategy.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 3 | 2018-07-10T10:16:57.000Z | 2018-10-20T19:32:05.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
from aio... | 31.784722 | 136 | 0.626611 |
import pprint
import re
from aiokubernetes.models.v1beta2_rolling_update_stateful_set_strategy import V1beta2RollingUpdateStatefulSetStrategy
class V1beta2StatefulSetUpdateStrategy(object):
swagger_types = {
'rolling_update': 'V1beta2RollingUpdateStatefulSetStrategy',
'type': 'str'
... | true | true |
f7f4c6bf1cb1128800470db66ee985063aad5fd6 | 18,265 | py | Python | bareasgi_graphql_next/controller.py | rob-blackbourn/bareasgi-graphql | 84e46f4e082630973a275b44811ef1136bbde418 | [
"Apache-2.0"
] | 2 | 2019-04-30T11:25:21.000Z | 2019-05-13T19:38:19.000Z | bareasgi_graphql_next/controller.py | rob-blackbourn/bareasgi-graphql | 84e46f4e082630973a275b44811ef1136bbde418 | [
"Apache-2.0"
] | null | null | null | bareasgi_graphql_next/controller.py | rob-blackbourn/bareasgi-graphql | 84e46f4e082630973a275b44811ef1136bbde418 | [
"Apache-2.0"
] | null | null | null | """GraphQL base controller"""
from abc import ABCMeta, abstractmethod
import asyncio
from cgi import parse_multipart
from datetime import datetime
from functools import partial
import io
import logging
from typing import (
Any,
AsyncIterable,
Callable,
Dict,
List,
Mapping,
Optional,
Tup... | 31.876091 | 87 | 0.552642 |
from abc import ABCMeta, abstractmethod
import asyncio
from cgi import parse_multipart
from datetime import datetime
from functools import partial
import io
import logging
from typing import (
Any,
AsyncIterable,
Callable,
Dict,
List,
Mapping,
Optional,
Tuple,
Union,
cast
)
from... | true | true |
f7f4c6f753830bb7bd47d2fbd61d5c668520ec93 | 3,291 | py | Python | benchmark/startCirq2847.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq2847.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq2847.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=42
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 37.397727 | 77 | 0.680036 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[1]))
... | true | true |
f7f4c74b0831cf200b31baf17e151bdd4d169d7d | 8,841 | py | Python | shotgunCache/validateFields.py | moonbot/shotgun-cache-server | 1a4d287e89cf6422b564accc5db4e7879aaad51d | [
"MIT"
] | 11 | 2015-07-15T09:29:45.000Z | 2020-07-20T03:45:57.000Z | shotgunCache/validateFields.py | moonbot/shotgun-cache-server | 1a4d287e89cf6422b564accc5db4e7879aaad51d | [
"MIT"
] | 1 | 2016-03-11T16:58:51.000Z | 2021-04-04T18:08:05.000Z | shotgunCache/validateFields.py | moonbot/shotgun-cache-server | 1a4d287e89cf6422b564accc5db4e7879aaad51d | [
"MIT"
] | 3 | 2016-03-10T08:51:37.000Z | 2018-02-16T07:04:17.000Z | import os
import time
import logging
import multiprocessing
import difflib
import Queue
import rethinkdb
import utils
__all__ = [
'FieldValidator'
]
LOG = logging.getLogger(__name__)
class FieldValidator(object):
def __init__(self, config, entityConfigManager, entityConfigs, filters, filterOperator, field... | 36.533058 | 123 | 0.557516 | import os
import time
import logging
import multiprocessing
import difflib
import Queue
import rethinkdb
import utils
__all__ = [
'FieldValidator'
]
LOG = logging.getLogger(__name__)
class FieldValidator(object):
def __init__(self, config, entityConfigManager, entityConfigs, filters, filterOperator, field... | true | true |
f7f4c7d8c5f1a0714e9af14419ae462deb0470c5 | 15,353 | py | Python | pdf_operations.py | TapirLab/pdf-watermarkin | f4e07f068ebb17e36fa2c8065f432ebd0d92a804 | [
"MIT"
] | 2 | 2021-02-23T20:00:18.000Z | 2021-04-24T21:38:01.000Z | pdf_operations.py | TapirLab/pdf-watermarking | f4e07f068ebb17e36fa2c8065f432ebd0d92a804 | [
"MIT"
] | null | null | null | pdf_operations.py | TapirLab/pdf-watermarking | f4e07f068ebb17e36fa2c8065f432ebd0d92a804 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This program includes functions to add watermark to A4 PDFs. Also, miscellaneous
functions are provided to harden OCR (Optical Character Recognition) process and
make encryption possible.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% A PDF Watermarking S... | 41.607046 | 99 | 0.650557 |
import os
import glob
from datetime import datetime
import cv2
import numpy as np
import pikepdf
from pdf2image import convert_from_path
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import A4, landscape
from PyPDF2 import PdfFileWriter, PdfFileReader, PdfFileMerger
def set_page(name, orientati... | true | true |
f7f4c9866b1d036fbb9af1f9bf84345bf1046243 | 1,888 | py | Python | tests/test_downloadqueue.py | runrin/castero | 4f516766d126c37a50b02b47676e11a48ed2800d | [
"MIT"
] | null | null | null | tests/test_downloadqueue.py | runrin/castero | 4f516766d126c37a50b02b47676e11a48ed2800d | [
"MIT"
] | null | null | null | tests/test_downloadqueue.py | runrin/castero | 4f516766d126c37a50b02b47676e11a48ed2800d | [
"MIT"
] | null | null | null | import os
from unittest import mock
from castero.downloadqueue import DownloadQueue
from castero.episode import Episode
from castero.feed import Feed
my_dir = os.path.dirname(os.path.realpath(__file__))
feed = Feed(file=my_dir + "/feeds/valid_basic.xml")
episode1 = Episode(feed=feed, title="episode1 title")
episode2... | 29.968254 | 68 | 0.746292 | import os
from unittest import mock
from castero.downloadqueue import DownloadQueue
from castero.episode import Episode
from castero.feed import Feed
my_dir = os.path.dirname(os.path.realpath(__file__))
feed = Feed(file=my_dir + "/feeds/valid_basic.xml")
episode1 = Episode(feed=feed, title="episode1 title")
episode2... | true | true |
f7f4ca25724ed442b6bef372ecff9c9deeea380d | 546 | py | Python | quietude/quietude/menus/AddQCollectionModifierPieMenu.py | x-serenity/quietude | abd9a0eeb8bb5962f172396ed3db37b30b226c96 | [
"MIT"
] | null | null | null | quietude/quietude/menus/AddQCollectionModifierPieMenu.py | x-serenity/quietude | abd9a0eeb8bb5962f172396ed3db37b30b226c96 | [
"MIT"
] | null | null | null | quietude/quietude/menus/AddQCollectionModifierPieMenu.py | x-serenity/quietude | abd9a0eeb8bb5962f172396ed3db37b30b226c96 | [
"MIT"
] | null | null | null | import bpy
class AddQCollectionModifierPieMenu(bpy.types.Menu):
# label is displayed at the center of the pie menu.
bl_idname = "VIEW3D_MT_AddQCollectionModifierPieMenu"
bl_label = "QCollection Modifiers"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
... | 39 | 98 | 0.694139 | import bpy
class AddQCollectionModifierPieMenu(bpy.types.Menu):
bl_idname = "VIEW3D_MT_AddQCollectionModifierPieMenu"
bl_label = "QCollection Modifiers"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
pie.operator_enum(operator=... | true | true |
f7f4cb01e96b7a34de544b928514048df369208a | 179 | py | Python | request.py | wallik2/Deploy-model-Iris.csv | 55348b96ebdf77a33818eca732ef4a5305a85a1d | [
"MIT"
] | 5 | 2021-12-28T07:59:52.000Z | 2022-01-09T11:31:02.000Z | request.py | wallik2/Deploy-model-Iris.csv | 55348b96ebdf77a33818eca732ef4a5305a85a1d | [
"MIT"
] | 7 | 2021-12-28T07:50:00.000Z | 2022-01-09T09:57:48.000Z | request.py | wallik2/Deploy-model-Iris.csv | 55348b96ebdf77a33818eca732ef4a5305a85a1d | [
"MIT"
] | 1 | 2021-12-17T13:21:48.000Z | 2021-12-17T13:21:48.000Z | import requests
url = 'http://localhost:5000/predict_api'
r = requests.post(url,json={'sepal_length':2, 'sepal_width':9, 'petal_length':6, 'petal_width':2})
print(r.json()) | 29.833333 | 99 | 0.698324 | import requests
url = 'http://localhost:5000/predict_api'
r = requests.post(url,json={'sepal_length':2, 'sepal_width':9, 'petal_length':6, 'petal_width':2})
print(r.json()) | true | true |
f7f4cb246eaccee207dfb0854e393bf8840dae2f | 10,323 | py | Python | dcCustom/data/data_loader.py | simonfqy/DTI_prediction | e01c592cc06c4de04b3ed6db35da5af5ff7f863f | [
"MIT"
] | 31 | 2018-08-15T13:35:24.000Z | 2022-02-18T08:11:12.000Z | dcCustom/data/data_loader.py | simonfqy/DTI_prediction | e01c592cc06c4de04b3ed6db35da5af5ff7f863f | [
"MIT"
] | 14 | 2018-07-13T03:56:19.000Z | 2020-05-22T23:25:34.000Z | dcCustom/data/data_loader.py | simonfqy/DTI_prediction | e01c592cc06c4de04b3ed6db35da5af5ff7f863f | [
"MIT"
] | 13 | 2018-07-13T03:56:26.000Z | 2021-02-24T10:58:37.000Z | """
Process an input dataset into a format suitable for machine learning.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import gzip
import pandas as pd
import numpy as np
import csv
import numbers
import tempfile
from rdkit.Chem import rdmolf... | 34.069307 | 99 | 0.694275 | from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import gzip
import pandas as pd
import numpy as np
import csv
import numbers
import tempfile
from rdkit.Chem import rdmolfiles
from rdkit.Chem import rdmolops
from rdkit import Chem
import time
import... | true | true |
f7f4cbfd58c36403999b2ed0805de9888ac43f75 | 3,950 | py | Python | app/models/image_nd.py | lv10/ross_sea | a4d89f06ef15bc2f7008fc5859d85ad86a0cba36 | [
"MIT"
] | null | null | null | app/models/image_nd.py | lv10/ross_sea | a4d89f06ef15bc2f7008fc5859d85ad86a0cba36 | [
"MIT"
] | null | null | null | app/models/image_nd.py | lv10/ross_sea | a4d89f06ef15bc2f7008fc5859d85ad86a0cba36 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
from matplotlib import pyplot as plt
from tools import data
class ImageND(object):
SENSOR = None
def __init__(self, filename, dimensions=3):
if dimensions < 3:
print "The image doesn't have the minimum of 3 dimensions"
sys.exit(1)
... | 24.842767 | 79 | 0.508354 | import os
import sys
import numpy as np
from matplotlib import pyplot as plt
from tools import data
class ImageND(object):
SENSOR = None
def __init__(self, filename, dimensions=3):
if dimensions < 3:
print "The image doesn't have the minimum of 3 dimensions"
sys.exit(1)
... | false | true |
f7f4cc4ce223b241d75cb344ef252e0d6303b292 | 458 | py | Python | DS-400/Medium/274-H-Index/Counting.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | 2 | 2020-04-24T18:36:52.000Z | 2020-04-25T00:15:57.000Z | DS-400/Medium/274-H-Index/Counting.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | DS-400/Medium/274-H-Index/Counting.py | ericchen12377/Leetcode-Algorithm-Python | eb58cd4f01d9b8006b7d1a725fc48910aad7f192 | [
"MIT"
] | null | null | null | class Solution:
def hIndex(self, citations):
n = len(citations)
# papers[i] is the number of papers with i citations.
papers = [0] * (n + 1)
for c in citations:
# All papers with citations larger than n is count as n.
papers[min(n, c)] += 1
i = n
... | 30.533333 | 68 | 0.49345 | class Solution:
def hIndex(self, citations):
n = len(citations)
papers = [0] * (n + 1)
for c in citations:
papers[min(n, c)] += 1
i = n
s = papers[n]
while i > s:
i -= 1
s += papers[i]
return i
| true | true |
f7f4ce2203670430de4c5248b66597fbd728c46b | 441 | py | Python | python-bindings/b2_terraform/arg_parser.py | reef-technologies/terraform-provider-b2 | 333d6146d30ce3d56b4405851b28b99b5b628eaa | [
"MIT"
] | 27 | 2020-12-18T01:04:18.000Z | 2022-03-06T08:37:14.000Z | python-bindings/b2_terraform/arg_parser.py | reef-technologies/terraform-provider-b2 | 333d6146d30ce3d56b4405851b28b99b5b628eaa | [
"MIT"
] | 25 | 2021-01-10T19:56:16.000Z | 2022-03-30T00:02:03.000Z | python-bindings/b2_terraform/arg_parser.py | reef-technologies/terraform-provider-b2 | 333d6146d30ce3d56b4405851b28b99b5b628eaa | [
"MIT"
] | 8 | 2020-11-27T16:33:55.000Z | 2022-03-26T10:48:07.000Z | ######################################################################
#
# File: python-bindings/b2_terraform/arg_parser.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
import arg... | 25.941176 | 70 | 0.512472 | true | true | |
f7f4cedd52a7dcb6ed1aa094918694044a23aa26 | 11,350 | py | Python | SoftLayer/managers/load_balancer.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | SoftLayer/managers/load_balancer.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | SoftLayer/managers/load_balancer.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """
SoftLayer.load_balancer
~~~~~~~~~~~~~~~~~~~~~~~
Load Balancer Manager/helpers
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import exceptions
from SoftLayer.managers import ordering
from SoftLayer import utils
class LoadBalancerManager(utils.IdentifierMixin, object):
"""Mana... | 40.827338 | 116 | 0.664229 | from SoftLayer import exceptions
from SoftLayer.managers import ordering
from SoftLayer import utils
class LoadBalancerManager(utils.IdentifierMixin, object):
TYPE = {
1: "Public to Private",
0: "Private to Private",
2: "Public to Public",
}
def __init__(self, client):
sel... | true | true |
f7f4cfec1c6450d6e7c30d5c08af076255c16635 | 16,527 | py | Python | catalyst/callbacks/metric.py | otherman16/catalyst | ccef2c7de7ff3869523a86f291b6a2390308bad5 | [
"Apache-2.0"
] | 1 | 2020-11-14T13:35:22.000Z | 2020-11-14T13:35:22.000Z | catalyst/callbacks/metric.py | otherman16/catalyst | ccef2c7de7ff3869523a86f291b6a2390308bad5 | [
"Apache-2.0"
] | null | null | null | catalyst/callbacks/metric.py | otherman16/catalyst | ccef2c7de7ff3869523a86f291b6a2390308bad5 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Dict, List, TYPE_CHECKING, Union
from abc import ABC, abstractmethod
from collections import defaultdict
import logging
import numpy as np
import torch
from catalyst.core.callback import Callback, CallbackNode, CallbackOrder
from catalyst.tools.meters.averagevaluemeter import Averag... | 31.967118 | 79 | 0.582864 | from typing import Any, Callable, Dict, List, TYPE_CHECKING, Union
from abc import ABC, abstractmethod
from collections import defaultdict
import logging
import numpy as np
import torch
from catalyst.core.callback import Callback, CallbackNode, CallbackOrder
from catalyst.tools.meters.averagevaluemeter import Averag... | true | true |
f7f4d0076679114fa6b234a7a13712c5c29bf2c5 | 6,458 | py | Python | test/test_id_parsers.py | RalfG/pyAscore | 9467276f22d230369b24fd56cd69eccb9e82d51c | [
"MIT"
] | 6 | 2021-07-27T10:15:33.000Z | 2022-03-25T18:27:54.000Z | test/test_id_parsers.py | RalfG/pyAscore | 9467276f22d230369b24fd56cd69eccb9e82d51c | [
"MIT"
] | 7 | 2021-07-26T11:56:52.000Z | 2022-03-12T00:13:48.000Z | test/test_id_parsers.py | RalfG/pyAscore | 9467276f22d230369b24fd56cd69eccb9e82d51c | [
"MIT"
] | 1 | 2021-08-03T14:53:15.000Z | 2021-08-03T14:53:15.000Z | import unittest
import os
import pickle
from itertools import product
from pyascore import id_parsers
import numpy as np
from pyteomics import mass
STD_AA_MASS = mass.std_aa_mass
class TestMassCorrector(unittest.TestCase):
corrector = id_parsers.MassCorrector()
def test_n_term(self):
res = "X"
... | 41.935065 | 148 | 0.539796 | import unittest
import os
import pickle
from itertools import product
from pyascore import id_parsers
import numpy as np
from pyteomics import mass
STD_AA_MASS = mass.std_aa_mass
class TestMassCorrector(unittest.TestCase):
corrector = id_parsers.MassCorrector()
def test_n_term(self):
res = "X"
... | true | true |
f7f4d0287cb7142bf8ea3a0a8c8bdc7398d46a9a | 1,051 | py | Python | test/test_del_contact_from_group.py | DmitriyNeurov/python_training | 64de4dc4dd392ae341933ea8721bdd694cfc03db | [
"Apache-2.0"
] | null | null | null | test/test_del_contact_from_group.py | DmitriyNeurov/python_training | 64de4dc4dd392ae341933ea8721bdd694cfc03db | [
"Apache-2.0"
] | null | null | null | test/test_del_contact_from_group.py | DmitriyNeurov/python_training | 64de4dc4dd392ae341933ea8721bdd694cfc03db | [
"Apache-2.0"
] | null | null | null | from model.group import Group
from model.contact import Contact
def test_del_contact_from_group(app, db, orm):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
old_groups = db.get_group_list()
new_groups = db.get_group_list()
assert len(old_groups) == len(new_groups)
... | 40.423077 | 71 | 0.730733 | from model.group import Group
from model.contact import Contact
def test_del_contact_from_group(app, db, orm):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="test"))
old_groups = db.get_group_list()
new_groups = db.get_group_list()
assert len(old_groups) == len(new_groups)
... | true | true |
f7f4d0a0630ca5f26f7f623613c839e1f70d6aeb | 227 | py | Python | b0mb3r/services/tabris.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | b0mb3r/services/tabris.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | b0mb3r/services/tabris.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | from b0mb3r.services.service import Service
class Tabris(Service):
async def run(self):
await self.post(
"https://lk.tabris.ru/reg/", data={"action": "phone", "phone": self.formatted_phone},
)
| 25.222222 | 97 | 0.621145 | from b0mb3r.services.service import Service
class Tabris(Service):
async def run(self):
await self.post(
"https://lk.tabris.ru/reg/", data={"action": "phone", "phone": self.formatted_phone},
)
| true | true |
f7f4d10469d7c901d03b5db5f6072168f0caf564 | 2,280 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/ListSourceReplicaRequest.py | silent-beaters/aliyun-openapi-python-sdk | 7a025eabdad622af07affc3a7beeae1c5def469d | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/ListSourceReplicaRequest.py | silent-beaters/aliyun-openapi-python-sdk | 7a025eabdad622af07affc3a7beeae1c5def469d | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/ListSourceReplicaRequest.py | silent-beaters/aliyun-openapi-python-sdk | 7a025eabdad622af07affc3a7beeae1c5def469d | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.529412 | 76 | 0.760526 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkiot.endpoint import endpoint_data
class ListSourceReplicaRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'ListSourceReplica','iot')
self.set_method('POST')
if hasattr(self, "endpoint_map"):
... | true | true |
f7f4d1610bfdea2050a0041cbdd29c08242ac386 | 16,255 | py | Python | tensorflow_probability/python/distributions/multivariate_student_t_test.py | ValentinMouret/probability | 7ea6cc55e5b3fed04372cd188cd0764e92fd3cf4 | [
"Apache-2.0"
] | 1 | 2020-04-29T11:29:25.000Z | 2020-04-29T11:29:25.000Z | tensorflow_probability/python/distributions/multivariate_student_t_test.py | ValentinMouret/probability | 7ea6cc55e5b3fed04372cd188cd0764e92fd3cf4 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/multivariate_student_t_test.py | ValentinMouret/probability | 7ea6cc55e5b3fed04372cd188cd0764e92fd3cf4 | [
"Apache-2.0"
] | 1 | 2020-07-04T21:37:20.000Z | 2020-07-04T21:37:20.000Z | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.549878 | 85 | 0.640787 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow_probability.python.distributions import multivariate_student_t as mvt
from tensorflow_probabil... | true | true |
f7f4d1e5a55e48b9b376d603ce872c4de3ef6754 | 1,187 | py | Python | unittests/test_IO.py | tyburesh/Forest | 59b213e4d8a0587d8bb24b9f7a2d05b9734b4bd7 | [
"BSD-3-Clause"
] | null | null | null | unittests/test_IO.py | tyburesh/Forest | 59b213e4d8a0587d8bb24b9f7a2d05b9734b4bd7 | [
"BSD-3-Clause"
] | null | null | null | unittests/test_IO.py | tyburesh/Forest | 59b213e4d8a0587d8bb24b9f7a2d05b9734b4bd7 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Eric Shook. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
@author: eshook (Eric Shook, eshook@gmail.edu)
@contributors: <Contribute and add your name here!>
"""
from forest import *
import unittest
# Test forest/bobs/Bob.p... | 25.255319 | 97 | 0.593934 |
from forest import *
import unittest
def maketiles(nfiles,nrows,ncols):
for f_i in range(nfiles):
f = open("unittests/tmp_raster"+str(f_i)+".asc","w")
f.write("ncols "+str(ncols)+"\n")
f.write("nrows "+str(nrows)+"\n")
f.write("xllcorner 0.0\n")
f.write("yllcorner 0.0\n")
... | true | true |
f7f4d32b0d4c21102074690da7e79ca0ebfccf27 | 38 | py | Python | workflowV2/__init__.py | neal-p/workflow2.0 | 65a71754310051ddb3fd4338ff579c499608a483 | [
"MIT"
] | null | null | null | workflowV2/__init__.py | neal-p/workflow2.0 | 65a71754310051ddb3fd4338ff579c499608a483 | [
"MIT"
] | 1 | 2021-07-22T15:19:58.000Z | 2021-07-22T15:19:58.000Z | workflowV2/__init__.py | neal-p/workflowV2 | 65a71754310051ddb3fd4338ff579c499608a483 | [
"MIT"
] | null | null | null | __logfile__ = None
__logging__ = True
| 12.666667 | 18 | 0.789474 | __logfile__ = None
__logging__ = True
| true | true |
f7f4d3b9535ce4d4fb1b20268ca4d5034dd6d28a | 119 | py | Python | src/__init__.py | superserver/MinecraftServerAutoDeploy | d2af2b4528572924c83e80b05ceee69166803083 | [
"Apache-2.0"
] | 1 | 2019-01-31T14:08:24.000Z | 2019-01-31T14:08:24.000Z | src/__init__.py | superserver/MinecraftServerAutoDeploy | d2af2b4528572924c83e80b05ceee69166803083 | [
"Apache-2.0"
] | null | null | null | src/__init__.py | superserver/MinecraftServerAutoDeploy | d2af2b4528572924c83e80b05ceee69166803083 | [
"Apache-2.0"
] | null | null | null | from src import init
from src import start
from src import pull
from src import push
print("You have imported package") | 23.8 | 34 | 0.806723 | from src import init
from src import start
from src import pull
from src import push
print("You have imported package") | true | true |
f7f4d3f2f63044301a2b8de2037559d9879ff3de | 1,815 | py | Python | django_mini_fastapi/fastapi/concurrency.py | hanyichiu/django-mini-fastapi | 911340319d4be28634ed49b90b862adf18b4e79a | [
"MIT"
] | null | null | null | django_mini_fastapi/fastapi/concurrency.py | hanyichiu/django-mini-fastapi | 911340319d4be28634ed49b90b862adf18b4e79a | [
"MIT"
] | null | null | null | django_mini_fastapi/fastapi/concurrency.py | hanyichiu/django-mini-fastapi | 911340319d4be28634ed49b90b862adf18b4e79a | [
"MIT"
] | null | null | null | from typing import Any, Callable
# from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa
# from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa
# from starlette.concurrency import ( # noqa
# run_until_first_complete as run_until_first_complete,
# )
fr... | 34.245283 | 90 | 0.730579 | from typing import Any, Callable
port iterate_in_threadpool, run_in_threadpool, run_until_first_complete
asynccontextmanager_error_message = """
FastAPI's contextmanager_in_threadpool require Python 3.7 or above,
or the backport for Python 3.6, installed with:
pip install async-generator
"""
def _fake_asynccont... | true | true |
f7f4d41a60fd28a6ed65ec2c50399477fba862f2 | 4,184 | py | Python | trac/tests/functional/svntestenv.py | tiagoeckhardt/trac | b18c226195bfed8cd19cba97c6f03bd54dbbc044 | [
"BSD-3-Clause"
] | null | null | null | trac/tests/functional/svntestenv.py | tiagoeckhardt/trac | b18c226195bfed8cd19cba97c6f03bd54dbbc044 | [
"BSD-3-Clause"
] | null | null | null | trac/tests/functional/svntestenv.py | tiagoeckhardt/trac | b18c226195bfed8cd19cba97c6f03bd54dbbc044 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2019 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This software cons... | 35.760684 | 79 | 0.588671 |
import os
import re
from subprocess import call
from testenv import FunctionalTestEnvironment
from trac.util.compat import close_fds
class SvnFunctionalTestEnvironment(FunctionalTestEnvironment):
def work_dir(self):
return os.path.join(self.dirname, 'workdir')
def repo_path(self, filena... | true | true |
f7f4d41d2465d5a2cf784854e9dd0ea79988b37c | 1,596 | py | Python | cogs/ping.py | Ashwinshankar98/ClassMateBot | 99441c02107b649aedd4b57f34be12823d01ea74 | [
"MIT"
] | null | null | null | cogs/ping.py | Ashwinshankar98/ClassMateBot | 99441c02107b649aedd4b57f34be12823d01ea74 | [
"MIT"
] | 64 | 2021-11-25T22:13:19.000Z | 2021-12-05T00:25:05.000Z | cogs/ping.py | chandur626/ClassMateBot | 6946767a5f1aec6d3e4386615d9b1eefb27c07ab | [
"MIT"
] | 4 | 2021-10-31T19:42:00.000Z | 2021-11-28T09:55:32.000Z | # Copyright (c) 2021 War-Keeper
import discord
from discord.ext import commands
# ----------------------------------------------------------------------------------------------
# Returns the ping of the bot, useful for testing bot lag and as a simple functionality command
# --------------------------------------------... | 40.923077 | 111 | 0.47619 |
import discord
from discord.ext import commands
class Helpful(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def ping(self, ctx):
await ctx.send(f"Pong! My ping currently is {round(min(999999999, self.b... | true | true |
f7f4d45e374d076f89128a81065c94720fb85fbb | 2,713 | py | Python | MLWorker/dataset_service.py | harymitchell/mscs-ml | 4e284c79c9c30926c7ca24ac8bf082b4cefadddc | [
"MIT"
] | 1 | 2018-05-31T14:58:49.000Z | 2018-05-31T14:58:49.000Z | MLWorker/dataset_service.py | harymitchell/mscs-ml | 4e284c79c9c30926c7ca24ac8bf082b4cefadddc | [
"MIT"
] | 7 | 2018-03-20T15:05:55.000Z | 2018-03-21T19:47:25.000Z | MLWorker/dataset_service.py | harymitchell/mscs-ml | 4e284c79c9c30926c7ca24ac8bf082b4cefadddc | [
"MIT"
] | null | null | null | import numpy as np
from numpy import ma
import pandas
from bson.objectid import ObjectId
from pymongo import MongoClient
from settings import TEST_MONGO_HOST, TEST_MONGO_PORT, TEST_MONGO_USERNAME, TEST_MONGO_PASSWORD
import gridfs
import pprint
import StringIO
class dataset_service (object):
"""Service ... | 35.697368 | 177 | 0.598968 | import numpy as np
from numpy import ma
import pandas
from bson.objectid import ObjectId
from pymongo import MongoClient
from settings import TEST_MONGO_HOST, TEST_MONGO_PORT, TEST_MONGO_USERNAME, TEST_MONGO_PASSWORD
import gridfs
import pprint
import StringIO
class dataset_service (object):
def __ini... | true | true |
f7f4d4c1ca4024665ad09d816148fd725f5740fa | 7,742 | py | Python | svm.py | AliMakiGmail/SFD-CNN-TL | 96890a086cb170334f761a825a5fdcdc51444696 | [
"MIT"
] | 27 | 2018-09-12T12:00:44.000Z | 2022-03-20T07:33:01.000Z | svm.py | AliMakiGmail/SFD-CNN-TL | 96890a086cb170334f761a825a5fdcdc51444696 | [
"MIT"
] | 2 | 2020-01-13T16:35:50.000Z | 2020-09-07T07:10:12.000Z | svm.py | AliMakiGmail/SFD-CNN-TL | 96890a086cb170334f761a825a5fdcdc51444696 | [
"MIT"
] | 16 | 2018-08-11T14:41:09.000Z | 2021-10-31T13:24:32.000Z | #!/usr/bin/env python
# Copyright 2019 Augusto Cunha and Axelle Pochet
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this code and
# associated documentation files, to deal in the code without restriction,
# including without limitation the rights to use, copy, modify, merge, pub... | 42.306011 | 181 | 0.691036 |
__license__ = "MIT"
__author__ = "Augusto Cunha, Axelle Pochet"
__email__ = "acunha@tecgraf.puc-rio.br, axelle@tecgraf.puc-rio.br"
__credits__ = ["Augusto Cunha", "Axelle Pochet", "Helio Lopes", "Marcelo Gattass"]
miter=' ', header = None)
trainImageDataList.append(df.values)
trainClas... | true | true |
f7f4d4f97d862b6d4a11c151ec3f9909b5d29c35 | 1,849 | py | Python | main/src/mecab.py | seven320/metamon_code | 48b3acde55f5ef2d062586a3c8fc792d8b4a4025 | [
"MIT"
] | 13 | 2020-01-22T12:09:10.000Z | 2021-05-26T16:03:36.000Z | main/src/mecab.py | seven320/metamon_code | 48b3acde55f5ef2d062586a3c8fc792d8b4a4025 | [
"MIT"
] | 15 | 2020-01-20T18:46:31.000Z | 2021-12-12T11:27:35.000Z | main/src/mecab.py | seven320/metamon_code | 48b3acde55f5ef2d062586a3c8fc792d8b4a4025 | [
"MIT"
] | 2 | 2020-01-17T14:59:14.000Z | 2020-04-12T12:13:25.000Z | #encoding:utf-8
import sys
import MeCab
import tweepy
#親ディレクトリにあるアカウント情報へのパス
import sys,os
pardir=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pardir)
#account情報をaccount.pyからロード
from account import account #load account
text="月が綺麗ですね。メロンパン。メロン。パン"
test = "豚汁垢、徹底的に中の人要素を排除して一貫性のあるツイートここ... | 27.191176 | 125 | 0.633856 |
import sys
import MeCab
import tweepy
import sys,os
pardir=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(pardir)
from account import account
text="月が綺麗ですね。メロンパン。メロン。パン"
test = "豚汁垢、徹底的に中の人要素を排除して一貫性のあるツイートこころがけて話題性提供してめちゃくちゃ自発してふぁぼ爆して5日くらいでフォロー500フォロワー200?くらいにしたのなかなかじゃないか? 自業自得とはいえつ... | false | true |
f7f4d523226aba579fff89dd465bb742f4a28d04 | 435 | py | Python | setup.py | rodrigocam/whaler | 1b1fe275eab690c410cf46de449f431e642da907 | [
"MIT"
] | null | null | null | setup.py | rodrigocam/whaler | 1b1fe275eab690c410cf46de449f431e642da907 | [
"MIT"
] | null | null | null | setup.py | rodrigocam/whaler | 1b1fe275eab690c410cf46de449f431e642da907 | [
"MIT"
] | null | null | null | import os
import re
from setuptools import setup, find_packages
init = open(os.path.join('src', 'whaler', '__init__.py')).read()
version = re.search(r"__version__ = '(\d+\.\d+.\d+)'", init).group(1)
setup(
name='whaler',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
setu... | 24.166667 | 69 | 0.632184 | import os
import re
from setuptools import setup, find_packages
init = open(os.path.join('src', 'whaler', '__init__.py')).read()
version = re.search(r"__version__ = '(\d+\.\d+.\d+)'", init).group(1)
setup(
name='whaler',
version=version,
package_dir={'': 'src'},
packages=find_packages('src'),
setu... | true | true |
f7f4d5384abe2d0d7a8dd2981587302f1f05fb55 | 18,514 | py | Python | clevrer_dev/text_baseline/train_net.py | gabrielsluz/SlowFast | bd06eac47fa236b070fd9a3b39518eea08d02947 | [
"Apache-2.0"
] | null | null | null | clevrer_dev/text_baseline/train_net.py | gabrielsluz/SlowFast | bd06eac47fa236b070fd9a3b39518eea08d02947 | [
"Apache-2.0"
] | null | null | null | clevrer_dev/text_baseline/train_net.py | gabrielsluz/SlowFast | bd06eac47fa236b070fd9a3b39518eea08d02947 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import numpy as np
import pprint
import torch
import copy
from torch.utils.data import DataLoader
import slowfast.models.losses as losses
import slowfast.models.optimizer as optim
import slowfast.utils.checkpoint as cu
imp... | 37.028 | 121 | 0.607918 |
import numpy as np
import pprint
import torch
import copy
from torch.utils.data import DataLoader
import slowfast.models.losses as losses
import slowfast.models.optimizer as optim
import slowfast.utils.checkpoint as cu
import slowfast.utils.logging as logging
import slowfast.utils.metrics as metrics
import slowfas... | true | true |
f7f4d8f12db74bf89cfd3ca8261da108c94fb6e3 | 426 | py | Python | runoob/basic_tutorial/parent_child_2.py | zeroonegit/python | 919f8bb14ae91e37e42ff08192df24b60135596f | [
"MIT"
] | 1 | 2017-03-30T00:43:40.000Z | 2017-03-30T00:43:40.000Z | runoob/basic_tutorial/parent_child_2.py | QuinceySun/Python | 919f8bb14ae91e37e42ff08192df24b60135596f | [
"MIT"
] | null | null | null | runoob/basic_tutorial/parent_child_2.py | QuinceySun/Python | 919f8bb14ae91e37e42ff08192df24b60135596f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
############################
# File Name: parent_child_2.py
# Author: One Zero
# Mail: zeroonegit@gmail.com
# Created Time: 2015-12-28 23:23:13
############################
class Parent: # 定义父类
def myMethod(self):
print("调用父类方法")
class Child(Parent): #... | 19.363636 | 35 | 0.528169 | true | true | |
f7f4dc9cf5e2229aa7650cc2913a282aef1762e9 | 3,051 | py | Python | gcloud/commons/template/migrations/0001_initial.py | gangh/bk-sops | 29f4b4915be42650c2eeee637e0cf798e4066f09 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | gcloud/commons/template/migrations/0001_initial.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | gcloud/commons/template/migrations/0001_initial.py | tanghaiyong1989/bk-sops-ce | 7388914acc4004469982d6b5bf9cd7641bdf82f7 | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 61.02 | 419 | 0.683382 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pipeline', '0013_old_template_... | true | true |
f7f4dcf61ec7e2d85bf3dc6a2bab6106bdb18d18 | 48 | py | Python | implementation_files/cosim_pandapipes_pandapower/simulators/time_series_player/__init__.py | ERIGrid2/benchmark-model-multi-energy-networks | 4172480a5fcdf99d086b98ea24e00342f8e42a91 | [
"BSD-3-Clause"
] | null | null | null | implementation_files/cosim_pandapipes_pandapower/simulators/time_series_player/__init__.py | ERIGrid2/benchmark-model-multi-energy-networks | 4172480a5fcdf99d086b98ea24e00342f8e42a91 | [
"BSD-3-Clause"
] | null | null | null | implementation_files/cosim_pandapipes_pandapower/simulators/time_series_player/__init__.py | ERIGrid2/benchmark-model-multi-energy-networks | 4172480a5fcdf99d086b98ea24e00342f8e42a91 | [
"BSD-3-Clause"
] | null | null | null | from .mosaik_wrapper import TimeSeriesPlayerSim
| 24 | 47 | 0.895833 | from .mosaik_wrapper import TimeSeriesPlayerSim
| true | true |
f7f4dd01e125702612abe21ad1f91687ae550f99 | 429 | py | Python | source/interprocedural_analyses/taint/test/integration/source_sink_flow.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | 1 | 2022-02-10T10:51:32.000Z | 2022-02-10T10:51:32.000Z | source/interprocedural_analyses/taint/test/integration/source_sink_flow.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | null | null | null | source/interprocedural_analyses/taint/test/integration/source_sink_flow.py | joehendrix/pyre-check | 23693455b1e0b4a7287efba9337be6bbfe23ada4 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from builtins import _test_sink, _test_source
def bar():
return _test_source()
def qux(arg):
_test_sink(arg)
def bad(ok, arg):... | 15.321429 | 65 | 0.682984 |
from builtins import _test_sink, _test_source
def bar():
return _test_source()
def qux(arg):
_test_sink(arg)
def bad(ok, arg):
qux(arg)
def some_source():
return bar()
def match_flows():
x = some_source()
bad(5, x)
| true | true |
f7f4dd86bce01fbd6f1ea363305d512e3923d832 | 3,520 | py | Python | Android/NDK/android-ndk-r20b-win/build/gen_cygpath.py | X018/CCTOOL | 989af4d7edab82bf540400eb72eca4e7447d722c | [
"MIT"
] | null | null | null | Android/NDK/android-ndk-r20b-win/build/gen_cygpath.py | X018/CCTOOL | 989af4d7edab82bf540400eb72eca4e7447d722c | [
"MIT"
] | null | null | null | Android/NDK/android-ndk-r20b-win/build/gen_cygpath.py | X018/CCTOOL | 989af4d7edab82bf540400eb72eca4e7447d722c | [
"MIT"
] | null | null | null | #
# Copyright (C) 2017 The Android Open Source Project
#
# 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 la... | 34.174757 | 78 | 0.650568 |
from __future__ import print_function
import posixpath
import re
import sys
def get_mounts(mount_output):
mount_regex = re.compile(r'^(\S+) on (\S+) .*$')
mounts = []
for line in mount_output.splitlines():
match = mount_regex.search(line)
if mat... | true | true |
f7f4dddb4f4c05b540fd89d2de427c9aee5e468f | 5,943 | py | Python | toolchain/riscv/MSYS/python/Tools/demo/redemo.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | toolchain/riscv/MSYS/python/Tools/demo/redemo.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 8 | 2019-06-29T14:18:51.000Z | 2022-02-19T07:30:27.000Z | toolchain/riscv/MSYS/python/Tools/demo/redemo.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 76 | 2020-03-16T01:47:46.000Z | 2022-03-21T16:37:07.000Z | #!/usr/bin/env python3
"""Basic regular expression demonstration facility (Perl style syntax)."""
from tkinter import *
import re
class ReDemo:
def __init__(self, master):
self.master = master
self.promptdisplay = Label(self.master, anchor=W,
text="Enter a Perl-styl... | 34.352601 | 75 | 0.502272 |
from tkinter import *
import re
class ReDemo:
def __init__(self, master):
self.master = master
self.promptdisplay = Label(self.master, anchor=W,
text="Enter a Perl-style regular expression:")
self.promptdisplay.pack(side=TOP, fill=X)
self.regexdis... | true | true |
f7f4de0222bfcd8aa6c17624df23ae0566c9314f | 4,742 | py | Python | andres@programo.ual.es/evaluatePCA.py | andresmasegosa/PRML-CoreSets | fb768debb15e3ff6f5b65b7224915a41c1493f3d | [
"MIT"
] | null | null | null | andres@programo.ual.es/evaluatePCA.py | andresmasegosa/PRML-CoreSets | fb768debb15e3ff6f5b65b7224915a41c1493f3d | [
"MIT"
] | null | null | null | andres@programo.ual.es/evaluatePCA.py | andresmasegosa/PRML-CoreSets | fb768debb15e3ff6f5b65b7224915a41c1493f3d | [
"MIT"
] | null | null | null | import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
import inferpy as inf
from datareduction.bayesian_pca_DR import BayesianPCA_DR
from datareduction.variational_gaussian_mixture_DR import VariationalGaussianMixture_DR
from prml.feature_extract... | 34.115108 | 108 | 0.695698 | import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
import inferpy as inf
from datareduction.bayesian_pca_DR import BayesianPCA_DR
from datareduction.variational_gaussian_mixture_DR import VariationalGaussianMixture_DR
from prml.feature_extract... | true | true |
f7f4de586136fbfae968e74b2df519bc44b47d98 | 3,805 | py | Python | cloudkitty/rating/hash/db/sqlalchemy/alembic/versions/3dd7e13527f3_initial_migration.py | wanghuiict/cloudkitty | 11ff713042eb0354f497f7051130630c46860735 | [
"Apache-2.0"
] | 1 | 2021-11-23T02:23:19.000Z | 2021-11-23T02:23:19.000Z | cloudkitty/rating/hash/db/sqlalchemy/alembic/versions/3dd7e13527f3_initial_migration.py | shanafang9/cloudkitty | 911c90569ccb09ecf0d7aa11a5a707c8ebda09cf | [
"Apache-2.0"
] | null | null | null | cloudkitty/rating/hash/db/sqlalchemy/alembic/versions/3dd7e13527f3_initial_migration.py | shanafang9/cloudkitty | 911c90569ccb09ecf0d7aa11a5a707c8ebda09cf | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under... | 35.560748 | 75 | 0.610512 |
revision = '3dd7e13527f3'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'hashmap_services',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('service_id', sa.String(length=36), nullable=False),
sa.Col... | true | true |
f7f4dee1a9b28f1634c57d526baaa7945cfda495 | 1,137 | py | Python | pycorrector/bert/predict_mask.py | Sueying/pycorrector | d4c8dbee7d055cd410d56bd1b52f0780ec8d1983 | [
"Apache-2.0"
] | 2 | 2020-09-21T01:59:48.000Z | 2020-09-21T02:16:15.000Z | pycorrector/bert/predict_mask.py | Sueying/pycorrector | d4c8dbee7d055cd410d56bd1b52f0780ec8d1983 | [
"Apache-2.0"
] | null | null | null | pycorrector/bert/predict_mask.py | Sueying/pycorrector | d4c8dbee7d055cd410d56bd1b52f0780ec8d1983 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description: Run BERT on Masked LM.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
from transformers import pipeline
MASK_TOKEN = "[MASK]"
pwd_path = os.path.abs... | 21.865385 | 120 | 0.623571 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
from transformers import pipeline
MASK_TOKEN = "[MASK]"
pwd_path = os.path.abspath(os.path.dirname(__file__))
def main():
parser = argparse.ArgumentParser()
parser... | true | true |
f7f4df9dc8d8d9e77ebf3bb98aed46f4f524bdc7 | 13,928 | py | Python | moto/ec2/responses/elastic_block_store.py | ljakimczuk/moto | ea2ccb944ec7cf56298744f771a62a12cbf45c50 | [
"Apache-2.0"
] | 1 | 2020-09-15T15:31:31.000Z | 2020-09-15T15:31:31.000Z | moto/ec2/responses/elastic_block_store.py | ljakimczuk/moto | ea2ccb944ec7cf56298744f771a62a12cbf45c50 | [
"Apache-2.0"
] | null | null | null | moto/ec2/responses/elastic_block_store.py | ljakimczuk/moto | ea2ccb944ec7cf56298744f771a62a12cbf45c50 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring
class ElasticBlockStore(BaseResponse):
def attach_volume(self):
volume_id = self._get_param("VolumeId")
instance_id = self._get_param("InstanceId")
devic... | 41.452381 | 109 | 0.635482 | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring
class ElasticBlockStore(BaseResponse):
def attach_volume(self):
volume_id = self._get_param("VolumeId")
instance_id = self._get_param("InstanceId")
devic... | true | true |
f7f4e1be58924666f53cea549c8bf28f7173b9f3 | 6,505 | py | Python | devstack/cfg.py | hagleitn/Openstack-Devstack2 | 88d3effc70c6479bba276856285dcb3974d76261 | [
"Apache-2.0"
] | 1 | 2015-02-21T05:30:46.000Z | 2015-02-21T05:30:46.000Z | devstack/cfg.py | hagleitn/Openstack-Devstack2 | 88d3effc70c6479bba276856285dcb3974d76261 | [
"Apache-2.0"
] | null | null | null | devstack/cfg.py | hagleitn/Openstack-Devstack2 | 88d3effc70c6479bba276856285dcb3974d76261 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.or... | 38.720238 | 118 | 0.651345 |
import re
import ConfigParser
from devstack import cfg_helpers
from devstack import date
from devstack import env
from devstack import exceptions as excp
from devstack import log as logging
from devstack import settings
from devstack import shell as sh
from devstack import utils
LOG = logging.getLogge... | true | true |
f7f4e231f867b658ad307a1e5ae115c7c45bb538 | 416 | py | Python | produto/admin.py | MatheusSaraiva/ecommerce | c508af86c89e772e0f44ec4b986a9aec88b34569 | [
"MIT"
] | null | null | null | produto/admin.py | MatheusSaraiva/ecommerce | c508af86c89e772e0f44ec4b986a9aec88b34569 | [
"MIT"
] | null | null | null | produto/admin.py | MatheusSaraiva/ecommerce | c508af86c89e772e0f44ec4b986a9aec88b34569 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
class VariacaoInline(admin.TabularInline):
model = models.Variacao
extra = 1
class ProdutoAdmin(admin.ModelAdmin):
list_display = ['nome', 'descricao_curta', 'get_preco_formatado', 'get_preco_promocional_formatado']
inlines = [
VariacaoInli... | 27.733333 | 104 | 0.752404 | from django.contrib import admin
from . import models
class VariacaoInline(admin.TabularInline):
model = models.Variacao
extra = 1
class ProdutoAdmin(admin.ModelAdmin):
list_display = ['nome', 'descricao_curta', 'get_preco_formatado', 'get_preco_promocional_formatado']
inlines = [
VariacaoInli... | true | true |
f7f4e2ef51489ef0b4957f5413e828ba25fd240f | 856 | py | Python | habitbreaker.py | Blaze-rahim/MLH_Day-2__habit_tracker | ffe9d6cf901ab640930e45e4700103691f01ce4c | [
"MIT"
] | null | null | null | habitbreaker.py | Blaze-rahim/MLH_Day-2__habit_tracker | ffe9d6cf901ab640930e45e4700103691f01ce4c | [
"MIT"
] | null | null | null | habitbreaker.py | Blaze-rahim/MLH_Day-2__habit_tracker | ffe9d6cf901ab640930e45e4700103691f01ce4c | [
"MIT"
] | null | null | null | from datetime import datetime
def habit_breaker(habit_name, startdate, cost_perday, mins_wasted):
goal = 30
wageperhour = 10
time_elapsed = (datetime.now()-startdate).total_seconds()
hours = round(time_elapsed /60 / 60 ,1)
days = round(hours/ 24, 2)
money_saved = cost_perday... | 29.517241 | 92 | 0.642523 | from datetime import datetime
def habit_breaker(habit_name, startdate, cost_perday, mins_wasted):
goal = 30
wageperhour = 10
time_elapsed = (datetime.now()-startdate).total_seconds()
hours = round(time_elapsed /60 / 60 ,1)
days = round(hours/ 24, 2)
money_saved = cost_perday... | true | true |
f7f4e35718cc8b97d3dab336cfcc028fffff7792 | 6,072 | py | Python | eye_window.py | dguari1/Emotrics | 8b807d97663d6deb8efab7c74b31ee42f9218d1b | [
"MIT"
] | 5 | 2018-07-23T12:10:58.000Z | 2020-05-28T20:04:10.000Z | eye_window.py | dguari1/Emotrics | 8b807d97663d6deb8efab7c74b31ee42f9218d1b | [
"MIT"
] | 4 | 2021-02-15T11:31:56.000Z | 2022-03-14T20:24:45.000Z | eye_window.py | dguari1/Emotrics | 8b807d97663d6deb8efab7c74b31ee42f9218d1b | [
"MIT"
] | 10 | 2019-11-10T14:49:27.000Z | 2022-03-10T22:41:54.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 23 21:10:25 2017
@author: Diego L.Guarin -- diego_guarin at meei.harvard.edu
"""
from PyQt5 import QtWidgets, QtCore, QtGui
import numpy as np
from utilities import find_circle_from_points
"""
This window show the eye and allows the user to select 4 points around the iri... | 35.928994 | 107 | 0.610343 |
from PyQt5 import QtWidgets, QtCore, QtGui
import numpy as np
from utilities import find_circle_from_points
class ProcessEye(QtWidgets.QDialog):
def __init__(self, image = None):
super(ProcessEye, self).__init__()
self.setWindowTitle('Eye Selection')
self._circle = None
self... | true | true |
f7f4e41ffa00a98ed77dac9e10afbb609cccf4d3 | 2,171 | py | Python | assignments/2019/assignment1/cs231n/vis_utils.py | comratvlad/cs231n.github.io | 63c72c3e8e88a6edfea7db7df604d715416ba15b | [
"MIT"
] | null | null | null | assignments/2019/assignment1/cs231n/vis_utils.py | comratvlad/cs231n.github.io | 63c72c3e8e88a6edfea7db7df604d715416ba15b | [
"MIT"
] | null | null | null | assignments/2019/assignment1/cs231n/vis_utils.py | comratvlad/cs231n.github.io | 63c72c3e8e88a6edfea7db7df604d715416ba15b | [
"MIT"
] | null | null | null | from builtins import range
from math import sqrt, ceil
import numpy as np
def visualize_grid(Xs, ubound=255.0, padding=1):
"""
Reshape a 4D tensor of image data to a grid for easy visualization.
Inputs:
- Xs: Data of shape (N, H, W, C)
- ubound: Output grid will have values scaled to the range [... | 28.565789 | 74 | 0.505758 | from builtins import range
from math import sqrt, ceil
import numpy as np
def visualize_grid(Xs, ubound=255.0, padding=1):
(N, H, W, C) = Xs.shape
grid_size = int(ceil(sqrt(N)))
grid_height = H * grid_size + padding * (grid_size - 1)
grid_width = W * grid_size + padding * (grid_size - 1)
grid = n... | true | true |
f7f4e42209e5860c9c5a01c292fc1d1c54d20d72 | 832 | py | Python | src/pretix/base/migrations/0177_auto_20210301_1510.py | fabm3n/pretix | 520fb620888d5c434665a6a4a33cb2ab22dd42c7 | [
"Apache-2.0"
] | 1,248 | 2015-04-24T13:32:06.000Z | 2022-03-29T07:01:36.000Z | src/pretix/base/migrations/0177_auto_20210301_1510.py | fabm3n/pretix | 520fb620888d5c434665a6a4a33cb2ab22dd42c7 | [
"Apache-2.0"
] | 2,113 | 2015-02-18T18:58:16.000Z | 2022-03-31T11:12:32.000Z | src/pretix/base/migrations/0177_auto_20210301_1510.py | fabm3n/pretix | 520fb620888d5c434665a6a4a33cb2ab22dd42c7 | [
"Apache-2.0"
] | 453 | 2015-05-13T09:29:06.000Z | 2022-03-24T13:39:16.000Z | # Generated by Django 3.0.10 on 2021-03-01 15:10
import phonenumber_field.modelfields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0176_auto_20210205_1512'),
]
operations = [
migrations.AddField(
model_name... | 26.83871 | 105 | 0.616587 |
import phonenumber_field.modelfields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0176_auto_20210205_1512'),
]
operations = [
migrations.AddField(
model_name='waitinglistentry',
name='name_cach... | true | true |
f7f4e4ca17aea8afb366e724c048ce22a944d964 | 9,550 | py | Python | BiLiVideoConvert.py | LengGeng/BiLiVideoConvert | 909d6b2dbfb438967c5a8968830ebce953c76481 | [
"MIT"
] | 1 | 2022-03-23T13:21:21.000Z | 2022-03-23T13:21:21.000Z | BiLiVideoConvert.py | LengGeng/BiLiVideoConvert | 909d6b2dbfb438967c5a8968830ebce953c76481 | [
"MIT"
] | null | null | null | BiLiVideoConvert.py | LengGeng/BiLiVideoConvert | 909d6b2dbfb438967c5a8968830ebce953c76481 | [
"MIT"
] | null | null | null | import re
import os
import json
import warnings
from sys import argv
from getopt import getopt
from typing import Union
from subprocess import Popen
DEVNULL = open(os.devnull, 'w')
CONFIG = {}
CONFIG_PATH = "config.json"
FORMAT_VIDEO_NAME = "{i}、{title}-{name}"
class BiLiVideoConvert:
def __init__(self, input_d... | 30.806452 | 113 | 0.52555 | import re
import os
import json
import warnings
from sys import argv
from getopt import getopt
from typing import Union
from subprocess import Popen
DEVNULL = open(os.devnull, 'w')
CONFIG = {}
CONFIG_PATH = "config.json"
FORMAT_VIDEO_NAME = "{i}、{title}-{name}"
class BiLiVideoConvert:
def __init__(self, input_d... | true | true |
f7f4e613ab300ab84ae8de1cb23ce67060ad5691 | 9,244 | py | Python | hangupsbot/commands/__init__.py | mygreentour/hangoutsbot | 9ea2da10f546e6f1dd06c8240187049501c5452a | [
"Unlicense"
] | null | null | null | hangupsbot/commands/__init__.py | mygreentour/hangoutsbot | 9ea2da10f546e6f1dd06c8240187049501c5452a | [
"Unlicense"
] | null | null | null | hangupsbot/commands/__init__.py | mygreentour/hangoutsbot | 9ea2da10f546e6f1dd06c8240187049501c5452a | [
"Unlicense"
] | null | null | null | import asyncio, logging, time
import plugins
logger = logging.getLogger(__name__)
class CommandDispatcher(object):
"""Register commands and run them"""
def __init__(self):
self.bot = None
self.commands = {}
self.admin_commands = []
self.unknown_command = None
self.bl... | 40.366812 | 113 | 0.607313 | import asyncio, logging, time
import plugins
logger = logging.getLogger(__name__)
class CommandDispatcher(object):
def __init__(self):
self.bot = None
self.commands = {}
self.admin_commands = []
self.unknown_command = None
self.blocked_command = None
self.trackin... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.