hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 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
2
1.02M
avg_line_length
float64
1
417k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
1 class
is_sharp_comment_removed
bool
1 class
f72e27140e31589687803d315c93b47f71e3a265
770
py
Python
backend/migrations/versions/c8f4b08529a4_.py
Tobiaqs/realtime
e6ff4110a71e1a806c37ae9b071328e1a5c6f41e
[ "MIT" ]
2
2017-05-16T11:49:10.000Z
2017-07-29T23:50:10.000Z
backend/migrations/versions/c8f4b08529a4_.py
Tobiaqs/realtime
e6ff4110a71e1a806c37ae9b071328e1a5c6f41e
[ "MIT" ]
45
2017-05-10T08:48:15.000Z
2020-08-31T10:17:19.000Z
backend/migrations/versions/c8f4b08529a4_.py
CodeYellowBV/cy-time
e5c0641e772c2c1ade88df5564d98a2765d5753a
[ "MIT" ]
2
2017-08-02T18:18:41.000Z
2020-10-12T09:01:15.000Z
"""empty message Revision ID: c8f4b08529a4 Revises: bbd324935815 Create Date: 2017-05-02 00:04:57.131824 """ # revision identifiers, used by Alembic. revision = 'c8f4b08529a4' down_revision = 'bbd324935815' from alembic import op import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic ...
26.551724
92
0.683117
revision = 'c8f4b08529a4' down_revision = 'bbd324935815' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('entries', sa.Column('user_id', sa.Integer(), nullable=True)) op.create_foreign_key(None, 'entries', 'users', ['user_id'], ['id'], ondelete='cascade') def downgrade(...
true
true
f72e27886171d70eb1ffb2fa7dec9f742588ee5f
2,303
py
Python
ckan/lib/navl/validators.py
code4sac/ckan
5354769c480f4ad115bf53ca7450d3f49c837edb
[ "Apache-2.0" ]
2
2015-11-05T12:04:52.000Z
2017-08-09T11:29:11.000Z
ckan/lib/navl/validators.py
code4sac/ckan
5354769c480f4ad115bf53ca7450d3f49c837edb
[ "Apache-2.0" ]
null
null
null
ckan/lib/navl/validators.py
code4sac/ckan
5354769c480f4ad115bf53ca7450d3f49c837edb
[ "Apache-2.0" ]
4
2016-12-17T22:26:06.000Z
2017-01-20T21:51:24.000Z
from dictization_functions import missing, StopOnError, Invalid from pylons.i18n import _ def identity_converter(key, data, errors, context): return def keep_extras(key, data, errors, context): extras = data.pop(key, {}) for extras_key, value in extras.iteritems(): data[key[:-1] + (extras_key,)] ...
24.242105
78
0.63439
from dictization_functions import missing, StopOnError, Invalid from pylons.i18n import _ def identity_converter(key, data, errors, context): return def keep_extras(key, data, errors, context): extras = data.pop(key, {}) for extras_key, value in extras.iteritems(): data[key[:-1] + (extras_key,)] ...
true
true
f72e27b5b949fa0026189d37fc6c50cbd9123218
848
py
Python
markovdwp/runtime/utils/common.py
ivannz/MarkovDWP
f10ed7a331ddd9b7fc28c4cab3b05b2352a9ee2b
[ "MIT" ]
null
null
null
markovdwp/runtime/utils/common.py
ivannz/MarkovDWP
f10ed7a331ddd9b7fc28c4cab3b05b2352a9ee2b
[ "MIT" ]
null
null
null
markovdwp/runtime/utils/common.py
ivannz/MarkovDWP
f10ed7a331ddd9b7fc28c4cab3b05b2352a9ee2b
[ "MIT" ]
null
null
null
from ...utils.dicttools import flatten, aggregate, propagate def prepare_log(details, level=5, delim='/'): prepared = aggregate(flatten(details, delim='.'), level=level, delim='.') return {k.replace('.', delim): v for k, v in prepared.items()} def weighted_sum(terms, **coef): # 1. compute the final loss...
29.241379
77
0.59316
from ...utils.dicttools import flatten, aggregate, propagate def prepare_log(details, level=5, delim='/'): prepared = aggregate(flatten(details, delim='.'), level=level, delim='.') return {k.replace('.', delim): v for k, v in prepared.items()} def weighted_sum(terms, **coef): C = dict(propagate({'':...
true
true
f72e27c302f229f0a9dadb88497decfdfe800148
3,189
py
Python
remove_code/my_data_mining.py
JohnZhang000/adaptive-jpeg-compression
f54e4798c01169812958f4d5539a03927dbdc313
[ "MIT" ]
null
null
null
remove_code/my_data_mining.py
JohnZhang000/adaptive-jpeg-compression
f54e4798c01169812958f4d5539a03927dbdc313
[ "MIT" ]
null
null
null
remove_code/my_data_mining.py
JohnZhang000/adaptive-jpeg-compression
f54e4798c01169812958f4d5539a03927dbdc313
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Sep 26 17:33:03 2021 @author: ubuntu204 """ import numpy as np from scipy import stats import statsmodels.stats.multitest as multitest import matplotlib.pyplot as plt import os import pandas as pd from pandas import Series,DataFrame # import seaborn as...
33.21875
122
0.665412
import numpy as np from scipy import stats import statsmodels.stats.multitest as multitest import matplotlib.pyplot as plt import os import pandas as pd from pandas import Series,DataFrame from sklearn import datasets from tqdm import tqdm plt.rcParams['font.sans-serif']=['SimHei'] epsilon=1e-10 def volcano_mine(dat...
true
true
f72e2822918932f7ca53aa163efd65081ca744f9
9,084
py
Python
test/unit/anchore_engine/services/apiext/test_api_utils.py
Btodhunter/anchore-engine
0f7ce6dea5f6c24c07616355affc64fdbfe1d6ef
[ "Apache-2.0" ]
null
null
null
test/unit/anchore_engine/services/apiext/test_api_utils.py
Btodhunter/anchore-engine
0f7ce6dea5f6c24c07616355affc64fdbfe1d6ef
[ "Apache-2.0" ]
null
null
null
test/unit/anchore_engine/services/apiext/test_api_utils.py
Btodhunter/anchore-engine
0f7ce6dea5f6c24c07616355affc64fdbfe1d6ef
[ "Apache-2.0" ]
null
null
null
""" Unit tests for the api controller utils of external API service """ import base64 import json import yaml import pytest from anchore_engine.services.apiext.api.controllers import utils as api_utils from anchore_engine.subsys import logger logger.enable_test_logging('INFO') spec_path = 'anchore_engine/services/api...
43.464115
211
0.647732
import base64 import json import yaml import pytest from anchore_engine.services.apiext.api.controllers import utils as api_utils from anchore_engine.subsys import logger logger.enable_test_logging('INFO') spec_path = 'anchore_engine/services/apiext/swagger/swagger.yaml' b64_dockerfile = str(base64.encodebytes(b'FROM...
true
true
f72e285fa57c1479b7ac589e986ce382761b7ce1
2,349
py
Python
apps/mascota/views.py
ecampetella/mascotas
c2b45a3ebe736eb9258081be05376796c7a8c5c4
[ "Apache-2.0" ]
null
null
null
apps/mascota/views.py
ecampetella/mascotas
c2b45a3ebe736eb9258081be05376796c7a8c5c4
[ "Apache-2.0" ]
null
null
null
apps/mascota/views.py
ecampetella/mascotas
c2b45a3ebe736eb9258081be05376796c7a8c5c4
[ "Apache-2.0" ]
null
null
null
from django.shortcuts import render, redirect from django.http import HttpResponse from django.core import serializers from django.urls import reverse_lazy from django.views.generic import ListView, CreateView, UpdateView, DeleteView from apps.mascota.forms import MascotaForm from apps.mascota.models import Mascota ...
27.635294
91
0.707961
from django.shortcuts import render, redirect from django.http import HttpResponse from django.core import serializers from django.urls import reverse_lazy from django.views.generic import ListView, CreateView, UpdateView, DeleteView from apps.mascota.forms import MascotaForm from apps.mascota.models import Mascota ...
true
true
f72e2a94bddcc6662ddbec5a3ed288d1de2fd3ed
841
py
Python
tests/util_test.py
panfill/pandoc-tables
ba26525e3e9c6ddab6236276ec9a9ac3508e31f5
[ "BSD-3-Clause" ]
74
2016-11-20T14:19:06.000Z
2022-01-27T13:53:45.000Z
tests/util_test.py
panfill/pandoc-tables
ba26525e3e9c6ddab6236276ec9a9ac3508e31f5
[ "BSD-3-Clause" ]
57
2016-12-23T01:37:59.000Z
2022-03-15T10:14:49.000Z
tests/util_test.py
panfill/pandoc-tables
ba26525e3e9c6ddab6236276ec9a9ac3508e31f5
[ "BSD-3-Clause" ]
19
2017-07-31T17:32:01.000Z
2022-03-09T17:44:24.000Z
from pytest import mark from pantable.util import convert_texts, convert_texts_fast, eq_panflute_elems # construct some texts cases texts_1 = [ 'some **markdown** here', 'and ~~some~~ other?' ] texts_2 = [ 'some *very* intersting markdown [example]{#so_fancy}', '''# Comical Text # Totally comical ...
23.361111
96
0.743163
from pytest import mark from pantable.util import convert_texts, convert_texts_fast, eq_panflute_elems texts_1 = [ 'some **markdown** here', 'and ~~some~~ other?' ] texts_2 = [ 'some *very* intersting markdown [example]{#so_fancy}', '''# Comical Text # Totally comical Text''' ] textss = [texts_1,...
true
true
f72e2be002132a3159a33734ff15192f64760aea
801
py
Python
scripts/mrep.py
akikuno/rosalind
7015dc63e493d870e5789e99f2ee523a9b1f5ab9
[ "MIT" ]
null
null
null
scripts/mrep.py
akikuno/rosalind
7015dc63e493d870e5789e99f2ee523a9b1f5ab9
[ "MIT" ]
null
null
null
scripts/mrep.py
akikuno/rosalind
7015dc63e493d870e5789e99f2ee523a9b1f5ab9
[ "MIT" ]
null
null
null
# https://rosalind.info/problems/mrep/ def fmtfa(fasta: list): prev = True header = [] seq = [] for f in fasta: if ">" in f: header.append(f[1:]) prev = True elif prev: seq.append(f) prev = False else: seq[-1] += f ...
18.627907
52
0.451935
def fmtfa(fasta: list): prev = True header = [] seq = [] for f in fasta: if ">" in f: header.append(f[1:]) prev = True elif prev: seq.append(f) prev = False else: seq[-1] += f return header, seq file_in = "sampl...
true
true
f72e2c20014b014adcc22ea0886c8a4731a2cba2
9,241
py
Python
trader/strategy.py
freshjang/MyKiwoom
6342ec7ba8da55194bb473f9052d87f7fa1a640e
[ "MIT" ]
null
null
null
trader/strategy.py
freshjang/MyKiwoom
6342ec7ba8da55194bb473f9052d87f7fa1a640e
[ "MIT" ]
null
null
null
trader/strategy.py
freshjang/MyKiwoom
6342ec7ba8da55194bb473f9052d87f7fa1a640e
[ "MIT" ]
null
null
null
import os import sys import psutil import numpy as np import pandas as pd sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import ui_num, DICT_SET, columns_gj from utility.static import now, timedelta_sec, thread_decorator, strf_time, float2str1p6 class Strategy: d...
41.071111
117
0.489125
import os import sys import psutil import numpy as np import pandas as pd sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import ui_num, DICT_SET, columns_gj from utility.static import now, timedelta_sec, thread_decorator, strf_time, float2str1p6 class Strategy: d...
true
true
f72e2fa4abeaaaa3579e087d88b76ff66cf23dc8
1,018
py
Python
vestlus/views/membership_detail.py
lehvitus/vestlus
6d9c8b1de7821e544e0c7c99f42d60f8f3805557
[ "BSD-3-Clause" ]
12
2020-07-02T23:36:02.000Z
2020-12-15T07:29:20.000Z
vestlus/views/membership_detail.py
lehvitus/vestlus
6d9c8b1de7821e544e0c7c99f42d60f8f3805557
[ "BSD-3-Clause" ]
null
null
null
vestlus/views/membership_detail.py
lehvitus/vestlus
6d9c8b1de7821e544e0c7c99f42d60f8f3805557
[ "BSD-3-Clause" ]
null
null
null
from django.utils import timezone from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from django.views.generic import DetailView from django.urls import path from .routes import routes from ..models import Membership, GroupMessage @method_decorator([login_re...
30.848485
93
0.735756
from django.utils import timezone from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from django.views.generic import DetailView from django.urls import path from .routes import routes from ..models import Membership, GroupMessage @method_decorator([login_re...
true
true
f72e30a9cc0654d4161f78820a66eb9ac6875248
5,073
py
Python
nemo_text_processing/inverse_text_normalization/es/taggers/decimal.py
hamjam/NeMo
b3484d32e1317666151f931bfa39867d88ed8658
[ "Apache-2.0" ]
1
2022-03-08T02:48:44.000Z
2022-03-08T02:48:44.000Z
nemo_text_processing/inverse_text_normalization/es/taggers/decimal.py
hamjam/NeMo
b3484d32e1317666151f931bfa39867d88ed8658
[ "Apache-2.0" ]
null
null
null
nemo_text_processing/inverse_text_normalization/es/taggers/decimal.py
hamjam/NeMo
b3484d32e1317666151f931bfa39867d88ed8658
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
40.91129
163
0.667258
from nemo_text_processing.inverse_text_normalization.es.utils import get_abs_path from nemo_text_processing.text_normalization.en.graph_utils import ( NEMO_DIGIT, GraphFst, delete_extra_space, delete_space, ) try: import pynini from pynini.lib import pynutil PYNINI_AVAILABLE = True except...
true
true
f72e31c4f8145bf8b6d8b38fadebe4ece9f6f934
7,710
py
Python
tool/tools.py
Khan-Xu/Pyrod
3ee62e3d6037328a010d9340bf1e8ff991f48414
[ "MIT" ]
null
null
null
tool/tools.py
Khan-Xu/Pyrod
3ee62e3d6037328a010d9340bf1e8ff991f48414
[ "MIT" ]
null
null
null
tool/tools.py
Khan-Xu/Pyrod
3ee62e3d6037328a010d9340bf1e8ff991f48414
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Wed Aug 15 21:50:58 2018 @author: USER """ # Codes are free to use. Do whatever you want from __future__ import absolute_import """Read raw data""" ####################### LIBRARY ############################# # exceptions library from exceptions import (Data...
31.469388
90
0.500778
from __future__ import absolute_import from exceptions import (Data_Format_Exception, Data_Match_Exception) import datetime from math import factorial import numpy as np def R_square(f, y, mask): if not len(f) == len(y) == len(mask): raise Da...
true
true
f72e324f5e7083cdb0caf72d507ef3b8937e4dd3
200
py
Python
Pacotes/aula21.py
TonyRio/Python-Exercicios
8a72d1b12418c6485794dae184425df0daf098bb
[ "MIT" ]
null
null
null
Pacotes/aula21.py
TonyRio/Python-Exercicios
8a72d1b12418c6485794dae184425df0daf098bb
[ "MIT" ]
null
null
null
Pacotes/aula21.py
TonyRio/Python-Exercicios
8a72d1b12418c6485794dae184425df0daf098bb
[ "MIT" ]
null
null
null
def teste(): global s print(f'na função teste S vale {s+2}') print(f'na função teste N vale {n+1}') s=10 n=4 print(f'no programa N vale {n}') print(f'no programa S vale {s}') teste()
14.285714
42
0.605
def teste(): global s print(f'na função teste S vale {s+2}') print(f'na função teste N vale {n+1}') s=10 n=4 print(f'no programa N vale {n}') print(f'no programa S vale {s}') teste()
true
true
f72e334ec5fd24bbda5b8e0ef6637a8c287b6e2f
15,343
py
Python
corehq/apps/app_manager/views/formdesigner.py
dborowiecki/commcare-hq
f2f4fa67faec09040a98502f5657444075b63f2e
[ "BSD-3-Clause" ]
null
null
null
corehq/apps/app_manager/views/formdesigner.py
dborowiecki/commcare-hq
f2f4fa67faec09040a98502f5657444075b63f2e
[ "BSD-3-Clause" ]
null
null
null
corehq/apps/app_manager/views/formdesigner.py
dborowiecki/commcare-hq
f2f4fa67faec09040a98502f5657444075b63f2e
[ "BSD-3-Clause" ]
null
null
null
import json import logging from django.conf import settings from django.contrib import messages from django.http import Http404, HttpResponse, HttpResponseBadRequest from django.shortcuts import render from django.urls import reverse from django.utils.translation import ugettext as _ from django.views.decorators.http ...
36.618138
106
0.671381
import json import logging from django.conf import settings from django.contrib import messages from django.http import Http404, HttpResponse, HttpResponseBadRequest from django.shortcuts import render from django.urls import reverse from django.utils.translation import ugettext as _ from django.views.decorators.http ...
true
true
f72e353cb0430f84180c9d81bdb77f14364cdd8e
10,548
py
Python
jschon/jsonpatch.py
ikonst/jschon
4aa5c2ffce1dca831342aab232bceff9c542c137
[ "MIT" ]
null
null
null
jschon/jsonpatch.py
ikonst/jschon
4aa5c2ffce1dca831342aab232bceff9c542c137
[ "MIT" ]
null
null
null
jschon/jsonpatch.py
ikonst/jschon
4aa5c2ffce1dca831342aab232bceff9c542c137
[ "MIT" ]
null
null
null
from __future__ import annotations from copy import deepcopy from enum import Enum from typing import Dict, Iterable, List, Mapping, MutableSequence, Optional, Sequence, Union, overload from jschon.exceptions import JSONPatchError, JSONPointerError from jschon.json import JSON, JSONCompatible from jschon.jsonpointer ...
34.811881
121
0.622677
from __future__ import annotations from copy import deepcopy from enum import Enum from typing import Dict, Iterable, List, Mapping, MutableSequence, Optional, Sequence, Union, overload from jschon.exceptions import JSONPatchError, JSONPointerError from jschon.json import JSON, JSONCompatible from jschon.jsonpointer ...
true
true
f72e35604f795a4e13916642b9ae4c94a24be9b3
139
py
Python
manager.py
HenryChenV/Spiritline
2fcea54886ba3945c3359ce9fa1a3f20257fa8b1
[ "MIT" ]
null
null
null
manager.py
HenryChenV/Spiritline
2fcea54886ba3945c3359ce9fa1a3f20257fa8b1
[ "MIT" ]
null
null
null
manager.py
HenryChenV/Spiritline
2fcea54886ba3945c3359ce9fa1a3f20257fa8b1
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding=utf-8 -*- """ Manager ~~~~~~~ """ from cmds import cmds if __name__ == '__main__': cmds()
11.583333
26
0.517986
from cmds import cmds if __name__ == '__main__': cmds()
true
true
f72e3621aa8551368313d955fdd5e69ddb1b2246
23,667
py
Python
rift/engine.py
kennethhuang123/rift-python
f4c208fe39cb14535573708637fa2345c919666b
[ "Apache-2.0" ]
43
2018-07-19T17:41:35.000Z
2022-03-16T04:04:09.000Z
rift/engine.py
kennethhuang123/rift-python
f4c208fe39cb14535573708637fa2345c919666b
[ "Apache-2.0" ]
96
2018-07-19T11:06:08.000Z
2021-07-27T10:52:09.000Z
rift/engine.py
kennethhuang123/rift-python
f4c208fe39cb14535573708637fa2345c919666b
[ "Apache-2.0" ]
29
2018-07-24T22:01:20.000Z
2022-02-13T21:28:18.000Z
import atexit import logging import random import os import sys import termios import sortedcontainers import netifaces import cli_listen_handler import cli_session_handler import constants import interface import key import node import scheduler import stats import table OLD_TERMINAL_SETTINGS = None # pylint:disab...
42.952813
100
0.662568
import atexit import logging import random import os import sys import termios import sortedcontainers import netifaces import cli_listen_handler import cli_session_handler import constants import interface import key import node import scheduler import stats import table OLD_TERMINAL_SETTINGS = None def make_term...
true
true
f72e364f5022fc04b93bc2dd298a9bd20a6cf030
1,337
py
Python
openpype/hosts/blender/plugins/create/create_layout.py
dangerstudios/OpenPype
10ddcc4699137888616eec57cd7fac9648189714
[ "MIT" ]
null
null
null
openpype/hosts/blender/plugins/create/create_layout.py
dangerstudios/OpenPype
10ddcc4699137888616eec57cd7fac9648189714
[ "MIT" ]
null
null
null
openpype/hosts/blender/plugins/create/create_layout.py
dangerstudios/OpenPype
10ddcc4699137888616eec57cd7fac9648189714
[ "MIT" ]
null
null
null
"""Create a layout asset.""" import bpy from avalon import api from avalon.blender import lib import openpype.hosts.blender.api.plugin class CreateLayout(openpype.hosts.blender.api.plugin.Creator): """Layout output for character rigs""" name = "layoutMain" label = "Layout" family = "layout" ico...
32.609756
77
0.658938
import bpy from avalon import api from avalon.blender import lib import openpype.hosts.blender.api.plugin class CreateLayout(openpype.hosts.blender.api.plugin.Creator): name = "layoutMain" label = "Layout" family = "layout" icon = "cubes" def process(self): asset = self.data["asset"] ...
true
true
f72e36d55617fb3f480bdfd74ae5f0ca81d6dede
2,358
py
Python
tools/progressive_iile_render.py
mistajuliax/pbrt-v3-IILE
afda605d92517d2396e494d81465ead22d0c25e1
[ "BSD-2-Clause" ]
16
2018-10-12T15:29:22.000Z
2022-03-16T11:24:10.000Z
tools/progressive_iile_render.py
mistajuliax/pbrt-v3-IILE
afda605d92517d2396e494d81465ead22d0c25e1
[ "BSD-2-Clause" ]
16
2018-02-02T11:49:36.000Z
2018-04-21T09:07:08.000Z
tools/progressive_iile_render.py
giuliojiang/pbrt-v3-IISPT
b9be01096293ab0f50b14b9043556c93ff9e07ec
[ "BSD-2-Clause" ]
2
2018-12-12T08:49:43.000Z
2019-12-03T12:20:04.000Z
import os import subprocess import time # ============================================================================= # Constants and settings # Each has: # - filepath # - directSpp inputFiles = [ # ["/home/gj/git/pbrt-v3-scenes/white-room/whiteroom-daytime.pbrt", 16], ["/home/gj/git/pbrt-v3-scenes-extra/ve...
25.354839
79
0.563189
import os import subprocess import time inputFiles = [ ["/home/gj/git/pbrt-v3-scenes-extra/veach-ajar/scene.pbrt", 2], ] outputDir = "/home/gj/git/pbrt-v3-IISPT/tmpiile" maxSpp = 256 toolsDir = os.path.abspath(os.path.dirname(__file__)) rootDir = os.path.dirname(toolsDir) binDir = os.path.join(rootDir...
true
true
f72e375f818d6fd833d1ecb3aad6edc6f7e61f69
3,565
py
Python
nvtabular/io/csv.py
miguelusque/NVTabular
e58d318a64d8c1607e91c10b9b5d4a8b48bcab69
[ "Apache-2.0" ]
1
2021-09-06T10:38:03.000Z
2021-09-06T10:38:03.000Z
nvtabular/io/csv.py
ksalama/NVTabular
76e63d9df7b90433d552606e9cf87bd61d7eee3b
[ "Apache-2.0" ]
null
null
null
nvtabular/io/csv.py
ksalama/NVTabular
76e63d9df7b90433d552606e9cf87bd61d7eee3b
[ "Apache-2.0" ]
null
null
null
# # Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
28.98374
93
0.646283
import functools import dask.dataframe as dd import dask_cudf import numpy as np from dask.bytes import read_bytes from dask.utils import parse_bytes from fsspec.core import get_fs_token_paths from fsspec.utils import infer_compression from .dataset_engine import DatasetEngine class CSVDatasetEngine(DatasetEngine):...
true
true
f72e37b9daa06a19c0e8a61a1f48c9b55ecc8390
1,883
py
Python
python/bifrost/quantize.py
MilesCranmer/bifrost
951dd4a449850d22cfd74f4db13ecf806fe5cc30
[ "BSD-3-Clause" ]
1
2017-06-27T10:12:44.000Z
2017-06-27T10:12:44.000Z
python/bifrost/quantize.py
MilesCranmer/bifrost
951dd4a449850d22cfd74f4db13ecf806fe5cc30
[ "BSD-3-Clause" ]
null
null
null
python/bifrost/quantize.py
MilesCranmer/bifrost
951dd4a449850d22cfd74f4db13ecf806fe5cc30
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2016, The Bifrost Authors. All rights reserved. # Copyright (c) 2016, NVIDIA CORPORATION. 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 r...
48.282051
72
0.762082
from libbifrost import _bf, _check, _get, _fast_call from ndarray import asarray def quantize(src, dst, scale=1.): src_bf = asarray(src).as_BFarray() dst_bf = asarray(dst).as_BFarray() _fast_call(_bf.Quantize, src_bf, dst_bf, scale) return dst
true
true
f72e39070a3b805ce41684fe891aaff8bfa78820
635
py
Python
torrent/torrent_tracker/manage.py
projectpai/paipass
8b8e70b6808bf026cf957e240c7eed7bfcf4c55d
[ "MIT" ]
3
2021-04-17T10:20:26.000Z
2022-03-08T07:36:13.000Z
torrent/torrent_tracker/manage.py
projectpai/paipass
8b8e70b6808bf026cf957e240c7eed7bfcf4c55d
[ "MIT" ]
null
null
null
torrent/torrent_tracker/manage.py
projectpai/paipass
8b8e70b6808bf026cf957e240c7eed7bfcf4c55d
[ "MIT" ]
null
null
null
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tracker_backend.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: rais...
28.863636
79
0.686614
import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tracker_backend.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and ...
true
true
f72e39b760182363d792931dc557e983045dec1f
718
py
Python
leonardo_form_pegastudio/migrations/0019_document.py
dresl/leonardo-form-pegastudio
915d6328a8ceef2217c896e3c3f0257092f08a16
[ "BSD-3-Clause" ]
null
null
null
leonardo_form_pegastudio/migrations/0019_document.py
dresl/leonardo-form-pegastudio
915d6328a8ceef2217c896e3c3f0257092f08a16
[ "BSD-3-Clause" ]
null
null
null
leonardo_form_pegastudio/migrations/0019_document.py
dresl/leonardo-form-pegastudio
915d6328a8ceef2217c896e3c3f0257092f08a16
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('leonardo_form_pegastudio', '0018_pegastudioorders_file'), ] operations = [ migrations.CreateModel( name='Documen...
29.916667
114
0.607242
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('leonardo_form_pegastudio', '0018_pegastudioorders_file'), ] operations = [ migrations.CreateModel( name='Document', fields=[...
true
true
f72e3a490c25894eea1fb44d63d056ee2372eb30
1,781
py
Python
models/testing/all_autoencoder_li_2019_ffnn.py
inovex/RCIS2021-degradation-bearing-vessels
27bd1a2e3f08c5b42011596aa98e5ac627a416d6
[ "MIT" ]
2
2021-06-21T11:40:38.000Z
2021-12-29T02:40:30.000Z
models/testing/all_autoencoder_li_2019_ffnn.py
chenzhengkun7/RCIS2021-degradation-estimation-bearing-vessels
27bd1a2e3f08c5b42011596aa98e5ac627a416d6
[ "MIT" ]
2
2021-04-08T11:30:28.000Z
2021-04-12T06:41:31.000Z
models/testing/all_autoencoder_li_2019_ffnn.py
chenzhengkun7/RCIS2021-degradation-estimation-bearing-vessels
27bd1a2e3f08c5b42011596aa98e5ac627a416d6
[ "MIT" ]
2
2021-06-21T11:40:43.000Z
2021-12-29T02:36:51.000Z
import pandas as pd from pre_processing.features import read_feature_dfs from util.helper import pop_labels, concat_dfs from health_stage_classification.health_stage_classifiers import cut_fpts from rul_prediction.ffnn import fit_ffnn from util.constants import LEARNING_SET, FEATURES_CSV_NAME, FULL_TEST_SET, BASIC_STA...
44.525
107
0.815834
import pandas as pd from pre_processing.features import read_feature_dfs from util.helper import pop_labels, concat_dfs from health_stage_classification.health_stage_classifiers import cut_fpts from rul_prediction.ffnn import fit_ffnn from util.constants import LEARNING_SET, FEATURES_CSV_NAME, FULL_TEST_SET, BASIC_STA...
true
true
f72e3b4756a5c4944372e531349c6f09fe1782e0
3,024
py
Python
4_simple_models/scripts/random_forest_SMOTE_bordeline_1.py
ReyhaneAskari/SLA_violation_classification
258a3c415cebcd04601e4d794d42d664471df668
[ "MIT" ]
2
2019-03-25T18:07:10.000Z
2022-03-06T08:49:49.000Z
4_simple_models/scripts/random_forest_SMOTE_bordeline_1.py
ReyhaneAskari/SLA_violation_classification
258a3c415cebcd04601e4d794d42d664471df668
[ "MIT" ]
null
null
null
4_simple_models/scripts/random_forest_SMOTE_bordeline_1.py
ReyhaneAskari/SLA_violation_classification
258a3c415cebcd04601e4d794d42d664471df668
[ "MIT" ]
2
2018-10-10T01:18:10.000Z
2018-10-10T03:05:53.000Z
# -*- coding: utf-8 -*- # In this script we use a simple classifer called naive bayes and try to predict the violations. But before that we use # some methods to tackle the problem of our skewed dataset. :) # 11 May 2016 # @author: reyhane_askari # Universite de Montreal, DIRO import csv import numpy as np from skl...
35.162791
120
0.76422
import csv import numpy as np from sklearn.metrics import roc_curve, auc from sklearn.cross_validation import train_test_split from sklearn import metrics import pandas as pd from os import chdir, listdir from pandas import read_csv from os import path from random import randint, sample, seed from collections import...
true
true
f72e3b4cd025f89103636fd22e3d20bbea3db413
7,354
py
Python
cca_zoo/data/simulated.py
raamana/cca_zoo
7137918a6bac098ec20ba998d1774d5335c178dd
[ "MIT" ]
1
2021-06-19T13:57:44.000Z
2021-06-19T13:57:44.000Z
cca_zoo/data/simulated.py
raamana/cca_zoo
7137918a6bac098ec20ba998d1774d5335c178dd
[ "MIT" ]
null
null
null
cca_zoo/data/simulated.py
raamana/cca_zoo
7137918a6bac098ec20ba998d1774d5335c178dd
[ "MIT" ]
null
null
null
import itertools from typing import List, Union import numpy as np from scipy import linalg from scipy.linalg import block_diag from ..utils.check_values import _process_parameter def generate_covariance_data(n: int, view_features: List[int], latent_dims: int = 1, view_sparsity: List[Un...
39.751351
133
0.565271
import itertools from typing import List, Union import numpy as np from scipy import linalg from scipy.linalg import block_diag from ..utils.check_values import _process_parameter def generate_covariance_data(n: int, view_features: List[int], latent_dims: int = 1, view_sparsity: List[Un...
true
true
f72e3b59e81104351bc14bbae3b3432d9707d643
1,914
py
Python
tests/test_action_list_sdk_verb_args.py
jschoewe/stackstorm-orion
a5fdb805ff70c3911cb4c74be3f299f9a1c2625f
[ "Apache-2.0" ]
164
2015-01-17T16:08:33.000Z
2021-08-03T02:34:07.000Z
tests/test_action_list_sdk_verb_args.py
jschoewe/stackstorm-orion
a5fdb805ff70c3911cb4c74be3f299f9a1c2625f
[ "Apache-2.0" ]
442
2015-01-01T11:19:01.000Z
2017-09-06T23:26:17.000Z
tests/test_action_list_sdk_verb_args.py
EncoreTechnologies/stackstorm-orion
ed6f54ab7a25885ba1313fe52c9bc0d243164aa2
[ "Apache-2.0" ]
202
2015-01-13T00:37:40.000Z
2020-11-07T11:30:10.000Z
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
36.113208
76
0.694357
from mock import MagicMock from orion_base_action_test_case import OrionBaseActionTestCase from list_sdk_verb_args import ListSdkVerbArgs __all__ = [ 'ListSdkVerbArgsTestCase' ] class ListSdkVerbArgsTestCase(OrionBaseActionTestCase): __test__ = True action_cls = ListSdkVerbArgs def test_run_conne...
true
true
f72e3b822f5090311cc7b659618c8e63ab60c38a
56,018
py
Python
hubblestack/loader.py
vladmonea/hubble
4db1653d8f65e88e7385651742377db5a7e088ce
[ "Apache-2.0" ]
363
2017-01-10T22:02:47.000Z
2022-03-21T10:44:40.000Z
hubblestack/loader.py
vladmonea/hubble
4db1653d8f65e88e7385651742377db5a7e088ce
[ "Apache-2.0" ]
439
2017-01-12T22:39:42.000Z
2021-10-11T18:43:28.000Z
hubblestack/loader.py
vladmonea/hubble
4db1653d8f65e88e7385651742377db5a7e088ce
[ "Apache-2.0" ]
138
2017-01-05T22:10:59.000Z
2021-09-01T14:35:00.000Z
# -*- coding: utf-8 -*- """ The Salt loader is the core to Salt's plugin system, the loader scans directories for python loadable code and organizes the code into the plugin interfaces used by Salt. """ import os import re import sys import time import yaml import logging import inspect import tempfile import functool...
39.477097
156
0.57926
import os import re import sys import time import yaml import logging import inspect import tempfile import functools import threading import traceback import types from zipimport import zipimporter import hubblestack.config import hubblestack.syspaths import hubblestack.utils.args import hubblestack.utils.context i...
true
true
f72e3b933ba4563bbe21eb2dba0d89e1a256b8b7
6,057
py
Python
update-server/tests/buildroot/test_update.py
faliester/opentrons
e945d0f72fed39b0f68c0b30b7afd1981644184f
[ "Apache-2.0" ]
235
2017-10-27T20:37:27.000Z
2022-03-30T14:09:49.000Z
update-server/tests/buildroot/test_update.py
faliester/opentrons
e945d0f72fed39b0f68c0b30b7afd1981644184f
[ "Apache-2.0" ]
8,425
2017-10-26T15:25:43.000Z
2022-03-31T23:54:26.000Z
update-server/tests/buildroot/test_update.py
faliester/opentrons
e945d0f72fed39b0f68c0b30b7afd1981644184f
[ "Apache-2.0" ]
130
2017-11-09T21:02:37.000Z
2022-03-15T18:01:24.000Z
""" Tests for the update server state machine in otupdate.buildroot.update """ import asyncio import binascii import hashlib import zipfile import pytest from otupdate.buildroot import update, config, file_actions from otupdate.buildroot.update_session import UpdateSession, Stages def session_endpoint(token, endpoi...
35.421053
75
0.632491
import asyncio import binascii import hashlib import zipfile import pytest from otupdate.buildroot import update, config, file_actions from otupdate.buildroot.update_session import UpdateSession, Stages def session_endpoint(token, endpoint): return f'/server/update/{token}/{endpoint}' @pytest.fixture async de...
true
true
f72e3c6beeda2758e387c16130afd284e00fb3b4
1,715
py
Python
py/getting_started.py
qcgm1978/formula
fee12667b585e37b21768f4d165b8bc5f2d4f448
[ "Apache-2.0" ]
null
null
null
py/getting_started.py
qcgm1978/formula
fee12667b585e37b21768f4d165b8bc5f2d4f448
[ "Apache-2.0" ]
null
null
null
py/getting_started.py
qcgm1978/formula
fee12667b585e37b21768f4d165b8bc5f2d4f448
[ "Apache-2.0" ]
null
null
null
import unittest,math from datatype import DataTypes import numpy as np from scipy import stats class TDD_GETTING_STARTED(unittest.TestCase): def test_mse(self): a=[1,2,3] b=[4,5,6] self.assertRaises(TypeError,DataTypes({'a':a}).getMSE,b) def test_datatypes(self): d=DataTypes(5) ...
35.729167
88
0.602332
import unittest,math from datatype import DataTypes import numpy as np from scipy import stats class TDD_GETTING_STARTED(unittest.TestCase): def test_mse(self): a=[1,2,3] b=[4,5,6] self.assertRaises(TypeError,DataTypes({'a':a}).getMSE,b) def test_datatypes(self): d=DataTypes(5) ...
true
true
f72e3d7d277d819667954bd3c25a462510891fc1
1,367
py
Python
lab1/queryEndpoint.py
KimMupfumira/python-2022
9b9936c5f9516fff8393b8f91a093d6dd19e7cac
[ "Apache-2.0" ]
1
2022-02-08T20:25:23.000Z
2022-02-08T20:25:23.000Z
lab1/queryEndpoint.py
KimMupfumira/python-2022
9b9936c5f9516fff8393b8f91a093d6dd19e7cac
[ "Apache-2.0" ]
null
null
null
lab1/queryEndpoint.py
KimMupfumira/python-2022
9b9936c5f9516fff8393b8f91a093d6dd19e7cac
[ "Apache-2.0" ]
5
2022-02-01T14:14:17.000Z
2022-03-28T21:41:55.000Z
''' Created on 19 Jan 2021 @author: ejimenez-ruiz ''' from SPARQLWrapper import SPARQLWrapper, JSON import time def queryRemoteGraph(endpoint_url, query, attempts=3): sparqlw = SPARQLWrapper(endpoint_url) sparqlw.setReturnFormat(JSON) try: sparqlw.setQuery(...
23.568966
145
0.585223
from SPARQLWrapper import SPARQLWrapper, JSON import time def queryRemoteGraph(endpoint_url, query, attempts=3): sparqlw = SPARQLWrapper(endpoint_url) sparqlw.setReturnFormat(JSON) try: sparqlw.setQuery(query) results = sparqlw.query().c...
true
true
f72e3ea1251b6b2b5249aab531946b974437cbe3
3,236
py
Python
population_class.py
adamscj14/Population-Genetics-Simulations
092648f42c0a1bf3fcdb2b58ac78bb58e1a406c0
[ "MIT" ]
null
null
null
population_class.py
adamscj14/Population-Genetics-Simulations
092648f42c0a1bf3fcdb2b58ac78bb58e1a406c0
[ "MIT" ]
null
null
null
population_class.py
adamscj14/Population-Genetics-Simulations
092648f42c0a1bf3fcdb2b58ac78bb58e1a406c0
[ "MIT" ]
null
null
null
import random ## Class that holds population object class Population: def __init__(self, size, allele_frequency, a_advantage=0.0, A_advantage=0.0, mut_rate_a_to_A=0.0, mut_rate_A_to_a=0.0): self.size = size self.parent_allele_freq = float(allele_frequency) self.child_allele_freq = 0 ...
24.892308
123
0.602287
import random class Population: def __init__(self, size, allele_frequency, a_advantage=0.0, A_advantage=0.0, mut_rate_a_to_A=0.0, mut_rate_A_to_a=0.0): self.size = size self.parent_allele_freq = float(allele_frequency) self.child_allele_freq = 0 self.parent_individuals = self....
true
true
f72e3ebabf440ec21aa584a65bf31aae72df3218
1,412
py
Python
Recommender_System/algorithm/NeuMF/train.py
Holldean/Recommender-System
5c1508b4fb430dc06979353627c4cb873aad490c
[ "MIT" ]
348
2019-11-12T12:20:08.000Z
2022-03-31T12:34:45.000Z
Recommender_System/algorithm/NeuMF/train.py
Runjeo/Recommender-System
6a93e6ee970b32c76e2f71043383bf24a7e865d5
[ "MIT" ]
15
2019-12-04T15:16:15.000Z
2021-07-21T06:27:38.000Z
Recommender_System/algorithm/NeuMF/train.py
Runjeo/Recommender-System
6a93e6ee970b32c76e2f71043383bf24a7e865d5
[ "MIT" ]
87
2019-11-24T10:26:26.000Z
2022-03-11T05:35:39.000Z
from Recommender_System.algorithm.NeuMF.model import NeuMF_model from Recommender_System.algorithm.train import train, test import tensorflow as tf def train_with_pretrain(n_user, n_item, train_data, test_data, topk_data, gmf_dim, mlp_dim, layers, l2): neumf_model, gmf_model, mlp_model = NeuMF_model(n_user,...
58.833333
130
0.746459
from Recommender_System.algorithm.NeuMF.model import NeuMF_model from Recommender_System.algorithm.train import train, test import tensorflow as tf def train_with_pretrain(n_user, n_item, train_data, test_data, topk_data, gmf_dim, mlp_dim, layers, l2): neumf_model, gmf_model, mlp_model = NeuMF_model(n_user,...
true
true
f72e3ed1ce8a318b29f3b1bf906dfcddc22f30e6
807
py
Python
main.py
ceilors/maige
bb53c3b858b57865ad8f4dc179d82fb26c12f5ce
[ "MIT" ]
null
null
null
main.py
ceilors/maige
bb53c3b858b57865ad8f4dc179d82fb26c12f5ce
[ "MIT" ]
null
null
null
main.py
ceilors/maige
bb53c3b858b57865ad8f4dc179d82fb26c12f5ce
[ "MIT" ]
null
null
null
from flask import Flask, render_template, request, jsonify from colors import get_main_colors from base64 import decodebytes from io import BytesIO app = Flask(__name__, static_url_path='') @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': if request.form: _, ...
31.038462
78
0.627014
from flask import Flask, render_template, request, jsonify from colors import get_main_colors from base64 import decodebytes from io import BytesIO app = Flask(__name__, static_url_path='') @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST': if request.form: _, ...
true
true
f72e3eedc75ee9c53a910ab98319340f3975f69d
10,813
py
Python
comparxiv/comparxiv.py
lukasschwab/comparxiv
1e422cc154c483f0b08c943f66bdd91b0f082f84
[ "MIT" ]
321
2020-04-24T14:54:08.000Z
2022-03-07T15:36:20.000Z
comparxiv/comparxiv.py
lukasschwab/comparxiv
1e422cc154c483f0b08c943f66bdd91b0f082f84
[ "MIT" ]
10
2020-04-23T17:26:24.000Z
2022-02-16T07:44:11.000Z
comparxiv/comparxiv.py
lukasschwab/comparxiv
1e422cc154c483f0b08c943f66bdd91b0f082f84
[ "MIT" ]
26
2020-04-24T22:26:51.000Z
2022-02-19T11:18:13.000Z
#!/usr/bin/env python import os import sys import shutil import arxiv import requests from sys import platform from tqdm import tqdm from os.path import join version = '0.1.7' author = 'Timon Emken' year = '2020' temp_folder = ".temp_comparxiv" def compare_preprints(arxiv_ID, version_a, version_b,keep_temp,show_l...
35.107143
328
0.70258
import os import sys import shutil import arxiv import requests from sys import platform from tqdm import tqdm from os.path import join version = '0.1.7' author = 'Timon Emken' year = '2020' temp_folder = ".temp_comparxiv" def compare_preprints(arxiv_ID, version_a, version_b,keep_temp,show_latex_output,dont_open_...
true
true
f72e3f4721a941cae58767e3a41507699843bbef
1,483
py
Python
Day 05/password_generator.py
Dheer08/100-days-of-code
05d0e5e6613f924ab083e13f28a7a0446bd34434
[ "MIT" ]
null
null
null
Day 05/password_generator.py
Dheer08/100-days-of-code
05d0e5e6613f924ab083e13f28a7a0446bd34434
[ "MIT" ]
null
null
null
Day 05/password_generator.py
Dheer08/100-days-of-code
05d0e5e6613f924ab083e13f28a7a0446bd34434
[ "MIT" ]
null
null
null
import random letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] numbers = ['0', '1', '2', '3', '4',...
38.025641
270
0.597438
import random letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] numbers = ['0', '1', '2', '3', '4',...
true
true
f72e3f481b6ee7faa4b350db4971d27d5f501b51
2,523
py
Python
tests/components/dynalite/common.py
domwillcode/home-assistant
f170c80bea70c939c098b5c88320a1c789858958
[ "Apache-2.0" ]
6
2020-07-18T16:33:25.000Z
2021-09-26T09:52:04.000Z
tests/components/dynalite/common.py
domwillcode/home-assistant
f170c80bea70c939c098b5c88320a1c789858958
[ "Apache-2.0" ]
56
2020-08-03T07:30:54.000Z
2022-03-31T06:02:04.000Z
tests/components/dynalite/common.py
klauern/home-assistant-core
c18ba6aec0627e6afb6442c678edb5ff2bb17db6
[ "Apache-2.0" ]
5
2020-03-29T00:29:13.000Z
2021-09-06T20:58:40.000Z
"""Common functions for tests.""" from homeassistant.components import dynalite from homeassistant.helpers import entity_registry from tests.async_mock import AsyncMock, Mock, call, patch from tests.common import MockConfigEntry ATTR_SERVICE = "service" ATTR_METHOD = "method" ATTR_ARGS = "args" def create_mock_devi...
38.815385
94
0.705906
from homeassistant.components import dynalite from homeassistant.helpers import entity_registry from tests.async_mock import AsyncMock, Mock, call, patch from tests.common import MockConfigEntry ATTR_SERVICE = "service" ATTR_METHOD = "method" ATTR_ARGS = "args" def create_mock_device(platform, spec): device = M...
true
true
f72e3fc70899c2619f3a52ac0851c7d574b246cd
78
py
Python
app/db.py
AntonOni/my-flasktodo
8e4ea7aca25e0b0ea11d4d2ea3fb322b55cfcd3a
[ "MIT" ]
null
null
null
app/db.py
AntonOni/my-flasktodo
8e4ea7aca25e0b0ea11d4d2ea3fb322b55cfcd3a
[ "MIT" ]
2
2021-03-25T23:44:31.000Z
2022-03-29T22:01:18.000Z
app/db.py
AntonOni/my-flasktodo
8e4ea7aca25e0b0ea11d4d2ea3fb322b55cfcd3a
[ "MIT" ]
null
null
null
import dataset db = dataset.connect('sqlite:///tasks.db') tasks = db['tasks']
19.5
42
0.692308
import dataset db = dataset.connect('sqlite:///tasks.db') tasks = db['tasks']
true
true
f72e407aacff036f6a27dabd01cc1a84b4e4a8ab
2,502
py
Python
test_nerf.py
dingjr27/nerf
b0e0554022f66d65705d3134c4cfdd71429eb574
[ "MIT" ]
null
null
null
test_nerf.py
dingjr27/nerf
b0e0554022f66d65705d3134c4cfdd71429eb574
[ "MIT" ]
null
null
null
test_nerf.py
dingjr27/nerf
b0e0554022f66d65705d3134c4cfdd71429eb574
[ "MIT" ]
null
null
null
import os, sys # os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true' os.environ['CUDA_VISIBLE_DEVICES'] = '1' import tensorflow as tf tf.compat.v1.enable_eager_execution() sys.path.append(r'/home/luca/Desktop/NERFPosit/Inference') import numpy as np import imageio import json import random import time import pprint from...
26.336842
119
0.684652
import os, sys os.environ['CUDA_VISIBLE_DEVICES'] = '1' import tensorflow as tf tf.compat.v1.enable_eager_execution() sys.path.append(r'/home/luca/Desktop/NERFPosit/Inference') import numpy as np import imageio import json import random import time import pprint from tensorflow import keras from tensorflow.keras impo...
true
true
f72e414bf6bdf8d43884107e4bbb78774081d65f
262
py
Python
languages/python3/japronto/main.py
jcnaud/snippet
10db24e2a648af29c51f6bc3a083ffe86e11ae5c
[ "Apache-2.0" ]
5
2018-01-18T10:08:50.000Z
2020-05-01T04:18:02.000Z
languages/python3/japronto/main.py
jcnaud/snippet
10db24e2a648af29c51f6bc3a083ffe86e11ae5c
[ "Apache-2.0" ]
null
null
null
languages/python3/japronto/main.py
jcnaud/snippet
10db24e2a648af29c51f6bc3a083ffe86e11ae5c
[ "Apache-2.0" ]
null
null
null
# source : https://github.com/squeaky-pl/japronto/blob/master/tutorial/1_hello.md from japronto import Application def hello(request): return request.Response(text='Hello world!') app = Application() app.router.add_route('/', hello) app.run(debug=True)
20.153846
81
0.744275
from japronto import Application def hello(request): return request.Response(text='Hello world!') app = Application() app.router.add_route('/', hello) app.run(debug=True)
true
true
f72e41538ac04b1bddab04878d05b47c34f51b7d
958
py
Python
code_week1_426_430/search_in_rotated_sorted_array.py
dylanlee101/leetcode
b059afdadb83d504e62afd1227107de0b59557af
[ "Apache-2.0" ]
null
null
null
code_week1_426_430/search_in_rotated_sorted_array.py
dylanlee101/leetcode
b059afdadb83d504e62afd1227107de0b59557af
[ "Apache-2.0" ]
null
null
null
code_week1_426_430/search_in_rotated_sorted_array.py
dylanlee101/leetcode
b059afdadb83d504e62afd1227107de0b59557af
[ "Apache-2.0" ]
null
null
null
''' 假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组 [0,1,2,4,5,6,7] 可能变为 [4,5,6,7,0,1,2] )。 搜索一个给定的目标值,如果数组中存在这个目标值,则返回它的索引,否则返回 -1 。 你可以假设数组中不存在重复的元素。 你的算法时间复杂度必须是 O(log n) 级别。 示例 1: 输入: nums = [4,5,6,7,0,1,2], target = 0 输出: 4 示例 2: 输入: nums = [4,5,6,7,0,1,2], target = 3 输出: -1 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/...
22.809524
66
0.462422
class Solution: def search(self, nums: List[int], target: int) -> int: l = 0 r = len(nums) -1 while (l <= r): mid = (l+r) >> 1 if target == nums[mid]: return mid if nums[l]<= nums[mid]: if target >= nums[l] and target < nums...
true
true
f72e41a742163eb3e707b174caea0f06b81bd15e
1,881
py
Python
third_party/blink/renderer/bindings/scripts/bind_gen/codegen_accumulator.py
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
third_party/blink/renderer/bindings/scripts/bind_gen/codegen_accumulator.py
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
third_party/blink/renderer/bindings/scripts/bind_gen/codegen_accumulator.py
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. class CodeGenAccumulator(object): """ Accumulates a variety of information and helps generate code based on the information. """ def __...
28.938462
77
0.701223
class CodeGenAccumulator(object): def __init__(self): self._include_headers = set() self._class_decls = set() self._struct_decls = set() def total_size(self): return (len(self.include_headers) + len(self.class_decls) + len( self.struct_decl...
true
true
f72e42b4141b3b01016c081715c4244055b83088
3,517
py
Python
assets/tools/asset_audit.py
yiya-core/yiya-core
54bdc5c72f6d760cb3ec840f202c289bccd03ccd
[ "MIT" ]
null
null
null
assets/tools/asset_audit.py
yiya-core/yiya-core
54bdc5c72f6d760cb3ec840f202c289bccd03ccd
[ "MIT" ]
null
null
null
assets/tools/asset_audit.py
yiya-core/yiya-core
54bdc5c72f6d760cb3ec840f202c289bccd03ccd
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Script to audit the assets # Reads the asset (amount has all issuances) # Reads the balances in every address for the asset. # Compares the two numbers to checks that qty of all assets are accounted for import subprocess import json #Set this to your yiya-cli program cli = "yiya-cli" mode =...
29.805085
123
0.627239
import subprocess import json cli = "yiya-cli" mode = "-testnet" rpc_port = 15591 rpc_user = 'rpcuser' rpc_pass = 'rpcpass555' def listassets(filter): rpc_connection = get_rpc_connection() result = rpc_connection.listassets(filter, True) return(result) def listaddressesbyasset(asset, bool, number, ...
true
true
f72e42e386695a450d722a3a775545996c37216f
3,796
py
Python
vio/vio/swagger/utils.py
onap/multicloud-openstack-vmware
53fd67e55f54c66b29e0eb5ab792e80d16ffff20
[ "Apache-2.0", "CC-BY-4.0" ]
1
2021-10-15T16:47:11.000Z
2021-10-15T16:47:11.000Z
vio/vio/swagger/utils.py
onap/multicloud-openstack-vmware
53fd67e55f54c66b29e0eb5ab792e80d16ffff20
[ "Apache-2.0", "CC-BY-4.0" ]
1
2020-02-11T22:14:45.000Z
2020-02-11T22:14:45.000Z
vio/vio/swagger/utils.py
onap/multicloud-openstack-vmware
53fd67e55f54c66b29e0eb5ab792e80d16ffff20
[ "Apache-2.0", "CC-BY-4.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 # di...
41.714286
77
0.688883
import json import os def get_swagger_json_data(): json_file = os.path.join(os.path.dirname( __file__), 'multivim.flavor.swagger.json') f = open(json_file) json_data = json.JSONDecoder().decode(f.read()) f.close() json_file = os.path.join(os.path.dirname( __file__), 'multivim.imag...
true
true
f72e432ddad2c586e45b0ee110568ffaa11c4951
1,825
py
Python
test/test_tenants.py
rubelw/auth0_client
51e68239babcf7c40e40491d1aaa3f8547a67f63
[ "MIT" ]
2
2020-10-08T21:42:56.000Z
2021-03-21T08:17:52.000Z
test/test_tenants.py
rubelw/auth0_client
51e68239babcf7c40e40491d1aaa3f8547a67f63
[ "MIT" ]
null
null
null
test/test_tenants.py
rubelw/auth0_client
51e68239babcf7c40e40491d1aaa3f8547a67f63
[ "MIT" ]
null
null
null
import json import sys import unittest from contextlib import contextmanager if sys.version_info[0] < 3: from StringIO import StringIO else: from io import StringIO from mock import patch from auth0_client.Auth0Client import Auth0Client as class_to_test @contextmanager def captured_output(): new_out, new...
25.347222
65
0.642192
import json import sys import unittest from contextlib import contextmanager if sys.version_info[0] < 3: from StringIO import StringIO else: from io import StringIO from mock import patch from auth0_client.Auth0Client import Auth0Client as class_to_test @contextmanager def captured_output(): new_out, new...
true
true
f72e4627ab0f3f4cac8d2b3cf9858e52763b8499
1,163
py
Python
__tests__/integration/mocks/main.py
tetrascience/ts-sdk-python
05a5034f99bc73ea456a16332ecd26ce7c403dad
[ "Apache-2.0" ]
1
2022-01-19T19:38:49.000Z
2022-01-19T19:38:49.000Z
__tests__/integration/mocks/main.py
tetrascience/ts-sdk-python
05a5034f99bc73ea456a16332ecd26ce7c403dad
[ "Apache-2.0" ]
17
2021-03-17T07:47:07.000Z
2022-03-28T18:49:06.000Z
__tests__/integration/mocks/main.py
tetrascience/ts-sdk-python
05a5034f99bc73ea456a16332ecd26ce7c403dad
[ "Apache-2.0" ]
1
2021-03-17T08:06:25.000Z
2021-03-17T08:06:25.000Z
from ts_sdk import task def test_log(input, context: task.Context): logger = context.get_logger() logger.log({ "message": "Hello from test function!", "level": "info" }) def test_file_operations(input, context: task.Context): file = context.write_file(b'test-content', input.get('newFil...
38.766667
111
0.695615
from ts_sdk import task def test_log(input, context: task.Context): logger = context.get_logger() logger.log({ "message": "Hello from test function!", "level": "info" }) def test_file_operations(input, context: task.Context): file = context.write_file(b'test-content', input.get('newFil...
true
true
f72e4686ac76fb9adca1ea4b64215bfc51049ddf
2,208
py
Python
zerver/webhooks/wordpress/view.py
Supermanu/zulip
26f6d708c2e30cfe50d9d61031edb759e8117596
[ "Apache-2.0" ]
null
null
null
zerver/webhooks/wordpress/view.py
Supermanu/zulip
26f6d708c2e30cfe50d9d61031edb759e8117596
[ "Apache-2.0" ]
15
2020-06-05T18:44:15.000Z
2022-03-11T23:26:03.000Z
zerver/webhooks/wordpress/view.py
Supermanu/zulip
26f6d708c2e30cfe50d9d61031edb759e8117596
[ "Apache-2.0" ]
null
null
null
# Webhooks for external integrations. from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.http import HttpRequest, HttpResponse from zerver.models import get_client, UserProfile from zerver.lib.actions import check_send_message from zerver.lib.response import json_succe...
46
153
0.680254
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.http import HttpRequest, HttpResponse from zerver.models import get_client, UserProfile from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator i...
true
true
f72e46d6af97d1838fd40d7621427e1174fa05e9
771
py
Python
pytz_timezone_field/models/fields.py
mkoistinen/django-pytz-timezone-field
4f558923f7d2a884eeed2def29a5690336598668
[ "MIT" ]
null
null
null
pytz_timezone_field/models/fields.py
mkoistinen/django-pytz-timezone-field
4f558923f7d2a884eeed2def29a5690336598668
[ "MIT" ]
null
null
null
pytz_timezone_field/models/fields.py
mkoistinen/django-pytz-timezone-field
4f558923f7d2a884eeed2def29a5690336598668
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from django.db.models.fields import CharField from ..forms.fields import TimeZoneInputField class TimeZoneField(CharField): """ A relatively dynamic TimeZone field for Django models. """ def __init__(self, *args, **kwargs): # Note, as of this writing, the max length of...
32.125
79
0.64332
from django.db.models.fields import CharField from ..forms.fields import TimeZoneInputField class TimeZoneField(CharField): def __init__(self, *args, **kwargs): kwargs.setdefault('max_length', 63) super().__init__(*args, **kwargs) def formfield(self, **kwargs): ...
true
true
f72e48d376dbe7b2b813c7e29cfe0902f94f05f9
2,192
py
Python
fire/cli/niv/_luk_sag.py
larsnaesbye/FIRE
1d2c65bf890391ebd0bff4bf41689e88f4d89704
[ "MIT" ]
4
2021-02-01T11:04:48.000Z
2022-03-11T19:14:59.000Z
fire/cli/niv/_luk_sag.py
larsnaesbye/FIRE
1d2c65bf890391ebd0bff4bf41689e88f4d89704
[ "MIT" ]
256
2020-05-06T21:30:10.000Z
2022-03-24T10:23:56.000Z
fire/cli/niv/_luk_sag.py
larsnaesbye/FIRE
1d2c65bf890391ebd0bff4bf41689e88f4d89704
[ "MIT" ]
11
2020-05-04T07:08:27.000Z
2022-01-05T11:34:31.000Z
from io import BytesIO from zipfile import ZipFile import click import fire.cli from fire.api.model import ( Sagsevent, SagseventInfo, SagseventInfoMateriale, EventType, ) from fire.io.regneark import arkdef from . import ( find_faneblad, find_sag, niv, bekræft, er_projekt_okay, )...
27.4
81
0.624544
from io import BytesIO from zipfile import ZipFile import click import fire.cli from fire.api.model import ( Sagsevent, SagseventInfo, SagseventInfoMateriale, EventType, ) from fire.io.regneark import arkdef from . import ( find_faneblad, find_sag, niv, bekræft, er_projekt_okay, )...
true
true
f72e4918b12a62bd6be858f4ee40afb0815cf68f
1,851
py
Python
device/kckr.py
smstuebe/kckr
1806baf34d329a033008acd6a8b79ffafd151bb1
[ "MIT" ]
null
null
null
device/kckr.py
smstuebe/kckr
1806baf34d329a033008acd6a8b79ffafd151bb1
[ "MIT" ]
1
2019-05-22T07:22:33.000Z
2019-05-22T07:22:33.000Z
device/kckr.py
smstuebe/kckr
1806baf34d329a033008acd6a8b79ffafd151bb1
[ "MIT" ]
null
null
null
import threading from time import sleep import collections import requests import json import argparse import configparser from sensors.sensors import Sensors from backend.backend import Backend parser = argparse.ArgumentParser(description="Kicker activity indicator.") parser.add_argument('--debug', action='store_cons...
28.476923
79
0.653701
import threading from time import sleep import collections import requests import json import argparse import configparser from sensors.sensors import Sensors from backend.backend import Backend parser = argparse.ArgumentParser(description="Kicker activity indicator.") parser.add_argument('--debug', action='store_cons...
true
true
f72e498c73fddceb72cebc0a84291e6fbbe0cdb0
417
py
Python
math/0x06-multivariate_prob/3-main.py
kyeeh/holbertonschool-machine_learning
8e4894c2b036ec7f4750de5bf99b95aee5b94449
[ "MIT" ]
null
null
null
math/0x06-multivariate_prob/3-main.py
kyeeh/holbertonschool-machine_learning
8e4894c2b036ec7f4750de5bf99b95aee5b94449
[ "MIT" ]
null
null
null
math/0x06-multivariate_prob/3-main.py
kyeeh/holbertonschool-machine_learning
8e4894c2b036ec7f4750de5bf99b95aee5b94449
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 if __name__ == '__main__': import numpy as np from multinormal import MultiNormal np.random.seed(0) data = np.random.multivariate_normal([12, 30, 10], [[36, -30, 15], [-30, 100, -20], [15, -20, 25]], 10000).T mn = MultiNormal(data) x = np.random.multivariate_normal([12, ...
32.076923
112
0.58753
if __name__ == '__main__': import numpy as np from multinormal import MultiNormal np.random.seed(0) data = np.random.multivariate_normal([12, 30, 10], [[36, -30, 15], [-30, 100, -20], [15, -20, 25]], 10000).T mn = MultiNormal(data) x = np.random.multivariate_normal([12, 30, 10], [[36, -30, 15]...
true
true
f72e4a86777f74860825078d88f210956daaf989
2,722
py
Python
azure/mgmt/network/v2017_08_01/models/route_filter.py
EnjoyLifeFund/py36pkgs
0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
azure/mgmt/network/v2017_08_01/models/route_filter.py
EnjoyLifeFund/py36pkgs
0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
azure/mgmt/network/v2017_08_01/models/route_filter.py
EnjoyLifeFund/py36pkgs
0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2
[ "MIT", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
37.805556
91
0.609478
from .resource import Resource class RouteFilter(Resource): _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'etag': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, ...
true
true
f72e4a8b3e4d7ff67bbca7884b9b872ee6346fc9
4,369
py
Python
google/ads/googleads/v4/resources/types/custom_interest.py
batardo/google-ads-python
a39748521847e85138fca593f3be2681352ad024
[ "Apache-2.0" ]
null
null
null
google/ads/googleads/v4/resources/types/custom_interest.py
batardo/google-ads-python
a39748521847e85138fca593f3be2681352ad024
[ "Apache-2.0" ]
null
null
null
google/ads/googleads/v4/resources/types/custom_interest.py
batardo/google-ads-python
a39748521847e85138fca593f3be2681352ad024
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
38.663717
112
0.703593
import proto from google.ads.googleads.v4.enums.types import custom_interest_member_type from google.ads.googleads.v4.enums.types import custom_interest_status from google.ads.googleads.v4.enums.types import custom_interest_type from google.protobuf import wrappers_pb2 as wrappers __protobuf__ = proto.module( ...
true
true
f72e4aa9ccd18adba05969c7078086aac4d097e9
1,184
py
Python
jdcloud_sdk/services/jdccs/apis/DescribeIdcOverviewRequest.py
Tanc009/jdcloud-sdk-python
8b045c99bc5b73ca7348e950b6f01e03a27982f5
[ "Apache-2.0" ]
14
2018-04-19T09:53:56.000Z
2022-01-27T06:05:48.000Z
jdcloud_sdk/services/jdccs/apis/DescribeIdcOverviewRequest.py
Tanc009/jdcloud-sdk-python
8b045c99bc5b73ca7348e950b6f01e03a27982f5
[ "Apache-2.0" ]
15
2018-09-11T05:39:54.000Z
2021-07-02T12:38:02.000Z
jdcloud_sdk/services/jdccs/apis/DescribeIdcOverviewRequest.py
Tanc009/jdcloud-sdk-python
8b045c99bc5b73ca7348e950b6f01e03a27982f5
[ "Apache-2.0" ]
33
2018-04-20T05:29:16.000Z
2022-02-17T09:10:05.000Z
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
28.190476
75
0.709459
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest class DescribeIdcOverviewRequest(JDCloudRequest): def __init__(self, parameters, header=None, version="v1"): super(DescribeIdcOverviewRequest, self).__init__( '/idcs/{idc}/overview', 'GET', header, version) self.parameters =...
true
true
f72e4b6ab3bb941e242246f3ae5d7b65f579b2bb
166
py
Python
examples/permissioned-voting/assets/permissioned-voting-clear.py
Lumene98/algo-builder
b718661d064862fcf72c67589f0b5a6e48a1e7cd
[ "Apache-2.0" ]
16
2021-05-15T00:23:47.000Z
2022-03-07T18:59:54.000Z
examples/permissioned-voting/assets/permissioned-voting-clear.py
Lumene98/algo-builder
b718661d064862fcf72c67589f0b5a6e48a1e7cd
[ "Apache-2.0" ]
8
2021-03-30T18:23:53.000Z
2022-01-08T23:48:19.000Z
examples/permissioned-voting/assets/permissioned-voting-clear.py
Lumene98/algo-builder
b718661d064862fcf72c67589f0b5a6e48a1e7cd
[ "Apache-2.0" ]
3
2021-09-03T20:42:02.000Z
2022-03-03T17:21:15.000Z
from pyteal import * def clear_state_program(): return Return(Int(1)) if __name__ == "__main__": print(compileTeal(clear_state_program(), Mode.Application))
23.714286
63
0.73494
from pyteal import * def clear_state_program(): return Return(Int(1)) if __name__ == "__main__": print(compileTeal(clear_state_program(), Mode.Application))
true
true
f72e4c1fc8c43dd026395cd356909eccee491b99
272
py
Python
Gathered CTF writeups/ptr-yudai-writeups/2019/picoCTF_2019/for/like1000/solve.py
mihaid-b/CyberSakura
f60e6b6bfd6898c69b84424b080090ae98f8076c
[ "MIT" ]
1
2022-03-27T06:00:41.000Z
2022-03-27T06:00:41.000Z
Gathered CTF writeups/ptr-yudai-writeups/2019/picoCTF_2019/for/like1000/solve.py
mihaid-b/CyberSakura
f60e6b6bfd6898c69b84424b080090ae98f8076c
[ "MIT" ]
null
null
null
Gathered CTF writeups/ptr-yudai-writeups/2019/picoCTF_2019/for/like1000/solve.py
mihaid-b/CyberSakura
f60e6b6bfd6898c69b84424b080090ae98f8076c
[ "MIT" ]
1
2022-03-27T06:01:42.000Z
2022-03-27T06:01:42.000Z
import tarfile import os x = 1000 while x > 0: print(x) if not tarfile.is_tarfile("{}.tar".format(x)): break with tarfile.open("{}.tar".format(x)) as tar: tar.extractall('./') if x < 1000: os.unlink("{}.tar".format(x)) x -= 1
18.133333
50
0.536765
import tarfile import os x = 1000 while x > 0: print(x) if not tarfile.is_tarfile("{}.tar".format(x)): break with tarfile.open("{}.tar".format(x)) as tar: tar.extractall('./') if x < 1000: os.unlink("{}.tar".format(x)) x -= 1
true
true
f72e4f1d7832b90b3a9381e99472a22906e78302
1,273
py
Python
setup.py
wingechr/pystache-cli
8a44ab393c7120f1acd09ff03bb69c24a6705581
[ "CC0-1.0" ]
null
null
null
setup.py
wingechr/pystache-cli
8a44ab393c7120f1acd09ff03bb69c24a6705581
[ "CC0-1.0" ]
null
null
null
setup.py
wingechr/pystache-cli
8a44ab393c7120f1acd09ff03bb69c24a6705581
[ "CC0-1.0" ]
null
null
null
from setuptools import setup if __name__ == "__main__": with open("README.md", encoding="utf-8") as file: long_description = file.read() setup( packages=['pystache_cli'], keywords=["cli", "pystache", "template"], install_requires=["pystache"], name='pystache-cl...
37.441176
99
0.601728
from setuptools import setup if __name__ == "__main__": with open("README.md", encoding="utf-8") as file: long_description = file.read() setup( packages=['pystache_cli'], keywords=["cli", "pystache", "template"], install_requires=["pystache"], name='pystache-cl...
true
true
f72e4f337e5d46230215fadd2cf839bd8d810a33
1,904
py
Python
client/pipe_mic.py
HubertReX/jasper-client
a161d5ad593f9f5b87535ed84643629fc5cb1138
[ "JasPer-2.0", "Unlicense", "MIT" ]
null
null
null
client/pipe_mic.py
HubertReX/jasper-client
a161d5ad593f9f5b87535ed84643629fc5cb1138
[ "JasPer-2.0", "Unlicense", "MIT" ]
null
null
null
client/pipe_mic.py
HubertReX/jasper-client
a161d5ad593f9f5b87535ed84643629fc5cb1138
[ "JasPer-2.0", "Unlicense", "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # a może teraz? """ A drop-in replacement for the Mic class that gets input from named pipe. It can be anny source, by here the goal is to communicate with www flask server, where voice recognition is done through chrome browser. We get plain text with no need for stt engine (chrome browser uses...
30.709677
79
0.602941
import re import alteration import os import io import str_formater PIPE_NAME = '/home/osmc/flask/jasper_pipe_mic' class Mic: prev = None def __init__(self, speaker, passive_stt_engine, active_stt_engine, logger): self.speaker = speaker self.first_run = True self.logge...
true
true
f72e503eef72185c5b47c7c34969961e1c0adab9
674
py
Python
mars/deploy/local/__init__.py
lmatz/mars
45f9166b54eb91b21e66cef8b590a41aa8ac9569
[ "Apache-2.0" ]
1
2018-12-26T08:37:04.000Z
2018-12-26T08:37:04.000Z
mars/deploy/local/__init__.py
lmatz/mars
45f9166b54eb91b21e66cef8b590a41aa8ac9569
[ "Apache-2.0" ]
null
null
null
mars/deploy/local/__init__.py
lmatz/mars
45f9166b54eb91b21e66cef8b590a41aa8ac9569
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
35.473684
74
0.749258
from .core import new_cluster
true
true
f72e50bca50dee1f81e09e845987a0210c3b21a2
1,948
py
Python
great_expectations/render/page_renderer_util.py
isichei/great_expectations
b408f2e61f95a2d0f233902cedfb4b2807b814ad
[ "Apache-2.0" ]
1
2020-10-22T19:54:10.000Z
2020-10-22T19:54:10.000Z
great_expectations/render/page_renderer_util.py
isichei/great_expectations
b408f2e61f95a2d0f233902cedfb4b2807b814ad
[ "Apache-2.0" ]
21
2020-08-05T07:15:47.000Z
2021-04-29T05:35:52.000Z
great_expectations/render/page_renderer_util.py
isichei/great_expectations
b408f2e61f95a2d0f233902cedfb4b2807b814ad
[ "Apache-2.0" ]
null
null
null
import warnings from great_expectations.render.renderer import ValidationResultsPageRenderer from great_expectations.render.view import DefaultMarkdownPageView from great_expectations.validation_operators.types.validation_operator_result import ( ValidationOperatorResult, ) def render_multiple_validation_result_...
43.288889
110
0.780287
import warnings from great_expectations.render.renderer import ValidationResultsPageRenderer from great_expectations.render.view import DefaultMarkdownPageView from great_expectations.validation_operators.types.validation_operator_result import ( ValidationOperatorResult, ) def render_multiple_validation_result_...
true
true
f72e511c4590e0ef1a936bbff413f8650790b642
302
py
Python
Automation/Build_Mods_Rebuild.py
NeonOcean/Environment
ca658cf66e8fd6866c22a4a0136d415705b36d26
[ "CC-BY-4.0" ]
1
2021-05-20T19:33:37.000Z
2021-05-20T19:33:37.000Z
Automation/Build_Mods_Rebuild.py
NeonOcean/Environment
ca658cf66e8fd6866c22a4a0136d415705b36d26
[ "CC-BY-4.0" ]
null
null
null
Automation/Build_Mods_Rebuild.py
NeonOcean/Environment
ca658cf66e8fd6866c22a4a0136d415705b36d26
[ "CC-BY-4.0" ]
null
null
null
from Automation import Mods import datetime def Run () -> bool: for modNamespace in Mods.GetAllModNames(): # type: str Mods.BuildModRebuild(modNamespace) print("All mods built. " + datetime.datetime.now().strftime("%I:%M %p")) return True if __name__ == "__main__": if not Run(): exit(1)
18.875
73
0.692053
from Automation import Mods import datetime def Run () -> bool: for modNamespace in Mods.GetAllModNames(): Mods.BuildModRebuild(modNamespace) print("All mods built. " + datetime.datetime.now().strftime("%I:%M %p")) return True if __name__ == "__main__": if not Run(): exit(1)
true
true
f72e51b8b2347bbee5b69c71f604e4985594661d
541
py
Python
zmodulo/plot/text/text.py
aaruff/Z-Modulo
53ae0b1e07c2b13cb08f7d803623010f508ba1b7
[ "AFL-3.0" ]
1
2019-03-24T03:12:28.000Z
2019-03-24T03:12:28.000Z
zmodulo/plot/text/text.py
aaruff/Z-Modulo
53ae0b1e07c2b13cb08f7d803623010f508ba1b7
[ "AFL-3.0" ]
null
null
null
zmodulo/plot/text/text.py
aaruff/Z-Modulo
53ae0b1e07c2b13cb08f7d803623010f508ba1b7
[ "AFL-3.0" ]
null
null
null
class Text: """ The Plot Text Text Template """ def __init__(self, text=""): """ Initializes the plot text Text :param text: plot text text :type text: str """ self.text = text self.template = '\ttext = "{text}";\n' def to_str(self): """ ...
25.761905
83
0.55268
class Text: def __init__(self, text=""): self.text = text self.template = '\ttext = "{text}";\n' def to_str(self): return self.template.format(text=self.text)
true
true
f72e5432db3d79bb9910e5b840d130990fb67b94
17,453
py
Python
MoLtimestepping/C_Code_Generation.py
Steve-Hawk/nrpytutorial
42d7450dba8bf43aa9c2d8f38f85f18803de69b7
[ "BSD-2-Clause" ]
null
null
null
MoLtimestepping/C_Code_Generation.py
Steve-Hawk/nrpytutorial
42d7450dba8bf43aa9c2d8f38f85f18803de69b7
[ "BSD-2-Clause" ]
null
null
null
MoLtimestepping/C_Code_Generation.py
Steve-Hawk/nrpytutorial
42d7450dba8bf43aa9c2d8f38f85f18803de69b7
[ "BSD-2-Clause" ]
1
2021-03-02T12:51:56.000Z
2021-03-02T12:51:56.000Z
# As documented in the NRPy+ tutorial module # Tutorial-RK_Butcher_Table_Generating_C_Code.ipynb, # this module will produce the required C codes for # allocating required memory Method of Lines (MoL) timestepping, # implementing MoL timestepping, and deallocating memory # Authors: Brandon Clark # Za...
53.701538
281
0.580531
import sympy as sp import os from MoLtimestepping.RK_Butcher_Table_Dictionary import Butcher_dict def diagonal(key): diagonal = True Butcher = Butcher_dict[key][0] L = len(Butcher)-1 row_idx = 0 for i in range(L): for j in range(1,row_idx): if Butcher[i][j] != sp.s...
true
true
f72e55e4350c1244e5fa9db22aa56f8fc1fa74e5
19,603
py
Python
benchmarks/launch_benchmark.py
wesleyhuang2014/intelai-models
f64dd11e6542a14bbc6048b6167201d3499f4bf1
[ "Apache-2.0" ]
null
null
null
benchmarks/launch_benchmark.py
wesleyhuang2014/intelai-models
f64dd11e6542a14bbc6048b6167201d3499f4bf1
[ "Apache-2.0" ]
null
null
null
benchmarks/launch_benchmark.py
wesleyhuang2014/intelai-models
f64dd11e6542a14bbc6048b6167201d3499f4bf1
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
43.756696
139
0.631179
from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import os import signal import subprocess import sys from argparse import ArgumentParser from common import base_benchmark_util from common import platform_util from common.utils.validators import...
true
true
f72e56127d3745b7e19a89a5d8f92b2706b59d1b
31,530
py
Python
dvc/remote/base.py
e3bo/dvc
05b9f425863f259fd72e6c83e31326e4aab27826
[ "Apache-2.0" ]
null
null
null
dvc/remote/base.py
e3bo/dvc
05b9f425863f259fd72e6c83e31326e4aab27826
[ "Apache-2.0" ]
null
null
null
dvc/remote/base.py
e3bo/dvc
05b9f425863f259fd72e6c83e31326e4aab27826
[ "Apache-2.0" ]
null
null
null
from __future__ import unicode_literals from dvc.utils.compat import basestring, FileNotFoundError, str, urlparse import itertools import json import logging import tempfile from concurrent.futures import ThreadPoolExecutor from copy import copy from functools import partial from multiprocessing import cpu_count from ...
32.605998
79
0.603362
from __future__ import unicode_literals from dvc.utils.compat import basestring, FileNotFoundError, str, urlparse import itertools import json import logging import tempfile from concurrent.futures import ThreadPoolExecutor from copy import copy from functools import partial from multiprocessing import cpu_count from ...
true
true
f72e562b024f7ff13e8d304233d4cd6194d7de63
17,604
py
Python
source/extensions/filters/network/kafka/protocol/generator.py
jaricftw/envoy
766f3fb8dbdafce402631c43c16fda46ed003462
[ "Apache-2.0" ]
1
2021-12-10T23:58:57.000Z
2021-12-10T23:58:57.000Z
source/extensions/filters/network/kafka/protocol/generator.py
jaricftw/envoy
766f3fb8dbdafce402631c43c16fda46ed003462
[ "Apache-2.0" ]
30
2022-02-17T02:28:37.000Z
2022-03-31T02:31:02.000Z
source/extensions/filters/network/kafka/protocol/generator.py
jaricftw/envoy
766f3fb8dbdafce402631c43c16fda46ed003462
[ "Apache-2.0" ]
1
2020-03-28T12:23:29.000Z
2020-03-28T12:23:29.000Z
#!/usr/bin/python # Main library file containing all the protocol generation logic. def generate_main_code(type, main_header_file, resolver_cc_file, input_files): """ Main code generator. Takes input files and processes them into structures representing a Kafka message (request or response). These respon...
33.984556
115
0.696603
def generate_main_code(type, main_header_file, resolver_cc_file, input_files): messages = parse_messages(input_files) complex_type_template = RenderingHelper.get_template('complex_type_template.j2') parsers_template = RenderingHelper.get_template("%s_parser.j2" % type) main_header_contents = '' for me...
true
true
f72e569409170b725e2459305ed08163426eefec
157
py
Python
testmeuk/test_enum.py
Jhsmit/AtomicPlot
551a79b899008408e1126e67ee690a87b0aa6e15
[ "MIT" ]
null
null
null
testmeuk/test_enum.py
Jhsmit/AtomicPlot
551a79b899008408e1126e67ee690a87b0aa6e15
[ "MIT" ]
1
2018-06-07T09:40:19.000Z
2018-06-07T09:40:19.000Z
testmeuk/test_enum.py
Jhsmit/AtomicPlot
551a79b899008408e1126e67ee690a87b0aa6e15
[ "MIT" ]
null
null
null
from atom.api import Atom, Enum, Int, Str class EnumTest(Atom): att = Enum(5, '4') et = EnumTest() et.att = 5 et.att = '5' et.att = 3.4
12.076923
42
0.547771
from atom.api import Atom, Enum, Int, Str class EnumTest(Atom): att = Enum(5, '4') et = EnumTest() et.att = 5 et.att = '5' et.att = 3.4
true
true
f72e57a4c0cf9726978343096b637c3248cc5657
829
py
Python
yoapi/extensions/flask_sendgrid.py
YoApp/yo-api
a162e51804ab91724cc7ad3e7608410329da6789
[ "MIT" ]
1
2021-12-17T03:25:34.000Z
2021-12-17T03:25:34.000Z
yoapi/extensions/flask_sendgrid.py
YoApp/yo-api
a162e51804ab91724cc7ad3e7608410329da6789
[ "MIT" ]
null
null
null
yoapi/extensions/flask_sendgrid.py
YoApp/yo-api
a162e51804ab91724cc7ad3e7608410329da6789
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Flask extension pacakge for Sendgrid""" from . import FlaskExtension from sendgrid import SendGridClient, Mail class SendGrid(FlaskExtension): """A helper class for managing a the SendGrid API calls""" EXTENSION_NAME = 'sendgrid' def __init__(self, app=None): super...
25.90625
78
0.615199
from . import FlaskExtension from sendgrid import SendGridClient, Mail class SendGrid(FlaskExtension): EXTENSION_NAME = 'sendgrid' def __init__(self, app=None): super(SendGrid, self).__init__(app=app) def _create_instance(self, app): client = SendGridClient( app.config.g...
true
true
f72e5883e8bc74d074a7e160b876d184fda48193
1,596
py
Python
src/an_FilterS1.py
mbonnema/SWAV
d5dd4dd1a88de008f27b0232c536491c7dc84623
[ "CNRI-Python" ]
null
null
null
src/an_FilterS1.py
mbonnema/SWAV
d5dd4dd1a88de008f27b0232c536491c7dc84623
[ "CNRI-Python" ]
null
null
null
src/an_FilterS1.py
mbonnema/SWAV
d5dd4dd1a88de008f27b0232c536491c7dc84623
[ "CNRI-Python" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 28 11:35:01 2021 @author: mbonnema """ import numpy as np def FilterS1(D,A,WE,LE): D_f = {} A_f = {} WE_f = {} LE_f = {} for key in D: dates = D[key] areas = A[key] werrors = WE[key] lerrors = LE[...
27.050847
98
0.431704
import numpy as np def FilterS1(D,A,WE,LE): D_f = {} A_f = {} WE_f = {} LE_f = {} for key in D: dates = D[key] areas = A[key] werrors = WE[key] lerrors = LE[key] d_f = [] a_f = [] we_f = [] le_f = [] ...
true
true
f72e58af1326ae193bd57bd14e31f871dea6eebf
6,316
py
Python
src/mpi4py/bench.py
renefritze/mpi4py
23d3635574eeb5eb7ebf4fb51f91f0604306d848
[ "BSD-2-Clause" ]
null
null
null
src/mpi4py/bench.py
renefritze/mpi4py
23d3635574eeb5eb7ebf4fb51f91f0604306d848
[ "BSD-2-Clause" ]
null
null
null
src/mpi4py/bench.py
renefritze/mpi4py
23d3635574eeb5eb7ebf4fb51f91f0604306d848
[ "BSD-2-Clause" ]
null
null
null
# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com """Run MPI benchmarks and tests.""" import sys as _sys def helloworld(comm, args=None, verbose=True): """Hello, World! using MPI.""" # pylint: disable=import-outside-toplevel from argparse import ArgumentParser parser = ArgumentParser(prog=__name...
37.152941
78
0.547498
import sys as _sys def helloworld(comm, args=None, verbose=True): from argparse import ArgumentParser parser = ArgumentParser(prog=__name__ + " helloworld") parser.add_argument("-q", "--quiet", action="store_false", dest="verbose", default=verbose) options = parser.parse_ar...
true
true
f72e5997f478141aba757b99a8e4ba2d3b188609
1,487
py
Python
tests/io/test_audit_log.py
oklymenok/pyTenable
73475e37034608afa5e9c7b20c9cec33a2818622
[ "MIT" ]
1
2020-05-22T12:08:52.000Z
2020-05-22T12:08:52.000Z
tests/io/test_audit_log.py
oklymenok/pyTenable
73475e37034608afa5e9c7b20c9cec33a2818622
[ "MIT" ]
null
null
null
tests/io/test_audit_log.py
oklymenok/pyTenable
73475e37034608afa5e9c7b20c9cec33a2818622
[ "MIT" ]
null
null
null
from .fixtures import * from tenable.errors import * def test_event_field_name_typeerror(api): with pytest.raises(TypeError): api.audit_log.events((1, 'gt', '2018-01-01')) def test_event_filter_operator_typeerror(api): with pytest.raises(TypeError): api.audit_log.events(('date', 1, '2018-01-01...
33.044444
74
0.64425
from .fixtures import * from tenable.errors import * def test_event_field_name_typeerror(api): with pytest.raises(TypeError): api.audit_log.events((1, 'gt', '2018-01-01')) def test_event_filter_operator_typeerror(api): with pytest.raises(TypeError): api.audit_log.events(('date', 1, '2018-01-01...
true
true
f72e59ce85863fc225c1c1258f4ce23a596cff3e
2,330
py
Python
ttp/src/lightsail_enum_load_balancers_src.py
blackbotinc/AWS-Attack
ad4668ab60173aabce3c6b9c7685160be5e3f14d
[ "Apache-2.0", "BSD-3-Clause" ]
26
2021-03-29T13:39:28.000Z
2022-03-21T10:57:58.000Z
ttp/src/lightsail_enum_load_balancers_src.py
blackbotinc/AWS-Attack
ad4668ab60173aabce3c6b9c7685160be5e3f14d
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
ttp/src/lightsail_enum_load_balancers_src.py
blackbotinc/AWS-Attack
ad4668ab60173aabce3c6b9c7685160be5e3f14d
[ "Apache-2.0", "BSD-3-Clause" ]
8
2021-02-23T12:17:04.000Z
2022-02-25T13:28:14.000Z
#!/usr/bin/env python3 import datetime #'description': "This module examines Lightsail data fields and automatically enumerates them for all available regions. Available fields can be passed upon execution to only look at certain types of data. By default, all Lightsail fields will be captured.", import argparse fro...
32.816901
258
0.660944
import datetime import argparse from botocore.exceptions import ClientError def setup_storage(fields): out = {} for field in fields: out[field] = [] return out def camelCase(name): splitted = name.split('_') out = splitted[0] for word in splitted[1:]: out += word[0].upper() ...
true
true
f72e5a152dd6b8508cca8dbff2620816eff039c7
2,550
py
Python
main.py
DethCount/usb-gamepad
d33dbc851e73f4c3702d50b3ef0e42e0aef39725
[ "MIT" ]
null
null
null
main.py
DethCount/usb-gamepad
d33dbc851e73f4c3702d50b3ef0e42e0aef39725
[ "MIT" ]
null
null
null
main.py
DethCount/usb-gamepad
d33dbc851e73f4c3702d50b3ef0e42e0aef39725
[ "MIT" ]
null
null
null
from inputs import get_gamepad from asyncio import run from bleak import BleakClient from bluetooth_telescope import BluetoothTelescope async def main(): bluetoothClient = BleakClient('D8:A9:8B:7E:1E:D2') is_connected = await bluetoothClient.connect() if not is_connected: raise Exception('Device n...
38.636364
84
0.521176
from inputs import get_gamepad from asyncio import run from bleak import BleakClient from bluetooth_telescope import BluetoothTelescope async def main(): bluetoothClient = BleakClient('D8:A9:8B:7E:1E:D2') is_connected = await bluetoothClient.connect() if not is_connected: raise Exception('Device n...
true
true
f72e5ab7b72290d97a6c8c05e9dbdf1113f6f9dd
630
py
Python
__scraping__/snapdeal.com - scrapy/main.py
whitmans-max/python-examples
881a8f23f0eebc76816a0078e19951893f0daaaa
[ "MIT" ]
140
2017-02-21T22:49:04.000Z
2022-03-22T17:51:58.000Z
__scraping__/snapdeal.com - scrapy/main.py
whitmans-max/python-examples
881a8f23f0eebc76816a0078e19951893f0daaaa
[ "MIT" ]
5
2017-12-02T19:55:00.000Z
2021-09-22T23:18:39.000Z
__scraping__/snapdeal.com - scrapy/main.py
whitmans-max/python-examples
881a8f23f0eebc76816a0078e19951893f0daaaa
[ "MIT" ]
79
2017-01-25T10:53:33.000Z
2022-03-11T16:13:57.000Z
#!/usr/bin/env python3 # # https://stackoverflow.com/a/48035123/1832058 # import scrapy from scrapy.commands.view import open_in_browser class MySpider(scrapy.Spider): name = 'myspider' start_urls = ['https://www.snapdeal.com/'] def parse(self, response): print('url:', response.url) ...
19.090909
77
0.636508
import scrapy from scrapy.commands.view import open_in_browser class MySpider(scrapy.Spider): name = 'myspider' start_urls = ['https://www.snapdeal.com/'] def parse(self, response): print('url:', response.url) for item in response.xpath('//*[@class="catText"]/text...
true
true
f72e5bf02fe24be9c7d26524c942c1a103093359
4,882
py
Python
flora/daemon/client.py
fugginoob/flora-blockchain
e57733fdc5ca3627ac5c4aa9a4a5707fb91267be
[ "Apache-2.0" ]
null
null
null
flora/daemon/client.py
fugginoob/flora-blockchain
e57733fdc5ca3627ac5c4aa9a4a5707fb91267be
[ "Apache-2.0" ]
null
null
null
flora/daemon/client.py
fugginoob/flora-blockchain
e57733fdc5ca3627ac5c4aa9a4a5707fb91267be
[ "Apache-2.0" ]
null
null
null
import asyncio import json import ssl from pathlib import Path from typing import Any, Dict, Optional import websockets from flora.server.server import ssl_context_for_client from flora.types.blockchain_format.sized_bytes import bytes32 from flora.util.config import load_config from flora.util.json_util import dict_t...
36.432836
120
0.648505
import asyncio import json import ssl from pathlib import Path from typing import Any, Dict, Optional import websockets from flora.server.server import ssl_context_for_client from flora.types.blockchain_format.sized_bytes import bytes32 from flora.util.config import load_config from flora.util.json_util import dict_t...
true
true
f72e5d21c42211531f0a523940feab958c3bc38b
5,561
py
Python
nipype/info.py
effigies/nipype
18fe222557cf3b9627e06b2a66fba589feaca581
[ "Apache-2.0" ]
null
null
null
nipype/info.py
effigies/nipype
18fe222557cf3b9627e06b2a66fba589feaca581
[ "Apache-2.0" ]
2
2017-10-05T21:08:38.000Z
2018-10-09T23:01:23.000Z
nipype/info.py
effigies/nipype
18fe222557cf3b9627e06b2a66fba589feaca581
[ "Apache-2.0" ]
null
null
null
""" This file contains defines parameters for nipy that we use to fill settings in setup.py, the nipy top-level docstring, and for building the docs. In setup.py in particular, we exec this file, so it cannot import nipy """ # nipype version information. An empty _version_extra corresponds to a # full release. '.d...
37.574324
81
0.670203
_version_major = 0 _version_minor = 13 _version_micro = 0 _version_extra = '-dev' def get_nipype_gitversion(): import os import subprocess try: import nipype gitpath = os.path.realpath(os.path.join(os.path.dirname(nipype.__file__), os.path...
true
true
f72e5d9a801e6d998e27b90743043c49babb6526
575
py
Python
jumpscale/packages/vdc_dashboard/services/provision_wallet_billing.py
threefoldtech/js-sdk
811f783ac34a60225175bab2d806802a87b9d5c7
[ "Apache-2.0" ]
13
2020-09-02T09:05:08.000Z
2022-03-12T02:43:24.000Z
jumpscale/packages/vdc_dashboard/services/provision_wallet_billing.py
threefoldtech/js-sdk
811f783ac34a60225175bab2d806802a87b9d5c7
[ "Apache-2.0" ]
1,998
2020-06-15T11:46:10.000Z
2022-03-24T22:12:41.000Z
jumpscale/packages/vdc_dashboard/services/provision_wallet_billing.py
threefoldtech/js-sdk
811f783ac34a60225175bab2d806802a87b9d5c7
[ "Apache-2.0" ]
8
2020-09-29T06:50:35.000Z
2021-06-14T03:30:52.000Z
from jumpscale.loader import j from jumpscale.packages.vdc.billing import auto_extend_billing from jumpscale.tools.servicemanager.servicemanager import BackgroundService class AutoExtendbillingService(BackgroundService): def __init__(self, interval=60 * 60, *args, **kwargs): """Provisioning wallet service...
31.944444
86
0.735652
from jumpscale.loader import j from jumpscale.packages.vdc.billing import auto_extend_billing from jumpscale.tools.servicemanager.servicemanager import BackgroundService class AutoExtendbillingService(BackgroundService): def __init__(self, interval=60 * 60, *args, **kwargs): super().__init__(interval, *ar...
true
true
f72e5e2b889876badd696ef1800deb4ada0a2f13
4,955
py
Python
timeeval_experiments/generator/param_config_gen.py
HPI-Information-Systems/TimeEval
9b2717b89decd57dd09e04ad94c120f13132d7b8
[ "MIT" ]
2
2022-01-29T03:46:31.000Z
2022-02-14T14:06:35.000Z
timeeval_experiments/generator/param_config_gen.py
HPI-Information-Systems/TimeEval
9b2717b89decd57dd09e04ad94c120f13132d7b8
[ "MIT" ]
null
null
null
timeeval_experiments/generator/param_config_gen.py
HPI-Information-Systems/TimeEval
9b2717b89decd57dd09e04ad94c120f13132d7b8
[ "MIT" ]
null
null
null
import json import os import warnings from pathlib import Path from typing import Union, Dict, Any from .parameter_matrix_parsing import ParameterMatrixProxy class ParamConfigGenerator: FIXED_KEY = "fixed_params" SHARED_KEY = "shared_params" DEPENDENT_KEY = "dependent_params" OPTIMIZED_KEY = "optimiz...
43.086957
119
0.605247
import json import os import warnings from pathlib import Path from typing import Union, Dict, Any from .parameter_matrix_parsing import ParameterMatrixProxy class ParamConfigGenerator: FIXED_KEY = "fixed_params" SHARED_KEY = "shared_params" DEPENDENT_KEY = "dependent_params" OPTIMIZED_KEY = "optimiz...
true
true
f72e5e5572e81441c9fb52541a31b92eb5db8aeb
983
py
Python
setup.py
UdbhavPrasad072300/GANs-Implementations
60aee8a48dc3cf3a6f1240f44ff9bf6c138e3e38
[ "MIT" ]
4
2021-01-24T02:43:02.000Z
2021-09-10T01:26:27.000Z
setup.py
UdbhavPrasad072300/GANs-Implementations
60aee8a48dc3cf3a6f1240f44ff9bf6c138e3e38
[ "MIT" ]
null
null
null
setup.py
UdbhavPrasad072300/GANs-Implementations
60aee8a48dc3cf3a6f1240f44ff9bf6c138e3e38
[ "MIT" ]
1
2021-09-11T07:53:45.000Z
2021-09-11T07:53:45.000Z
from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() classifiers = [ 'Development Status :: 3 - Alpha', 'Intended Audience :: Science/Resea...
31.709677
73
0.704985
from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() classifiers = [ 'Development Status :: 3 - Alpha', 'Intended Audience :: Science/Resea...
true
true
f72e5e5770402f322f58ec67f33bddc036118b03
4,641
py
Python
yandex/cloud/ydb/v1/location_service_pb2_grpc.py
korsar182/python-sdk
873bf2a9b136a8f2faae72e86fae1f5b5c3d896a
[ "MIT" ]
36
2018-12-23T13:51:50.000Z
2022-03-25T07:48:24.000Z
yandex/cloud/ydb/v1/location_service_pb2_grpc.py
korsar182/python-sdk
873bf2a9b136a8f2faae72e86fae1f5b5c3d896a
[ "MIT" ]
15
2019-02-28T04:55:09.000Z
2022-03-06T23:17:24.000Z
yandex/cloud/ydb/v1/location_service_pb2_grpc.py
korsar182/python-sdk
873bf2a9b136a8f2faae72e86fae1f5b5c3d896a
[ "MIT" ]
18
2019-02-23T07:10:57.000Z
2022-03-28T14:41:08.000Z
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from yandex.cloud.ydb.v1 import location_pb2 as yandex_dot_cloud_dot_ydb_dot_v1_dot_location__pb2 from yandex.cloud.ydb.v1 import location_service_pb2 as yandex_...
45.058252
139
0.704159
import grpc from yandex.cloud.ydb.v1 import location_pb2 as yandex_dot_cloud_dot_ydb_dot_v1_dot_location__pb2 from yandex.cloud.ydb.v1 import location_service_pb2 as yandex_dot_cloud_dot_ydb_dot_v1_dot_location__service__pb2 class LocationServiceStub(object): def __init__(self, channel): self.Get = chan...
true
true
f72e5e660b6ecc4715fa7d16284b2b112851a050
5,059
py
Python
server/server/settings.py
raminawahda7/servize
9941401c72a949c8c2ad83012ab5cc4276355b6c
[ "MIT" ]
null
null
null
server/server/settings.py
raminawahda7/servize
9941401c72a949c8c2ad83012ab5cc4276355b6c
[ "MIT" ]
null
null
null
server/server/settings.py
raminawahda7/servize
9941401c72a949c8c2ad83012ab5cc4276355b6c
[ "MIT" ]
null
null
null
""" Django settings for server project. Generated by 'django-admin startproject' using Django 3.1.4. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib ...
25.811224
96
0.686302
from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = '!ju*wb_1y5dcdijc&u&_+mt80mz)jg01-^4_#j-+hm6wd_f7#6' DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', ...
true
true
f72e5e66d16ddddaa3f4271d15f9f4fb89a6cc34
4,347
py
Python
augustus/custom/trade_log_analysis.py
jialuechen/augustus
d4fbda427e3d9c60896b0e22c06cd593b484ef9d
[ "MIT" ]
2
2019-09-13T18:49:17.000Z
2022-01-25T05:14:05.000Z
augustus/custom/trade_log_analysis.py
jialuechen/augustus
d4fbda427e3d9c60896b0e22c06cd593b484ef9d
[ "MIT" ]
null
null
null
augustus/custom/trade_log_analysis.py
jialuechen/augustus
d4fbda427e3d9c60896b0e22c06cd593b484ef9d
[ "MIT" ]
2
2019-02-28T21:23:04.000Z
2020-07-02T01:23:24.000Z
import dash import dash_core_components as dcc import dash_html_components as html import dash_table_experiments as dt import pandas as pd import plotly from dash.dependencies import Input, Output, State from plotly import graph_objs as go from augustus.systemabase_env import augustusEnvBase TRADE_LOG = augustusEnvBa...
27.339623
72
0.586841
import dash import dash_core_components as dcc import dash_html_components as html import dash_table_experiments as dt import pandas as pd import plotly from dash.dependencies import Input, Output, State from plotly import graph_objs as go from augustus.systemabase_env import augustusEnvBase TRADE_LOG = augustusEnvBa...
true
true
f72e5e82f62e0adf4ac740409e8e5cec97f305f7
1,039
py
Python
tests/test_models.py
armendk/pyconcepticon
7764d4b0900a37a76a6cb6ff9bdc8348502fa51d
[ "Apache-2.0" ]
1
2020-04-17T21:21:49.000Z
2020-04-17T21:21:49.000Z
tests/test_models.py
armendk/pyconcepticon
7764d4b0900a37a76a6cb6ff9bdc8348502fa51d
[ "Apache-2.0" ]
null
null
null
tests/test_models.py
armendk/pyconcepticon
7764d4b0900a37a76a6cb6ff9bdc8348502fa51d
[ "Apache-2.0" ]
null
null
null
import copy import pytest from pyconcepticon.models import * @pytest.fixture def sun1991(tmprepos): return tmprepos / 'concepticondata' / 'conceptlists' / 'Sun-1991-1004.tsv' def test_Conceptlist(sun1991, api): kw = dict( api=sun1991, id='Abc-1234-12', author='Some One', ye...
21.645833
78
0.59769
import copy import pytest from pyconcepticon.models import * @pytest.fixture def sun1991(tmprepos): return tmprepos / 'concepticondata' / 'conceptlists' / 'Sun-1991-1004.tsv' def test_Conceptlist(sun1991, api): kw = dict( api=sun1991, id='Abc-1234-12', author='Some One', ye...
true
true
f72e5f909b0d7dbec63a8e2929a90bf6108605aa
22,413
py
Python
tests/ut/python/parallel/test_reshape.py
tjulitianyi1997/mindspore
c802a8c31fe2b51530d932fdd364824e45264b12
[ "Apache-2.0" ]
2
2020-04-28T03:49:10.000Z
2020-04-28T03:49:13.000Z
tests/ut/python/parallel/test_reshape.py
tjulitianyi1997/mindspore
c802a8c31fe2b51530d932fdd364824e45264b12
[ "Apache-2.0" ]
null
null
null
tests/ut/python/parallel/test_reshape.py
tjulitianyi1997/mindspore
c802a8c31fe2b51530d932fdd364824e45264b12
[ "Apache-2.0" ]
null
null
null
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
34.010622
124
0.668674
from mindspore.train import Model, ParallelMode from mindspore.nn.loss import SoftmaxCrossEntropyWithLogits from mindspore.nn.optim.momentum import Momentum from mindspore import Tensor import mindspore as ms import numpy as np from mindspore.ops import operations as P import mindspore.nn as nn from mindspore.common.p...
true
true
f72e61805f48ef4806ac3d02c1f59eb7f642baa8
4,674
py
Python
models/clnet.py
angseung/torch_cifar10
3160f749f3bffd941d6c0fb98ddaad63d4e5641d
[ "MIT" ]
null
null
null
models/clnet.py
angseung/torch_cifar10
3160f749f3bffd941d6c0fb98ddaad63d4e5641d
[ "MIT" ]
null
null
null
models/clnet.py
angseung/torch_cifar10
3160f749f3bffd941d6c0fb98ddaad63d4e5641d
[ "MIT" ]
null
null
null
''' CrossLink Network ''' import torch import torch.nn as nn import torch.nn.functional as F def swish(x): return x * x.sigmoid() def mish(x): return x * torch.tanh(F.softplus(x)) class CrossLinkBlock(nn.Module): '''Cross-Link Block''' def __init__(self, in_channels, out_channels, kernel_size, p...
29.031056
83
0.456354
import torch import torch.nn as nn import torch.nn.functional as F def swish(x): return x * x.sigmoid() def mish(x): return x * torch.tanh(F.softplus(x)) class CrossLinkBlock(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, pool_enable): super(CrossLinkBlock, self).__in...
true
true
f72e62b8e653411c678624094bfff9469f0cfb03
1,672
py
Python
var/spack/repos/builtin/packages/re2c/package.py
jeanbez/spack
f4e51ce8f366c85bf5aa0eafe078677b42dae1ba
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
var/spack/repos/builtin/packages/re2c/package.py
jeanbez/spack
f4e51ce8f366c85bf5aa0eafe078677b42dae1ba
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
8
2021-11-09T20:28:40.000Z
2022-03-15T03:26:33.000Z
var/spack/repos/builtin/packages/re2c/package.py
jeanbez/spack
f4e51ce8f366c85bf5aa0eafe078677b42dae1ba
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
2
2019-02-08T20:37:20.000Z
2019-03-31T15:19:26.000Z
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * class Re2c(AutotoolsPackage): """re2c: a free and open-source lexer generator for C and ...
47.771429
95
0.727273
from spack.package import * class Re2c(AutotoolsPackage): homepage = "https://re2c.org/index.html" url = "https://github.com/skvadrik/re2c/releases/download/1.2.1/re2c-1.2.1.tar.xz" version('2.2', sha256='0fc45e4130a8a555d68e230d1795de0216dfe99096b61b28e67c86dfd7d86bda') version('2.1.1', sha...
true
true
f72e63331fdecca17f380ab15c4073db30e469ad
3,208
py
Python
psycholab/examples/prisoners_dilemma.py
jrmendeshurb/google-research
f9fa8cdd2fb77975b524371fd29df008b9dc6cf4
[ "Apache-2.0" ]
1
2020-08-14T08:11:30.000Z
2020-08-14T08:11:30.000Z
psycholab/examples/prisoners_dilemma.py
jrmendeshurb/google-research
f9fa8cdd2fb77975b524371fd29df008b9dc6cf4
[ "Apache-2.0" ]
12
2020-09-25T22:43:27.000Z
2022-02-10T02:21:35.000Z
psycholab/examples/prisoners_dilemma.py
ZachT1711/google-research
662e6837a3efa0c40b11cb4122447c4b028d2115
[ "Apache-2.0" ]
1
2020-03-16T14:21:31.000Z
2020-03-16T14:21:31.000Z
# coding=utf-8 # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
29.431193
79
0.683603
import numpy as np from psycholab import game from psycholab import visualizer def create_game(): art = ['####d####', 'a A B b', '#########' ] item_a = game.Item(color=(0, 254, 254)) item_b = game.Item(color=(254, 254, 0)) item_d = game.Item(color=(0, 254, 254)) items = {'a':...
true
true
f72e64fb1484ce3cce892ced018d30ae8e0d7a72
2,728
py
Python
compiler/modules/precharge_array.py
panicmarvin/OpenRAM
abf47bab50adb48337c59b72ccd6023c1999f3fc
[ "BSD-3-Clause" ]
null
null
null
compiler/modules/precharge_array.py
panicmarvin/OpenRAM
abf47bab50adb48337c59b72ccd6023c1999f3fc
[ "BSD-3-Clause" ]
null
null
null
compiler/modules/precharge_array.py
panicmarvin/OpenRAM
abf47bab50adb48337c59b72ccd6023c1999f3fc
[ "BSD-3-Clause" ]
1
2020-01-23T07:12:52.000Z
2020-01-23T07:12:52.000Z
import design import debug from tech import drc from vector import vector from precharge import precharge class precharge_array(design.design): """ Dynamically generated precharge array of all bitlines. Cols is number of bit line columns, height is the height of the bit-cell array. """ def __ini...
35.428571
81
0.495235
import design import debug from tech import drc from vector import vector from precharge import precharge class precharge_array(design.design): def __init__(self, columns, size=1): design.design.__init__(self, "precharge_array") debug.info(1, "Creating {0}".format(self.name)) self.column...
true
true
f72e6521b83c2e7be6a5b020d3b956027f505035
14,176
py
Python
warehouse-loader/warehouse/components/services.py
uk-gov-mirror/NHSX.covid-chest-imaging-database
77799a97193d09e9267182d18fbb79d604bbb038
[ "MIT" ]
56
2020-04-08T12:40:28.000Z
2021-10-02T22:57:16.000Z
warehouse-loader/warehouse/components/services.py
uk-gov-mirror/NHSX.covid-chest-imaging-database
77799a97193d09e9267182d18fbb79d604bbb038
[ "MIT" ]
111
2020-04-02T13:23:06.000Z
2022-03-30T13:23:28.000Z
warehouse-loader/warehouse/components/services.py
uk-gov-mirror/NHSX.covid-chest-imaging-database
77799a97193d09e9267182d18fbb79d604bbb038
[ "MIT" ]
10
2020-05-05T14:07:11.000Z
2022-01-11T15:47:27.000Z
import csv import gzip import logging import re import sys import tempfile import boto3 import mondrian from botocore.exceptions import ClientError from warehouse.components.constants import TRAINING_PERCENTAGE mondrian.setup(excepthook=True) logger = logging.getLogger() class PipelineConfig: """Configuration ...
31.85618
123
0.541267
import csv import gzip import logging import re import sys import tempfile import boto3 import mondrian from botocore.exceptions import ClientError from warehouse.components.constants import TRAINING_PERCENTAGE mondrian.setup(excepthook=True) logger = logging.getLogger() class PipelineConfig: def __init__(sel...
true
true
f72e65bb1baacfec1ef3804586f97ab8315edec7
2,585
py
Python
cootbx/__init__.py
jbeilstenedmands/cctbx_project
c228fb15ab10377f664c39553d866281358195aa
[ "BSD-3-Clause-LBNL" ]
null
null
null
cootbx/__init__.py
jbeilstenedmands/cctbx_project
c228fb15ab10377f664c39553d866281358195aa
[ "BSD-3-Clause-LBNL" ]
null
null
null
cootbx/__init__.py
jbeilstenedmands/cctbx_project
c228fb15ab10377f664c39553d866281358195aa
[ "BSD-3-Clause-LBNL" ]
null
null
null
from __future__ import division import os.path def write_disable_nomenclature_errors (f) : f.write("try :\n") f.write(" set_nomenclature_errors_on_read(\"ignore\")\n") f.write("except Exception :\n") f.write(" pass\n") def create_refinement_view_script ( mtz_file_name, pdb_file_name, coot_scrip...
37.463768
67
0.696325
from __future__ import division import os.path def write_disable_nomenclature_errors (f) : f.write("try :\n") f.write(" set_nomenclature_errors_on_read(\"ignore\")\n") f.write("except Exception :\n") f.write(" pass\n") def create_refinement_view_script ( mtz_file_name, pdb_file_name, coot_scrip...
true
true
f72e681168a596571b63014df7cf94e45a96aa0d
746
py
Python
JinaAI/utils/get_data.py
TheVikJ/SUAVE
eff37d167a4318ba8ba77dff873422c89db489b2
[ "MIT" ]
6
2021-07-24T05:28:51.000Z
2021-11-08T12:55:56.000Z
JinaAI/utils/get_data.py
TheVikJ/SUAVE
eff37d167a4318ba8ba77dff873422c89db489b2
[ "MIT" ]
null
null
null
JinaAI/utils/get_data.py
TheVikJ/SUAVE
eff37d167a4318ba8ba77dff873422c89db489b2
[ "MIT" ]
2
2021-07-24T16:22:33.000Z
2021-08-01T12:55:05.000Z
import json import requests import pandas as pd import os baseurl = "http://exploreapiswith.tech/api/" categories = json.loads(requests.get( baseurl + "category").text) def get_category_api(category_name=None): category_apis = json.loads(requests.get( baseurl + "category/" + category_name).text) ...
19.631579
52
0.698391
import json import requests import pandas as pd import os baseurl = "http://exploreapiswith.tech/api/" categories = json.loads(requests.get( baseurl + "category").text) def get_category_api(category_name=None): category_apis = json.loads(requests.get( baseurl + "category/" + category_name).text) ...
true
true
f72e6826e6b680e35cd4d77fd37db27ecc6e072d
24,999
py
Python
libs/canvas.py
yangjjie94/labelImg
8c14af70bfc0e6f3e22e3a6cbe21e586b0492ba0
[ "MIT" ]
null
null
null
libs/canvas.py
yangjjie94/labelImg
8c14af70bfc0e6f3e22e3a6cbe21e586b0492ba0
[ "MIT" ]
null
null
null
libs/canvas.py
yangjjie94/labelImg
8c14af70bfc0e6f3e22e3a6cbe21e586b0492ba0
[ "MIT" ]
null
null
null
try: from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * except ImportError: from PyQt4.QtGui import * from PyQt4.QtCore import * #from PyQt4.QtOpenGL import * from libs.shape import Shape from libs.lib import distance CURSOR_DEFAULT = Qt.ArrowCursor CURSOR_POINT =...
36.601757
99
0.563903
try: from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * except ImportError: from PyQt4.QtGui import * from PyQt4.QtCore import * from libs.shape import Shape from libs.lib import distance CURSOR_DEFAULT = Qt.ArrowCursor CURSOR_POINT = Qt.PointingHandCursor CURSOR_...
true
true
f72e68844e89c751c604cdf5b912da555e19a617
981
py
Python
setup.py
cnpls/pyords
249591e96031cb2c49045a9984fd9c5f50ef757d
[ "MIT" ]
null
null
null
setup.py
cnpls/pyords
249591e96031cb2c49045a9984fd9c5f50ef757d
[ "MIT" ]
null
null
null
setup.py
cnpls/pyords
249591e96031cb2c49045a9984fd9c5f50ef757d
[ "MIT" ]
null
null
null
from setuptools import setup, find_packages from pyords import __version__ import os currdir = os.path.dirname(os.path.abspath(__file__)) long_description = '' with open(os.path.join(currdir, 'README.md')) as f: long_description = f.read() install_requires = [] with open(os.path.join(currdir, 'require...
31.645161
87
0.673802
from setuptools import setup, find_packages from pyords import __version__ import os currdir = os.path.dirname(os.path.abspath(__file__)) long_description = '' with open(os.path.join(currdir, 'README.md')) as f: long_description = f.read() install_requires = [] with open(os.path.join(currdir, 'require...
true
true
f72e6941d55bd0dffbd13951538964bc9cda8790
3,862
py
Python
sequana/iuapc.py
khourhin/sequana
c56d4490b7c8edc8a0f63fd60578eb72ed64f1b5
[ "BSD-3-Clause" ]
138
2016-07-13T06:24:45.000Z
2022-03-28T13:12:03.000Z
sequana/iuapc.py
khourhin/sequana
c56d4490b7c8edc8a0f63fd60578eb72ed64f1b5
[ "BSD-3-Clause" ]
655
2016-03-10T17:33:40.000Z
2022-03-30T16:10:45.000Z
sequana/iuapc.py
khourhin/sequana
c56d4490b7c8edc8a0f63fd60578eb72ed64f1b5
[ "BSD-3-Clause" ]
39
2016-11-04T11:40:58.000Z
2022-03-15T08:12:29.000Z
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this s...
23.26506
79
0.487053
import colorlog logger = colorlog.getLogger(__name__) dna_bases = ("A", "C", "T", "G") dna_bases_names = { "A": "Adenine", "T": "Thymidine", "U": "Uridine", "G": "Guanidine", "C": "Cytidine", "Y": "pYrimidine", "R": "puRine", "S": "Strong", "W": "Weak", "K": "Keto", "M"...
true
true
f72e6942e7acd082f6cba1fa9c3d70a58320e52f
611
py
Python
python/math/0204_count_primes.py
linshaoyong/leetcode
ea052fad68a2fe0cbfa5469398508ec2b776654f
[ "MIT" ]
6
2019-07-15T13:23:57.000Z
2020-01-22T03:12:01.000Z
python/math/0204_count_primes.py
linshaoyong/leetcode
ea052fad68a2fe0cbfa5469398508ec2b776654f
[ "MIT" ]
null
null
null
python/math/0204_count_primes.py
linshaoyong/leetcode
ea052fad68a2fe0cbfa5469398508ec2b776654f
[ "MIT" ]
1
2019-07-24T02:15:31.000Z
2019-07-24T02:15:31.000Z
import math class Solution: def countPrimes(self, n): """ :type n: int :rtype: int 厄拉多塞筛法 比如求20以内质数的个数, 首先0,1不是质数。 2是第一个质数,然后把20以内所有2的倍数划去。 2后面紧跟的数即为下一个质数3,然后把3所有的倍数划去。 3后面紧跟的数即为下一个质数5,再把5所有的倍数划去,以此类推。 """ if n < 2: return...
21.821429
65
0.466448
import math class Solution: def countPrimes(self, n): if n < 2: return 0 s = [1] * n s[0] = s[1] = 0 for i in range(2, int(math.sqrt(n)) + 1): if s[i] == 1: s[i * i:n:i] = [0] * int((n - i * i - 1) / i + 1) return sum(s) def test_co...
true
true
f72e697176b5866e0d5c839007d53c1d63f7d40e
1,348
py
Python
Algorithms/Easy/840. Magic Squares In Grid/answer.py
KenWoo/Algorithm
4012a2f0a099a502df1e5df2e39faa75fe6463e8
[ "Apache-2.0" ]
null
null
null
Algorithms/Easy/840. Magic Squares In Grid/answer.py
KenWoo/Algorithm
4012a2f0a099a502df1e5df2e39faa75fe6463e8
[ "Apache-2.0" ]
null
null
null
Algorithms/Easy/840. Magic Squares In Grid/answer.py
KenWoo/Algorithm
4012a2f0a099a502df1e5df2e39faa75fe6463e8
[ "Apache-2.0" ]
null
null
null
from typing import List class Solution: def numMagicSquaresInside(self, grid: List[List[int]]) -> int: R = len(grid) C = len(grid[0]) count = 0 for r in range(R-2): for c in range(C-2): r1c1 = grid[r][c] r1c2 = grid[r][c+1] ...
32.095238
79
0.411721
from typing import List class Solution: def numMagicSquaresInside(self, grid: List[List[int]]) -> int: R = len(grid) C = len(grid[0]) count = 0 for r in range(R-2): for c in range(C-2): r1c1 = grid[r][c] r1c2 = grid[r][c+1] ...
true
true
f72e69d278b7517f93a9a5030feaaae14e83c6ef
4,803
py
Python
energyPATHWAYS/tests/test_time_series.py
jdailey/EnergyPATHWAYS
0fb0ead475b6395f6b07fc43fe6c85826ee47d0f
[ "MIT" ]
26
2017-02-06T22:57:29.000Z
2022-03-25T20:02:32.000Z
energyPATHWAYS/tests/test_time_series.py
jdailey/EnergyPATHWAYS
0fb0ead475b6395f6b07fc43fe6c85826ee47d0f
[ "MIT" ]
65
2016-01-22T01:33:05.000Z
2016-09-03T14:46:08.000Z
energyPATHWAYS/tests/test_time_series.py
jdailey/EnergyPATHWAYS
0fb0ead475b6395f6b07fc43fe6c85826ee47d0f
[ "MIT" ]
11
2017-02-24T23:27:36.000Z
2021-10-18T17:33:37.000Z
# -*- coding: utf-8 -*- __author__ = 'Ben, Ryan, Michael' import numpy as np from collections import defaultdict import pandas as pd import energyPATHWAYS from energyPATHWAYS.time_series import TimeSeries import unittest from matplotlib import pyplot as plt class TestTimeSeries(unittest.TestCase): def setUp(self...
34.804348
163
0.621278
__author__ = 'Ben, Ryan, Michael' import numpy as np from collections import defaultdict import pandas as pd import energyPATHWAYS from energyPATHWAYS.time_series import TimeSeries import unittest from matplotlib import pyplot as plt class TestTimeSeries(unittest.TestCase): def setUp(self): self.methods ...
true
true
f72e69d4bd341d20916ee603e013db4ef7cad8db
5,588
py
Python
certbot/plugins/storage_test.py
pub-repository/letsencrypt
c4684f187a4ce4ef13425cfba607dec9d8bfa963
[ "Apache-2.0" ]
1
2019-12-29T16:34:18.000Z
2019-12-29T16:34:18.000Z
certbot/plugins/storage_test.py
pub-repository/letsencrypt
c4684f187a4ce4ef13425cfba607dec9d8bfa963
[ "Apache-2.0" ]
null
null
null
certbot/plugins/storage_test.py
pub-repository/letsencrypt
c4684f187a4ce4ef13425cfba607dec9d8bfa963
[ "Apache-2.0" ]
1
2019-12-29T16:34:20.000Z
2019-12-29T16:34:20.000Z
"""Tests for certbot.plugins.storage.PluginStorage""" import json import unittest import mock from certbot import errors from certbot.compat import os from certbot.compat import filesystem from certbot.plugins import common from certbot.tests import util as test_util class PluginStorageTest(test_util.ConfigTestCase...
46.566667
100
0.620616
import json import unittest import mock from certbot import errors from certbot.compat import os from certbot.compat import filesystem from certbot.plugins import common from certbot.tests import util as test_util class PluginStorageTest(test_util.ConfigTestCase): def setUp(self): super(PluginStorageTe...
true
true
f72e6b9fa3ef86cd10c13a1694c38d2ce9a37f73
83,070
py
Python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py
iscai-msft/azure-sdk-for-python
83715b95c41e519d5be7f1180195e2fba136fc0f
[ "MIT" ]
1
2021-06-02T08:01:35.000Z
2021-06-02T08:01:35.000Z
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py
iscai-msft/azure-sdk-for-python
83715b95c41e519d5be7f1180195e2fba136fc0f
[ "MIT" ]
226
2019-07-24T07:57:21.000Z
2019-10-15T01:07:24.000Z
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_network_watchers_operations.py
iscai-msft/azure-sdk-for-python
83715b95c41e519d5be7f1180195e2fba136fc0f
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
49.653317
225
0.694402
import uuid from msrest.pipeline import ClientRawResponse from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling from .. import models class NetworkWatchersOperations(object): models = models def __init__(self, client, config, serializer, deserializer): ...
true
true
f72e6bfbeca4a53d02af3c2b08549ad0c766ce10
1,060
py
Python
pq/jobs.py
quantmind/pulsar-queue
26ec8cbc291a830bd338c31f8a129cbd15f87a69
[ "BSD-3-Clause" ]
64
2015-09-25T19:28:17.000Z
2022-02-15T20:52:03.000Z
pq/jobs.py
quantmind/pulsar-queue
26ec8cbc291a830bd338c31f8a129cbd15f87a69
[ "BSD-3-Clause" ]
16
2015-09-23T13:35:10.000Z
2017-11-25T09:32:15.000Z
pq/jobs.py
quantmind/pulsar-queue
26ec8cbc291a830bd338c31f8a129cbd15f87a69
[ "BSD-3-Clause" ]
11
2015-10-01T14:39:36.000Z
2021-12-31T06:57:49.000Z
"""Useful Job for the task queue. Include this file in the ``task_paths`` list if you need them """ import sys import os import tempfile from pq.api import job @job() async def execute_python(self, code=None): """Execute arbitrary python code on a subprocess. For example: tasks.queue_task('execute.pyth...
26.5
72
0.649057
import sys import os import tempfile from pq.api import job @job() async def execute_python(self, code=None): assert isinstance(code, str), "code must be a string" fp, path = tempfile.mkstemp(suffix='.py', text=True) try: with open(path, 'w') as fp: fp.write(code) command = '...
true
true